Skip to content

Commit

Permalink
thermophysicalTransportModels: Added nonUnityLewisEddyDiffusivity
Browse files Browse the repository at this point in the history
This allows specification of a turbulent Schmidt number independent from
that of the turbulent Prandtl number. An example specification in
constant/thermophysicalTransport is as follows:

    RAS
    {
        model           nonUnityLewisEddyDiffusivity;
        Prt             0.85;
        Sct             0.7;
    }

The defaulting of the turbulent Prandtl number (Prt) to 1 has also been
removed from the eddyDiffusivity model. Now the value must be set
explicitly. The only exception is if the
constant/thermophysicalTransport dictionary is omitted entirely, in
which case eddyDiffusivity with a turbulent Prandtl number of 1 is
selected as before.
  • Loading branch information
Will Bainbridge committed Apr 21, 2020
1 parent cf358d7 commit 86f2c6d
Show file tree
Hide file tree
Showing 10 changed files with 418 additions and 6 deletions.
Expand Up @@ -107,6 +107,9 @@ makeLaminarThermophysicalTransportModel(Fourier);
#include "eddyDiffusivity.H"
makeRASLESThermophysicalTransportModel(RAS, eddyDiffusivity);

#include "nonUnityLewisEddyDiffusivity.H"
makeRASLESThermophysicalTransportModel(RAS, nonUnityLewisEddyDiffusivity);


// -------------------------------------------------------------------------- //
// LES models
Expand All @@ -115,5 +118,8 @@ makeRASLESThermophysicalTransportModel(RAS, eddyDiffusivity);
#include "eddyDiffusivity.H"
makeRASLESThermophysicalTransportModel(LES, eddyDiffusivity);

#include "nonUnityLewisEddyDiffusivity.H"
makeRASLESThermophysicalTransportModel(LES, nonUnityLewisEddyDiffusivity);


// ************************************************************************* //
Expand Up @@ -44,7 +44,7 @@ namespace Foam
namespace laminarThermophysicalTransportModels
{

/*---------------------------------------------------------------------------* \
/*---------------------------------------------------------------------------*\
Class Fourier Declaration
\*---------------------------------------------------------------------------*/

Expand Down
Expand Up @@ -50,6 +50,9 @@ makeLaminarThermophysicalTransportModel(Fourier);
#include "eddyDiffusivity.H"
makeRASLESThermophysicalTransportModel(RAS, eddyDiffusivity);

#include "nonUnityLewisEddyDiffusivity.H"
makeRASLESThermophysicalTransportModel(RAS, nonUnityLewisEddyDiffusivity);


// -------------------------------------------------------------------------- //
// LES models
Expand All @@ -58,5 +61,8 @@ makeRASLESThermophysicalTransportModel(RAS, eddyDiffusivity);
#include "eddyDiffusivity.H"
makeRASLESThermophysicalTransportModel(LES, eddyDiffusivity);

#include "nonUnityLewisEddyDiffusivity.H"
makeRASLESThermophysicalTransportModel(LES, nonUnityLewisEddyDiffusivity);


// ************************************************************************* //
Expand Up @@ -50,6 +50,9 @@ makeLaminarThermophysicalTransportModel(Fourier);
#include "eddyDiffusivity.H"
makeRASLESThermophysicalTransportModel(RAS, eddyDiffusivity);

#include "nonUnityLewisEddyDiffusivity.H"
makeRASLESThermophysicalTransportModel(RAS, nonUnityLewisEddyDiffusivity);


// -------------------------------------------------------------------------- //
// LES models
Expand All @@ -58,5 +61,8 @@ makeRASLESThermophysicalTransportModel(RAS, eddyDiffusivity);
#include "eddyDiffusivity.H"
makeRASLESThermophysicalTransportModel(LES, eddyDiffusivity);

#include "nonUnityLewisEddyDiffusivity.H"
makeRASLESThermophysicalTransportModel(LES, nonUnityLewisEddyDiffusivity);


// ************************************************************************* //
Expand Up @@ -139,7 +139,13 @@ Foam::LESThermophysicalTransportModel

return autoPtr<LESThermophysicalTransportModel>
(
new LESeddyDiffusivity(momentumTransport, thermo)
new LESeddyDiffusivity
(
LESeddyDiffusivity::typeName,
momentumTransport,
thermo,
true
)
);
}
}
Expand Down
Expand Up @@ -139,7 +139,13 @@ Foam::RASThermophysicalTransportModel

return autoPtr<RASThermophysicalTransportModel>
(
new RASeddyDiffusivity(momentumTransport, thermo)
new RASeddyDiffusivity
(
RASeddyDiffusivity::typeName,
momentumTransport,
thermo,
true
)
);
}
}
Expand Down
Expand Up @@ -53,6 +53,25 @@ eddyDiffusivity<TurbulenceThermophysicalTransportModel>::eddyDiffusivity
const momentumTransportModel& momentumTransport,
const thermoModel& thermo
)
:
eddyDiffusivity
(
typeName,
momentumTransport,
thermo,
false
)
{}


