
[Sponsors] 
July 30, 2012, 04:07 
where is the calculation of the temperature field

#1 
Senior Member
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,073
Blog Entries: 4
Rep Power: 19 
Hi all,
i am looking for the calculation step of the temperature field in the rhoSimpleFoam solver. The T field must be calculated due to the enthalpy field which is solved in the hEqn.H file. I had a look at the thermodynamics (hPsiThermo) which is used in the constant/hermodynamics file. There i find the correction (h.correct()) and therefor OF go to the calculate function. The code (shorted) is that one: Code:
template<class MixtureType> void Foam::hPsiThermo<MixtureType>::calculate() { const scalarField& hCells = h_.internalField(); const scalarField& pCells = this>p_.internalField(); scalarField& TCells = this>T_.internalField(); scalarField& psiCells = this>psi_.internalField(); scalarField& muCells = this>mu_.internalField(); scalarField& alphaCells = this>alpha_.internalField(); forAll(TCells, celli) { const typename MixtureType::thermoType& mixture_ = this>cellMixture(celli); TCells[celli] = mixture_.TH(hCells[celli], TCells[celli]); psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]); muCells[celli] = mixture_.mu(TCells[celli]); alphaCells[celli] = mixture_.alpha(TCells[celli]); } Code:
TCells[celli] = mixture_.TH(hCells[celli], TCells[celli]); After that I had a look at the TH function in the species (pureMixture) files but there was just a inline function prototype in the header file and no declaration of the function. Can someone give me an advice? Or am I completely wrong? Why do I need it (for those who are interested in it): I am using the flamelet solver. In this model all theromdynamic properties are just depend on the mixture fraction Z. The new thermodynamic model get the temperature field by extracting the temperature depended on Z out of a flamelet library. In this solver there is an extension using an enthalpy defect. So you can get use fixed value BC. If you choose that, the thermodynamics just calculating a new enthalpy defect derived of the fixed temperature and then selecting all new properties out of the flamelet library using that depended on Z and the enthalpy defect. That`s very good but I wanna use the "wallHeatTransfer" BC. For that I have to calculate the temperature field every time step. For now just the h, p and U are calculated. h is used for the correct choice of enthalpy defect library to get better results. But if I have the enthalpy field it should be possible to recalculate the temperature field every iteration or just for the patch faces. For now its possible to set the BC "wallHeatTransfer" but there is no calculation of the temperature and its like I set a fixed value. Notice: The extraction of the properties can be set. Like every 10 iterations you can extract the properties depended on Z. Thanks in advance Tobi Last edited by Tobi; July 30, 2012 at 05:39. 

July 30, 2012, 10:40 

#2 
Senior Member
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,073
Blog Entries: 4
Rep Power: 19 
Hi all,
i solved it. I had to implement the enthalpy equation for "h". Present I am just calculating the enthalpy "H". Now the calculation for the temperature field is going and my wall heat transfer wall BC works. But I have to get deeper into the code to know exactly what the solver is doing. Tobi & Thanks for reading 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Diverging result for Temperature field in interFoam  ovie  OpenFOAM Running, Solving & CFD  94  March 26, 2015 04:54 
Problem with rhoSimpleFoam  matteo_gautero  OpenFOAM Running, Solving & CFD  0  February 28, 2008 07:51 
transient temperature field with constant velocity  Törnquist  CFX  0  September 16, 2003 04:22 
overwrite temperature field using usrsrc  jess  CFX  0  November 13, 2002 03:50 
Question concering about validating Temperature field  ghlee  Main CFD Forum  1  December 1, 1998 13:36 