CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   About the reactingFoam solver (https://www.cfd-online.com/Forums/openfoam-solving/102825-about-reactingfoam-solver.html)

Qingang Xiong June 3, 2012 23:45

About the reactingFoam solver
 
Dear OF members,
I am learning the code of reactingFoam. I found that in the reactingFoam.C there is "#include rhoEqn.H". I just want to know where is this header file? In addition, at where the compressivity "psi" get its value? I found that psi = thermo.psi(), but how the psi_ get its value? These two issues made me confused. Thank you for reply!:confused:

olivierG June 4, 2012 03:16

hello,

You will find rhoEqn.H in src/finiteVolume/cfdTools/compressible/, as rhoEqn is shared by other solver. (i guess you and me would have liked a link instead).

Psi come from your thermoType, that why you get "psi = thermo.psi()". (C++ stuff to save memories ...)

regards,
olivier

Qingang Xiong June 4, 2012 12:51

Quote:

Originally Posted by olivierG (Post 364572)
hello,

You will find rhoEqn.H in src/finiteVolume/cfdTools/compressible/, as rhoEqn is shared by other solver. (i guess you and me would have liked a link instead).

Psi come from your thermoType, that why you get "psi = thermo.psi()". (C++ stuff to save memories ...)

regards,
olivier

Dear olivier,
Thank you very much for your reply! I have found the "rhoEqn.H". But for the psi(), I know it is positioned in the class "basicThermo" and it is used to access the variable "psi_". But in "basicThermo.C" I found that "psi_" needs not to read data, so where for the program gives value to "psi_"? Thanks.:p

mturcios777 June 4, 2012 12:58

psi() is an access function to get a reference to the private member psi_ of the thermo class. As an example, look at the top level thermo classes of psiThermo and rhoThermo to see the differences.

Qingang Xiong June 5, 2012 09:58

Quote:

Originally Posted by mturcios777 (Post 364686)
psi() is an access function to get a reference to the private member psi_ of the thermo class. As an example, look at the top level thermo classes of psiThermo and rhoThermo to see the differences.

Dear mturcios,
Thank you for your help. I understand that psi() is an access function to psi_ and rho = p*psi() in psiThermo. Whether it means that psi_ will get value automatically with 1/(RT)? I found the combustionModels is really complex and related to thermoPhysics models which is also very complex. I think you are good at these so kindly thanks!:)

mturcios777 June 5, 2012 12:28

Have a look in $FOAM_SRC/thermophysicalModels/basic/psiThermo/hsPsiThermo/hsPsiThermos.C. There you will see all the allowed types for hsPsiThermo. psi is calculated from the equation of state, so the calculation of psi depends on which equation of state you have selected. The code for the different equations is found in $FOAM_SRC/thermophysicalModels/specie/equationOfState.

For example, for perfectGas (in equationOfState/perfectGas/perfectGasI.H), psi = 1/(R()*T). Have a look at the section on thermophysical models to see how the specification of thermo works.

Qingang Xiong June 5, 2012 12:35

Quote:

Originally Posted by mturcios777 (Post 364872)
Have a look in $FOAM_SRC/thermophysicalModels/basic/psiThermo/hsPsiThermo/hsPsiThermos.C. There you will see all the allowed types for hsPsiThermo. psi is calculated from the equation of state, so the calculation of psi depends on which equation of state you have selected. The code for the different equations is found in $FOAM_SRC/thermophysicalModels/specie/equationOfState.

For example, for perfectGas (in equationOfState/perfectGas/perfectGasI.H), psi = 1/(R()*T). Have a look at the section on thermophysical models to see how the specification of thermo works.

Dear mturcios,
I understand now. Thank you very much! Can I have your email? May be we can discuss about OpenFOAM directly.:D


All times are GMT -4. The time now is 07:49.