mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -2,8 +2,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
-I$(LIB_SRC)/turbulenceModels \
|
-I$(LIB_SRC)/turbulenceModels \
|
||||||
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions \
|
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions \
|
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions \
|
||||||
|
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
|
|||||||
@ -37,11 +37,11 @@ Description
|
|||||||
|
|
||||||
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
|
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
|
||||||
#include "incompressible/RAS/RASModel/RASModel.H"
|
#include "incompressible/RAS/RASModel/RASModel.H"
|
||||||
#include "nutkWallFunction/nutkWallFunctionFvPatchScalarField.H"
|
#include "nutWallFunction/nutWallFunctionFvPatchScalarField.H"
|
||||||
|
|
||||||
#include "basicThermo.H"
|
#include "basicThermo.H"
|
||||||
#include "compressible/RAS/RASModel/RASModel.H"
|
#include "compressible/RAS/RASModel/RASModel.H"
|
||||||
#include "mutkWallFunction/mutkWallFunctionFvPatchScalarField.H"
|
#include "mutWallFunction/mutWallFunctionFvPatchScalarField.H"
|
||||||
|
|
||||||
#include "wallDist.H"
|
#include "wallDist.H"
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ void calcIncompressibleYPlus
|
|||||||
volScalarField& yPlus
|
volScalarField& yPlus
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
typedef incompressible::RASModels::nutkWallFunctionFvPatchScalarField
|
typedef incompressible::RASModels::nutWallFunctionFvPatchScalarField
|
||||||
wallFunctionPatchField;
|
wallFunctionPatchField;
|
||||||
|
|
||||||
#include "createPhi.H"
|
#include "createPhi.H"
|
||||||
@ -107,7 +107,7 @@ void calcCompressibleYPlus
|
|||||||
volScalarField& yPlus
|
volScalarField& yPlus
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
typedef compressible::RASModels::mutkWallFunctionFvPatchScalarField
|
typedef compressible::RASModels::mutWallFunctionFvPatchScalarField
|
||||||
wallFunctionPatchField;
|
wallFunctionPatchField;
|
||||||
|
|
||||||
IOobject rhoHeader
|
IOobject rhoHeader
|
||||||
|
|||||||
@ -27,10 +27,10 @@ License
|
|||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
|
||||||
#include "incompressible/RAS/RASModel/RASModel.H"
|
#include "incompressible/RAS/RASModel/RASModel.H"
|
||||||
#include "nutkWallFunction/nutkWallFunctionFvPatchScalarField.H"
|
#include "nutWallFunction/nutWallFunctionFvPatchScalarField.H"
|
||||||
|
|
||||||
#include "compressible/RAS/RASModel/RASModel.H"
|
#include "compressible/RAS/RASModel/RASModel.H"
|
||||||
#include "mutkWallFunction/mutkWallFunctionFvPatchScalarField.H"
|
#include "mutWallFunction/mutWallFunctionFvPatchScalarField.H"
|
||||||
|
|
||||||
#include "wallDist.H"
|
#include "wallDist.H"
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ void Foam::yPlusRAS::calcIncompressibleYPlus
|
|||||||
volScalarField& yPlus
|
volScalarField& yPlus
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
typedef incompressible::RASModels::nutkWallFunctionFvPatchScalarField
|
typedef incompressible::RASModels::nutWallFunctionFvPatchScalarField
|
||||||
wallFunctionPatchField;
|
wallFunctionPatchField;
|
||||||
|
|
||||||
const incompressible::RASModel& model =
|
const incompressible::RASModel& model =
|
||||||
@ -150,7 +150,7 @@ void Foam::yPlusRAS::calcCompressibleYPlus
|
|||||||
volScalarField& yPlus
|
volScalarField& yPlus
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
typedef compressible::RASModels::mutkWallFunctionFvPatchScalarField
|
typedef compressible::RASModels::mutWallFunctionFvPatchScalarField
|
||||||
wallFunctionPatchField;
|
wallFunctionPatchField;
|
||||||
|
|
||||||
const compressible::RASModel& model =
|
const compressible::RASModel& model =
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -155,6 +155,7 @@ autoPtr<LESModel> LESModel::New
|
|||||||
|
|
||||||
void LESModel::correct(const tmp<volTensorField>&)
|
void LESModel::correct(const tmp<volTensorField>&)
|
||||||
{
|
{
|
||||||
|
turbulenceModel::correct();
|
||||||
delta_().correct();
|
delta_().correct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,14 +11,4 @@ SpalartAllmaras/SpalartAllmaras.C
|
|||||||
|
|
||||||
vanDriestDelta/vanDriestDelta.C
|
vanDriestDelta/vanDriestDelta.C
|
||||||
|
|
||||||
/* Wall functions */
|
|
||||||
wallFunctions=derivedFvPatchFields/wallFunctions
|
|
||||||
|
|
||||||
muSgsWallFunctions=$(wallFunctions)/muSgsWallFunctions
|
|
||||||
$(muSgsWallFunctions)/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C
|
|
||||||
|
|
||||||
alphaSgsWallFunctions=$(wallFunctions)/alphaSgsWallFunctions
|
|
||||||
$(alphaSgsWallFunctions)/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C
|
|
||||||
$(alphaSgsWallFunctions)/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libcompressibleLESModels
|
LIB = $(FOAM_LIBBIN)/libcompressibleLESModels
|
||||||
|
|||||||
@ -1,341 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2012 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 "alphaSgsJayatillekeWallFunctionFvPatchScalarField.H"
|
|
||||||
#include "LESModel.H"
|
|
||||||
#include "fvPatchFieldMapper.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "wallFvPatch.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace compressible
|
|
||||||
{
|
|
||||||
namespace LESModels
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::maxExp_ = 50.0;
|
|
||||||
scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::tolerance_ = 0.01;
|
|
||||||
label alphaSgsJayatillekeWallFunctionFvPatchScalarField::maxIters_ = 10;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void alphaSgsJayatillekeWallFunctionFvPatchScalarField::checkType()
|
|
||||||
{
|
|
||||||
if (!isA<wallFvPatch>(patch()))
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"alphaSgsJayatillekeWallFunctionFvPatchScalarField::checkType()"
|
|
||||||
)
|
|
||||||
<< "Patch type for patch " << patch().name() << " must be wall\n"
|
|
||||||
<< "Current patch type is " << patch().type() << nl
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::Psmooth
|
|
||||||
(
|
|
||||||
const scalar Prat
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return 9.24*(pow(Prat, 0.75) - 1.0)*(1.0 + 0.28*exp(-0.007*Prat));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
scalar alphaSgsJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
|
|
||||||
(
|
|
||||||
const scalar P,
|
|
||||||
const scalar Prat
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar ypt = 11.0;
|
|
||||||
|
|
||||||
for (int i=0; i<maxIters_; i++)
|
|
||||||
{
|
|
||||||
scalar f = ypt - (log(E_*ypt)/kappa_ + P)/Prat;
|
|
||||||
scalar df = 1.0 - 1.0/(ypt*kappa_*Prat);
|
|
||||||
scalar yptNew = ypt - f/df;
|
|
||||||
|
|
||||||
if (yptNew < VSMALL)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else if (mag(yptNew - ypt) < tolerance_)
|
|
||||||
{
|
|
||||||
return yptNew;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ypt = yptNew;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ypt;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField::
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(p, iF),
|
|
||||||
Prt_(0.85),
|
|
||||||
kappa_(0.41),
|
|
||||||
E_(9.8),
|
|
||||||
heName_("he")
|
|
||||||
|
|
||||||
{
|
|
||||||
checkType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField::
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const alphaSgsJayatillekeWallFunctionFvPatchScalarField& ptf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
|
||||||
Prt_(ptf.Prt_),
|
|
||||||
kappa_(ptf.kappa_),
|
|
||||||
E_(ptf.E_),
|
|
||||||
heName_(ptf.heName_)
|
|
||||||
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField::
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(p, iF, dict),
|
|
||||||
Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85)),
|
|
||||||
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
|
|
||||||
E_(dict.lookupOrDefault<scalar>("E", 9.8)),
|
|
||||||
heName_(dict.lookupOrDefault<word>("he", "he"))
|
|
||||||
{
|
|
||||||
checkType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField::
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const alphaSgsJayatillekeWallFunctionFvPatchScalarField& awfpsf
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(awfpsf),
|
|
||||||
Prt_(awfpsf.Prt_),
|
|
||||||
kappa_(awfpsf.kappa_),
|
|
||||||
E_(awfpsf.E_),
|
|
||||||
heName_(awfpsf.heName_)
|
|
||||||
{
|
|
||||||
checkType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField::
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const alphaSgsJayatillekeWallFunctionFvPatchScalarField& awfpsf,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(awfpsf, iF),
|
|
||||||
Prt_(awfpsf.Prt_),
|
|
||||||
kappa_(awfpsf.kappa_),
|
|
||||||
E_(awfpsf.E_),
|
|
||||||
heName_(awfpsf.heName_)
|
|
||||||
{
|
|
||||||
checkType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void alphaSgsJayatillekeWallFunctionFvPatchScalarField::evaluate
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
|
|
||||||
|
|
||||||
// Field data
|
|
||||||
const label patchI = patch().index();
|
|
||||||
|
|
||||||
const scalarField& muw = lesModel.mu().boundaryField()[patchI];
|
|
||||||
const scalarField muSgsw(lesModel.muSgs()().boundaryField()[patchI]);
|
|
||||||
|
|
||||||
const scalarField& alphaw = lesModel.alpha().boundaryField()[patchI];
|
|
||||||
scalarField& alphaSgsw = *this;
|
|
||||||
|
|
||||||
const fvPatchVectorField& Uw = lesModel.U().boundaryField()[patchI];
|
|
||||||
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
|
||||||
const scalarField magGradUw(mag(Uw.snGrad()));
|
|
||||||
|
|
||||||
const scalarField& rhow = lesModel.rho().boundaryField()[patchI];
|
|
||||||
const fvPatchScalarField& hw =
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>(heName_);
|
|
||||||
|
|
||||||
const scalarField& ry = patch().deltaCoeffs();
|
|
||||||
|
|
||||||
// Heat flux [W/m2] - lagging alphaSgsw
|
|
||||||
const scalarField qDot((alphaw + alphaSgsw)*hw.snGrad());
|
|
||||||
|
|
||||||
// Populate boundary values
|
|
||||||
forAll(alphaSgsw, faceI)
|
|
||||||
{
|
|
||||||
// Calculate uTau using Newton-Raphson iteration
|
|
||||||
scalar uTau =
|
|
||||||
sqrt((muSgsw[faceI] + muw[faceI])/rhow[faceI]*magGradUw[faceI]);
|
|
||||||
|
|
||||||
if (uTau > ROOTVSMALL)
|
|
||||||
{
|
|
||||||
label iter = 0;
|
|
||||||
scalar err = GREAT;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
scalar kUu = min(kappa_*magUp[faceI]/uTau, maxExp_);
|
|
||||||
scalar fkUu = exp(kUu) - 1.0 - kUu*(1.0 + 0.5*kUu);
|
|
||||||
|
|
||||||
scalar f =
|
|
||||||
- uTau/(ry[faceI]*muw[faceI]/rhow[faceI])
|
|
||||||
+ magUp[faceI]/uTau
|
|
||||||
+ 1.0/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu));
|
|
||||||
|
|
||||||
scalar df =
|
|
||||||
- 1.0/(ry[faceI]*muw[faceI]/rhow[faceI])
|
|
||||||
- magUp[faceI]/sqr(uTau)
|
|
||||||
- 1.0/E_*kUu*fkUu/uTau;
|
|
||||||
|
|
||||||
scalar uTauNew = uTau - f/df;
|
|
||||||
err = mag((uTau - uTauNew)/uTau);
|
|
||||||
uTau = uTauNew;
|
|
||||||
|
|
||||||
} while (uTau>VSMALL && err>tolerance_ && ++iter<maxIters_);
|
|
||||||
|
|
||||||
scalar yPlus = uTau/ry[faceI]/(muw[faceI]/rhow[faceI]);
|
|
||||||
|
|
||||||
// Molecular Prandtl number
|
|
||||||
scalar Pr = muw[faceI]/alphaw[faceI];
|
|
||||||
|
|
||||||
// Molecular-to-turbulenbt Prandtl number ratio
|
|
||||||
scalar Prat = Pr/Prt_;
|
|
||||||
|
|
||||||
// Thermal sublayer thickness
|
|
||||||
scalar P = Psmooth(Prat);
|
|
||||||
scalar yPlusTherm = this->yPlusTherm(P, Prat);
|
|
||||||
|
|
||||||
// Evaluate new effective thermal diffusivity
|
|
||||||
scalar alphaEff = 0.0;
|
|
||||||
if (yPlus < yPlusTherm)
|
|
||||||
{
|
|
||||||
scalar A = qDot[faceI]*rhow[faceI]*uTau/ry[faceI];
|
|
||||||
scalar B = qDot[faceI]*Pr*yPlus;
|
|
||||||
scalar C = Pr*0.5*rhow[faceI]*uTau*sqr(magUp[faceI]);
|
|
||||||
alphaEff = A/(B + C + VSMALL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scalar A = qDot[faceI]*rhow[faceI]*uTau/ry[faceI];
|
|
||||||
scalar B = qDot[faceI]*Prt_*(1.0/kappa_*log(E_*yPlus) + P);
|
|
||||||
scalar magUc = uTau/kappa_*log(E_*yPlusTherm) - mag(Uw[faceI]);
|
|
||||||
scalar C =
|
|
||||||
0.5*rhow[faceI]*uTau
|
|
||||||
*(Prt_*sqr(magUp[faceI]) + (Pr - Prt_)*sqr(magUc));
|
|
||||||
alphaEff = A/(B + C + VSMALL);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update turbulent thermal diffusivity
|
|
||||||
alphaSgsw[faceI] = max(0.0, alphaEff - alphaw[faceI]);
|
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< " uTau = " << uTau << nl
|
|
||||||
<< " Pr = " << Pr << nl
|
|
||||||
<< " Prt = " << Prt_ << nl
|
|
||||||
<< " qDot = " << qDot[faceI] << nl
|
|
||||||
<< " yPlus = " << yPlus << nl
|
|
||||||
<< " yPlusTherm = " << yPlusTherm << nl
|
|
||||||
<< " alphaEff = " << alphaEff << nl
|
|
||||||
<< " alphaw = " << alphaw[faceI] << nl
|
|
||||||
<< " alphaSgsw = " << alphaSgsw[faceI] << nl
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
alphaSgsw[faceI] = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void alphaSgsJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const
|
|
||||||
{
|
|
||||||
fvPatchField<scalar>::write(os);
|
|
||||||
os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("he") << heName_ << token::END_STATEMENT << nl;
|
|
||||||
writeEntry("value", os);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
makePatchTypeField
|
|
||||||
(
|
|
||||||
fvPatchScalarField,
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace LESModels
|
|
||||||
} // End namespace compressible
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,197 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2012 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
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
|
|
||||||
Description
|
|
||||||
Thermal wall function for turbulent thermal diffusivity based on the
|
|
||||||
Jayatilleke thermal wall function
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef alphaSgsJayatillekeWallFunctionFvPatchScalarField_H
|
|
||||||
#define alphaSgsJayatillekeWallFunctionFvPatchScalarField_H
|
|
||||||
|
|
||||||
#include "fixedValueFvPatchFields.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace compressible
|
|
||||||
{
|
|
||||||
namespace LESModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class alphaSgsJayatillekeWallFunctionFvPatchScalarField Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
:
|
|
||||||
public fixedValueFvPatchScalarField
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Turbulent Prandtl number
|
|
||||||
scalar Prt_;
|
|
||||||
|
|
||||||
//- Von Karman constant
|
|
||||||
scalar kappa_;
|
|
||||||
|
|
||||||
//- E coefficient
|
|
||||||
scalar E_;
|
|
||||||
|
|
||||||
//- Name of (sensible/total) enthalpy field
|
|
||||||
word heName_;
|
|
||||||
|
|
||||||
|
|
||||||
// Solution parameters
|
|
||||||
|
|
||||||
static scalar maxExp_;
|
|
||||||
static scalar tolerance_;
|
|
||||||
static label maxIters_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Check the type of the patch
|
|
||||||
void checkType();
|
|
||||||
|
|
||||||
//- `P' function
|
|
||||||
scalar Psmooth(const scalar Prat) const;
|
|
||||||
|
|
||||||
//- Calculate y+ at the edge of the thermal laminar sublayer
|
|
||||||
scalar yPlusTherm
|
|
||||||
(
|
|
||||||
const scalar P,
|
|
||||||
const scalar Prat
|
|
||||||
) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("alphaSgsJayatillekeWallFunction");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given an
|
|
||||||
// alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
// onto a new patch
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const alphaSgsJayatillekeWallFunctionFvPatchScalarField&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const alphaSgsJayatillekeWallFunctionFvPatchScalarField&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual tmp<fvPatchScalarField> clone() const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new alphaSgsJayatillekeWallFunctionFvPatchScalarField(*this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Construct as copy setting internal field reference
|
|
||||||
alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const alphaSgsJayatillekeWallFunctionFvPatchScalarField&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchScalarField> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new alphaSgsJayatillekeWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
*this,
|
|
||||||
iF
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
// Evaluation functions
|
|
||||||
|
|
||||||
//- Evaluate the patchField
|
|
||||||
virtual void evaluate
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes commsType=Pstream::Pstream::blocking
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// I-O
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
void write(Ostream&) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace LESModels
|
|
||||||
} // End namespace compressible
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,164 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 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 "alphaSgsWallFunctionFvPatchScalarField.H"
|
|
||||||
#include "LESModel.H"
|
|
||||||
#include "fvPatchFieldMapper.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "wallFvPatch.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace compressible
|
|
||||||
{
|
|
||||||
namespace LESModels
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void alphaSgsWallFunctionFvPatchScalarField::checkType()
|
|
||||||
{
|
|
||||||
if (!isA<wallFvPatch>(patch()))
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"alphaSgsWallFunctionFvPatchScalarField::checkType()"
|
|
||||||
)
|
|
||||||
<< "Patch type for patch " << patch().name() << " must be wall\n"
|
|
||||||
<< "Current patch type is " << patch().type() << nl
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
alphaSgsWallFunctionFvPatchScalarField::
|
|
||||||
alphaSgsWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(p, iF),
|
|
||||||
Prt_(0.85)
|
|
||||||
{
|
|
||||||
checkType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
alphaSgsWallFunctionFvPatchScalarField::
|
|
||||||
alphaSgsWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const alphaSgsWallFunctionFvPatchScalarField& ptf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
|
||||||
Prt_(ptf.Prt_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
alphaSgsWallFunctionFvPatchScalarField::
|
|
||||||
alphaSgsWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(p, iF, dict),
|
|
||||||
Prt_(dict.lookupOrDefault<scalar>("Prt", 0.85))
|
|
||||||
{
|
|
||||||
checkType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
alphaSgsWallFunctionFvPatchScalarField::
|
|
||||||
alphaSgsWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const alphaSgsWallFunctionFvPatchScalarField& awfpsf
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(awfpsf),
|
|
||||||
Prt_(awfpsf.Prt_)
|
|
||||||
{
|
|
||||||
checkType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
alphaSgsWallFunctionFvPatchScalarField::
|
|
||||||
alphaSgsWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const alphaSgsWallFunctionFvPatchScalarField& awfpsf,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(awfpsf, iF),
|
|
||||||
Prt_(awfpsf.Prt_)
|
|
||||||
|
|
||||||
{
|
|
||||||
checkType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void alphaSgsWallFunctionFvPatchScalarField::evaluate
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
|
|
||||||
|
|
||||||
const scalarField muSgsw
|
|
||||||
(
|
|
||||||
lesModel.muSgs()().boundaryField()[patch().index()]
|
|
||||||
);
|
|
||||||
|
|
||||||
operator==(muSgsw/Prt_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
makePatchTypeField
|
|
||||||
(
|
|
||||||
fvPatchScalarField,
|
|
||||||
alphaSgsWallFunctionFvPatchScalarField
|
|
||||||
);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace LESModels
|
|
||||||
} // End namespace compressible
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,223 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 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 "muSgsUSpaldingWallFunctionFvPatchScalarField.H"
|
|
||||||
#include "LESModel.H"
|
|
||||||
#include "fvPatchFieldMapper.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace compressible
|
|
||||||
{
|
|
||||||
namespace LESModels
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField::
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(p, iF),
|
|
||||||
UName_("U"),
|
|
||||||
rhoName_("rho"),
|
|
||||||
muName_("mu"),
|
|
||||||
kappa_(0.41),
|
|
||||||
E_(9.8)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField::
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const muSgsUSpaldingWallFunctionFvPatchScalarField& ptf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
|
||||||
UName_(ptf.UName_),
|
|
||||||
rhoName_(ptf.rhoName_),
|
|
||||||
muName_(ptf.muName_),
|
|
||||||
kappa_(ptf.kappa_),
|
|
||||||
E_(ptf.E_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField::
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(p, iF, dict),
|
|
||||||
UName_(dict.lookupOrDefault<word>("U", "U")),
|
|
||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
|
||||||
muName_(dict.lookupOrDefault<word>("mu", "mu")),
|
|
||||||
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
|
|
||||||
E_(dict.lookupOrDefault<scalar>("E", 9.8))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField::
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const muSgsUSpaldingWallFunctionFvPatchScalarField& mwfpsf
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(mwfpsf),
|
|
||||||
UName_(mwfpsf.UName_),
|
|
||||||
rhoName_(mwfpsf.rhoName_),
|
|
||||||
muName_(mwfpsf.muName_),
|
|
||||||
kappa_(mwfpsf.kappa_),
|
|
||||||
E_(mwfpsf.E_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField::
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const muSgsUSpaldingWallFunctionFvPatchScalarField& mwfpsf,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedValueFvPatchScalarField(mwfpsf, iF),
|
|
||||||
UName_(mwfpsf.UName_),
|
|
||||||
rhoName_(mwfpsf.rhoName_),
|
|
||||||
muName_(mwfpsf.muName_),
|
|
||||||
kappa_(mwfpsf.kappa_),
|
|
||||||
E_(mwfpsf.E_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void muSgsUSpaldingWallFunctionFvPatchScalarField::evaluate
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const scalarField& ry = patch().deltaCoeffs();
|
|
||||||
|
|
||||||
const fvPatchVectorField& U =
|
|
||||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
|
||||||
|
|
||||||
const scalarField magUp(mag(U.patchInternalField() - U));
|
|
||||||
|
|
||||||
const scalarField& muw =
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>(muName_);
|
|
||||||
|
|
||||||
const scalarField& rhow =
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
|
||||||
|
|
||||||
scalarField& muSgsw = *this;
|
|
||||||
|
|
||||||
const scalarField magFaceGradU(mag(U.snGrad()));
|
|
||||||
|
|
||||||
forAll(muSgsw, facei)
|
|
||||||
{
|
|
||||||
scalar magUpara = magUp[facei];
|
|
||||||
|
|
||||||
scalar utau =
|
|
||||||
sqrt((muSgsw[facei] + muw[facei])*magFaceGradU[facei]/rhow[facei]);
|
|
||||||
|
|
||||||
if (utau > 0)
|
|
||||||
{
|
|
||||||
int iter = 0;
|
|
||||||
scalar err = GREAT;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
scalar kUu = kappa_*magUpara/utau;
|
|
||||||
scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu);
|
|
||||||
|
|
||||||
scalar f =
|
|
||||||
- utau/(ry[facei]*muw[facei]/rhow[facei])
|
|
||||||
+ magUpara/utau
|
|
||||||
+ 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu));
|
|
||||||
|
|
||||||
scalar df =
|
|
||||||
- 1.0/(ry[facei]*muw[facei]/rhow[facei])
|
|
||||||
- magUpara/sqr(utau)
|
|
||||||
- 1/E_*kUu*fkUu/utau;
|
|
||||||
|
|
||||||
scalar utauNew = utau - f/df;
|
|
||||||
err = mag((utau - utauNew)/utau);
|
|
||||||
utau = utauNew;
|
|
||||||
|
|
||||||
} while (utau > VSMALL && err > 0.01 && ++iter < 10);
|
|
||||||
|
|
||||||
muSgsw[facei] =
|
|
||||||
max
|
|
||||||
(
|
|
||||||
rhow[facei]*sqr(utau)/magFaceGradU[facei] - muw[facei],
|
|
||||||
0.0
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
muSgsw[facei] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void muSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const
|
|
||||||
{
|
|
||||||
fvPatchField<scalar>::write(os);
|
|
||||||
writeEntryIfDifferent<word>(os, "U", "U", UName_);
|
|
||||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
|
||||||
writeEntryIfDifferent<word>(os, "mu", "mu", muName_);
|
|
||||||
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
|
|
||||||
writeEntry("value", os);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
makePatchTypeField
|
|
||||||
(
|
|
||||||
fvPatchScalarField,
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace LESModels
|
|
||||||
} // End namespace compressible
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,173 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 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::compressible::LESModels::
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
|
|
||||||
Description
|
|
||||||
Wall function boundary condition for walls, based on velocity, using
|
|
||||||
Spaldings law to give a continuous muSgs profile to the wall (y+ = 0).
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef muSgsUSpaldingWallFunctionFvPatchScalarField_H
|
|
||||||
#define muSgsUSpaldingWallFunctionFvPatchScalarField_H
|
|
||||||
|
|
||||||
#include "fixedValueFvPatchFields.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace compressible
|
|
||||||
{
|
|
||||||
namespace LESModels
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class muSgsUSpaldingWallFunctionFvPatchScalarField Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
:
|
|
||||||
public fixedValueFvPatchScalarField
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Name of velocity field
|
|
||||||
word UName_;
|
|
||||||
|
|
||||||
//- Name of density field
|
|
||||||
word rhoName_;
|
|
||||||
|
|
||||||
//- Name of laminar viscosity field
|
|
||||||
word muName_;
|
|
||||||
|
|
||||||
//- Von Karman constant
|
|
||||||
scalar kappa_;
|
|
||||||
|
|
||||||
//- E coefficient
|
|
||||||
scalar E_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("muSgsUSpaldingWallFunction");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given
|
|
||||||
// muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
// onto a new patch
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const muSgsUSpaldingWallFunctionFvPatchScalarField&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const muSgsUSpaldingWallFunctionFvPatchScalarField&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual tmp<fvPatchScalarField> clone() const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new muSgsUSpaldingWallFunctionFvPatchScalarField(*this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Construct as copy setting internal field reference
|
|
||||||
muSgsUSpaldingWallFunctionFvPatchScalarField
|
|
||||||
(
|
|
||||||
const muSgsUSpaldingWallFunctionFvPatchScalarField&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchScalarField> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new muSgsUSpaldingWallFunctionFvPatchScalarField(*this, iF)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
// Evaluation functions
|
|
||||||
|
|
||||||
//- Evaluate the patchField
|
|
||||||
virtual void evaluate
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes commsType=Pstream::blocking
|
|
||||||
);
|
|
||||||
|
|
||||||
// I-O
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
void write(Ostream&) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace LESModels
|
|
||||||
} // End namespace compressible
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -18,11 +18,14 @@ $(alphatWallFunctions)/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C
|
|||||||
$(alphatWallFunctions)/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
|
$(alphatWallFunctions)/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
|
||||||
|
|
||||||
mutWallFunctions = $(wallFunctions)/mutWallFunctions
|
mutWallFunctions = $(wallFunctions)/mutWallFunctions
|
||||||
$(mutWallFunctions)/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C
|
$(mutWallFunctions)/mutWallFunction/mutWallFunctionFvPatchScalarField.C
|
||||||
|
|
||||||
$(mutWallFunctions)/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C
|
$(mutWallFunctions)/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C
|
||||||
|
$(mutWallFunctions)/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C
|
||||||
|
|
||||||
|
$(mutWallFunctions)/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C
|
||||||
$(mutWallFunctions)/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C
|
$(mutWallFunctions)/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C
|
||||||
$(mutWallFunctions)/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C
|
$(mutWallFunctions)/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C
|
||||||
$(mutWallFunctions)/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C
|
|
||||||
$(mutWallFunctions)/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C
|
$(mutWallFunctions)/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C
|
||||||
|
|
||||||
epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions
|
epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions
|
||||||
@ -35,7 +38,7 @@ kqRWallFunctions = $(wallFunctions)/kqRWallFunctions
|
|||||||
$(kqRWallFunctions)/kqRWallFunction/kqRWallFunctionFvPatchFields.C
|
$(kqRWallFunctions)/kqRWallFunction/kqRWallFunctionFvPatchFields.C
|
||||||
|
|
||||||
/* Patch fields */
|
/* Patch fields */
|
||||||
derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C
|
derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C
|
||||||
derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
|
derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
|
||||||
derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
|
derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
|
||||||
backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
|
backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -83,9 +83,7 @@ RASModel::RASModel
|
|||||||
|
|
||||||
kMin_("kMin", sqr(dimVelocity), SMALL),
|
kMin_("kMin", sqr(dimVelocity), SMALL),
|
||||||
epsilonMin_("epsilonMin", kMin_.dimensions()/dimTime, SMALL),
|
epsilonMin_("epsilonMin", kMin_.dimensions()/dimTime, SMALL),
|
||||||
omegaMin_("omegaMin", dimless/dimTime, SMALL),
|
omegaMin_("omegaMin", dimless/dimTime, SMALL)
|
||||||
|
|
||||||
y_(mesh_)
|
|
||||||
{
|
{
|
||||||
kMin_.readIfPresent(*this);
|
kMin_.readIfPresent(*this);
|
||||||
epsilonMin_.readIfPresent(*this);
|
epsilonMin_.readIfPresent(*this);
|
||||||
@ -159,57 +157,9 @@ autoPtr<RASModel> RASModel::New
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
scalar RASModel::yPlusLam(const scalar kappa, const scalar E) const
|
|
||||||
{
|
|
||||||
scalar ypl = 11.0;
|
|
||||||
|
|
||||||
for (int i=0; i<10; i++)
|
|
||||||
{
|
|
||||||
ypl = log(max(E*ypl, 1))/kappa;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ypl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tmp<scalarField> RASModel::yPlus(const label patchNo, const scalar Cmu) const
|
|
||||||
{
|
|
||||||
const fvPatch& curPatch = mesh_.boundary()[patchNo];
|
|
||||||
|
|
||||||
tmp<scalarField> tYp(new scalarField(curPatch.size()));
|
|
||||||
scalarField& Yp = tYp();
|
|
||||||
|
|
||||||
if (isA<wallFvPatch>(curPatch))
|
|
||||||
{
|
|
||||||
Yp = pow025(Cmu)
|
|
||||||
*y_[patchNo]
|
|
||||||
*sqrt(k()().boundaryField()[patchNo].patchInternalField())
|
|
||||||
/(
|
|
||||||
mu().boundaryField()[patchNo].patchInternalField()
|
|
||||||
/rho_.boundaryField()[patchNo]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
WarningIn
|
|
||||||
(
|
|
||||||
"tmp<scalarField> RASModel::yPlus(const label patchNo) const"
|
|
||||||
) << "Patch " << patchNo << " is not a wall. Returning null field"
|
|
||||||
<< nl << endl;
|
|
||||||
|
|
||||||
Yp.setSize(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
return tYp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RASModel::correct()
|
void RASModel::correct()
|
||||||
{
|
{
|
||||||
if (mesh_.changing())
|
turbulenceModel::correct();
|
||||||
{
|
|
||||||
y_.correct();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,6 @@ SourceFiles
|
|||||||
#include "compressible/turbulenceModel/turbulenceModel.H"
|
#include "compressible/turbulenceModel/turbulenceModel.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
#include "nearWallDist.H"
|
|
||||||
#include "fvm.H"
|
#include "fvm.H"
|
||||||
#include "fvc.H"
|
#include "fvc.H"
|
||||||
#include "fvMatrices.H"
|
#include "fvMatrices.H"
|
||||||
@ -96,9 +95,6 @@ protected:
|
|||||||
//- Lower limit for omega
|
//- Lower limit for omega
|
||||||
dimensionedScalar omegaMin_;
|
dimensionedScalar omegaMin_;
|
||||||
|
|
||||||
//- Near wall distance boundary field
|
|
||||||
nearWallDist y_;
|
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
@ -213,15 +209,6 @@ public:
|
|||||||
return omegaMin_;
|
return omegaMin_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return the near wall distances
|
|
||||||
const nearWallDist& y() const
|
|
||||||
{
|
|
||||||
return y_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Calculate y+ at the edge of the laminar sublayer
|
|
||||||
scalar yPlusLam(const scalar kappa, const scalar E) const;
|
|
||||||
|
|
||||||
//- Const access to the coefficients dictionary
|
//- Const access to the coefficients dictionary
|
||||||
const dictionary& coeffDict() const
|
const dictionary& coeffDict() const
|
||||||
{
|
{
|
||||||
@ -264,13 +251,6 @@ public:
|
|||||||
thermo().alphaEff(alphat()().boundaryField()[patchI], patchI);
|
thermo().alphaEff(alphat()().boundaryField()[patchI], patchI);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return yPlus for the given patch
|
|
||||||
virtual tmp<scalarField> yPlus
|
|
||||||
(
|
|
||||||
const label patchI,
|
|
||||||
const scalar Cmu
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Solve the turbulence equations and correct the turbulence viscosity
|
//- Solve the turbulence equations and correct the turbulence viscosity
|
||||||
virtual void correct();
|
virtual void correct();
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "htcConvFvPatchScalarField.H"
|
#include "convectiveHeatTransferFvPatchScalarField.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "fvPatchFieldMapper.H"
|
#include "fvPatchFieldMapper.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
@ -39,7 +39,8 @@ namespace RASModels
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
htcConvFvPatchScalarField::htcConvFvPatchScalarField
|
convectiveHeatTransferFvPatchScalarField::
|
||||||
|
convectiveHeatTransferFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
@ -50,9 +51,10 @@ htcConvFvPatchScalarField::htcConvFvPatchScalarField
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
htcConvFvPatchScalarField::htcConvFvPatchScalarField
|
convectiveHeatTransferFvPatchScalarField::
|
||||||
|
convectiveHeatTransferFvPatchScalarField
|
||||||
(
|
(
|
||||||
const htcConvFvPatchScalarField& ptf,
|
const convectiveHeatTransferFvPatchScalarField& ptf,
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
const DimensionedField<scalar, volMesh>& iF,
|
||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
@ -63,7 +65,8 @@ htcConvFvPatchScalarField::htcConvFvPatchScalarField
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
htcConvFvPatchScalarField::htcConvFvPatchScalarField
|
convectiveHeatTransferFvPatchScalarField::
|
||||||
|
convectiveHeatTransferFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
const DimensionedField<scalar, volMesh>& iF,
|
||||||
@ -75,9 +78,10 @@ htcConvFvPatchScalarField::htcConvFvPatchScalarField
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
htcConvFvPatchScalarField::htcConvFvPatchScalarField
|
convectiveHeatTransferFvPatchScalarField::
|
||||||
|
convectiveHeatTransferFvPatchScalarField
|
||||||
(
|
(
|
||||||
const htcConvFvPatchScalarField& htcpsf
|
const convectiveHeatTransferFvPatchScalarField& htcpsf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(htcpsf),
|
fixedValueFvPatchScalarField(htcpsf),
|
||||||
@ -85,9 +89,10 @@ htcConvFvPatchScalarField::htcConvFvPatchScalarField
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
htcConvFvPatchScalarField::htcConvFvPatchScalarField
|
convectiveHeatTransferFvPatchScalarField::
|
||||||
|
convectiveHeatTransferFvPatchScalarField
|
||||||
(
|
(
|
||||||
const htcConvFvPatchScalarField& htcpsf,
|
const convectiveHeatTransferFvPatchScalarField& htcpsf,
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
@ -98,24 +103,25 @@ htcConvFvPatchScalarField::htcConvFvPatchScalarField
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void htcConvFvPatchScalarField::updateCoeffs()
|
void convectiveHeatTransferFvPatchScalarField::updateCoeffs()
|
||||||
{
|
{
|
||||||
if (updated())
|
if (updated())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
const scalarField alphaEffw(rasModel.alphaEff(patchI));
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
|
const scalarField alphaEffw(turbModel.alphaEff(patchi));
|
||||||
const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
|
const scalarField& muw = turbModel.mu().boundaryField()[patchi];
|
||||||
const vectorField& Uc = rasModel.U();
|
const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
|
||||||
const vectorField& Uw = rasModel.U().boundaryField()[patchI];
|
const vectorField& Uc = turbModel.U();
|
||||||
const scalarField& Tw = rasModel.thermo().T().boundaryField()[patchI];
|
const vectorField& Uw = turbModel.U().boundaryField()[patchi];
|
||||||
const scalarField& pw = rasModel.thermo().p().boundaryField()[patchI];
|
const scalarField& Tw = turbModel.thermo().T().boundaryField()[patchi];
|
||||||
const scalarField Cpw(rasModel.thermo().Cp(pw, Tw, patchI));
|
const scalarField& pw = turbModel.thermo().p().boundaryField()[patchi];
|
||||||
|
const scalarField Cpw(turbModel.thermo().Cp(pw, Tw, patchi));
|
||||||
|
|
||||||
const scalarField kappaw(Cpw*alphaEffw);
|
const scalarField kappaw(Cpw*alphaEffw);
|
||||||
const scalarField Pr(muw*Cpw/kappaw);
|
const scalarField Pr(muw*Cpw/kappaw);
|
||||||
@ -141,7 +147,7 @@ void htcConvFvPatchScalarField::updateCoeffs()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void htcConvFvPatchScalarField::write(Ostream& os) const
|
void convectiveHeatTransferFvPatchScalarField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchField<scalar>::write(os);
|
fvPatchField<scalar>::write(os);
|
||||||
os.writeKeyword("L") << L_ << token::END_STATEMENT << nl;
|
os.writeKeyword("L") << L_ << token::END_STATEMENT << nl;
|
||||||
@ -154,7 +160,7 @@ void htcConvFvPatchScalarField::write(Ostream& os) const
|
|||||||
makePatchTypeField
|
makePatchTypeField
|
||||||
(
|
(
|
||||||
fvPatchScalarField,
|
fvPatchScalarField,
|
||||||
htcConvFvPatchScalarField
|
convectiveHeatTransferFvPatchScalarField
|
||||||
);
|
);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -22,13 +22,13 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::compressible::RASModels::htcConvFvPatchScalarField
|
Foam::compressible::RASModels::convectiveHeatTransferFvPatchScalarField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Convective heat transfer boundary condition
|
Convective heat transfer boundary condition
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
htcConvFvPatchScalarField.C
|
convectiveHeatTransferFvPatchScalarField.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -47,10 +47,10 @@ namespace RASModels
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class htcConvFvPatchScalarField Declaration
|
Class convectiveHeatTransferFvPatchScalarField Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class htcConvFvPatchScalarField
|
class convectiveHeatTransferFvPatchScalarField
|
||||||
:
|
:
|
||||||
public fixedValueFvPatchScalarField
|
public fixedValueFvPatchScalarField
|
||||||
{
|
{
|
||||||
@ -65,20 +65,20 @@ protected:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("htcConvection");
|
TypeName("convectiveHeatTransfer");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
//- Construct from patch and internal field
|
||||||
htcConvFvPatchScalarField
|
convectiveHeatTransferFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fvPatch&,
|
const fvPatch&,
|
||||||
const DimensionedField<scalar, volMesh>&
|
const DimensionedField<scalar, volMesh>&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
//- Construct from patch, internal field and dictionary
|
||||||
htcConvFvPatchScalarField
|
convectiveHeatTransferFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fvPatch&,
|
const fvPatch&,
|
||||||
const DimensionedField<scalar, volMesh>&,
|
const DimensionedField<scalar, volMesh>&,
|
||||||
@ -86,20 +86,20 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct by mapping given
|
//- Construct by mapping given
|
||||||
// htcConvFvPatchScalarField
|
// convectiveHeatTransferFvPatchScalarField
|
||||||
// onto a new patch
|
// onto a new patch
|
||||||
htcConvFvPatchScalarField
|
convectiveHeatTransferFvPatchScalarField
|
||||||
(
|
(
|
||||||
const htcConvFvPatchScalarField&,
|
const convectiveHeatTransferFvPatchScalarField&,
|
||||||
const fvPatch&,
|
const fvPatch&,
|
||||||
const DimensionedField<scalar, volMesh>&,
|
const DimensionedField<scalar, volMesh>&,
|
||||||
const fvPatchFieldMapper&
|
const fvPatchFieldMapper&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct as copy
|
//- Construct as copy
|
||||||
htcConvFvPatchScalarField
|
convectiveHeatTransferFvPatchScalarField
|
||||||
(
|
(
|
||||||
const htcConvFvPatchScalarField&
|
const convectiveHeatTransferFvPatchScalarField&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
@ -107,14 +107,14 @@ public:
|
|||||||
{
|
{
|
||||||
return tmp<fvPatchScalarField>
|
return tmp<fvPatchScalarField>
|
||||||
(
|
(
|
||||||
new htcConvFvPatchScalarField(*this)
|
new convectiveHeatTransferFvPatchScalarField(*this)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Construct as copy setting internal field reference
|
//- Construct as copy setting internal field reference
|
||||||
htcConvFvPatchScalarField
|
convectiveHeatTransferFvPatchScalarField
|
||||||
(
|
(
|
||||||
const htcConvFvPatchScalarField&,
|
const convectiveHeatTransferFvPatchScalarField&,
|
||||||
const DimensionedField<scalar, volMesh>&
|
const DimensionedField<scalar, volMesh>&
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ public:
|
|||||||
{
|
{
|
||||||
return tmp<fvPatchScalarField>
|
return tmp<fvPatchScalarField>
|
||||||
(
|
(
|
||||||
new htcConvFvPatchScalarField(*this, iF)
|
new convectiveHeatTransferFvPatchScalarField(*this, iF)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,34 +199,35 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
|
|
||||||
const scalar Cmu25 = pow025(Cmu_);
|
const scalar Cmu25 = pow025(Cmu_);
|
||||||
|
|
||||||
const scalarField& y = rasModel.y()[patchI];
|
const scalarField& y = turbModel.y()[patchi];
|
||||||
|
|
||||||
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
|
const scalarField& muw = turbModel.mu().boundaryField()[patchi];
|
||||||
|
|
||||||
const scalarField& alphaw = rasModel.alpha().boundaryField()[patchI];
|
const scalarField& alphaw = turbModel.alpha().boundaryField()[patchi];
|
||||||
scalarField& alphatw = *this;
|
scalarField& alphatw = *this;
|
||||||
|
|
||||||
const tmp<volScalarField> tk = rasModel.k();
|
const tmp<volScalarField> tk = turbModel.k();
|
||||||
const volScalarField& k = tk();
|
const volScalarField& k = tk();
|
||||||
|
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
|
||||||
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
||||||
const scalarField magGradUw(mag(Uw.snGrad()));
|
const scalarField magGradUw(mag(Uw.snGrad()));
|
||||||
|
|
||||||
const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
|
const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
|
||||||
const fvPatchScalarField& hew =
|
const fvPatchScalarField& hew =
|
||||||
rasModel.thermo().he().boundaryField()[patchI];
|
turbModel.thermo().he().boundaryField()[patchi];
|
||||||
|
|
||||||
// Heat flux [W/m2] - lagging alphatw
|
// Heat flux [W/m2] - lagging alphatw
|
||||||
const scalarField qDot
|
const scalarField qDot
|
||||||
(
|
(
|
||||||
rasModel.thermo().alphaEff(alphatw, patchI)*hew.snGrad()
|
turbModel.thermo().alphaEff(alphatw, patchi)*hew.snGrad()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Populate boundary values
|
// Populate boundary values
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -28,6 +28,7 @@ License
|
|||||||
#include "fvPatchFieldMapper.H"
|
#include "fvPatchFieldMapper.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "mutWallFunctionFvPatchScalarField.H"
|
||||||
#include "wallFvPatch.H"
|
#include "wallFvPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -55,23 +56,6 @@ void epsilonWallFunctionFvPatchScalarField::checkType()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
scalar epsilonWallFunctionFvPatchScalarField::calcYPlusLam
|
|
||||||
(
|
|
||||||
const scalar kappa,
|
|
||||||
const scalar E
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar ypl = 11.0;
|
|
||||||
|
|
||||||
for (int i=0; i<10; i++)
|
|
||||||
{
|
|
||||||
ypl = log(E*ypl)/kappa;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ypl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void epsilonWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
|
void epsilonWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
|
||||||
{
|
{
|
||||||
writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
|
writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
|
||||||
@ -94,7 +78,7 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField
|
|||||||
Cmu_(0.09),
|
Cmu_(0.09),
|
||||||
kappa_(0.41),
|
kappa_(0.41),
|
||||||
E_(9.8),
|
E_(9.8),
|
||||||
yPlusLam_(calcYPlusLam(kappa_, E_))
|
yPlusLam_(mutWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_))
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -134,7 +118,7 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField
|
|||||||
Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
|
Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
|
||||||
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
|
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
|
||||||
E_(dict.lookupOrDefault<scalar>("E", 9.8)),
|
E_(dict.lookupOrDefault<scalar>("E", 9.8)),
|
||||||
yPlusLam_(calcYPlusLam(kappa_, E_))
|
yPlusLam_(mutWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_))
|
||||||
|
|
||||||
{
|
{
|
||||||
checkType();
|
checkType();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -81,9 +81,6 @@ protected:
|
|||||||
//- Check the type of the patch
|
//- Check the type of the patch
|
||||||
virtual void checkType();
|
virtual void checkType();
|
||||||
|
|
||||||
//- Calculate the Y+ at the edge of the laminar sublayer
|
|
||||||
virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
|
|
||||||
|
|
||||||
//- Write local wall function variables
|
//- Write local wall function variables
|
||||||
virtual void writeLocalEntries(Ostream&) const;
|
virtual void writeLocalEntries(Ostream&) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -54,7 +54,7 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(p, iF)
|
mutWallFunctionFvPatchScalarField(p, iF)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField
|
|||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
|
mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(p, iF, dict)
|
mutWallFunctionFvPatchScalarField(p, iF, dict)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField
|
|||||||
const mutLowReWallFunctionFvPatchScalarField& mlrwfpsf
|
const mutLowReWallFunctionFvPatchScalarField& mlrwfpsf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(mlrwfpsf)
|
mutWallFunctionFvPatchScalarField(mlrwfpsf)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -96,10 +96,29 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(mlrwfpsf, iF)
|
mutWallFunctionFvPatchScalarField(mlrwfpsf, iF)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
tmp<scalarField> mutLowReWallFunctionFvPatchScalarField::yPlus() const
|
||||||
|
{
|
||||||
|
const label patchi = patch().index();
|
||||||
|
const turbulenceModel& turbModel =
|
||||||
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
|
const scalarField& y = turbModel.y()[patchi];
|
||||||
|
const scalarField nuw
|
||||||
|
(
|
||||||
|
turbModel.mu().boundaryField()[patchi]
|
||||||
|
/turbModel.rho().boundaryField()[patchi]
|
||||||
|
);
|
||||||
|
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
|
||||||
|
|
||||||
|
return y*sqrt(nuw*mag(Uw.snGrad()))/nuw;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makePatchTypeField
|
makePatchTypeField
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -38,7 +38,7 @@ SourceFiles
|
|||||||
#ifndef compressibleMutLowReWallFunctionFvPatchScalarField_H
|
#ifndef compressibleMutLowReWallFunctionFvPatchScalarField_H
|
||||||
#define compressibleMutLowReWallFunctionFvPatchScalarField_H
|
#define compressibleMutLowReWallFunctionFvPatchScalarField_H
|
||||||
|
|
||||||
#include "mutkWallFunctionFvPatchScalarField.H"
|
#include "mutWallFunctionFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ namespace RASModels
|
|||||||
|
|
||||||
class mutLowReWallFunctionFvPatchScalarField
|
class mutLowReWallFunctionFvPatchScalarField
|
||||||
:
|
:
|
||||||
public mutkWallFunctionFvPatchScalarField
|
public mutWallFunctionFvPatchScalarField
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -132,6 +132,14 @@ public:
|
|||||||
new mutLowReWallFunctionFvPatchScalarField(*this, iF)
|
new mutLowReWallFunctionFvPatchScalarField(*this, iF)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// Evaluation functions
|
||||||
|
|
||||||
|
//- Calculate and return the yPlus at the boundary
|
||||||
|
virtual tmp<scalarField> yPlus() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -45,12 +45,14 @@ tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::calcYPlus
|
|||||||
const scalarField& magUp
|
const scalarField& magUp
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
const scalarField& y = rasModel.y()[patchI];
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
|
|
||||||
const fvPatchScalarField& rho = rasModel.rho().boundaryField()[patchI];
|
const scalarField& y = turbModel.y()[patchi];
|
||||||
|
const scalarField& muw = turbModel.mu().boundaryField()[patchi];
|
||||||
|
const fvPatchScalarField& rho = turbModel.rho().boundaryField()[patchi];
|
||||||
|
|
||||||
tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0));
|
tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0));
|
||||||
scalarField& yPlus = tyPlus();
|
scalarField& yPlus = tyPlus();
|
||||||
@ -170,13 +172,15 @@ tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::calcYPlus
|
|||||||
|
|
||||||
tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::calcMut() const
|
tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::calcMut() const
|
||||||
{
|
{
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
const scalarField& y = rasModel.y()[patchI];
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
|
||||||
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
|
const scalarField& y = turbModel.y()[patchi];
|
||||||
const fvPatchScalarField& rho = rasModel.rho().boundaryField()[patchI];
|
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
|
||||||
|
const scalarField& muw = turbModel.mu().boundaryField()[patchi];
|
||||||
|
const fvPatchScalarField& rho = turbModel.rho().boundaryField()[patchi];
|
||||||
|
|
||||||
scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
||||||
|
|
||||||
@ -208,7 +212,7 @@ mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(p, iF),
|
mutWallFunctionFvPatchScalarField(p, iF),
|
||||||
roughnessHeight_(pTraits<scalar>::zero),
|
roughnessHeight_(pTraits<scalar>::zero),
|
||||||
roughnessConstant_(pTraits<scalar>::zero),
|
roughnessConstant_(pTraits<scalar>::zero),
|
||||||
roughnessFactor_(pTraits<scalar>::zero)
|
roughnessFactor_(pTraits<scalar>::zero)
|
||||||
@ -223,7 +227,7 @@ mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField
|
|||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
|
mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
roughnessHeight_(ptf.roughnessHeight_),
|
roughnessHeight_(ptf.roughnessHeight_),
|
||||||
roughnessConstant_(ptf.roughnessConstant_),
|
roughnessConstant_(ptf.roughnessConstant_),
|
||||||
roughnessFactor_(ptf.roughnessFactor_)
|
roughnessFactor_(ptf.roughnessFactor_)
|
||||||
@ -237,7 +241,7 @@ mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(p, iF, dict),
|
mutWallFunctionFvPatchScalarField(p, iF, dict),
|
||||||
roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))),
|
roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))),
|
||||||
roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))),
|
roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))),
|
||||||
roughnessFactor_(readScalar(dict.lookup("roughnessFactor")))
|
roughnessFactor_(readScalar(dict.lookup("roughnessFactor")))
|
||||||
@ -249,7 +253,7 @@ mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField
|
|||||||
const mutURoughWallFunctionFvPatchScalarField& rwfpsf
|
const mutURoughWallFunctionFvPatchScalarField& rwfpsf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(rwfpsf),
|
mutWallFunctionFvPatchScalarField(rwfpsf),
|
||||||
roughnessHeight_(rwfpsf.roughnessHeight_),
|
roughnessHeight_(rwfpsf.roughnessHeight_),
|
||||||
roughnessConstant_(rwfpsf.roughnessConstant_),
|
roughnessConstant_(rwfpsf.roughnessConstant_),
|
||||||
roughnessFactor_(rwfpsf.roughnessFactor_)
|
roughnessFactor_(rwfpsf.roughnessFactor_)
|
||||||
@ -262,7 +266,7 @@ mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(rwfpsf, iF),
|
mutWallFunctionFvPatchScalarField(rwfpsf, iF),
|
||||||
roughnessHeight_(rwfpsf.roughnessHeight_),
|
roughnessHeight_(rwfpsf.roughnessHeight_),
|
||||||
roughnessConstant_(rwfpsf.roughnessConstant_),
|
roughnessConstant_(rwfpsf.roughnessConstant_),
|
||||||
roughnessFactor_(rwfpsf.roughnessFactor_)
|
roughnessFactor_(rwfpsf.roughnessFactor_)
|
||||||
@ -273,10 +277,11 @@ mutURoughWallFunctionFvPatchScalarField::mutURoughWallFunctionFvPatchScalarField
|
|||||||
|
|
||||||
tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::yPlus() const
|
tmp<scalarField> mutURoughWallFunctionFvPatchScalarField::yPlus() const
|
||||||
{
|
{
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
|
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
|
||||||
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
||||||
|
|
||||||
return calcYPlus(magUp);
|
return calcYPlus(magUp);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -35,7 +35,7 @@ SourceFiles
|
|||||||
#ifndef compressibleMutURoughWallFunctionFvPatchScalarField_H
|
#ifndef compressibleMutURoughWallFunctionFvPatchScalarField_H
|
||||||
#define compressibleMutURoughWallFunctionFvPatchScalarField_H
|
#define compressibleMutURoughWallFunctionFvPatchScalarField_H
|
||||||
|
|
||||||
#include "mutkWallFunctionFvPatchScalarField.H"
|
#include "mutWallFunctionFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ namespace RASModels
|
|||||||
|
|
||||||
class mutURoughWallFunctionFvPatchScalarField
|
class mutURoughWallFunctionFvPatchScalarField
|
||||||
:
|
:
|
||||||
public mutkWallFunctionFvPatchScalarField
|
public mutWallFunctionFvPatchScalarField
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -45,19 +45,21 @@ tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::calcUTau
|
|||||||
const scalarField& magGradU
|
const scalarField& magGradU
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
const scalarField& y = rasModel.y()[patch().index()];
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
|
|
||||||
|
const scalarField& y = turbModel.y()[patch().index()];
|
||||||
|
|
||||||
const fvPatchVectorField& Uw =
|
const fvPatchVectorField& Uw =
|
||||||
rasModel.U().boundaryField()[patch().index()];
|
turbModel.U().boundaryField()[patch().index()];
|
||||||
|
|
||||||
scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
||||||
|
|
||||||
const fvPatchScalarField& rhow =
|
const fvPatchScalarField& rhow =
|
||||||
rasModel.rho().boundaryField()[patch().index()];
|
turbModel.rho().boundaryField()[patch().index()];
|
||||||
|
|
||||||
const fvPatchScalarField& muw =
|
const fvPatchScalarField& muw =
|
||||||
rasModel.mu().boundaryField()[patch().index()];
|
turbModel.mu().boundaryField()[patch().index()];
|
||||||
const scalarField& mutw = *this;
|
const scalarField& mutw = *this;
|
||||||
|
|
||||||
tmp<scalarField> tuTau(new scalarField(patch().size(), 0.0));
|
tmp<scalarField> tuTau(new scalarField(patch().size(), 0.0));
|
||||||
@ -104,13 +106,15 @@ tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::calcUTau
|
|||||||
|
|
||||||
tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::calcMut() const
|
tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::calcMut() const
|
||||||
{
|
{
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
|
|
||||||
|
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
|
||||||
const scalarField magGradU(mag(Uw.snGrad()));
|
const scalarField magGradU(mag(Uw.snGrad()));
|
||||||
const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
|
const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
|
||||||
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
|
const scalarField& muw = turbModel.mu().boundaryField()[patchi];
|
||||||
|
|
||||||
return max
|
return max
|
||||||
(
|
(
|
||||||
@ -129,7 +133,7 @@ mutUSpaldingWallFunctionFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(p, iF)
|
mutWallFunctionFvPatchScalarField(p, iF)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -142,7 +146,7 @@ mutUSpaldingWallFunctionFvPatchScalarField
|
|||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
|
mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -154,7 +158,7 @@ mutUSpaldingWallFunctionFvPatchScalarField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(p, iF, dict)
|
mutWallFunctionFvPatchScalarField(p, iF, dict)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -164,7 +168,7 @@ mutUSpaldingWallFunctionFvPatchScalarField
|
|||||||
const mutUSpaldingWallFunctionFvPatchScalarField& wfpsf
|
const mutUSpaldingWallFunctionFvPatchScalarField& wfpsf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(wfpsf)
|
mutWallFunctionFvPatchScalarField(wfpsf)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -175,7 +179,7 @@ mutUSpaldingWallFunctionFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(wfpsf, iF)
|
mutWallFunctionFvPatchScalarField(wfpsf, iF)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -183,13 +187,15 @@ mutUSpaldingWallFunctionFvPatchScalarField
|
|||||||
|
|
||||||
tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::yPlus() const
|
tmp<scalarField> mutUSpaldingWallFunctionFvPatchScalarField::yPlus() const
|
||||||
{
|
{
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
const scalarField& y = rasModel.y()[patchI];
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
|
||||||
const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
|
const scalarField& y = turbModel.y()[patchi];
|
||||||
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
|
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
|
||||||
|
const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
|
||||||
|
const scalarField& muw = turbModel.mu().boundaryField()[patchi];
|
||||||
|
|
||||||
return y*calcUTau(mag(Uw.snGrad()))/(muw/rhow);
|
return y*calcUTau(mag(Uw.snGrad()))/(muw/rhow);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -35,7 +35,7 @@ SourceFiles
|
|||||||
#ifndef compressibleMutUSpaldingWallFunctionFvPatchScalarField_H
|
#ifndef compressibleMutUSpaldingWallFunctionFvPatchScalarField_H
|
||||||
#define compressibleMutUSpaldingWallFunctionFvPatchScalarField_H
|
#define compressibleMutUSpaldingWallFunctionFvPatchScalarField_H
|
||||||
|
|
||||||
#include "mutkWallFunctionFvPatchScalarField.H"
|
#include "mutWallFunctionFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ namespace RASModels
|
|||||||
|
|
||||||
class mutUSpaldingWallFunctionFvPatchScalarField
|
class mutUSpaldingWallFunctionFvPatchScalarField
|
||||||
:
|
:
|
||||||
public mutkWallFunctionFvPatchScalarField
|
public mutWallFunctionFvPatchScalarField
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -45,12 +45,14 @@ tmp<scalarField> mutUWallFunctionFvPatchScalarField::calcYPlus
|
|||||||
const scalarField& magUp
|
const scalarField& magUp
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
const scalarField& y = rasModel.y()[patchI];
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
const fvPatchScalarField& rhow = rasModel.rho().boundaryField()[patchI];
|
|
||||||
const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI];
|
const scalarField& y = turbModel.y()[patchi];
|
||||||
|
const fvPatchScalarField& rhow = turbModel.rho().boundaryField()[patchi];
|
||||||
|
const fvPatchScalarField& muw = turbModel.mu().boundaryField()[patchi];
|
||||||
|
|
||||||
tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0));
|
tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0));
|
||||||
scalarField& yPlus = tyPlus();
|
scalarField& yPlus = tyPlus();
|
||||||
@ -81,12 +83,14 @@ tmp<scalarField> mutUWallFunctionFvPatchScalarField::calcYPlus
|
|||||||
|
|
||||||
tmp<scalarField> mutUWallFunctionFvPatchScalarField::calcMut() const
|
tmp<scalarField> mutUWallFunctionFvPatchScalarField::calcMut() const
|
||||||
{
|
{
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
|
|
||||||
|
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
|
||||||
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
||||||
const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI];
|
const fvPatchScalarField& muw = turbModel.mu().boundaryField()[patchi];
|
||||||
|
|
||||||
tmp<scalarField> tyPlus = calcYPlus(magUp);
|
tmp<scalarField> tyPlus = calcYPlus(magUp);
|
||||||
scalarField& yPlus = tyPlus();
|
scalarField& yPlus = tyPlus();
|
||||||
@ -115,7 +119,7 @@ mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(p, iF)
|
mutWallFunctionFvPatchScalarField(p, iF)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -127,7 +131,7 @@ mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField
|
|||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
|
mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -138,7 +142,7 @@ mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(p, iF, dict)
|
mutWallFunctionFvPatchScalarField(p, iF, dict)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -147,7 +151,7 @@ mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField
|
|||||||
const mutUWallFunctionFvPatchScalarField& sawfpsf
|
const mutUWallFunctionFvPatchScalarField& sawfpsf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(sawfpsf)
|
mutWallFunctionFvPatchScalarField(sawfpsf)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -157,7 +161,7 @@ mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mutkWallFunctionFvPatchScalarField(sawfpsf, iF)
|
mutWallFunctionFvPatchScalarField(sawfpsf, iF)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -165,9 +169,10 @@ mutUWallFunctionFvPatchScalarField::mutUWallFunctionFvPatchScalarField
|
|||||||
|
|
||||||
tmp<scalarField> mutUWallFunctionFvPatchScalarField::yPlus() const
|
tmp<scalarField> mutUWallFunctionFvPatchScalarField::yPlus() const
|
||||||
{
|
{
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
|
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
|
||||||
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
|
||||||
|
|
||||||
return calcYPlus(magUp);
|
return calcYPlus(magUp);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -35,7 +35,7 @@ SourceFiles
|
|||||||
#ifndef compressibleMutUWallFunctionFvPatchScalarField_H
|
#ifndef compressibleMutUWallFunctionFvPatchScalarField_H
|
||||||
#define compressibleMutUWallFunctionFvPatchScalarField_H
|
#define compressibleMutUWallFunctionFvPatchScalarField_H
|
||||||
|
|
||||||
#include "mutkWallFunctionFvPatchScalarField.H"
|
#include "mutWallFunctionFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ namespace RASModels
|
|||||||
|
|
||||||
class mutUWallFunctionFvPatchScalarField
|
class mutUWallFunctionFvPatchScalarField
|
||||||
:
|
:
|
||||||
public mutkWallFunctionFvPatchScalarField
|
public mutWallFunctionFvPatchScalarField
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,191 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011-2012 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 "mutWallFunctionFvPatchScalarField.H"
|
||||||
|
#include "RASModel.H"
|
||||||
|
#include "fvPatchFieldMapper.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "wallFvPatch.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace compressible
|
||||||
|
{
|
||||||
|
namespace RASModels
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
defineTypeNameAndDebug(mutWallFunctionFvPatchScalarField, 0);
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void mutWallFunctionFvPatchScalarField::checkType()
|
||||||
|
{
|
||||||
|
if (!isA<wallFvPatch>(patch()))
|
||||||
|
{
|
||||||
|
FatalErrorIn("mutWallFunctionFvPatchScalarField::checkType()")
|
||||||
|
<< "Invalid wall function specification" << nl
|
||||||
|
<< " Patch type for patch " << patch().name()
|
||||||
|
<< " must be wall" << nl
|
||||||
|
<< " Current patch type is " << patch().type() << nl << endl
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void mutWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchScalarField(p, iF),
|
||||||
|
Cmu_(0.09),
|
||||||
|
kappa_(0.41),
|
||||||
|
E_(9.8),
|
||||||
|
yPlusLam_(yPlusLam(kappa_, E_))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
|
||||||
|
(
|
||||||
|
const mutWallFunctionFvPatchScalarField& ptf,
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<scalar, volMesh>& iF,
|
||||||
|
const fvPatchFieldMapper& mapper
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
|
Cmu_(ptf.Cmu_),
|
||||||
|
kappa_(ptf.kappa_),
|
||||||
|
E_(ptf.E_),
|
||||||
|
yPlusLam_(ptf.yPlusLam_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<scalar, volMesh>& iF,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchScalarField(p, iF, dict),
|
||||||
|
Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
|
||||||
|
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
|
||||||
|
E_(dict.lookupOrDefault<scalar>("E", 9.8)),
|
||||||
|
yPlusLam_(yPlusLam(kappa_, E_))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
|
||||||
|
(
|
||||||
|
const mutWallFunctionFvPatchScalarField& wfpsf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchScalarField(wfpsf),
|
||||||
|
Cmu_(wfpsf.Cmu_),
|
||||||
|
kappa_(wfpsf.kappa_),
|
||||||
|
E_(wfpsf.E_),
|
||||||
|
yPlusLam_(wfpsf.yPlusLam_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
mutWallFunctionFvPatchScalarField::mutWallFunctionFvPatchScalarField
|
||||||
|
(
|
||||||
|
const mutWallFunctionFvPatchScalarField& wfpsf,
|
||||||
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fixedValueFvPatchScalarField(wfpsf, iF),
|
||||||
|
Cmu_(wfpsf.Cmu_),
|
||||||
|
kappa_(wfpsf.kappa_),
|
||||||
|
E_(wfpsf.E_),
|
||||||
|
yPlusLam_(wfpsf.yPlusLam_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
scalar mutWallFunctionFvPatchScalarField::yPlusLam
|
||||||
|
(
|
||||||
|
const scalar kappa,
|
||||||
|
const scalar E
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar ypl = 11.0;
|
||||||
|
|
||||||
|
for (int i=0; i<10; i++)
|
||||||
|
{
|
||||||
|
ypl = log(max(E*ypl, 1))/kappa;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ypl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void mutWallFunctionFvPatchScalarField::updateCoeffs()
|
||||||
|
{
|
||||||
|
if (updated())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
operator==(calcMut());
|
||||||
|
|
||||||
|
fixedValueFvPatchScalarField::updateCoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void mutWallFunctionFvPatchScalarField::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
fvPatchField<scalar>::write(os);
|
||||||
|
writeLocalEntries(os);
|
||||||
|
writeEntry("value", os);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace RASModels
|
||||||
|
} // End namespace compressible
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -22,19 +22,20 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Class
|
Class
|
||||||
alphaSgsWallFunctionFvPatchScalarField
|
Foam::compressible::RASModels::mutWallFunctionFvPatchScalarField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Boundary condition for thermal diffusivity when using wall functions
|
Boundary condition for turbulent (kinematic) viscosity when using wall
|
||||||
|
functions, based on turbulence kinetic energy.
|
||||||
- replicates OpenFOAM v1.5 (and earlier) behaviour
|
- replicates OpenFOAM v1.5 (and earlier) behaviour
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
alphaSgsWallFunctionFvPatchScalarField.C
|
mutWallFunctionFvPatchScalarField.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef alphaSgsWallFunctionFvPatchScalarField_H
|
#ifndef compressibleMutWallFunctionFvPatchScalarField_H
|
||||||
#define alphaSgsWallFunctionFvPatchScalarField_H
|
#define compressibleMutWallFunctionFvPatchScalarField_H
|
||||||
|
|
||||||
#include "fixedValueFvPatchFields.H"
|
#include "fixedValueFvPatchFields.H"
|
||||||
|
|
||||||
@ -44,112 +45,119 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
namespace compressible
|
namespace compressible
|
||||||
{
|
{
|
||||||
namespace LESModels
|
namespace RASModels
|
||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class alphaSgsWallFunctionFvPatchScalarField Declaration
|
Class mutWallFunctionFvPatchScalarField Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class alphaSgsWallFunctionFvPatchScalarField
|
class mutWallFunctionFvPatchScalarField
|
||||||
:
|
:
|
||||||
public fixedValueFvPatchScalarField
|
public fixedValueFvPatchScalarField
|
||||||
{
|
{
|
||||||
// Private data
|
protected:
|
||||||
|
|
||||||
//- Turbulent Prandtl number
|
// Protected data
|
||||||
scalar Prt_;
|
|
||||||
|
//- Cmu coefficient
|
||||||
|
scalar Cmu_;
|
||||||
|
|
||||||
|
//- Von Karman constant
|
||||||
|
scalar kappa_;
|
||||||
|
|
||||||
|
//- E coefficient
|
||||||
|
scalar E_;
|
||||||
|
|
||||||
|
//- Y+ at the edge of the laminar sublayer
|
||||||
|
scalar yPlusLam_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Check the type of the patch
|
//- Check the type of the patch
|
||||||
void checkType();
|
virtual void checkType();
|
||||||
|
|
||||||
|
//- Calculate the turbulence viscosity
|
||||||
|
virtual tmp<scalarField> calcMut() const = 0;
|
||||||
|
|
||||||
|
//- Write local wall function variables
|
||||||
|
virtual void writeLocalEntries(Ostream&) const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("alphaSgsWallFunction");
|
TypeName("mutWallFunction");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
//- Construct from patch and internal field
|
||||||
alphaSgsWallFunctionFvPatchScalarField
|
mutWallFunctionFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fvPatch&,
|
const fvPatch&,
|
||||||
const DimensionedField<scalar, volMesh>&
|
const DimensionedField<scalar, volMesh>&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
//- Construct from patch, internal field and dictionary
|
||||||
alphaSgsWallFunctionFvPatchScalarField
|
mutWallFunctionFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fvPatch&,
|
const fvPatch&,
|
||||||
const DimensionedField<scalar, volMesh>&,
|
const DimensionedField<scalar, volMesh>&,
|
||||||
const dictionary&
|
const dictionary&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct by mapping given alphaSgsWallFunctionFvPatchScalarField
|
//- Construct by mapping given
|
||||||
|
// mutWallFunctionFvPatchScalarField
|
||||||
// onto a new patch
|
// onto a new patch
|
||||||
alphaSgsWallFunctionFvPatchScalarField
|
mutWallFunctionFvPatchScalarField
|
||||||
(
|
(
|
||||||
const alphaSgsWallFunctionFvPatchScalarField&,
|
const mutWallFunctionFvPatchScalarField&,
|
||||||
const fvPatch&,
|
const fvPatch&,
|
||||||
const DimensionedField<scalar, volMesh>&,
|
const DimensionedField<scalar, volMesh>&,
|
||||||
const fvPatchFieldMapper&
|
const fvPatchFieldMapper&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct as copy
|
//- Construct as copy
|
||||||
alphaSgsWallFunctionFvPatchScalarField
|
mutWallFunctionFvPatchScalarField
|
||||||
(
|
(
|
||||||
const alphaSgsWallFunctionFvPatchScalarField&
|
const mutWallFunctionFvPatchScalarField&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual tmp<fvPatchScalarField> clone() const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new alphaSgsWallFunctionFvPatchScalarField(*this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Construct as copy setting internal field reference
|
//- Construct as copy setting internal field reference
|
||||||
alphaSgsWallFunctionFvPatchScalarField
|
mutWallFunctionFvPatchScalarField
|
||||||
(
|
(
|
||||||
const alphaSgsWallFunctionFvPatchScalarField&,
|
const mutWallFunctionFvPatchScalarField&,
|
||||||
const DimensionedField<scalar, volMesh>&
|
const DimensionedField<scalar, volMesh>&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchScalarField> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new alphaSgsWallFunctionFvPatchScalarField(*this, iF)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
//- Calculate the Y+ at the edge of the laminar sublayer
|
||||||
|
static scalar yPlusLam(const scalar kappa, const scalar E);
|
||||||
|
|
||||||
|
//- Calculate and return the yPlus at the boundary
|
||||||
|
virtual tmp<scalarField> yPlus() const = 0;
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
|
||||||
//- Evaluate the patchField
|
//- Update the coefficients associated with the patch field
|
||||||
virtual void evaluate
|
virtual void updateCoeffs();
|
||||||
(
|
|
||||||
const Pstream::commsTypes commsType=Pstream::Pstream::blocking
|
|
||||||
);
|
// I-O
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace LESModels
|
} // End namespace RASModels
|
||||||
} // End namespace compressible
|
} // End namespace compressible
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -65,14 +65,16 @@ scalar mutkRoughWallFunctionFvPatchScalarField::fnRough
|
|||||||
|
|
||||||
tmp<scalarField> mutkRoughWallFunctionFvPatchScalarField::calcMut() const
|
tmp<scalarField> mutkRoughWallFunctionFvPatchScalarField::calcMut() const
|
||||||
{
|
{
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
const scalarField& y = rasModel.y()[patchI];
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
|
|
||||||
const tmp<volScalarField> tk = rasModel.k();
|
const scalarField& y = turbModel.y()[patchi];
|
||||||
|
const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
|
||||||
|
const tmp<volScalarField> tk = turbModel.k();
|
||||||
const volScalarField& k = tk();
|
const volScalarField& k = tk();
|
||||||
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
|
const scalarField& muw = turbModel.mu().boundaryField()[patchi];
|
||||||
|
|
||||||
const scalar Cmu25 = pow025(Cmu_);
|
const scalar Cmu25 = pow025(Cmu_);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -41,46 +41,16 @@ namespace RASModels
|
|||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void mutkWallFunctionFvPatchScalarField::checkType()
|
|
||||||
{
|
|
||||||
if (!isA<wallFvPatch>(patch()))
|
|
||||||
{
|
|
||||||
FatalErrorIn("mutkWallFunctionFvPatchScalarField::checkType()")
|
|
||||||
<< "Invalid wall function specification" << nl
|
|
||||||
<< " Patch type for patch " << patch().name()
|
|
||||||
<< " must be wall" << nl
|
|
||||||
<< " Current patch type is " << patch().type() << nl << endl
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
scalar mutkWallFunctionFvPatchScalarField::calcYPlusLam
|
|
||||||
(
|
|
||||||
const scalar kappa,
|
|
||||||
const scalar E
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar ypl = 11.0;
|
|
||||||
|
|
||||||
for (int i=0; i<10; i++)
|
|
||||||
{
|
|
||||||
ypl = log(E*ypl)/kappa;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ypl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tmp<scalarField> mutkWallFunctionFvPatchScalarField::calcMut() const
|
tmp<scalarField> mutkWallFunctionFvPatchScalarField::calcMut() const
|
||||||
{
|
{
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
const scalarField& y = rasModel.y()[patchI];
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
|
const scalarField& y = turbModel.y()[patchi];
|
||||||
const tmp<volScalarField> tk = rasModel.k();
|
const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
|
||||||
|
const tmp<volScalarField> tk = turbModel.k();
|
||||||
const volScalarField& k = tk();
|
const volScalarField& k = tk();
|
||||||
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
|
const scalarField& muw = turbModel.mu().boundaryField()[patchi];
|
||||||
|
|
||||||
const scalar Cmu25 = pow025(Cmu_);
|
const scalar Cmu25 = pow025(Cmu_);
|
||||||
|
|
||||||
@ -104,14 +74,6 @@ tmp<scalarField> mutkWallFunctionFvPatchScalarField::calcMut() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void mutkWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
|
|
||||||
{
|
|
||||||
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
|
mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
|
||||||
@ -120,11 +82,7 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF),
|
mutWallFunctionFvPatchScalarField(p, iF)
|
||||||
Cmu_(0.09),
|
|
||||||
kappa_(0.41),
|
|
||||||
E_(9.8),
|
|
||||||
yPlusLam_(calcYPlusLam(kappa_, E_))
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -136,11 +94,7 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
|
|||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
mutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
|
||||||
Cmu_(ptf.Cmu_),
|
|
||||||
kappa_(ptf.kappa_),
|
|
||||||
E_(ptf.E_),
|
|
||||||
yPlusLam_(ptf.yPlusLam_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -151,11 +105,7 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF, dict),
|
mutWallFunctionFvPatchScalarField(p, iF, dict)
|
||||||
Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
|
|
||||||
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
|
|
||||||
E_(dict.lookupOrDefault<scalar>("E", 9.8)),
|
|
||||||
yPlusLam_(calcYPlusLam(kappa_, E_))
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -164,11 +114,7 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
|
|||||||
const mutkWallFunctionFvPatchScalarField& wfpsf
|
const mutkWallFunctionFvPatchScalarField& wfpsf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(wfpsf),
|
mutWallFunctionFvPatchScalarField(wfpsf)
|
||||||
Cmu_(wfpsf.Cmu_),
|
|
||||||
kappa_(wfpsf.kappa_),
|
|
||||||
E_(wfpsf.E_),
|
|
||||||
yPlusLam_(wfpsf.yPlusLam_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -178,54 +124,30 @@ mutkWallFunctionFvPatchScalarField::mutkWallFunctionFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(wfpsf, iF),
|
mutWallFunctionFvPatchScalarField(wfpsf, iF)
|
||||||
Cmu_(wfpsf.Cmu_),
|
|
||||||
kappa_(wfpsf.kappa_),
|
|
||||||
E_(wfpsf.E_),
|
|
||||||
yPlusLam_(wfpsf.yPlusLam_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void mutkWallFunctionFvPatchScalarField::updateCoeffs()
|
|
||||||
{
|
|
||||||
if (updated())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
operator==(calcMut());
|
|
||||||
|
|
||||||
fixedValueFvPatchScalarField::updateCoeffs();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tmp<scalarField> mutkWallFunctionFvPatchScalarField::yPlus() const
|
tmp<scalarField> mutkWallFunctionFvPatchScalarField::yPlus() const
|
||||||
{
|
{
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
const scalarField& y = rasModel.y()[patchI];
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
|
const scalarField& y = turbModel.y()[patchi];
|
||||||
|
|
||||||
const tmp<volScalarField> tk = rasModel.k();
|
const tmp<volScalarField> tk = turbModel.k();
|
||||||
const volScalarField& k = tk();
|
const volScalarField& k = tk();
|
||||||
const scalarField kwc(k.boundaryField()[patchI].patchInternalField());
|
const scalarField kwc(k.boundaryField()[patchi].patchInternalField());
|
||||||
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
|
const scalarField& muw = turbModel.mu().boundaryField()[patchi];
|
||||||
const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
|
const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
|
||||||
|
|
||||||
return pow025(Cmu_)*y*sqrt(kwc)/(muw/rhow);
|
return pow025(Cmu_)*y*sqrt(kwc)/(muw/rhow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void mutkWallFunctionFvPatchScalarField::write(Ostream& os) const
|
|
||||||
{
|
|
||||||
fvPatchField<scalar>::write(os);
|
|
||||||
writeLocalEntries(os);
|
|
||||||
writeEntry("value", os);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makePatchTypeField
|
makePatchTypeField
|
||||||
@ -234,6 +156,7 @@ makePatchTypeField
|
|||||||
mutkWallFunctionFvPatchScalarField
|
mutkWallFunctionFvPatchScalarField
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace RASModels
|
} // End namespace RASModels
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -37,7 +37,7 @@ SourceFiles
|
|||||||
#ifndef compressibleMutkWallFunctionFvPatchScalarField_H
|
#ifndef compressibleMutkWallFunctionFvPatchScalarField_H
|
||||||
#define compressibleMutkWallFunctionFvPatchScalarField_H
|
#define compressibleMutkWallFunctionFvPatchScalarField_H
|
||||||
|
|
||||||
#include "fixedValueFvPatchFields.H"
|
#include "mutWallFunctionFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -54,39 +54,15 @@ namespace RASModels
|
|||||||
|
|
||||||
class mutkWallFunctionFvPatchScalarField
|
class mutkWallFunctionFvPatchScalarField
|
||||||
:
|
:
|
||||||
public fixedValueFvPatchScalarField
|
public mutWallFunctionFvPatchScalarField
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
//- Cmu coefficient
|
|
||||||
scalar Cmu_;
|
|
||||||
|
|
||||||
//- Von Karman constant
|
|
||||||
scalar kappa_;
|
|
||||||
|
|
||||||
//- E coefficient
|
|
||||||
scalar E_;
|
|
||||||
|
|
||||||
//- Y+ at the edge of the laminar sublayer
|
|
||||||
scalar yPlusLam_;
|
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Check the type of the patch
|
|
||||||
virtual void checkType();
|
|
||||||
|
|
||||||
//- Calculate the Y+ at the edge of the laminar sublayer
|
|
||||||
virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
|
|
||||||
|
|
||||||
//- Calculate the turbulence viscosity
|
//- Calculate the turbulence viscosity
|
||||||
virtual tmp<scalarField> calcMut() const;
|
virtual tmp<scalarField> calcMut() const;
|
||||||
|
|
||||||
//- Write local wall function variables
|
|
||||||
virtual void writeLocalEntries(Ostream&) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -163,15 +139,6 @@ public:
|
|||||||
|
|
||||||
//- Calculate and return the yPlus at the boundary
|
//- Calculate and return the yPlus at the boundary
|
||||||
virtual tmp<scalarField> yPlus() const;
|
virtual tmp<scalarField> yPlus() const;
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
|
||||||
virtual void updateCoeffs();
|
|
||||||
|
|
||||||
|
|
||||||
// I-O
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -28,6 +28,7 @@ License
|
|||||||
#include "fvPatchFieldMapper.H"
|
#include "fvPatchFieldMapper.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "mutWallFunctionFvPatchScalarField.H"
|
||||||
#include "wallFvPatch.H"
|
#include "wallFvPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -55,23 +56,6 @@ void omegaWallFunctionFvPatchScalarField::checkType()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
scalar omegaWallFunctionFvPatchScalarField::calcYPlusLam
|
|
||||||
(
|
|
||||||
const scalar kappa,
|
|
||||||
const scalar E
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalar ypl = 11.0;
|
|
||||||
|
|
||||||
for (int i=0; i<10; i++)
|
|
||||||
{
|
|
||||||
ypl = log(E*ypl)/kappa;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ypl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void omegaWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
|
void omegaWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
|
||||||
{
|
{
|
||||||
writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
|
writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
|
||||||
@ -96,7 +80,7 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
|
|||||||
kappa_(0.41),
|
kappa_(0.41),
|
||||||
E_(9.8),
|
E_(9.8),
|
||||||
beta1_(0.075),
|
beta1_(0.075),
|
||||||
yPlusLam_(calcYPlusLam(kappa_, E_))
|
yPlusLam_(mutWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_))
|
||||||
|
|
||||||
{
|
{
|
||||||
checkType();
|
checkType();
|
||||||
@ -136,7 +120,7 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
|
|||||||
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
|
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
|
||||||
E_(dict.lookupOrDefault<scalar>("E", 9.8)),
|
E_(dict.lookupOrDefault<scalar>("E", 9.8)),
|
||||||
beta1_(dict.lookupOrDefault<scalar>("beta1", 0.075)),
|
beta1_(dict.lookupOrDefault<scalar>("beta1", 0.075)),
|
||||||
yPlusLam_(calcYPlusLam(kappa_, E_))
|
yPlusLam_(mutWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_))
|
||||||
{
|
{
|
||||||
checkType();
|
checkType();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -98,9 +98,6 @@ protected:
|
|||||||
//- Check the type of the patch
|
//- Check the type of the patch
|
||||||
virtual void checkType();
|
virtual void checkType();
|
||||||
|
|
||||||
//- Calculate the Y+ at the edge of the laminar sublayer
|
|
||||||
virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
|
|
||||||
|
|
||||||
//- Write local wall function variables
|
//- Write local wall function variables
|
||||||
virtual void writeLocalEntries(Ostream&) const;
|
virtual void writeLocalEntries(Ostream&) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -68,7 +68,9 @@ turbulenceModel::turbulenceModel
|
|||||||
rho_(rho),
|
rho_(rho),
|
||||||
U_(U),
|
U_(U),
|
||||||
phi_(phi),
|
phi_(phi),
|
||||||
thermophysicalModel_(thermophysicalModel)
|
thermophysicalModel_(thermophysicalModel),
|
||||||
|
|
||||||
|
y_(mesh_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -137,7 +139,12 @@ tmp<volScalarField> turbulenceModel::rhoEpsilonEff() const
|
|||||||
|
|
||||||
|
|
||||||
void turbulenceModel::correct()
|
void turbulenceModel::correct()
|
||||||
{}
|
{
|
||||||
|
if (mesh_.changing())
|
||||||
|
{
|
||||||
|
y_.correct();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -49,6 +49,7 @@ SourceFiles
|
|||||||
#include "surfaceFieldsFwd.H"
|
#include "surfaceFieldsFwd.H"
|
||||||
#include "fvMatricesFwd.H"
|
#include "fvMatricesFwd.H"
|
||||||
#include "basicThermo.H"
|
#include "basicThermo.H"
|
||||||
|
#include "nearWallDist.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
|
|
||||||
@ -85,6 +86,9 @@ protected:
|
|||||||
|
|
||||||
const basicThermo& thermophysicalModel_;
|
const basicThermo& thermophysicalModel_;
|
||||||
|
|
||||||
|
//- Near wall distance boundary field
|
||||||
|
nearWallDist y_;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -178,6 +182,12 @@ public:
|
|||||||
return thermophysicalModel_;
|
return thermophysicalModel_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return the near wall distances
|
||||||
|
const nearWallDist& y() const
|
||||||
|
{
|
||||||
|
return y_;
|
||||||
|
}
|
||||||
|
|
||||||
//- Return the laminar viscosity
|
//- Return the laminar viscosity
|
||||||
const volScalarField& mu() const
|
const volScalarField& mu() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -106,11 +106,12 @@ void fixedShearStressFvPatchVectorField::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
|
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
|
|
||||||
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
|
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
|
||||||
|
|
||||||
const vectorField Ui(Uw.patchInternalField());
|
const vectorField Ui(Uw.patchInternalField());
|
||||||
|
|
||||||
@ -118,9 +119,9 @@ void fixedShearStressFvPatchVectorField::updateCoeffs()
|
|||||||
|
|
||||||
const scalarField& ry = patch().deltaCoeffs();
|
const scalarField& ry = patch().deltaCoeffs();
|
||||||
|
|
||||||
tmp<volScalarField> tnuEff = rasModel.nuEff();
|
tmp<volScalarField> tnuEff = turbModel.nuEff();
|
||||||
const volScalarField& nuEff = tnuEff();
|
const volScalarField& nuEff = tnuEff();
|
||||||
const scalarField& nuEffw = nuEff.boundaryField()[patchI];
|
const scalarField& nuEffw = nuEff.boundaryField()[patchi];
|
||||||
|
|
||||||
tmp<vectorField> UwUpdated =
|
tmp<vectorField> UwUpdated =
|
||||||
tauHat*(tauHat & (tau0_*(1.0/(ry*nuEffw)) + Ui));
|
tauHat*(tauHat & (tau0_*(1.0/(ry*nuEffw)) + Ui));
|
||||||
@ -130,8 +131,8 @@ void fixedShearStressFvPatchVectorField::updateCoeffs()
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
tmp<vectorField> nHat = this->patch().nf();
|
tmp<vectorField> nHat = this->patch().nf();
|
||||||
volSymmTensorField Reff(rasModel.devReff());
|
volSymmTensorField Reff(turbModel.devReff());
|
||||||
Info << "tau : " << (nHat & Reff.boundaryField()[patchI])() << endl;
|
Info << "tau : " << (nHat & Reff.boundaryField()[patchi])() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
fixedValueFvPatchVectorField::updateCoeffs();
|
fixedValueFvPatchVectorField::updateCoeffs();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -201,21 +201,22 @@ void kappatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const label patchI = patch().index();
|
const label patchi = patch().index();
|
||||||
|
|
||||||
// Retrieve turbulence properties from model
|
// Retrieve turbulence properties from model
|
||||||
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
|
const turbulenceModel& turbModel =
|
||||||
|
db().lookupObject<turbulenceModel>("turbulenceModel");
|
||||||
const scalar Cmu25 = pow(Cmu_, 0.25);
|
const scalar Cmu25 = pow(Cmu_, 0.25);
|
||||||
const scalarField& y = rasModel.y()[patchI];
|
const scalarField& y = turbModel.y()[patchi];
|
||||||
const tmp<volScalarField> tnu = rasModel.nu();
|
const tmp<volScalarField> tnu = turbModel.nu();
|
||||||
const volScalarField& nu = tnu();
|
const volScalarField& nu = tnu();
|
||||||
const scalarField& nuw = nu.boundaryField()[patchI];
|
const scalarField& nuw = nu.boundaryField()[patchi];
|
||||||
const tmp<volScalarField> tk = rasModel.k();
|
const tmp<volScalarField> tk = turbModel.k();
|
||||||
const volScalarField& k = tk();
|
const volScalarField& k = tk();
|
||||||
|
|
||||||
// Molecular Prandtl number
|
// Molecular Prandtl number
|
||||||
const scalar
|
const scalar
|
||||||
Pr(dimensionedScalar(rasModel.transport().lookup("Pr")).value());
|
Pr(dimensionedScalar(turbModel.transport().lookup("Pr")).value());
|
||||||
|
|
||||||
// Populate boundary values
|
// Populate boundary values
|
||||||
scalarField& kappatw = *this;
|
scalarField& kappatw = *this;
|
||||||
|
|||||||
@ -39,6 +39,11 @@ namespace incompressible
|
|||||||
namespace RASModels
|
namespace RASModels
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
defineTypeNameAndDebug(nutWallFunctionFvPatchScalarField, 0);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void nutWallFunctionFvPatchScalarField::checkType()
|
void nutWallFunctionFvPatchScalarField::checkType()
|
||||||
|
|||||||
@ -41,20 +41,6 @@ namespace RASModels
|
|||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void nutkWallFunctionFvPatchScalarField::checkType()
|
|
||||||
{
|
|
||||||
if (!isA<wallFvPatch>(patch()))
|
|
||||||
{
|
|
||||||
FatalErrorIn("nutkWallFunctionFvPatchScalarField::checkType()")
|
|
||||||
<< "Invalid wall function specification" << nl
|
|
||||||
<< " Patch type for patch " << patch().name()
|
|
||||||
<< " must be wall" << nl
|
|
||||||
<< " Current patch type is " << patch().type() << nl << endl
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tmp<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const
|
tmp<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const
|
||||||
{
|
{
|
||||||
const label patchi = patch().index();
|
const label patchi = patch().index();
|
||||||
@ -89,14 +75,6 @@ tmp<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void nutkWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
|
|
||||||
{
|
|
||||||
os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
||||||
@ -105,14 +83,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF),
|
nutWallFunctionFvPatchScalarField(p, iF)
|
||||||
Cmu_(0.09),
|
{}
|
||||||
kappa_(0.41),
|
|
||||||
E_(9.8),
|
|
||||||
yPlusLam_(yPlusLam(kappa_, E_))
|
|
||||||
{
|
|
||||||
checkType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
||||||
@ -123,14 +95,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
|||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
|
||||||
Cmu_(ptf.Cmu_),
|
{}
|
||||||
kappa_(ptf.kappa_),
|
|
||||||
E_(ptf.E_),
|
|
||||||
yPlusLam_(ptf.yPlusLam_)
|
|
||||||
{
|
|
||||||
checkType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
||||||
@ -140,14 +106,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF, dict),
|
nutWallFunctionFvPatchScalarField(p, iF, dict)
|
||||||
Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
|
{}
|
||||||
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
|
|
||||||
E_(dict.lookupOrDefault<scalar>("E", 9.8)),
|
|
||||||
yPlusLam_(yPlusLam(kappa_, E_))
|
|
||||||
{
|
|
||||||
checkType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
||||||
@ -155,14 +115,8 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
|||||||
const nutkWallFunctionFvPatchScalarField& wfpsf
|
const nutkWallFunctionFvPatchScalarField& wfpsf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(wfpsf),
|
nutWallFunctionFvPatchScalarField(wfpsf)
|
||||||
Cmu_(wfpsf.Cmu_),
|
{}
|
||||||
kappa_(wfpsf.kappa_),
|
|
||||||
E_(wfpsf.E_),
|
|
||||||
yPlusLam_(wfpsf.yPlusLam_)
|
|
||||||
{
|
|
||||||
checkType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
||||||
@ -171,48 +125,12 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
|
|||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(wfpsf, iF),
|
nutWallFunctionFvPatchScalarField(wfpsf, iF)
|
||||||
Cmu_(wfpsf.Cmu_),
|
{}
|
||||||
kappa_(wfpsf.kappa_),
|
|
||||||
E_(wfpsf.E_),
|
|
||||||
yPlusLam_(wfpsf.yPlusLam_)
|
|
||||||
{
|
|
||||||
checkType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
scalar nutkWallFunctionFvPatchScalarField::yPlusLam
|
|
||||||
(
|
|
||||||
const scalar kappa,
|
|
||||||
const scalar E
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scalar ypl = 11.0;
|
|
||||||
|
|
||||||
for (int i=0; i<10; i++)
|
|
||||||
{
|
|
||||||
ypl = log(max(E*ypl, 1))/kappa;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ypl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void nutkWallFunctionFvPatchScalarField::updateCoeffs()
|
|
||||||
{
|
|
||||||
if (updated())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
operator==(calcNut());
|
|
||||||
|
|
||||||
fixedValueFvPatchScalarField::updateCoeffs();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tmp<scalarField> nutkWallFunctionFvPatchScalarField::yPlus() const
|
tmp<scalarField> nutkWallFunctionFvPatchScalarField::yPlus() const
|
||||||
{
|
{
|
||||||
const label patchi = patch().index();
|
const label patchi = patch().index();
|
||||||
@ -232,14 +150,6 @@ tmp<scalarField> nutkWallFunctionFvPatchScalarField::yPlus() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void nutkWallFunctionFvPatchScalarField::write(Ostream& os) const
|
|
||||||
{
|
|
||||||
fvPatchField<scalar>::write(os);
|
|
||||||
writeLocalEntries(os);
|
|
||||||
writeEntry("value", os);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makePatchTypeField
|
makePatchTypeField
|
||||||
|
|||||||
@ -37,7 +37,7 @@ SourceFiles
|
|||||||
#ifndef nutkWallFunctionFvPatchScalarField_H
|
#ifndef nutkWallFunctionFvPatchScalarField_H
|
||||||
#define nutkWallFunctionFvPatchScalarField_H
|
#define nutkWallFunctionFvPatchScalarField_H
|
||||||
|
|
||||||
#include "fixedValueFvPatchFields.H"
|
#include "nutWallFunctionFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -54,36 +54,15 @@ namespace RASModels
|
|||||||
|
|
||||||
class nutkWallFunctionFvPatchScalarField
|
class nutkWallFunctionFvPatchScalarField
|
||||||
:
|
:
|
||||||
public fixedValueFvPatchScalarField
|
public nutWallFunctionFvPatchScalarField
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
|
||||||
|
|
||||||
//- Cmu coefficient
|
|
||||||
scalar Cmu_;
|
|
||||||
|
|
||||||
//- Von Karman constant
|
|
||||||
scalar kappa_;
|
|
||||||
|
|
||||||
//- E coefficient
|
|
||||||
scalar E_;
|
|
||||||
|
|
||||||
//- Y+ at the edge of the laminar sublayer
|
|
||||||
scalar yPlusLam_;
|
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Check the type of the patch
|
|
||||||
virtual void checkType();
|
|
||||||
|
|
||||||
//- Calculate the turbulence viscosity
|
//- Calculate the turbulence viscosity
|
||||||
virtual tmp<scalarField> calcNut() const;
|
virtual tmp<scalarField> calcNut() const;
|
||||||
|
|
||||||
//- Write local wall function variables
|
|
||||||
virtual void writeLocalEntries(Ostream&) const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -156,23 +135,8 @@ public:
|
|||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
//- Calculate the Y+ at the edge of the laminar sublayer
|
|
||||||
static scalar yPlusLam(const scalar kappa, const scalar E);
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
|
||||||
|
|
||||||
//- Calculate and return the yPlus at the boundary
|
//- Calculate and return the yPlus at the boundary
|
||||||
virtual tmp<scalarField> yPlus() const;
|
virtual tmp<scalarField> yPlus() const;
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
|
||||||
virtual void updateCoeffs();
|
|
||||||
|
|
||||||
|
|
||||||
// I-O
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,14 +32,14 @@ boundaryField
|
|||||||
|
|
||||||
upperWall
|
upperWall
|
||||||
{
|
{
|
||||||
type alphaSgsJayatillekeWallFunction;
|
type alphatJayatillekeWallFunction;
|
||||||
he ha;
|
he ha;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
lowerWall
|
lowerWall
|
||||||
{
|
{
|
||||||
type alphaSgsJayatillekeWallFunction;
|
type alphatJayatillekeWallFunction;
|
||||||
he ha;
|
he ha;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,13 +32,13 @@ boundaryField
|
|||||||
|
|
||||||
upperWall
|
upperWall
|
||||||
{
|
{
|
||||||
type muSgsUSpaldingWallFunction;
|
type mutUSpaldingWallFunction;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
lowerWall
|
lowerWall
|
||||||
{
|
{
|
||||||
type muSgsUSpaldingWallFunction;
|
type mutUSpaldingWallFunction;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -31,13 +31,13 @@ boundaryField
|
|||||||
}
|
}
|
||||||
upperWall
|
upperWall
|
||||||
{
|
{
|
||||||
type alphaSgsJayatillekeWallFunction;
|
type alphatJayatillekeWallFunction;
|
||||||
he ha;
|
he ha;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
lowerWall
|
lowerWall
|
||||||
{
|
{
|
||||||
type alphaSgsJayatillekeWallFunction;
|
type alphatJayatillekeWallFunction;
|
||||||
he ha;
|
he ha;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,12 +31,12 @@ boundaryField
|
|||||||
}
|
}
|
||||||
upperWall
|
upperWall
|
||||||
{
|
{
|
||||||
type muSgsUSpaldingWallFunction;
|
type mutUSpaldingWallFunction;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
lowerWall
|
lowerWall
|
||||||
{
|
{
|
||||||
type muSgsUSpaldingWallFunction;
|
type mutUSpaldingWallFunction;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
front
|
front
|
||||||
|
|||||||
@ -23,7 +23,7 @@ boundaryField
|
|||||||
{
|
{
|
||||||
ground
|
ground
|
||||||
{
|
{
|
||||||
type alphaSgsWallFunction;
|
type alphatWallFunction;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ boundaryField
|
|||||||
|
|
||||||
"(region0_to.*)"
|
"(region0_to.*)"
|
||||||
{
|
{
|
||||||
type alphaSgsWallFunction;
|
type alphatWallFunction;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ boundaryField
|
|||||||
|
|
||||||
"(region0_to.*)"
|
"(region0_to.*)"
|
||||||
{
|
{
|
||||||
type muSgsUSpaldingWallFunction;
|
type mutUSpaldingWallFunction;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ boundaryField
|
|||||||
}
|
}
|
||||||
wallFilm
|
wallFilm
|
||||||
{
|
{
|
||||||
type htcConvection;
|
type convectiveHeatTransfer;
|
||||||
L 1.0;
|
L 1.0;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user