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

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

 October 24, 2013, 05:34 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: 3 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 Type> inline Foam::scalar Foam::species::thermo::he(const scalar p, const scalar T) const { return Type >::he(*this, p, T);``` But where is the function "Type >::he(*this, p, T);"? I understand "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 inline Foam::scalar Foam::janafThermo::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 inline Foam::scalar Foam::janafThermo::hs ( const scalar p, const scalar T ) const { return ha(p, T) - hc(); } template inline Foam::scalar Foam::janafThermo::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 inline Foam::scalar Foam::janafThermo::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 inline Foam::scalar Foam::janafThermo::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 inline Foam::scalar Foam::janafThermo::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!