Fourier, eddyDiffusivity and nonUnityLewisEddyDiffusivity thermophysical transport models now apply an implicit energy correction to a temperature gradient based heat-flux to provide computational stability and efficiency while converging to temperature gradient based solution. This ensures consistent heat exchange between fluid and solid regions in CHT cases and with heat-flux boundaries. The Fourier and eddyDiffusivity models support single specie systems only whereas nonUnityLewisEddyDiffusivity supports specie diffusion with independent specification of turbulent Prandtl and Schmidt numbers, i.e. non-unity Lewis number. The unityLewisFourier and unityLewisEddyDiffusivity thermophysical transport models use an implicit energy gradient based heat-flux which is optimal for numerical stability and convergence but does not guarantee consistent heat exchange between fluid and solid regions and heat-flux boundaries in the presence of gradients of heat capacity. Both of these models support specie diffusion with the restriction that the laminar and turbulent Prandtl and Schmidt numbers are equal, i.e. unity Lewis number. The thermophysical transport model is specified in the optional thermophysicalTransport dictionary; if this file is not present the unityLewisFourier model is selected for laminar and unityLewisEddyDiffusivity for turbulent cases for backward compatibility. The chtMultiRegionFoam tutorial cases have been updated to use the most appropriate of the new thermophysical transport models.
235 lines
6.8 KiB
C++
235 lines
6.8 KiB
C++
/*---------------------------------------------------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration | Website: https://openfoam.org
|
|
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
|
|
\\/ M anipulation |
|
|
-------------------------------------------------------------------------------
|
|
License
|
|
This file is part of OpenFOAM.
|
|
|
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
Class
|
|
Foam::turbulenceThermophysicalTransportModels::unityLewisEddyDiffusivity
|
|
|
|
Description
|
|
Eddy-diffusivity based energy gradient heat flux model for RAS or LES
|
|
of turbulent flow. Specie fluxes are computed assuming a unity turbulent
|
|
Lewis number.
|
|
|
|
Usage
|
|
\verbatim
|
|
LES
|
|
{
|
|
model unityLewisEddyDiffusivity;
|
|
Prt 0.85;
|
|
}
|
|
\endverbatim
|
|
|
|
SourceFiles
|
|
unityLewisEddyDiffusivity.C
|
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
#ifndef unityLewisEddyDiffusivity_H
|
|
#define unityLewisEddyDiffusivity_H
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
namespace Foam
|
|
{
|
|
namespace turbulenceThermophysicalTransportModels
|
|
{
|
|
|
|
/*---------------------------------------------------------------------------*\
|
|
Class unityLewisEddyDiffusivity Declaration
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
template<class TurbulenceThermophysicalTransportModel>
|
|
class unityLewisEddyDiffusivity
|
|
:
|
|
public TurbulenceThermophysicalTransportModel
|
|
{
|
|
|
|
protected:
|
|
|
|
// Protected data
|
|
|
|
// Model coefficients
|
|
|
|
//- Turbulent Prandtl number []
|
|
dimensionedScalar Prt_;
|
|
|
|
// Fields
|
|
|
|
//- Turbulent thermal diffusivity of enthalpy [kg/m/s]
|
|
volScalarField alphat_;
|
|
|
|
|
|
// Protected Member Functions
|
|
|
|
virtual void correctAlphat();
|
|
|
|
|
|
public:
|
|
|
|
typedef typename TurbulenceThermophysicalTransportModel::alphaField
|
|
alphaField;
|
|
|
|
typedef typename
|
|
TurbulenceThermophysicalTransportModel::momentumTransportModel
|
|
momentumTransportModel;
|
|
|
|
typedef typename TurbulenceThermophysicalTransportModel::thermoModel
|
|
thermoModel;
|
|
|
|
|
|
//- Runtime type information
|
|
TypeName("unityLewisEddyDiffusivity");
|
|
|
|
|
|
// Constructors
|
|
|
|
//- Construct from a momentum transport model and a thermo model
|
|
unityLewisEddyDiffusivity
|
|
(
|
|
const momentumTransportModel& momentumTransport,
|
|
const thermoModel& thermo
|
|
);
|
|
|
|
//- Construct from a type name, a momentum transport model and a thermo
|
|
// model, and whether to default the turbulent Prandtl number to one
|
|
// if it is not specified
|
|
unityLewisEddyDiffusivity
|
|
(
|
|
const word& type,
|
|
const momentumTransportModel& momentumTransport,
|
|
const thermoModel& thermo,
|
|
const bool allowDefaultPrt
|
|
);
|
|
|
|
|
|
//- Destructor
|
|
virtual ~unityLewisEddyDiffusivity()
|
|
{}
|
|
|
|
|
|
// Member Functions
|
|
|
|
//- Read thermophysicalTransport dictionary
|
|
virtual bool read();
|
|
|
|
//- Turbulent thermal diffusivity for enthalpy [kg/m/s]
|
|
virtual tmp<volScalarField> alphat() const
|
|
{
|
|
return alphat_;
|
|
}
|
|
|
|
//- Turbulent thermal diffusivity for enthalpy for a patch [kg/m/s]
|
|
virtual tmp<scalarField> alphat(const label patchi) const
|
|
{
|
|
return alphat()().boundaryField()[patchi];
|
|
}
|
|
|
|
//- Effective thermal turbulent diffusivity for temperature
|
|
// of mixture [W/m/K]
|
|
virtual tmp<volScalarField> kappaEff() const
|
|
{
|
|
return this->thermo().kappaEff(alphat());
|
|
}
|
|
|
|
//- Effective thermal turbulent diffusivity for temperature
|
|
// of mixture for patch [W/m/K]
|
|
virtual tmp<scalarField> kappaEff(const label patchi) const
|
|
{
|
|
return this->thermo().kappaEff
|
|
(
|
|
alphat(patchi),
|
|
patchi
|
|
);
|
|
}
|
|
|
|
//- Effective thermal turbulent diffusivity of mixture [kg/m/s]
|
|
virtual tmp<volScalarField> alphaEff() const
|
|
{
|
|
return this->thermo().alphaEff(alphat());
|
|
}
|
|
|
|
//- Effective thermal turbulent diffusivity of mixture
|
|
// for patch [kg/m/s]
|
|
virtual tmp<scalarField> alphaEff(const label patchi) const
|
|
{
|
|
return this->thermo().alphaEff
|
|
(
|
|
alphat(patchi),
|
|
patchi
|
|
);
|
|
}
|
|
|
|
//- Effective mass diffusivity for a given specie mass-fraction [kg/m/s]
|
|
virtual tmp<volScalarField> DEff(const volScalarField& Yi) const
|
|
{
|
|
return volScalarField::New
|
|
(
|
|
"DEff",
|
|
alphaEff()
|
|
);
|
|
}
|
|
|
|
//- Effective mass diffusivity for a given specie mass-fraction
|
|
// for patch [kg/m/s]
|
|
virtual tmp<scalarField> DEff
|
|
(
|
|
const volScalarField& Yi,
|
|
const label patchi
|
|
) const
|
|
{
|
|
return alphaEff(patchi);
|
|
}
|
|
|
|
//- Return the heat flux
|
|
virtual tmp<volVectorField> q() const;
|
|
|
|
//- Return the source term for the energy equation
|
|
virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
|
|
|
|
//- Return the specie flux for the given specie mass-fraction
|
|
virtual tmp<volVectorField> j(const volScalarField& Yi) const;
|
|
|
|
//- Return the source term for the given specie mass-fraction equation
|
|
virtual tmp<fvScalarMatrix> divj(volScalarField& Yi) const;
|
|
|
|
//- Correct the unityLewisEddyDiffusivity viscosity
|
|
virtual void correct();
|
|
};
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
} // End namespace turbulenceThermophysicalTransportModels
|
|
} // End namespace Foam
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
#ifdef NoRepository
|
|
#include "unityLewisEddyDiffusivity.C"
|
|
#endif
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
#endif
|
|
|
|
// ************************************************************************* //
|