CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Writing an equation of state (https://www.cfd-online.com/Forums/cfx/185809-writing-equation-state.html)

FAKHREDDINE April 3, 2017 07:29

Writing an equation of state
 
Hello

I would like to write new equation of state in CFX (Martin-Hou equation of state) in order to calculate the thermodynamic properties of the working fluid.

I don't know how to do that ? can any one help with an example of implementing formulas in CFX using CFX Expression Language (CEL) ?

thank you very much

Opaque April 3, 2017 10:06

For a start, it would be great if you elaborate on your model ( I do not follow every equation of state). You can classify the equation of state into two overall groups: explicit in density (or specific volume), and implicit.

The explicit ones are easy to implement using CEL; however, implicit ones (usually a cubic function) require some kind of root finder to determine the specific volume (density) as a function of P and T. That is better done using UserFortran.

Please keep in mind that an equation of state is not an isolated equation for specific volume, P and T. It also requires a consistent specific heat capacity since Cp is a Maxwell's relationship away from the equation of state. If that relation is not satisfied your energy calculations are of little use (broken thermodynamics), and your solution may never converge.

My advice is to contact ANSYS CFX support for advice on existing functionality, or steps to implement a new equation of state.

Hope the above helps,

turbo April 3, 2017 12:08

Just use the gas table approach.


All times are GMT -4. The time now is 03:10.