# psi in the rhoThermo class

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

 June 3, 2020, 03:50 psi in the rhoThermo class #1 Senior Member   Ruiyan Chen Join Date: Jul 2016 Location: Hangzhou, China Posts: 162 Rep Power: 9 Greetings Foamers, As we know, there are psiThermo and rhoThermo classes to select from in FOAM. In psiThermo rho = psi*p. psi is given by the EOS, and by psi*p we get the density. My question is, in the rhoThermo class, is rho = psi*p still assumed? If yes, since both rho and psi are gived by the EOS and p is calculated, doesn't this mean that we overconstrained the system? With this comes another more general question, why do we need both psiThermo and rhoThermo? I noticed that most heat transfer solvers use the rhoThermo class but most combustion ones use the psiThermo class, why the difference? I have a feeling that this might have something to do with the low Mach number assumption but couldn't quite figure it out. Thanks in advance! Ruiyan granzer likes this.

 June 9, 2020, 22:58 #2 Senior Member   Ruiyan Chen Join Date: Jul 2016 Location: Hangzhou, China Posts: 162 Rep Power: 9 Anyone? Really looking forward to hearing your input here!

June 10, 2020, 23:04
#4
Senior Member

Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 9
Hi Lahaye,

Thank you for sharing all these materials and references, some of them I have seen before but some of them definitely not. Up to now I only get a chance to browse and check part of them, will read more carefully later!

To your 1st point about thermo class, which is split to a psi-based one and a rho-based one, do you think the relation between rho and p, i.e., rho = psi * p, is still used in the rho-based thermo class? To me it is, as one can see from the psi*correction(fvm::ddt(p_rgh)) term in code. Following this, is it really rho = psi * p or rho = psi * p_rgh? More generally, I'm not sure why we still need psi in the rho-based thermo class. This psi*correction(fvm::ddt(p_rgh)) term should go to 0 at convergence, so it is added mainly due to numerical reasons I guess?

About the psi-based thermo, can you elaborate on the statement
Quote:
 They have another pressure equation where the change in time of pressure is treated implicit by ddt(psi, p); larger pressure jumps are now possible.
. I understand that by using rho = psi * p, ddt(rho) now becomes ddt(psi,p), which indicates implicit treatment of pressure, but why implicit treatments make larger pressure jumps possible? From a numerical point of view, it seems to me that the real reason we have rho-based and psi-based thermo is because of their different treatment of pressure. Basically, rhoThermo allows minor pressure jumps but psiThermo allows larger jumps?

To your 2nd point about waves, I'm actually very interested in such things. I see that both rhoSimpleFoam and rhoPimpleFoam are tested, what about solvers using rho-based thermo? I would think that wave is a typical example of "fluids with low compressibility" and it should be used with rho-based thermo.

 June 11, 2020, 03:09 #5 Senior Member   Domenico Lahaye Join Date: Dec 2013 Posts: 751 Blog Entries: 1 Rep Power: 17 Thank you for your reply. I need to take a closer look myself. Let us stay in touch. Best wishes.

 June 15, 2020, 02:18 #6 Senior Member   Domenico Lahaye Join Date: Dec 2013 Posts: 751 Blog Entries: 1 Rep Power: 17 I found this to be valuable: https://bugs.openfoam.org/view.php?id=1772#c5033

 June 15, 2020, 04:22 #7 Senior Member   Ruiyan Chen Join Date: Jul 2016 Location: Hangzhou, China Posts: 162 Rep Power: 9 Hi Lahaye, Thank you, I've read that before actually, it does provide very valuable information. I'm still looking for explanations to the idea that "implicit treatment of pressure allows for larger pressure jumps but explicit one doesn't", could you explain it in more detail or maybe pointing out some references? Thanks, Ruiyan

 June 15, 2020, 05:54 #8 Senior Member   Domenico Lahaye Join Date: Dec 2013 Posts: 751 Blog Entries: 1 Rep Power: 17 Not sure. I read however that rhoThermo is meant to handle low Mach numbers. I therefore imagine rhoThermo to break in case of high Mach number. One could e.g. take a rhoSimpleFoam tutorial case and see what happens in case that one gradually increases the mass flow rate at the inlet. Possibly one can place various simulations in a loop using foamDictionary.

 June 15, 2020, 10:37 #9 Senior Member   Domenico Lahaye Join Date: Dec 2013 Posts: 751 Blog Entries: 1 Rep Power: 17 rhoSimpleFoam is not limited to rhoThermo as explained here: https://develop.openfoam.com/Develop...230a8965bdb860 Not sure what is means to "break" rhoSimpleFoam using rhoTherm as imposing limits on either pressure or density or switching to rhoPimpleFoam might "fix" rhoThermo again. Requires further thinking.

 July 26, 2020, 07:32 #10 New Member   wangkuiming Join Date: Jul 2020 Posts: 2 Rep Power: 0 I plan to use rhoCentralFoam to simulate the liquid weak compressibility and thermal expansion, the state equation of ρ=ρ0[1+β(P-P0)-α(T-T0)]to use include compression coefficient and coefficient of expansion, is constant, the expression with Boussinesq assumptions like but rhoCentralFoam only allow psiThermo type, more specifically the ideal gas (called perfectGas) and Peng Robinson EOS 1. can this change of state equation be realized, what documents are need to change?2. I know that Boussinesq assumes that it is in rhoThermo. What is the essential difference between psiThermo and rhoThermo?In psiThermo, I know that FOAM assumes rho = psi * p, and that psi is an ideal gas with a compressibility of 1/RT. If it were my equation of state in this form, what would the psi be

 October 21, 2020, 05:09 #11 Senior Member   Ruiyan Chen Join Date: Jul 2016 Location: Hangzhou, China Posts: 162 Rep Power: 9 I came back with things I've learnt in the past several months and hopefully it sheds some lights on the original question I asked. In the psiThermo class, psi = rho/p. The implication is that the EOS can be written in such a way that the density equals to something times the pressure. This, from the built-in EOS in FOAM, only applies to ideal gas and peng robinson gas. One can check this by using the rhoPimpleFoam solver (which uses psiThermo) and the "banana" method in the equationOfState entry in thermophysicalProperties file. This constraint has been relaxed in higher version FOAM though, because rhoPimpleFoam now allows the use of rhoThermo too. In the rhoThermo class, psi should be the partial derivative of density with respect to pressure at constant temperature. This is clearly stated in Chapter 10.2 of Ferziger and Peric's book Computational Methods for Fluid Dynamics, 3rd ed. The remaining question is still there, which is, why using two different thermo classes? When does one outperform the other? It seems to me that the rhoThermo class is a more general one and should be used for any solver. CorbinMG likes this.