CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Cantera

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2010, 05:48
Default
  #61
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by heavy_user View Post
just an general advise:

do NOT install cantera in /opt/ !!!!!!!!!!!!!!!!!

guess what...I did...just finished reinstalling the system..
it screws up your kernel !!
With all due respect: I don't see how it would do that on its own. I mean it could have triggered some other problem

Bernhard
gschaider is offline   Reply With Quote

Old   October 15, 2010, 06:56
Default
  #62
Senior Member
 
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 184
Rep Power: 17
markusrehm is on a distinguished road
Hello Nir,

you can install the packages anywhere where you have write permission. So the Thirdparty dictionary is not a bad idea. Usually you indicate this during the configuring process with the preface-option. Have a look at the Sundials installation procedure indicated in the Wiki.

Often it is easiest to install as much as possible through you package manager (yast for linux, aptget for debian).

Markus
markusrehm is offline   Reply With Quote

Old   October 15, 2010, 11:25
Default
  #63
Senior Member
 
Join Date: Dec 2009
Posts: 112
Rep Power: 17
heavy_user is on a distinguished road
Hey Guys,

thx for your answers!

I was pretty sure that it would work in /opt as well.
I stuck pretty much to the manual (defining $CANTERA_HOME ...) except for the location /opt/cantera-1.8 .
So after typing make the system was screwed.
So I reinstalled and cp-ed from backup i had taken after it was screwed up.
I wanted to install cantera in another place, but bevore moving it out of opt i had the great idea to "sudo make uninstall" to clean up....
Guess what...system was screwed again!
I am pretty sure that it was cantera...and not a coincident..
If you doubt, give it a try !!

Have a nice weekend!

Best!
heavy_user is offline   Reply With Quote

Old   October 18, 2010, 10:11
Default
  #64
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by heavy_user View Post
Hey Guys,

thx for your answers!

I was pretty sure that it would work in /opt as well.
I stuck pretty much to the manual (defining $CANTERA_HOME ...) except for the location /opt/cantera-1.8 .
So after typing make the system was screwed.
So I reinstalled and cp-ed from backup i had taken after it was screwed up.
I wanted to install cantera in another place, but bevore moving it out of opt i had the great idea to "sudo make uninstall" to clean up....
Guess what...system was screwed again!
I am pretty sure that it was cantera...and not a coincident..
If you doubt, give it a try !!
Would love to, but don't have the time

But at least you admit that you compiled/installed/uninstalled as root (or sudo)? Then it would have been an overzealous script/Makefile

That is one of the reasons why when compiling/installing software yourself you should do it as a separate non-privileged user that may only write to the directory where you want to install your software. That way he can't mess up the system. On the other hand normal users can't mess up the installation

Bernhard
gschaider is offline   Reply With Quote

Old   October 21, 2010, 09:19
Default thermopysical properties of CANTERA
  #65
Member
 
Join Date: May 2009
Posts: 32
Rep Power: 17
KrisT is on a distinguished road
Hi,

while running alternatereactingFoam on the dualInlet case I get

Reading from Cantera-File "/home/tegner/OpenFOAM/tegner-1.5.x/run/AlternateChemistry/Transient/dualInlet/constant/mix.cti" the mixture mix
--> FOAM Warning :
From function canteraMixture::canteraMixture
in file canteraMixture.C at line 70
The thermophysical properties of CANTERA are currently not converted to OpenFOAM. Instead the properties from "OpenFOAM/user-1.5.x/run/AlternateChemistry/Transient/dualInlet/constant/gasThermo" are used

I have seen this asked before, but I couldn't find an answer. Is this due to an error on my part?

Thanks!
KrisT is offline   Reply With Quote

Old   October 21, 2010, 13:43
Default
  #66
New Member
 
Silvano
Join Date: Aug 2010
Location: Chicago /Torino Us/Italy
Posts: 11
Rep Power: 16
SilPaut is on a distinguished road
Quote:
Originally Posted by KrisT View Post
Hi,

while running alternatereactingFoam on the dualInlet case I get

Reading from Cantera-File "/home/tegner/OpenFOAM/tegner-1.5.x/run/AlternateChemistry/Transient/dualInlet/constant/mix.cti" the mixture mix
--> FOAM Warning :
From function canteraMixture::canteraMixture
in file canteraMixture.C at line 70
The thermophysical properties of CANTERA are currently not converted to OpenFOAM. Instead the properties from "OpenFOAM/user-1.5.x/run/AlternateChemistry/Transient/dualInlet/constant/gasThermo" are used

I have seen this asked before, but I couldn't find an answer. Is this due to an error on my part?

Thanks!

Check the first page of this forum the post by markus on October 21, 2009. :-P
Silvano
SilPaut is offline   Reply With Quote

Old   October 22, 2010, 05:58
Default Stupid me.
  #67
Member
 
Join Date: May 2009
Posts: 32
Rep Power: 17
KrisT is on a distinguished road
Thanks a lot!
KrisT is offline   Reply With Quote

