
[Sponsors] 
question about fvm::laplacian(turbulence>alphaEff(), he) in rhoSimpleFoam 

LinkBack  Thread Tools  Search this Thread  Display Modes 
December 3, 2020, 07:49 
question about fvm::laplacian(turbulence>alphaEff(), he) in rhoSimpleFoam

#1 
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 613
Rep Power: 15 
In rhoSimpleFoam and other solvers as well the energy equation has the form:
Code:
volScalarField& he = thermo.he(); fvScalarMatrix EEqn ( fvm::div(phi, he) + ( he.name() == "e" ? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho)) : fvc::div(phi, volScalarField("K", 0.5*magSqr(U))) )  fvm::laplacian(turbulence>alphaEff(), he) == fvOptions(rho, he) ); According to the book of Wilcox "Wilcox, David C. Turbulence modeling for CFD. Vol. 3. La Canada, CA: DCW industries, 2006." equation 5.54 the turbulent heat flux is defined as follows: (1) which is the equation used to calculate the turbulent heat flux for the case the sensible enthalpy h is solved for. The above equation can also written ( I hop my thermodynamic knowledge is correct): (2) However if the sensible internal energy is solved for the turbulent heat flux is modeled like this: (3) So equation (2) and (3) differ by a factor of cp/cv. So in may opinion two slightly different equation are solved whether one uses h or e. Regarding the rest of the terms in the equation they are equivalent regardless if one solves for h or e. Or maybe I have overseen something. Did someone else encounter the same doubts? 

December 4, 2020, 06:31 

#2 
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 536
Rep Power: 12 

December 4, 2020, 06:36 

#3 
Senior Member

cp/cv = gamma = 1.4 (for diatomic gas), and thus the difference matters.
Definition of Prandtl number involves c_p in case that energy equation is formulated in terms of enthalpy. No equivalent in terms of c_v seems to exist. Not sure. 

December 4, 2020, 06:42 

#4 
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 536
Rep Power: 12 
Ok, let me try explain again. Ultimately you are trying to model , and you use the chain rule to write this as one of the following (I have left out the "at constant p" etc. limits, out of laziness):
From this you get either: or and you can manipulate these to get your expressions since . The point is  the turbulent Prandtl number (an approximation) is different for the two approaches, and of course is not related to the moelcular properties of the gas. Do remember  this is a modelled diffusion term for the turbulent energy transport. And again, my point is that alphaT is different depending on whether you solve for h or e; the difference being the factor gamma. 

December 5, 2020, 03:28 

#5 
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 20 
turbulence>alphaEff() returns lambda/c_p or lambda/c_v depending on the solution variable e or h


December 5, 2020, 05:13 

#6 
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 613
Rep Power: 15 
Oh I see.
The compressible turbulence model take also the thermodynamic model as template parameter. alphaEff is calculated as follwos in the file EddyDiffusivity.H: Code:
// Return the effective turbulent thermal diffusivity for enthalpy // [kg/m/s] virtual tmp<volScalarField> alphaEff() const { return this>transport_.alphaEff(alphat()); } Code:
alphaEff(alphat()) Code:
template<class BasicThermo, class MixtureType> Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::alphaEff ( const volScalarField& alphat ) const { tmp<Foam::volScalarField> alphaEff(this>CpByCpv()*(this>alpha_ + alphat)); alphaEff.ref().rename("alphaEff"); return alphaEff; } Code:
CpByCpv() Code:
template<class BasicThermo, class MixtureType> Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::CpByCpv() const { const fvMesh& mesh = this>T_.mesh(); tmp<volScalarField> tCpByCpv ( new volScalarField ( IOobject ( "CpByCpv", mesh.time().timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE, false ), mesh, dimless ) ); volScalarField& CpByCpv = tCpByCpv.ref(); forAll(this>T_, celli) { CpByCpv[celli] = this>cellMixture(celli).CpByCpv ( this>p_[celli], this>T_[celli] ); } Code:
CpByCpv(p,T) For the sensibleEntalpy we find the function in sensibleEnthalpy.H (it returns 1) Code:
// Cp/Cp [] scalar CpByCpv ( const Thermo& thermo, const scalar p, const scalar T ) const { return 1; } Code:
// Ratio of specific heats Cp/Cv [] scalar CpByCpv ( const Thermo& thermo, const scalar p, const scalar T ) const { #ifdef __clang__ // Using volatile to prevent compiler optimisations leading to // a sigfpe volatile const scalar gamma = thermo.gamma(p, T); return gamma; #else return thermo.gamma(p, T); #endif } 

December 5, 2020, 05:21 

#7 
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 613
Rep Power: 15 
Ok so we can say the the same equations are solve regardless one take h or e as quantity you solve for.
The difference in both equation may lay in the numerical stability since different explicit source terms appear in the equations. For this see also When choose sensibleInternalEnergy or sensibleEnthalpy in thermophysicalProperties 

May 11, 2023, 19:21 

#8  
New Member
Mohamed el Abbassi
Join Date: Oct 2016
Location: Delft, the Netherlands
Posts: 9
Rep Power: 8 
Quote:
and the diffusion term in the energy equation should be: Code:
fvm::laplacian(rho * turbulence>alphaEff(), he) source: https://cfd.direct/openfoam/freesof...orthefuture/ 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Question Re Engineering Data Source  imnull  ANSYS  0  March 5, 2012 13:51 
Transonic rhoSimpleFoam Equations  eric.m.tridas  OpenFOAM  3  January 25, 2012 10:52 
internal field question  PitzDaily Case  atareen64  OpenFOAM Running, Solving & CFD  2  January 26, 2011 15:26 
Question about rhoSimpleFoam "if (transonic)"  universez  OpenFOAM  4  April 17, 2010 10:21 
Poisson Solver question  Suresh  Main CFD Forum  3  August 12, 2005 04:37 