Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thermophysicalTransportModels: Added nonUnityLewisEddyDiffusivity
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
Showing
10 changed files
with
418 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
188 changes: 188 additions & 0 deletions
188
...calTransportModels/turbulence/nonUnityLewisEddyDiffusivity/nonUnityLewisEddyDiffusivity.C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
// ************************************************************************* // |
Oops, something went wrong.