View Issue Details

IDProjectCategoryView StatusLast Update
0003374OpenFOAMBugpublic2019-10-21 08:26
Reporterhaoyuan Assigned Tohenry  
Status closedResolutionduplicate 
PlatformGNU/LinuxOSUbuntuOS Version16.04
Summary0003374: The calculation of alphaEff() in rhoCentralFoam is not alway right for laminar or turbulent flows
DescriptionThe thermal diffusivity of a mixture, alphaEff(), is not right for laminar flow in OpenFOAM V5.0 and above, but right for turbulent flows.
However, this calculation is right for laminar flow in OpenFOAM 4.1 or below but wrong for turbulent flows.

When it is laminar, alphaEff() is calculated from (src/TurbulenceModels/compressible/ThermalDiffusivity/ThermalDiffusivity.H)
         //- Return the effective turbulent thermal diffusivity for enthalpy
  158 // [kg/m/s]
  159 virtual tmp<volScalarField> alphaEff() const
  160 {
  161 return alpha();
  162 }
This part of calculation is the same in both V4.1 and V5.0 (or above).

The alpha(), if we choose Sutherland transport mode, is calculated from (src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H)
 template<class Thermo>
  154 inline Foam::scalar Foam::sutherlandTransport<Thermo>::alphah
  155 (
  156 const scalar p,
  157 const scalar T
  158 ) const
  159 {
  161 return kappa(p, T)/this->Cpv(p, T);
  162 }

The line of 161 is "Cpv" in OpenFOAM 4.1 but "Cp" in OpenFOAM 5.0 or above.

This is not consistent. In OpenFOAM 4.1 the alpha() calculated could be either the thermal diffusivity of enthalpy or inner energy, which depends on what thermal type we choose,(for instance "sensibleEnthalpy" or "sensibleInternalEnergy"). However, in OpenFOAM 5.0 or above, it could only return the thermal diffusivity of enthalpy.

So, if we run a laminar simulation with rhoCentralFoamm for high-speed flows and choose the "sensibleInternalEnergy" package, the alphaEff() returned is the thermal diffusivity of inner energy in OpenFOAM V4.1, which is what we want, but it returns the thermal diffusivity of enthalpy in OpenFOAM V5.0, which is not right.

If we run a turbulent simulation, the situation is just the opposite.

The alphaEff() is calculated from (src/TurbulenceModels/compressible/EddyDiffusivity/EddyDiffusivity.H)

         //- Return the effective turbulent thermal diffusivity for enthalpy
  133 // [kg/m/s]
  134 virtual tmp<volScalarField> alphaEff() const
  135 {
  136 return this->transport_.alphaEff(alphat());
  137 }
and if we choose "hePsiThermo" package (src/thermophysicalModels/basic/heThermo/heThermo.C)
 template<class BasicThermo, class MixtureType>
  785 Foam::tmp<Foam::volScalarField>
  786 Foam::heThermo<BasicThermo, MixtureType>::alphaEff
  787 (
  788 const volScalarField& alphat
  789 ) const
  790 {
  791 tmp<Foam::volScalarField> alphaEff(this->CpByCpv()*(this->alpha_ + alphat));
  792 alphaEff.ref().rename("alphaEff");
  793 return alphaEff;
  794 }
 because alphat is always the turbulent thermal diffusivity of enthalpy, so if "this->alpha_" is for enthalpy, this calculation is self-consistent. As we have known, the calculation of "this->alpha_" could be either for enthalpy of inner energy, so it may be not self-consistent under certain condition.

Steps To ReproduceA 2D hypersonic laminar cylinder flow case is attached. With V4.1 and V5.0, we would get different results on wall heat transfer rate but almost identical results on wall pressure.
TagsNo tags attached.


duplicate of 0003025 resolvedhenry wallHeatFlux Utility - Error in new versions - internalEnergy/Enthalpy mismatch for sonicFoam and rhoCentralFoam 



2019-10-20 10:55

reporter (186,497 bytes)


2019-10-20 15:18

reporter   ~0010846

Just find the new variable alphahe() in the OpenFOAM 6 and OpenFOAM 7, so I guess this problem may be solved already.

Issue History

Date Modified Username Field Change
2019-10-20 10:55 haoyuan New Issue
2019-10-20 10:55 haoyuan File Added:
2019-10-20 15:18 haoyuan Note Added: 0010846
2019-10-21 08:25 henry Relationship added duplicate of 0003025
2019-10-21 08:26 henry Assigned To => henry
2019-10-21 08:26 henry Status new => closed
2019-10-21 08:26 henry Resolution open => duplicate