template<class TurbulenceThermophysicalTransportModel>
eddyDiffusivity<TurbulenceThermophysicalTransportModel>::eddyDiffusivity
(
const word& type,
const momentumTransportModel& momentumTransport,
const thermoModel& thermo,
const bool allowDefaultPrt
)
:
TurbulenceThermophysicalTransportModel
(
Expand All @@ -63,12 +82,19 @@ eddyDiffusivity<TurbulenceThermophysicalTransportModel>::eddyDiffusivity

Prt_
(
dimensioned<scalar>::lookupOrAddToDict
allowDefaultPrt
? dimensioned<scalar>::lookupOrAddToDict
(
"Prt",
this->coeffDict_,
1
)
: dimensioned<scalar>
(
"Prt",
dimless,
this->coeffDict_
)
),

alphat_
Expand Down
Expand Up @@ -26,7 +26,17 @@ Class
Description
Eddy-diffusivity based gradient heat flux model for RAS or LES
of turbulent flow.
of turbulent flow. Specie fluxes are computed assuming a unity turbulent
Lewis number.
Usage
\verbatim
LES
{
model eddyDiffusivity;
Prt 0.85;
}
\endverbatim
SourceFiles
eddyDiffusivity.C
Expand Down Expand Up @@ -59,10 +69,12 @@ protected:

// Model coefficients

//- Turbulent Prandtl number []
dimensionedScalar Prt_;

// Fields

//- Turbulent thermal diffusivity of enthalpy [kg/m/s]
volScalarField alphat_;


Expand Down Expand Up @@ -90,13 +102,24 @@ public:

// Constructors

//- Construct from components
//- Construct from a momentum transport model and a thermo model
eddyDiffusivity
(
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
eddyDiffusivity
(
const word& type,
const momentumTransportModel& momentumTransport,
const thermoModel& thermo,
const bool allowDefaultPrt
);


//- Destructor
virtual ~eddyDiffusivity()
Expand Down
@@ -0,0 +1,188 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
\*---------------------------------------------------------------------------*/

#include "nonUnityLewisEddyDiffusivity.H"
#include "fvcLaplacian.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{
namespace turbulenceThermophysicalTransportModels
{

// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

template<class TurbulenceThermophysicalTransportModel>
nonUnityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::
nonUnityLewisEddyDiffusivity
(
const momentumTransportModel& momentumTransport,
const thermoModel& thermo
)
:
eddyDiffusivity<TurbulenceThermophysicalTransportModel>
(
typeName,
momentumTransport,
thermo,
false
),

Sct_
(
dimensioned<scalar>
(
"Sct",
dimless,
this->coeffDict_
)
)
{}


// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

template<class TurbulenceThermophysicalTransportModel>
bool
nonUnityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::read()
{
if (eddyDiffusivity<TurbulenceThermophysicalTransportModel>::read())
{
Sct_.readIfPresent(this->coeffDict());

return true;
}
else
{
return false;
}
}


template<class TurbulenceThermophysicalTransportModel>
tmp<volVectorField>
nonUnityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::q() const
{
tmp<volVectorField> tmpq =
eddyDiffusivity<TurbulenceThermophysicalTransportModel>::q();

if (mag(this->Prt_ - Sct_).value() > small)
{
const basicSpecieMixture& composition = this->thermo().composition();

const PtrList<volScalarField>& Y = composition.Y();

volScalarField alphaEffMinusDEff
(
"alphaEffMinusDEff",
this->alphaEff()*(1 - this->Prt_/Sct_)
);

forAll(Y, i)
{
tmpq.ref() +=
this->alpha()
*alphaEffMinusDEff
*composition.HE(i, this->thermo().p(), this->thermo().T())
*fvc::grad(Y[i]);
}
}

return tmpq;
}


template<class TurbulenceThermophysicalTransportModel>
tmp<fvScalarMatrix>
nonUnityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::divq
(
volScalarField& he
) const
{
tmp<fvScalarMatrix> tmpDivq =
eddyDiffusivity<TurbulenceThermophysicalTransportModel>::divq(he);

if (mag(this->Prt_ - Sct_).value() > small)
{
const basicSpecieMixture& composition = this->thermo().composition();

const PtrList<volScalarField>& Y = composition.Y();

volScalarField alphaEffMinusDEff
(
"alphaEffMinusDEff",
this->alphaEff()*(1 - this->Prt_/Sct_)
);

forAll(Y, i)
{
tmpDivq.ref() +=
fvc::laplacian
(
this->alpha()
*alphaEffMinusDEff
*composition.HE(i, this->thermo().p(), this->thermo().T()),
Y[i]
);
}
}

return tmpDivq;
}


template<class TurbulenceThermophysicalTransportModel>
tmp<volVectorField>
nonUnityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::j
(
const volScalarField& Yi
) const
{
return
this->Prt_/Sct_
*eddyDiffusivity<TurbulenceThermophysicalTransportModel>::j(Yi);
}


template<class TurbulenceThermophysicalTransportModel>
tmp<fvScalarMatrix>
nonUnityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::divj
(
volScalarField& Yi
) const
{
return
this->Prt_/Sct_
*eddyDiffusivity<TurbulenceThermophysicalTransportModel>::divj(Yi);
}


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace turbulenceThermophysicalTransportModels
} // End namespace Foam

// ************************************************************************* //

0 comments on commit 86f2c6d

Please sign in to comment.