This offering is not approved or endorsed by Silicon Graphics International Corp.,
the producer of the OpenFOAM® software and owner of the OpenFOAM® trade mark.
top
logo


Welcome, Guest
Please Login or Register.  Lost Password?
Special Interest Group on General Chemistry/Thermo Group Forum: This group is covering general topics related to chemical reactions and thermodynamic applications. You can use it for general topics and to find people with common interests to found more specialized goups.
Go to bottomPage: 1
TOPIC: psiThermo and rhoThermo, is there a difference?
#14
psiThermo and rhoThermo, is there a difference? 1 Year, 10 Months ago Karma: 1
Hello everyone,

let's try to start the discussions in this group by posting about a topic that might be of general interest for people using thermodynamic libraries in their solvers. You will see that some things are still unclear so please comment and help finding the answers.

Since the release of OF 1.6 I was asking myself the above question and the documentation in the header files "Basic thermodynamic properties based on compressibility/density" did not really help to clarify things for me.

So I took a look into the source code and started from the end:

1) The solvers reactingFoam and rhoReactingFoam use psiChemistryModel and rhoChemistryModel which then use
hsCombustionThermo and hsReactionThermo, respectively. Both pairs of classes are different only by the name not by the way the functions are implemented.

2) They use hsPsiMixtureThermo and hsRhoMixtureThermo to calculate the values for T, psi, mu and alpha as a mixture of the components' cell values. How the cell mixture itself is calculated depends on multiComponentMixture, dieselMixture, etc. which is used by both hsPsiMixtureThermo and hsRhoMixtureThermo. The two classes are actually different only in one line: hsRhoMixtureThermo calculates also the density as a cell mixture of the component densities.

3) The actual difference can be found in basicPsiThermo and basicRhoThermo:
When you call thermo->rho(), basicPsiThermo will return rho=p*psi. Psi is the ideal gas compressibility psi=1/RT if you use "perfectGas" or zero if you use icoPolynomial. As a result, icoPolynomials should always return rho=0 in psiThermo!!

On the other hand, basicRhoThermo will return a rho field that is stored as a private variable. This means that when using rhoThermo, you might have two different density fields, one in the solver and one in the rhoThermo class. To avoid confusing both fields in the object registry, the rhoThermo class names its rho field "rhoThermo". The rho field is updated when you call thermo->correct() and rho is calculated as a cell mixture of the components' rho values. If you select perfect gas model, then the component's rho will be rho= p/RT.

So in the case of ideal (perfect) gases, the difference between psiThermo and rhoThermo is: nothing!
(Well, there is a small difference, since rhoThermo is updated once every time step and psiThermo will always use the up-to-date pressure field)

The difference arises when using icoPolynimial for simulating liquids: Here, psiThermo will return rho=0! (Why is psiChemistryModel also defined for icoPoly8ThermoPhysics??? It should not work!). rhoThermo will just return the value for rho from the defined polynomial. As I understand this is the only difference between psiThermo and rhoThermo, since other fluid properties are calculated as cell mixtures e.g. by multiComponentMixture.

Another difference is in the PISO loop of the solver application: In pEqn.H of rhoReactingFoam, p*psi is first subtracted from rho, then the p equation is solved with an additional correction term and then p*psi is again added to rho. The purpose of this in unclear to me. Is it for numerical stability purposes??

As a conclusion, I will prefer rhoThermo for my solvers, since only this one seems to be valid for both liquids and gases...
Which one are you using?

Best Regards,
Dominik
Dominik Christ
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#18
Re:psiThermo and rhoThermo, is there a difference? 1 Year, 10 Months ago Karma: 1
Update: After looking at Version 1.7.0, it seems, that psiThermo has been consequently dropped.

Erratum: No, there has not been a change. It is just that the doxygen on the opencfd-page now uses client side search which only searches class and file names and does not make a full text search anymore. Therefore I got a different search result than before, but if you search directly for "basicPsiThermo" you will find that it is still there.
Dominik Christ
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2010/08/05 11:06 By DominikChrist.
The administrator has disabled public write access.
 
#200
Re:psiThermo and rhoThermo, is there a difference? 11 Months ago Karma: 0
Well done Dominik!
Ryan Johnson
Fresh Boarder
Posts: 8
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Joomla SEO powered by JoomSEF


bottom
top

OpenFOAM®-Extend World

You need to upgrade your Flash Player

bottom
Legal | Imprint
©Copyright 2012 The OpenFOAM® Extend Project 

Powered by Joomla! Designed by Joomla Templates, ecommerce web hosting, Thanks to J! Developer Goran Gligorin for support! Joomla SEF URLs by Artio. Powered by Staff Master v0.9.8 Valid: XHTML and CSS

Friends Online