CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   rho in basicPsiThermo (

megacrout January 30, 2012 12:47

rho in basicPsiThermo

1) Why does basicRhoThermo possess a "non-const access to the local density field", i.e.


virtual volScalarField& rho();
but not basicPsiThermo?

2) I need to access rho as a non-tmp object using basicPsiThermo (need Janaf and Sutherland). How do I have modify this utility in order to make it work?



Chris Lucas January 31, 2012 04:22


About question no. 1)

Because basicRhoThermo has an internal rho volScalarField and basicPsiThermo doesn't. In basicPsiThermo rho is calculated by psi*p.

About question no. 2).

I'm not sure about janaf, but I can use sutherland in combination with basicPsiThermo. The way janaf works (not 100% sure), it should work as well in combination with basicPsiThermo. None of the two models need the density field.

Best Regards,

megacrout February 2, 2012 04:25

Hey Chris,

Thanks for your help.

1) I obviously noticed that rho is not computed the same, but I was confused noticing that this influences the way it is defined and the way it can be used. (And still am a bit).

2) I guess my question was not detailed enough. I know that Janaf AND Sutherland models work in combination with basicPsiThermo (s. e.g. reactingFoam) and that is precisely why I want to use this thermo package.
But I need to use and modify the value of thermo.rho() in the pEqn.H file and thought I needed to change the way it is defined to do so. I found an alternative solution though, as explained in the original thread about that topic: (see post #15).


All times are GMT -4. The time now is 11:55.