Old   October 22, 2010, 12:17
Default
  #68
Member
 
N. A.
Join Date: May 2010
Posts: 64
Rep Power: 16
N. A. is on a distinguished road
Hi Bernhard,

Can you recommend what can be done to modify the package to make it work with OpenFOAM 1.6 version.

Thanks,
Nir
N. A. is offline   Reply With Quote

Old   November 16, 2010, 05:50
Default Copy of massfractions
  #69
Member
 
Join Date: May 2009
Posts: 32
Rep Power: 17
KrisT is on a distinguished road
Hi,

I want to modify the transient alternateReactingFoam, and to that end I would like to make a copy of the massfractions.

In alternateReactingFoam the massfractions are created with the line:

Code:
PtrList<volScalarField>& Y = composition.Y();
I have vainly tried to make the copy with the following lines (and several other variants of similar type):

Code:
PtrList<volScalarField> YOld;
for(label i=0; i<Y.size(); i++) {
    volScalarField * Ytmp = & Y[i];
    YOld[i] = *Ytmp;
Obviously I'm not an expert on c++, and I would really appreciate some help on this.

Thanks!

Edited:

The following seems to be working (correct me if I'm wrong):

Code:
PtrList<volScalarField> YOld(Y.size());
for(label i=0; i<Y.size(); i++) {
    YOld.set(i,Y[i]);

Last edited by KrisT; November 16, 2010 at 07:02. Reason: Found out how to do?
KrisT is offline   Reply With Quote

Old   November 16, 2010, 09:02
Default
  #70
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by KrisT View Post
Edited:

The following seems to be working (correct me if I'm wrong):

Code:
PtrList<volScalarField> YOld(Y.size());
for(label i=0; i<Y.size(); i++) {
    YOld.set(i,Y[i]);
Now both PtrLists hold the same pointers.
Consequences:
a) (YOld[i]-Y[i])==0 at all times
b) Memory will be freed twice in the end

So you might want to try set(i,new volScalarField(Y[i])) instead
gschaider is offline   Reply With Quote

Old   November 16, 2010, 09:36
Default
  #71
Member
 
Join Date: May 2009
Posts: 32
Rep Power: 17
KrisT is on a distinguished road
Quote:
Originally Posted by gschaider View Post
So you might want to try set(i,new volScalarField(Y[i])) instead
Thanks a lot!

I tried both, and in my very naive test

Code:
Info<< "YOld[0].internalField()[45] " << YOld[0].internalField()[45] << "\n" << endl;
Info<< "Y[0].internalField()[45] " << Y[0].internalField()[45] << "\n" << endl;
Y[0].internalField()[45] = 0.15;
Info<< "YOld[0].internalField()[45] " << YOld[0].internalField()[45] << "\n" << endl;
Info<< "Y[0].internalField()[45] " << Y[0].internalField()[45] << "\n" << endl;
the same result were produced:

0.1
0.1
0.1
0.15

I'll stick with your formulation though (since I'm not completely convinced by this test).

Thanks again, much appreciated!
KrisT is offline   Reply With Quote

Old   November 16, 2010, 13:02
Default
  #72
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by KrisT View Post
Thanks a lot!

I tried both, and in my very naive test

Code:
Info<< "YOld[0].internalField()[45] " << YOld[0].internalField()[45] << "\n" << endl;
Info<< "Y[0].internalField()[45] " << Y[0].internalField()[45] << "\n" << endl;
Y[0].internalField()[45] = 0.15;
Info<< "YOld[0].internalField()[45] " << YOld[0].internalField()[45] << "\n" << endl;
Info<< "Y[0].internalField()[45] " << Y[0].internalField()[45] << "\n" << endl;
the same result were produced:

0.1
0.1
0.1
0.15
OK. That is not what I would have expected. You learn something new every day

Bernhard
gschaider is offline   Reply With Quote

Old   November 23, 2010, 07:54
Default Undestanding Cantera/OpenFOAM
  #73
Member
 
Join Date: May 2009
Posts: 32
Rep Power: 17
KrisT is on a distinguished road
I'm trying to understand Cantera and how it is linked to OpenFOAM (i.e., I'm at the same time trying to understand OpenFOAM - so please excuse me if my questions are stupid). For instance in createFields.H in Transient/alternateReactingFoam:

Code:
volScalarField rho
(
    IOobject
    (
        "rho",
        runTime.timeName(),
        mesh,
        IOobject::READ_IF_PRESENT,
        IOobject::AUTO_WRITE
    ),
    thermo->rho()
);
Here I guess the last line (thermo->rho) signifies that rho is calculated by thermo (in turn defined by Cantera) if it is not supplied as initial data?

A bit further down in the same file:

Code:
volScalarField& p = thermo->p();
const volScalarField& psi = thermo->psi();
const volScalarField& T = thermo->T();
  1. In the example code supplied with the solver (dualInlet), both p and T are given as initial data - but I can't find any code (similar to rho above) which specifies how they should be read?
  2. Why is T declared as const?
  3. What is psi?

Finally, what is the best source of information (to read) regarding issues like these?

Thanks
KrisT is offline   Reply With Quote

Old   November 25, 2010, 08:40
Default
  #74
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by KrisT View Post
I'm trying to understand Cantera and how it is linked to OpenFOAM (i.e., I'm at the same time trying to understand OpenFOAM - so please excuse me if my questions are stupid). For instance in createFields.H in Transient/alternateReactingFoam:

