Equation of State in Openfoam
I have a question about the equation of state in Openfoam when the combustion or multi-gas 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;
00003 autoPtr<combustionModels::psiChemistryCombustionMo del> combustion
00011 psiChemistryModel& chemistry = combustion->pChemistry();
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 multi-gas 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:confused:? Your any suggestion and comments are very welcome. Thank you very much.
I was checking the file
Hope this helps.
Thank you so much! Your answer exactly solve my problem.
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
00087 return molWeight_;
00091 inline scalar specie::nMoles() const
00093 return nMoles_;
00097 inline scalar specie::R() const
00099 return RR/molWeight_;
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.
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.
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)
00151 scalar sumNmoles = max(st1.nMoles_ + st2.nMoles_, SMALL);
00153 return specie
00157 + st2.nMoles_/sumNmoles*st2.molWeight_
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.
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)
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.
nMoles depends on the concentration.
The answer to your question is in the mixture class e.g. "homogenousMixture" in the function mixture.
|All times are GMT -4. The time now is 05:32.|