reactingTwoPhaseEulerFoam: Added support for thermal diffusivity and thermal wall-functions

This commit is contained in:
Henry Weller
2015-08-22 18:09:44 +01:00
parent c80e7cd4e5
commit 85c62fc1b7
30 changed files with 691 additions and 144 deletions

View File

@ -4,8 +4,8 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/transportModel \ -I$(LIB_SRC)/transportModels/incompressible/transportModel \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \ -I$(LIB_SRC)/fvOptions/lnInclude \

View File

@ -41,7 +41,13 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel
const word& type const word& type
) )
: :
eddyViscosity<RASModel<PhaseCompressibleTurbulenceModel<phaseModel> > > eddyViscosity
<
RASModel<EddyDiffusivity<ThermalDiffusivity
<
PhaseCompressibleTurbulenceModel<phaseModel>
> > >
>
( (
type, type,
alpha, alpha,
@ -183,7 +189,10 @@ bool Foam::RASModels::kineticTheoryModel::read()
( (
eddyViscosity eddyViscosity
< <
RASModel<PhaseCompressibleTurbulenceModel<phaseModel> > RASModel<EddyDiffusivity<ThermalDiffusivity
<
PhaseCompressibleTurbulenceModel<phaseModel>
> > >
>::read() >::read()
) )
{ {

View File

@ -48,6 +48,8 @@ SourceFiles
#include "RASModel.H" #include "RASModel.H"
#include "eddyViscosity.H" #include "eddyViscosity.H"
#include "PhaseCompressibleTurbulenceModel.H" #include "PhaseCompressibleTurbulenceModel.H"
#include "ThermalDiffusivity.H"
#include "EddyDiffusivity.H"
#include "phaseModel.H" #include "phaseModel.H"
#include "dragModel.H" #include "dragModel.H"
#include "viscosityModel.H" #include "viscosityModel.H"
@ -72,7 +74,10 @@ class kineticTheoryModel
: :
public eddyViscosity public eddyViscosity
< <
RASModel<PhaseCompressibleTurbulenceModel<phaseModel> > RASModel<EddyDiffusivity<ThermalDiffusivity
<
PhaseCompressibleTurbulenceModel<phaseModel>
> > >
> >
{ {
// Private data // Private data

View File

@ -29,6 +29,9 @@ License
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "makeTurbulenceModel.H" #include "makeTurbulenceModel.H"
#include "ThermalDiffusivity.H"
#include "EddyDiffusivity.H"
#include "laminar.H" #include "laminar.H"
#include "RASModel.H" #include "RASModel.H"
#include "LESModel.H" #include "LESModel.H"
@ -39,6 +42,7 @@ makeBaseTurbulenceModel
volScalarField, volScalarField,
compressibleTurbulenceModel, compressibleTurbulenceModel,
PhaseCompressibleTurbulenceModel, PhaseCompressibleTurbulenceModel,
ThermalDiffusivity,
phaseModel phaseModel
); );

View File

@ -40,7 +40,13 @@ Foam::RASModels::phasePressureModel::phasePressureModel
const word& type const word& type
) )
: :
eddyViscosity<RASModel<PhaseCompressibleTurbulenceModel<phaseModel> > > eddyViscosity
<
RASModel<EddyDiffusivity<ThermalDiffusivity
<
PhaseCompressibleTurbulenceModel<phaseModel>
> > >
>
( (
type, type,
alpha, alpha,
@ -87,7 +93,10 @@ bool Foam::RASModels::phasePressureModel::read()
( (
eddyViscosity eddyViscosity
< <
RASModel<PhaseCompressibleTurbulenceModel<phaseModel> > RASModel<EddyDiffusivity<ThermalDiffusivity
<
PhaseCompressibleTurbulenceModel<phaseModel>
> > >
>::read() >::read()
) )
{ {

View File

@ -54,6 +54,8 @@ SourceFiles
#include "RASModel.H" #include "RASModel.H"
#include "eddyViscosity.H" #include "eddyViscosity.H"
#include "PhaseCompressibleTurbulenceModel.H" #include "PhaseCompressibleTurbulenceModel.H"
#include "ThermalDiffusivity.H"
#include "EddyDiffusivity.H"
#include "phaseModel.H" #include "phaseModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -71,7 +73,10 @@ class phasePressureModel
: :
public eddyViscosity public eddyViscosity
< <
RASModel<PhaseCompressibleTurbulenceModel<phaseModel> > RASModel<EddyDiffusivity<ThermalDiffusivity
<
PhaseCompressibleTurbulenceModel<phaseModel>
> > >
> >
{ {
// Private data // Private data

View File

@ -110,10 +110,10 @@ template<class BasePhaseModel, class ThermoType>
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField>
Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::mu Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::mu
( (
const label patchI const label patchi
) const ) const
{ {
return thermo_->mu(patchI); return thermo_->mu(patchi);
} }
@ -129,10 +129,10 @@ template<class BasePhaseModel, class ThermoType>
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField>
Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::nu Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::nu
( (
const label patchI const label patchi
) const ) const
{ {
return thermo_->nu(patchI); return thermo_->nu(patchi);
} }
@ -148,10 +148,75 @@ template<class BasePhaseModel, class ThermoType>
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField>
Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::kappa Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::kappa
( (
const label patchI const label patchi
) const ) const
{ {
return thermo_->kappa(patchI); return thermo_->kappa(patchi);
}
template<class BasePhaseModel, class ThermoType>
Foam::tmp<Foam::volScalarField>
Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::kappaEff
(
const volScalarField& alphat
) const
{
return thermo_->kappaEff(alphat);
}
template<class BasePhaseModel, class ThermoType>
Foam::tmp<Foam::scalarField>
Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::kappaEff
(
const scalarField& alphat,
const label patchi
) const
{
return thermo_->kappaEff(alphat, patchi);
}
template<class BasePhaseModel, class ThermoType>
Foam::tmp<Foam::volScalarField>
Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::alpha() const
{
return thermo_->alpha();
}
template<class BasePhaseModel, class ThermoType>
Foam::tmp<Foam::scalarField>
Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::alpha
(
const label patchi
) const
{
return thermo_->alpha(patchi);
}
template<class BasePhaseModel, class ThermoType>
Foam::tmp<Foam::volScalarField>
Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::alphaEff
(
const volScalarField& alphat
) const
{
return thermo_->alphaEff(alphat);
}
template<class BasePhaseModel, class ThermoType>
Foam::tmp<Foam::scalarField>
Foam::ThermoPhaseModel<BasePhaseModel, ThermoType>::alphaEff
(
const scalarField& alphat,
const label patchi
) const
{
return thermo_->alphaEff(alphat, patchi);
} }

View File

@ -105,19 +105,51 @@ public:
virtual tmp<volScalarField> mu() const; virtual tmp<volScalarField> mu() const;
//- Access the laminar dynamic viscosity //- Access the laminar dynamic viscosity
virtual tmp<scalarField> mu(const label patchI) const; virtual tmp<scalarField> mu(const label patchi) const;
//- Return the laminar kinematic viscosity //- Return the laminar kinematic viscosity
virtual tmp<volScalarField> nu() const; virtual tmp<volScalarField> nu() const;
//- Access the laminar kinematic viscosity //- Access the laminar kinematic viscosity
virtual tmp<scalarField> nu(const label patchI) const; virtual tmp<scalarField> nu(const label patchi) const;
//- Return the laminar thermal conductivity //- Return the laminar thermal conductivity
virtual tmp<volScalarField> kappa() const; virtual tmp<volScalarField> kappa() const;
//- Access the laminar thermal conductivity //- Access the laminar thermal conductivity
virtual tmp<scalarField> kappa(const label patchI) const; virtual tmp<scalarField> kappa(const label patchi) const;
//- Return the laminar thermal conductivity
virtual tmp<volScalarField> kappaEff
(
const volScalarField& alphat
) const;
//- Access the laminar thermal conductivity
virtual tmp<scalarField> kappaEff
(
const scalarField& alphat,
const label patchi
) const;
//- Return the thermal diffusivity for enthalpy
virtual tmp<volScalarField> alpha() const;
//- Return the thermal diffusivity for enthalpy on a patch
virtual tmp<scalarField> alpha(const label patchi) const;
//- Return the thermal diffusivity for enthalpy
virtual tmp<volScalarField> alphaEff
(
const volScalarField& alphat
) const;
//- Return the thermal diffusivity for enthalpy on a patch
virtual tmp<scalarField> alphaEff
(
const scalarField& alphat,
const label patchi
) const;
}; };

View File

@ -246,19 +246,51 @@ public:
virtual tmp<volScalarField> mu() const = 0; virtual tmp<volScalarField> mu() const = 0;
//- Return the laminar dynamic viscosity on a patch //- Return the laminar dynamic viscosity on a patch
virtual tmp<scalarField> mu(const label patchI) const = 0; virtual tmp<scalarField> mu(const label patchi) const = 0;
//- Return the laminar kinematic viscosity //- Return the laminar kinematic viscosity
virtual tmp<volScalarField> nu() const = 0; virtual tmp<volScalarField> nu() const = 0;
//- Return the laminar kinematic viscosity on a patch //- Return the laminar kinematic viscosity on a patch
virtual tmp<scalarField> nu(const label patchI) const = 0; virtual tmp<scalarField> nu(const label patchi) const = 0;
//- Return the laminar thermal conductivity //- Return the laminar thermal conductivity
virtual tmp<volScalarField> kappa() const = 0; virtual tmp<volScalarField> kappa() const = 0;
//- Return the laminar thermal conductivity on a patch //- Return the laminar thermal conductivity on a patch
virtual tmp<scalarField> kappa(const label patchI) const = 0; virtual tmp<scalarField> kappa(const label patchi) const = 0;
//- Return the laminar thermal conductivity
virtual tmp<volScalarField> kappaEff
(
const volScalarField& alphat
) const = 0;
//- Access the laminar thermal conductivity
virtual tmp<scalarField> kappaEff
(
const scalarField& alphat,
const label patchi
) const = 0;
//- Return the thermal diffusivity for enthalpy
virtual tmp<volScalarField> alpha() const = 0;
//- Return the thermal diffusivity for enthalpy on a patch
virtual tmp<scalarField> alpha(const label patchi) const = 0;
//- Return the thermal diffusivity for enthalpy
virtual tmp<volScalarField> alphaEff
(
const volScalarField& alphat
) const = 0;
//- Return the thermal diffusivity for enthalpy on a patch
virtual tmp<scalarField> alphaEff
(
const scalarField& alphat,
const label patchi
) const = 0;
// Turbulence // Turbulence

View File

@ -33,29 +33,17 @@ License
#include "perfectGas.H" #include "perfectGas.H"
#include "perfectFluid.H" #include "perfectFluid.H"
#include "rhoConst.H" #include "rhoConst.H"
#include "incompressiblePerfectGas.H"
#include "hConstThermo.H"
#include "janafThermo.H"
#include "sensibleEnthalpy.H" #include "sensibleEnthalpy.H"
#include "absoluteEnthalpy.H"
#include "absoluteInternalEnergy.H"
#include "thermo.H"
#include "constTransport.H"
#include "sutherlandTransport.H"
#include "pureMixture.H"
#include "homogeneousMixture.H"
#include "inhomogeneousMixture.H"
#include "veryInhomogeneousMixture.H"
#include "multiComponentMixture.H"
#include "reactingMixture.H"
#include "singleStepReactingMixture.H"
#include "thermoPhysicsTypes.H"
#include "hRefConstThermo.H" #include "hRefConstThermo.H"
#include "constTransport.H"
#include "pureMixture.H"
#include "multiComponentMixture.H"
#include "thermoPhysicsTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -119,6 +107,19 @@ constTransport
> >
> constRefFluidEThermoPhysics; > constRefFluidEThermoPhysics;
typedef
constTransport
<
species::thermo
<
hRefConstThermo
<
rhoConst<specie>
>,
sensibleInternalEnergy
>
> constRefRhoConstEThermoPhysics;
// pureMixture, sensibleEnthalpy: // pureMixture, sensibleEnthalpy:
@ -218,6 +219,15 @@ makeReactionMixtureThermo
constRefFluidEThermoPhysics constRefFluidEThermoPhysics
); );
makeReactionMixtureThermo
(
rhoThermo,
rhoReactionThermo,
heRhoThermo,
multiComponentMixture,
constRefRhoConstEThermoPhysics
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -30,6 +30,14 @@ License
template<class BasicTurbulenceModel> template<class BasicTurbulenceModel>
void Foam::EddyDiffusivity<BasicTurbulenceModel>::correctNut() void Foam::EddyDiffusivity<BasicTurbulenceModel>::correctNut()
{ {
// Read Prt if provided
Prt_ = dimensioned<scalar>::lookupOrDefault
(
"Prt",
this->coeffDict(),
1.0
);
alphat_ = this->rho_*this->nut()/Prt_; alphat_ = this->rho_*this->nut()/Prt_;
alphat_.correctBoundaryConditions(); alphat_.correctBoundaryConditions();
} }
@ -41,7 +49,7 @@ template<class BasicTurbulenceModel>
Foam::EddyDiffusivity<BasicTurbulenceModel>::EddyDiffusivity Foam::EddyDiffusivity<BasicTurbulenceModel>::EddyDiffusivity
( (
const word& type, const word& type,
const geometricOneField& alpha, const alphaField& alpha,
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const surfaceScalarField& alphaRhoPhi, const surfaceScalarField& alphaRhoPhi,
@ -62,23 +70,14 @@ Foam::EddyDiffusivity<BasicTurbulenceModel>::EddyDiffusivity
propertiesName propertiesName
), ),
// Prt_ // Cannot read Prt yet
// (
// dimensioned<scalar>::lookupOrAddToDict
// (
// "Prt",
// this->coeffDict_,
// 1.0
// )
// ),
Prt_("Prt", dimless, 1.0), Prt_("Prt", dimless, 1.0),
alphat_ alphat_
( (
IOobject IOobject
( (
"alphat", IOobject::groupName("alphat", U.group()),
this->runTime_.timeName(), this->runTime_.timeName(),
this->mesh_, this->mesh_,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -89,34 +88,6 @@ Foam::EddyDiffusivity<BasicTurbulenceModel>::EddyDiffusivity
{} {}
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
template<class BasicTurbulenceModel>
Foam::autoPtr<Foam::EddyDiffusivity<BasicTurbulenceModel> >
Foam::EddyDiffusivity<BasicTurbulenceModel>::New
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName
)
{
return autoPtr<EddyDiffusivity>
(
static_cast<EddyDiffusivity*>(
BasicTurbulenceModel::New
(
rho,
U,
phi,
transport,
propertiesName
).ptr())
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BasicTurbulenceModel> template<class BasicTurbulenceModel>

View File

@ -82,7 +82,7 @@ public:
EddyDiffusivity EddyDiffusivity
( (
const word& type, const word& type,
const geometricOneField& alpha, const alphaField& alpha,
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const surfaceScalarField& alphaRhoPhi, const surfaceScalarField& alphaRhoPhi,
@ -92,19 +92,6 @@ public:
); );
// Selectors
//- Return a reference to the selected turbulence model
static autoPtr<EddyDiffusivity> New
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const transportModel& trasportModel,
const word& propertiesName = turbulenceModel::propertiesName
);
//- Destructor //- Destructor
virtual ~EddyDiffusivity() virtual ~EddyDiffusivity()
{} {}

View File

@ -31,7 +31,7 @@ template<class BasicTurbulenceModel>
Foam::ThermalDiffusivity<BasicTurbulenceModel>::ThermalDiffusivity Foam::ThermalDiffusivity<BasicTurbulenceModel>::ThermalDiffusivity
( (
const word& type, const word& type,
const geometricOneField& alpha, const alphaField& alpha,
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const surfaceScalarField& alphaRhoPhi, const surfaceScalarField& alphaRhoPhi,
@ -56,6 +56,34 @@ Foam::ThermalDiffusivity<BasicTurbulenceModel>::ThermalDiffusivity
// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
template<class BasicTurbulenceModel>
Foam::autoPtr<Foam::ThermalDiffusivity<BasicTurbulenceModel> >
Foam::ThermalDiffusivity<BasicTurbulenceModel>::New
(
const alphaField& alpha,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName
)
{
return autoPtr<ThermalDiffusivity>
(
static_cast<ThermalDiffusivity*>(
BasicTurbulenceModel::New
(
alpha,
rho,
U,
phi,
transport,
propertiesName
).ptr())
);
}
template<class BasicTurbulenceModel> template<class BasicTurbulenceModel>
Foam::autoPtr<Foam::ThermalDiffusivity<BasicTurbulenceModel> > Foam::autoPtr<Foam::ThermalDiffusivity<BasicTurbulenceModel> >
Foam::ThermalDiffusivity<BasicTurbulenceModel>::New Foam::ThermalDiffusivity<BasicTurbulenceModel>::New

View File

@ -53,7 +53,7 @@ class ThermalDiffusivity
public: public:
typedef geometricOneField alphaField; typedef typename BasicTurbulenceModel::alphaField alphaField;
typedef volScalarField rhoField; typedef volScalarField rhoField;
typedef typename BasicTurbulenceModel::transportModel transportModel; typedef typename BasicTurbulenceModel::transportModel transportModel;
@ -64,7 +64,7 @@ public:
ThermalDiffusivity ThermalDiffusivity
( (
const word& type, const word& type,
const geometricOneField& alpha, const alphaField& alpha,
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const surfaceScalarField& alphaRhoPhi, const surfaceScalarField& alphaRhoPhi,
@ -76,6 +76,18 @@ public:
// Selectors // Selectors
//- Return a reference to the selected turbulence model
static autoPtr<ThermalDiffusivity> New
(
const alphaField& alpha,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
const transportModel& trasportModel,
const word& propertiesName = turbulenceModel::propertiesName
);
//- Return a reference to the selected turbulence model //- Return a reference to the selected turbulence model
static autoPtr<ThermalDiffusivity> New static autoPtr<ThermalDiffusivity> New
( (

View File

@ -110,11 +110,12 @@ void convectiveHeatTransferFvPatchScalarField::updateCoeffs()
const label patchi = patch().index(); const label patchi = patch().index();
const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> const compressible::turbulenceModel& turbModel =
db().lookupObject<compressible::turbulenceModel>
( (
IOobject::groupName IOobject::groupName
( (
turbulenceModel::propertiesName, compressible::turbulenceModel::propertiesName,
dimensionedInternalField().group() dimensionedInternalField().group()
) )
); );

View File

@ -32,6 +32,7 @@ License
#include "turbulentFluidThermoModel.H" #include "turbulentFluidThermoModel.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField:: Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::
totalFlowRateAdvectiveDiffusiveFvPatchScalarField totalFlowRateAdvectiveDiffusiveFvPatchScalarField
( (
@ -157,7 +158,8 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs()
db().lookupObject db().lookupObject
< <
LESModel<EddyDiffusivity<compressible::turbulenceModel> > LESModel<EddyDiffusivity<compressible::turbulenceModel> >
> ( >
(
IOobject::groupName IOobject::groupName
( (
turbulenceModel::propertiesName, turbulenceModel::propertiesName,

View File

@ -200,12 +200,12 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
const label patchi = patch().index(); const label patchi = patch().index();
// Retrieve turbulence properties from model // Retrieve turbulence properties from model
const compressible::turbulenceModel& turbModel =
const turbulenceModel& turbModel = db().lookupObject<turbulenceModel> db().lookupObject<compressible::turbulenceModel>
( (
IOobject::groupName IOobject::groupName
( (
turbulenceModel::propertiesName, compressible::turbulenceModel::propertiesName,
dimensionedInternalField().group() dimensionedInternalField().group()
) )
); );

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "alphatWallFunctionFvPatchScalarField.H" #include "alphatWallFunctionFvPatchScalarField.H"
#include "compressibleTurbulenceModel.H"
#include "fvPatchFieldMapper.H" #include "fvPatchFieldMapper.H"
#include "volFields.H" #include "volFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
@ -44,8 +45,6 @@ alphatWallFunctionFvPatchScalarField::alphatWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
rhoName_("rho"),
nutName_("nut"),
Prt_(0.85) Prt_(0.85)
{} {}
@ -59,8 +58,6 @@ alphatWallFunctionFvPatchScalarField::alphatWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(ptf, p, iF, mapper), fixedValueFvPatchScalarField(ptf, p, iF, mapper),
rhoName_(ptf.rhoName_),
nutName_(ptf.nutName_),
Prt_(ptf.Prt_) Prt_(ptf.Prt_)
{} {}
@ -73,8 +70,6 @@ alphatWallFunctionFvPatchScalarField::alphatWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(p, iF, dict), fixedValueFvPatchScalarField(p, iF, dict),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
nutName_(dict.lookupOrDefault<word>("nut", "nut")),
Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85)) Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85))
{} {}
@ -85,8 +80,6 @@ alphatWallFunctionFvPatchScalarField::alphatWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(awfpsf), fixedValueFvPatchScalarField(awfpsf),
rhoName_(awfpsf.rhoName_),
nutName_(awfpsf.nutName_),
Prt_(awfpsf.Prt_) Prt_(awfpsf.Prt_)
{} {}
@ -98,8 +91,6 @@ alphatWallFunctionFvPatchScalarField::alphatWallFunctionFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(awfpsf, iF), fixedValueFvPatchScalarField(awfpsf, iF),
rhoName_(awfpsf.rhoName_),
nutName_(awfpsf.nutName_),
Prt_(awfpsf.Prt_) Prt_(awfpsf.Prt_)
{} {}
@ -113,13 +104,23 @@ void alphatWallFunctionFvPatchScalarField::updateCoeffs()
return; return;
} }
const scalarField& rhow = const label patchi = patch().index();
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
const scalarField& nutw = // Retrieve turbulence properties from model
patch().lookupPatchField<volScalarField, scalar>(nutName_); const compressibleTurbulenceModel& turbModel =
db().lookupObject<compressibleTurbulenceModel>
(
IOobject::groupName
(
compressibleTurbulenceModel::propertiesName,
dimensionedInternalField().group()
)
);
operator==(rhow*nutw/Prt_); const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
const tmp<scalarField> tnutw = turbModel.nut(patchi);
operator==(rhow*tnutw/Prt_);
fixedValueFvPatchScalarField::updateCoeffs(); fixedValueFvPatchScalarField::updateCoeffs();
} }
@ -128,8 +129,6 @@ void alphatWallFunctionFvPatchScalarField::updateCoeffs()
void alphatWallFunctionFvPatchScalarField::write(Ostream& os) const void alphatWallFunctionFvPatchScalarField::write(Ostream& os) const
{ {
fvPatchField<scalar>::write(os); fvPatchField<scalar>::write(os);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntryIfDifferent<word>(os, "nut", "nut", nutName_);
os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl;
writeEntry("value", os); writeEntry("value", os);
} }

View File

@ -95,12 +95,6 @@ class alphatWallFunctionFvPatchScalarField
{ {
// Private data // Private data
//- Name of density field (default = rho)
word rhoName_;
//- Name of turbulent viscosity field (default = nut)
word nutName_;
//- Turbulent Prandtl number (default = 0.85) //- Turbulent Prandtl number (default = 0.85)
scalar Prt_; scalar Prt_;

View File

@ -23,7 +23,8 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#define makeBaseTurbulenceModel(Alpha, Rho, baseModel, BaseModel, Transport) \ #define makeBaseTurbulenceModel( \
Alpha, Rho, baseModel, BaseModel, TDModel, Transport) \
\ \
namespace Foam \ namespace Foam \
{ \ { \
@ -41,7 +42,7 @@ License
dictionary \ dictionary \
); \ ); \
\ \
typedef BaseModel<CompressibleTurbulenceModel<Transport> > \ typedef TDModel<BaseModel<Transport> > \
Transport##BaseModel; \ Transport##BaseModel; \
\ \
\ \

View File

@ -23,12 +23,12 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "CompressibleTurbulenceModel.H"
#include "compressibleTransportModel.H" #include "compressibleTransportModel.H"
#include "fluidThermo.H" #include "fluidThermo.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "makeTurbulenceModel.H" #include "makeTurbulenceModel.H"
#include "CompressibleTurbulenceModel.H"
#include "ThermalDiffusivity.H" #include "ThermalDiffusivity.H"
#include "EddyDiffusivity.H" #include "EddyDiffusivity.H"
@ -43,17 +43,18 @@ makeBaseTurbulenceModel
geometricOneField, geometricOneField,
volScalarField, volScalarField,
compressibleTurbulenceModel, compressibleTurbulenceModel,
CompressibleTurbulenceModel,
ThermalDiffusivity, ThermalDiffusivity,
fluidThermo fluidThermo
); );
#define makeRASModel(Type) \ #define makeRASModel(Type) \
makeTemplatedTurbulenceModel \ makeTemplatedTurbulenceModel \
(fluidThermoThermalDiffusivity, RAS, Type) (fluidThermoCompressibleTurbulenceModel, RAS, Type)
#define makeLESModel(Type) \ #define makeLESModel(Type) \
makeTemplatedTurbulenceModel \ makeTemplatedTurbulenceModel \
(fluidThermoThermalDiffusivity, LES, Type) (fluidThermoCompressibleTurbulenceModel, LES, Type)
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //

View File

@ -141,8 +141,6 @@ protected:
dimensionedScalar alphaOmega1_; dimensionedScalar alphaOmega1_;
dimensionedScalar alphaOmega2_; dimensionedScalar alphaOmega2_;
dimensionedScalar Prt_;
dimensionedScalar gamma1_; dimensionedScalar gamma1_;
dimensionedScalar gamma2_; dimensionedScalar gamma2_;

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alphat.air;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
walls
{
type compressible::alphatWallFunction;
Prt 0.85;
value $internalField;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alphat.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
walls
{
type compressible::alphatWallFunction;
Prt 0.85;
value $internalField;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alphat.air;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
walls
{
type compressible::alphatWallFunction;
Prt 0.85;
value $internalField;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alphat.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
walls
{
type compressible::alphatWallFunction;
Prt 0.85;
value $internalField;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alphat.gas;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
walls
{
type compressible::alphatWallFunction;
Prt 0.85;
value $internalField;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alphat.air;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
walls
{
type compressible::alphatWallFunction;
Prt 0.85;
value $internalField;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alphat.particles;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
walls
{
type calculated;
value $internalField;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alphat.particles;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
walls
{
type calculated;
value $internalField;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //