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

How does the function"he=thermo.he()"work in EEqn.H with OpenFOAM2.2.1

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 24, 2013, 05:34
Default How does the function"he=thermo.he()"work in EEqn.H with OpenFOAM2.2.1
  #1
Member
 
赵庆良
Join Date: Aug 2013
Posts: 56
Rep Power: 12
zqlhzx is on a distinguished road
Hi Foamers:
I am confused with how does the function " thermo.he()"work?in other word,how to abtain Enthalpy in EEqn.H with OF2.2.1 ?
In EEqn.H,Enthalpy can be availabled with the code:
Code:
volScalarField& he = thermo.he();
where is the function "thermo.he()"?
I think it is in the file "thermoI.H".I found the codes in "thermoI.H".
Code:
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::species::thermo<Thermo, Type>::he(const scalar p, const scalar T) const
{
    return Type<thermo<Thermo, Type> >::he(*this, p, T);
But where is the function "Type<thermo<Thermo, Type> >::he(*this, p, T);"?
I understand "Type<thermo<Thermo, Type> >::he(*this, p, T);" as following:
If I use janafThermo,the function "he(*this, p, T)" is in the "janafThermoI.H".We can see the following codes in "janafThermoI.H":
Code:
template<class EquationOfState>
inline Foam::scalar Foam::janafThermo<EquationOfState>::ha
(
    const scalar p,
    const scalar T
) const
{
    const coeffArray& a = coeffs(T);
    return this->RR*
    (
        ((((a[4]/5.0*T + a[3]/4.0)*T + a[2]/3.0)*T + a[1]/2.0)*T + a[0])*T
      + a[5]
    );
}
 
template<class EquationOfState>
inline Foam::scalar Foam::janafThermo<EquationOfState>::hs
(
    const scalar p,
    const scalar T
) const
{
    return ha(p, T) - hc();
}
 
template<class EquationOfState>
inline Foam::scalar Foam::janafThermo<EquationOfState>::hc() const
{
    const coeffArray& a = lowCpCoeffs_;
    const scalar Tstd = specie::Tstd;
    return this->RR*
    (
        (
            (((a[4]/5.0*Tstd + a[3]/4.0)*Tstd + a[2]/3.0)*Tstd + a[1]/2.0)*Tstd
          + a[0]
        )*Tstd + a[5]
    );
}
 
template<class EquationOfState>
inline Foam::scalar Foam::janafThermo<EquationOfState>::s
(
    const scalar p,
    const scalar T
) const
{
    const coeffArray& a = coeffs(T);
    return
    this->RR*
    (
        (((a[4]/4.0*T + a[3]/3.0)*T + a[2]/2.0)*T + a[1])*T + a[0]*::log(T)
      + a[6]
    );
}
If I use absoluteEnthalpy,then the function "he(*this, p, T)" is corresponding to
Code:
template<class EquationOfState>
inline Foam::scalar Foam::janafThermo<EquationOfState>::ha
(
const scalar p,
const scalar T
) const
{
const coeffArray& a = coeffs(T);
return this->RR*
(
((((a[4]/5.0*T + a[3]/4.0)*T + a[2]/3.0)*T + a[1]/2.0)*T + a[0])*T
+ a[5]
);
}
And if I use sensible Enthalpy ,then the function "he(*this, p, T)" is corresponding to
Code:
template<class EquationOfState>
inline Foam::scalar Foam::janafThermo<EquationOfState>::hs
(
const scalar p,
const scalar T
) const
{
return ha(p, T) - hc();
}
Does my understanding right?If it is wrong,how should understander
Code:
volScalarField& he = thermo.he();
and How does it work?
Thanks in advance!Any reply will be appreciated!
zqlhzx is offline   Reply With Quote

Old   September 11, 2015, 18:58
Default
  #2
Member
 
Lisandro Maders
Join Date: Feb 2013
Posts: 98
Rep Power: 13
Lisandro Maders is on a distinguished road
Hello,

were you correct in your analysis? I have similar doubts regarding to this..

Thanks!

Lisandro
Lisandro Maders is offline   Reply With Quote

Reply


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
Study of the EEqn.H in rhoPimpleDyMFoam. Horacio Aguerre OpenFOAM Programming & Development 11 August 19, 2022 02:47
errors about div(phi,h) when move 2.0.1solver to openfoam2.2.1 zqlhzx OpenFOAM Running, Solving & CFD 1 September 11, 2013 00:35


All times are GMT -4. The time now is 16:10.