CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Procedure to implement a new equation of State

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 16, 2021, 04:43
Default Procedure to implement a new equation of State
  #1
Member
 
Join Date: Feb 2020
Posts: 67
Rep Power: 3
Shibi is on a distinguished road
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!
Shibi is offline   Reply With Quote

Old   February 23, 2021, 12:48
Default
  #2
Member
 
Join Date: Feb 2020
Posts: 67
Rep Power: 3
Shibi is on a distinguished road
Anyone with some insight on this matter?
Shibi is offline   Reply With Quote

Old   February 24, 2021, 04:19
Default
  #3
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 308
Rep Power: 7
Tobermory is on a distinguished road
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;
}
before trying to implement your new EOS. Good luck.
Tobermory is online now   Reply With Quote

Reply

Tags
equation of state, programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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 05:21
Writing an equation of state FAKHREDDINE CFX 2 April 3, 2017 12:08
Simple piston movement in cylinder- fluid models arun1994 CFX 4 July 8, 2016 02:54
continuity equation was diverging in transient state stenber FLUENT 0 March 19, 2016 22:37
Real gas equation of state for gas mixture ahourri FLUENT 0 April 30, 2008 11:23


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