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

How rho_ and psi_ are calculated in compressible solvers of OpenFOAM?

Register Blogs Community New Posts Updated Threads Search

Like Tree39Likes
  • 15 Post By JBUNSW
  • 4 Post By mturcios777
  • 5 Post By JBUNSW
  • 2 Post By mturcios777
  • 6 Post By JBUNSW
  • 3 Post By JBUNSW
  • 1 Post By dkxls
  • 3 Post By JBUNSW

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   July 10, 2012, 11:29
Default How rho_ and psi_ are calculated in compressible solvers of OpenFOAM?
  #1
New Member
 
James Behzadi
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 27
Rep Power: 14
JBUNSW is on a distinguished road
Dear FOAMers,

I need to know how the density and compressibility are updated in OpenFOAM? The question has a general scope and applies to many compressible thermophysical models and solvers. I divide my question in two parts:

1. In pEqn.H of all compressible solvers (dieselFOAM, sonicFOAM, reactingFOAM, etc.) there is a line that reads
Code:
rho = thermo.rho();
I tracked down this rho() function to see how density is calculated. For the compressible thermophysical models, in the base class that is basicPsiThermo.H, one can find this:
Code:
             //- Density [kg/m^3] - uses current value of pressure
             virtual tmp<volScalarField> rho() const
             {
                 return p_*psi();
             }
Is my understanding of how rho_ is updated correct?!

2. Assuming that my impression of rho_ calculation is correct, we need to know psi() to find density, that is we need to know the compressibility. This raises two more questions:

2.1 My survey led to the speculation that psi_ is updated in hsPsiThermo.C.
Code:
TCells[celli] = mixture_.THs(hsCells[celli], TCells[celli]);
psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
This is true when sensible enthalpy is used as the basis of thermophysical model. For scenarios where h or e are used similar procedure follows. Is my understanding correct?!

2.2 If above is correct, then I need to know how the psi(p, T) works. I could find THs function in specieThermoI.H which basically updates temperature based on a given sensible ehthalpy and known composition mixture by an iterative method. However, I couldn't locate such a function for psi_ calculation. The only thing I could think of was the equation of state for perfect gas in perfectGasI.H
Code:
inline Foam::scalar Foam::perfectGas::psi(scalar, scalar T) const
 {
     return 1.0/(R()*T);
 }
But I'm not sure, and this in itself raises additional questions. Is this where psi_ is calculated or I'm wrong?!

I appreciate it, if you could answer any of the above three questions. Any clue will be of great value to me.

Thanks in advance...
JBUNSW is offline   Reply With Quote

 

Tags
compressibility, density, psi_, rho_, thermo.rho()


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
Need help with boundary conditions: open to atmosphere Wolle OpenFOAM 2 April 11, 2011 07:32


All times are GMT -4. The time now is 00:24.