Code:
volScalarField rho
(
    IOobject
    (
        "rho",
        runTime.timeName(),
        mesh,
        IOobject::READ_IF_PRESENT,
        IOobject::AUTO_WRITE
    ),
    thermo->rho()
);
Here I guess the last line (thermo->rho) signifies that rho is calculated by thermo (in turn defined by Cantera) if it is not supplied as initial data?

A bit further down in the same file:

Code:
volScalarField& p = thermo->p();
const volScalarField& psi = thermo->psi();
const volScalarField& T = thermo->T();
  1. In the example code supplied with the solver (dualInlet), both p and T are given as initial data - but I can't find any code (similar to rho above) which specifies how they should be read?
  2. Why is T declared as const?
  3. What is psi?

Finally, what is the best source of information (to read) regarding issues like these?

Thanks
All this is not Cantera-specific but the regular compressible solvers all work that way
@rho: Yep
@1: they are stored and maintained by the thermophysical-model
@2: because the solver is not supposed to modify it
@3: compressibility
@further information: the source code. If you find other documents please let us know

Bernhard
gschaider is offline   Reply With Quote

Old   November 25, 2010, 09:19
Default
  #75
Member
 
Join Date: May 2009
Posts: 32
Rep Power: 17
KrisT is on a distinguished road
Great, thanks!

I do understand that the source is a good place to look (as would be any decent book in C++ ;-).

Just one more question, I _guess_ that the expression
Code:
thermo->correct();
is responsible (among other things) for updating the temperature after the massfractions have been modified. But the problem here is that I don't find the souce to verify. I have looked (doing "grep correct *") under "canteraThermosChemistry" and "alternateChemistryModels" but that didn't give me anything. But I'm probably looking the wrong way/places?

Anyway, many thanks!
KrisT is offline   Reply With Quote

Old   November 25, 2010, 09:35
Default
  #76
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 15
alfa_8C is an unknown quantity at this point
Hello everybody,

I am looking for a steady state version of reactingFoam. Has anybody an idea where to get one? I'm using OF 1.7.1 where no steady state version is available.

Best
Tony
alfa_8C is offline   Reply With Quote

Old   November 25, 2010, 13:16
Default
  #77
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by KrisT View Post
Great, thanks!

I do understand that the source is a good place to look (as would be any decent book in C++ ;-).

Just one more question, I _guess_ that the expression
Code:
thermo->correct();
is responsible (among other things) for updating the temperature after the massfractions have been modified. But the problem here is that I don't find the souce to verify. I have looked (doing "grep correct *") under "canteraThermosChemistry" and "alternateChemistryModels" but that didn't give me anything. But I'm probably looking the wrong way/places?

Anyway, many thanks!
No. That'll be in the $FOAM_SRC/thermoPhysical. Although that in turn calls the Mixture-classes that are in the canter-Lib
gschaider is offline   Reply With Quote

Old   November 26, 2010, 07:26
Default modify alternateSteadyReactingFoam to steadyReactingFoam
  #78
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 15
alfa_8C is an unknown quantity at this point
Dear Bernhard,

a short question. Would it be a big deal to compile alternateSteadyReactingFoam without those additional capabilites related to cantera, sundials, blas ect.? I need only a steady alternative to reactingFoam. If so, what do I have to pay special attention to?

Best Regards
Tony
alfa_8C is offline   Reply With Quote

Old   November 26, 2010, 07:50
Default
  #79
Senior Member
 
Markus Rehm
Join Date: Mar 2009
Location: Erlangen (Germany)
Posts: 184
Rep Power: 17
markusrehm is on a distinguished road
Hello Tony,

this should be possible but problems arise in the details. Just take the reactingFoam, change the PISO loop to a SIMPLE one as done in the alternateSteady solver and adapt the chemistry.H for steady-state. This was done in the alternate solver with the help of a cell residence time. This is a very very simple approach but you need that value because deltaT in steady-state is arbitrary.

The next issue might occur with the ODE solver. All this is explained in the Berlin Presentation cited in the very first posting.

Markus
markusrehm is offline   Reply With Quote

Old   November 26, 2010, 11:48
Default
  #80
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 76
Rep Power: 15
alfa_8C is an unknown quantity at this point
Hello Markus,

thanks a lot for your quick reply.

I'll try this, following your hint,

Tony
alfa_8C is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 15:41.