
[Sponsors] 
January 9, 2013, 09:54 
Equation of State in Openfoam

#1 
Senior Member
Join Date: Nov 2012
Posts: 168
Rep Power: 3 
Hi All,
I have a question about the equation of state in Openfoam when the combustion or multigas simulation situation. I take the solver reactingFoam as example: In this solver, thermodyanmic related is defined as follows: 00001 Info<< "Creating combustion model\n" << endl; 00002 00003 autoPtr<combustionModels:siChemistryCombustionMo del> combustion 00004 ( 00005 combustionModels:siChemistryCombustionModel::New 00006 ( 00007 mesh 00008 ) 00009 ); 00010 00011 psiChemistryModel& chemistry = combustion>pChemistry(); 00012 00013 hsCombustionThermo& thermo = chemistry.thermo(); The desntiy is updated through EoS using thermo.rho(). Since hsCombustionThermo is the object, whose class is detrived from basicPsiThermo. So we can say that rho is calculated through psi_*p in basicPsiThermo. psi=/R()*T. For combustion or multigas situation, the composition in each cell should be different, I think this is directly shown in the gas constant (p=rho*Ru*T/W, W is average mocular weight of the mixture for each cell). In Openfoam, this influence should be related to psi=1/R()*T. I check the code, i.e., perfectgas.C, but I failed to find some information about if this treatment is made. Is calculation of psi_ totally the same for combsution case and single gas case in Openfoam? Does anyboby know something about this? Your any suggestion and comments are very welcome. Thank you very much. best regards, H 

January 9, 2013, 10:15 

#2 
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Pennsylvania, United States
Posts: 101
Rep Power: 6 
I was checking the file
Code:
$FOAM_SRC/thermophysicalModels/reactionThermo/combustionThermo/hsCombustionThermo/hsCombustionThermo.C Code:
correct() Hope this helps. 

January 9, 2013, 11:26 

#3 
Senior Member
Join Date: Nov 2012
Posts: 168
Rep Power: 3 
Hi Adhiraj,
Thank you so much! Your answer exactly solve my problem. best regards, H 

January 9, 2013, 11:41 

#4  
Senior Member
Join Date: Nov 2012
Posts: 168
Rep Power: 3 
Quote:
Can I ask you another question about EoS: In specieI.H, the molecular weight, gas constant and mole amount is defined/calculated as follows: 00085 inline scalar specie::W() const 00086 { 00087 return molWeight_; 00088 } 00089 00090 00091 inline scalar specie::nMoles() const 00092 { 00093 return nMoles_; 00094 } 00095 00096 00097 inline scalar specie::R() const 00098 { 00099 return RR/molWeight_; 00100 } My question is where is molWeight_ is calculated ? As you know, for tutorials of reactingFoam, the fuel and oxidizer's molecular weight are given in the file thermo.compressibleGas. How is the molWeight_ calculated using these given molecular weight of individual species? Is molWeight_ the molecular of the mixture or single species? Thank you very much. 

January 11, 2013, 03:49 

#5 
Senior Member
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 197
Rep Power: 7 
Hi,
you define the molar mass of your mixture components in the thermalphysicalProperties file in your case folder. The operator* and operator+ function in the specie class calculate the mixture molar mass. Kind Regards, Christian Last edited by Chris Lucas; January 11, 2013 at 09:58. 

January 11, 2013, 10:25 

#6  
Senior Member
Join Date: Nov 2012
Posts: 168
Rep Power: 3 
Quote:
Thank you very much for your reply. In specieI.H, the operator * is defined as follows: 00149 inline specie operator+(const specie& st1, const specie& st2) 00150 { 00151 scalar sumNmoles = max(st1.nMoles_ + st2.nMoles_, SMALL); 00152 00153 return specie 00154 ( 00155 sumNmoles, 00156 st1.nMoles_/sumNmoles*st1.molWeight_ 00157 + st2.nMoles_/sumNmoles*st2.molWeight_ 00158 ); 00159 } I have another question, here is the variable nMoles fixed during the run time? Because it is read into from the dictionary. Actually, for example, in combustion case, the composition (for example mass fraction, molar fraction and molar concentration of the major species) changes with the time for each point. This will directly make the average molecualr weight W change and thus the return values of R() changes. Do the quantities W and R change for each point with the time? Is my unstanding correct? If not, I really appreciate it if you can point it out. best regards, H 

January 11, 2013, 10:51 

#7 
Senior Member
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 197
Rep Power: 7 
Hi,
R and W can change if the concentration changes. Have a look at the mixture class you are using (e.g. homogenousMixture). Here, the mixture "object" is created. However, you can find the way the mixture is created in the operator+ and operator* (of the classes in your thermo model e.g.the species class) Kind Regards Christian 

January 11, 2013, 12:12 

#8  
Senior Member
Join Date: Nov 2012
Posts: 168
Rep Power: 3 
Quote:
Thank you very much for your help. I check these classess about the mixture and indeed the two quantities R and W are defined. Do you mind if ask you another question? For instance, in reactingFoam, the mass fraction of these species will be calculated through spcies governing equations. How these mass fractions at each time step affact the nMoles? Is nMoles is molar amount of the individual species at each cell center for each time step? Because as you know the composition at each cell center will be affected by these mass fractions. Thank you very much if you can give me some hints about this question. best regads, H 

January 15, 2013, 11:15 

#9 
Senior Member
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 197
Rep Power: 7 
Hi,
nMoles depends on the concentration. The answer to your question is in the mixture class e.g. "homogenousMixture" in the function mixture. Kind Regards, Christian 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Hentalpy equation openfoam  miss a term  lions85  OpenFOAM  2  August 18, 2010 12:12 
Modified OpenFOAM Forum Structure and New MailingList  pete  Site News & Announcements  0  June 29, 2009 05:56 
Equation of state for water?  jinwon park  Main CFD Forum  2  December 20, 2007 07:32 
Redlich kwong equation of state for drysteam  Pankaj  CFX  3  May 8, 2007 16:20 
Equation of state for liquid  russo  Main CFD Forum  3  October 22, 2005 04:50 