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: |
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 |
Quote:
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 |
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.
|
Quote:
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!:) |
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. |
Quote:
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. |