|
[Sponsors] |
Procedure to implement a new equation of State |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 16, 2021, 05:43 |
Procedure to implement a new equation of State
|
#1 |
Member
Join Date: Feb 2020
Posts: 90
Rep Power: 6 |
Hello to all,
I would like to implement a new Equation of State (EoS) in OpenFOAM 7. From what I was able to understand, we just need to copy and paste an Equation of State (e.g., perfect Gas) and change it accordingly. The density (rho) function is known. The compressibility (psi) should be the derivative of density with respect to pressure (dRho/dp) However, I am struggling to understand how to define the departure equations for enthalpy, Cp, internal energy, CV and CpMCv. Are there general equations to define these? Can anyone complement the procedure to implement a new Equation of State. At the end, and to use the new EoS, we just need to add a new model in either rhoThermos.C or psiThermos.C depending on the thermophysical model. Thanks in advance! |
|
February 23, 2021, 13:48 |
|
#2 |
Member
Join Date: Feb 2020
Posts: 90
Rep Power: 6 |
Anyone with some insight on this matter?
|
|
February 24, 2021, 05:19 |
|
#3 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 746
Rep Power: 14 |
Look in section 7.1.3 of the user guide:
https://cfd.direct/openfoam/user-gui...hermophysical/ and you'll see that Cp etc are defined by the "thermo" type. The guide tells you that options are hconst, janaf etc. Now go look these up in Doxygen, and you'll see where Cp etc are defined, eg https://cpp.openfoam.org/v8/janafThe...ce.html#l00171 or https://cpp.openfoam.org/v8/hConstTh...8H_source.html You probably need to get your head around each of the components in the thermophysicalProperties dictionary: Code:
thermoType { type hePsiThermo; mixture pureMixture; transport const; thermo hConst; equationOfState perfectGas; specie specie; energy sensibleEnthalpy; } |
|
September 8, 2021, 11:54 |
|
#4 |
Member
Join Date: Feb 2020
Posts: 90
Rep Power: 6 |
Sorry if this is too basic, but I have been reading through the derivation of rhoSimpleFoam (https://openfoamwiki.net/index.php/RhoSimpleFoam) and was wondering the following:
The density correction is given has This is true for ideal gases, but if I want to implement something where: then: so: This should mean that I need to create a new pressure equation for this model, correct? Which means that rhoSimpleFoam basiically only work for gas-like EoS, right? Last edited by Shibi; September 9, 2021 at 16:42. |
|
Tags |
equation of state, programming |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 06:21 |
Writing an equation of state | FAKHREDDINE | CFX | 2 | April 3, 2017 13:08 |
Simple piston movement in cylinder- fluid models | arun1994 | CFX | 4 | July 8, 2016 03:54 |
continuity equation was diverging in transient state | stenber | FLUENT | 0 | March 19, 2016 23:37 |
Real gas equation of state for gas mixture | ahourri | FLUENT | 0 | April 30, 2008 12:23 |