CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

Declaration of the function TH()

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 1, 2012, 17:15
Default Declaration of the function TH()
  #1
Senior Member
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg (Bavaria / Germany)
Posts: 455
Rep Power: 11
Tobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

I am trying to find the place where the temperature is derived from the enthalpy.

- Solver: rhoSimpleFoam
- thermodynamics: hPsiThermo
- transport: hConstTransport

Therefor I had a look at the solver and the enthalpy equation h:

Code:
{
    fvScalarMatrix hEqn
    (
        fvm::div(phi, h)
      - fvm::Sp(fvc::div(phi), h)
      - fvm::laplacian(turbulence->alphaEff(), h) 
     ==
      - fvc::div(phi, 0.5*magSqr(U), "div(phi,K)")
    );

    hEqn.relax();

    hEqn.solve();

    thermo.correct();
Here I think the step I am searching is in the function "correct".
That leads me to the thermomodel -> hPsiThermo.C.

From the correct() function you get into the calculate() function. And there (I think) you get the temperature derived from the enthalpy. Its described in the *.H file that T is calculated there.

I found that function:

Code:
        TCells[celli] = mixture_.TH(hCells[celli], TCells[celli]);
And would find the definition of that function. With grep I get into the specieThermo.H file. Here I found that:
Code:
        // Energy->temperature  inversion functions

            //- Temperature from Enthalpy given an initial temperature T0
            inline scalar TH(const scalar H, const scalar T0) const;
So I am very sure that I am on the right way. But thats just a function prototype and not a function declaration. I searched everywhere but do not find the definition of that function.

Where can i find it?
Can someone give me an advice?

Thanks in advance
Tobi
Tobi is offline   Reply With Quote

Old   August 1, 2012, 17:30
Default
  #2
Senior Member
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg (Bavaria / Germany)
Posts: 455
Rep Power: 11
Tobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
I should have a look at the specieThermoI.H
So solved Thanks for reading
Tobi is offline   Reply With Quote

Old   August 1, 2012, 17:50
Default
  #3
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 502
Rep Power: 9
mturcios777 is on a distinguished road
If you look in specieThermoI.H you will find the function TH. Looking at it you will see that the template is calling another function T and feeding it the proper coefficients (whether its enthalpy or energy you are inverting).

The function T is also in the file, near the very beginning. Here is where temperature is obtained by inverting the enthalpy/energy based on the the species thermo (its a simple Newton's method if I read the code right).

EDIT: Hehe Tobi, you must have been thinking while I was typing ;-)

Last edited by mturcios777; August 1, 2012 at 17:51. Reason: Answered already
mturcios777 is offline   Reply With Quote

Old   August 1, 2012, 17:56
Default
  #4
Senior Member
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg (Bavaria / Germany)
Posts: 455
Rep Power: 11
Tobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hihi,

well, nevertheless thanks for reading and anwering
You are right. After I read the specieThermoI.H file I saw that TH is calling a other function T() and thats defined in the beginning of the thermo model

Wow .. cool ... hihi. I am getting familiar and familiar with OF code.
Tobi is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 04:37
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51
Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00


All times are GMT -4. The time now is 01:50.