- **OpenFOAM Running, Solving & CFD**
(*http://www.cfd-online.com/Forums/openfoam-solving/*)

- - **Real gases**
(*http://www.cfd-online.com/Forums/openfoam-solving/60275-real-gases.html*)

Hi to all.
The problem I'm Hi to all.
The problem I'm pointing to is that OpenFOAM thermophysicalModels can only take account for ideal gases equation of state. In which manner can I take account for the real gases covolume non-ideality according to Able-Nobel gas equation of state { P(1/rho-b)=RT ; b=const }? Perfect gases are defined in OpenFOAM-1.2/src/thermophysicalModels/specie/equationofState/perfectGas. I think I can create a clone of this definition as ablenobleGas, and then? Have I to recompile OpenFOAM? How to select 'b' parameter? Thanks for any suggestion Lorenzo |

What you need to do is:
- wriWhat you need to do is:
- write the ablenobleGas implementation based on the perfectGas - have a look at the instantiated combinations of thermo using the gas equations of state. Examples are e.g. for basic thermo in: thermophysicalModels/basic/basicThermo/basicThermos.C for combustion in thermophysicalModels/combustion/hCombustionThermo/hCombustionThermos.C - instantiate the combinations you want for yourself and pick them from a run-time selection table in the application. Example is: $FOAM_TUTORIALS/sonicTurbFoam/nacaAirfoil/constant/thermophysicalProperties Enjoy, Hrv |

Thanks for guidelines.
I willThanks for guidelines.
I will try it in the next few days... Regards Lorenzo |

This particular discussion is along the lines of the problem I am now looking at.
I have similar questions around implementing custom thermo functions? I am trying to implment the German KTA 3102.1 standard helium gas properties. As I see it, it's relatively straightforward to copy the perfectGas class and implement the required equation of state. I have a question around the definition of compressibility though. The comments in perfectGas say that it is rho/p and it looks like basicThermo calculates density using p*psi which supports this. I would have expected the derivative drho/dp to apply. Can somebody please tell me which is correct? I am finding the implementation of a new transport class somewhat trickier than originally expected as well. I have noticed in both constTransport and sutherlandTransport that mu, kappa and alpha are functions of temperature only. My question is, what are the implications of these being functions of both temperature and pressure? Thanks in advance Ivor |

RksHi,
I just tried to implement the Redlich-Kwong-Soave equationofstate. Therefore I defined the necessary constants and some "help-functions" for calculating rho analytically. These functions have the same definition " inline scalar perfectGas::FUNCTION() const" as rho, psi...:Last step I calculate psi with rho: 00077 //- Return compressibility rho/p [s^2/m^2]00078 inline scalar perfectGas:: psi(scalar, scalar T) const00079 {00080 return rho/p;00081 }1. sorry for no education: what excactly has to stand in the parentheses:e. g. perfectGas:: psi(scalar, scalar T) ...if I use a "help-function" perfectGas::sCoeff depending on T, and finally define the function perfectGas::rho... Has it to be T or sCoeff in the parentheses for rho??? 2. What are the member operators for (e.g. perfectGas:: operator+=) and thefriend operators (e. g. operator+)??My equationOfState gets compiled but makes non-physical densities. If the constants in the parentheses are not these used in the "help-functions" I get the error message: invalid use of member (did you forget the '&'?)Thanks for Your help Marco |

Real gas EOS for reactingFoamType solversDear all,
I added new Equation of state (peng Robinson), works with compressible solvers e.g."sonicTurbFoam", but I need to utilize reactingFoam to model high pressure carbon dioxide release in Air (near saturation line). Before reading this Thread, I created a new chemistryReader with sutherlandTransport<specieThermo<janafThermo<pengR obinson>>> defined in typedef. Then defined a new chemistry Model, new reacting mixture and new chemistrySolver to make reactingFoam read from pengRobinson Eos. Running the compiled updated solver throws a bad_cast error. Would you please share your idea, regarding defining a real gas model coupled with combustion solver as reactingfoam? Best regards, Hamed |

Peng Robinson EOS implementation in OF-1.6Dear All,
Please correct me if I am wrong; To implement Peng Robinson EOS in OF-1.6, I should update hCombustionThermos.C, by adding: makeCombustionMixtureThermo ( hCombustionMixtureThermo, hPsiMixtureThermo, reactingMixture, mGasThermoPhysics // which I should modify in ThermoPhysicalTypes.H // its for is say.,sutherlandTransport<specieThermo<janafThermo< pengRobinson>>>mGasThermoPhysics);Best regards, Hamed |

All times are GMT -4. The time now is 04:28. |