diff --git a/src/turbulenceModels/compressible/RAS/Make/files b/src/turbulenceModels/compressible/RAS/Make/files
index 524f89b653..e107b6793d 100644
--- a/src/turbulenceModels/compressible/RAS/Make/files
+++ b/src/turbulenceModels/compressible/RAS/Make/files
@@ -9,6 +9,7 @@ LaunderGibsonRSTM/LaunderGibsonRSTM.C
realizableKE/realizableKE.C
SpalartAllmaras/SpalartAllmaras.C
kOmegaSST/kOmegaSST.C
+v2f/v2f.C
/* Wall functions */
wallFunctions = derivedFvPatchFields/wallFunctions
@@ -30,12 +31,20 @@ $(mutWallFunctions)/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.
epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions
$(epsilonWallFunctions)/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
+$(epsilonWallFunctions)/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C
+
+fWallFunctions = $(wallFunctions)/fWallFunctions
+$(fWallFunctions)/fWallFunction/fWallFunctionFvPatchScalarField.C
omegaWallFunctions = $(wallFunctions)/omegaWallFunctions
$(omegaWallFunctions)/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
kqRWallFunctions = $(wallFunctions)/kqRWallFunctions
$(kqRWallFunctions)/kqRWallFunction/kqRWallFunctionFvPatchFields.C
+$(kqRWallFunctions)/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C
+
+v2WallFunctions = $(wallFunctions)/v2WallFunctions
+$(v2WallFunctions)/v2WallFunction/v2WallFunctionFvPatchScalarField.C
/* Patch fields */
derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C
new file mode 100644
index 0000000000..c9d824287d
--- /dev/null
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C
@@ -0,0 +1,208 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "epsilonLowReWallFunctionFvPatchScalarField.H"
+#include "RASModel.H"
+#include "fvPatchFieldMapper.H"
+#include "volFields.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace compressible
+{
+namespace RASModels
+{
+
+// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
+
+scalar epsilonLowReWallFunctionFvPatchScalarField::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;
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+epsilonLowReWallFunctionFvPatchScalarField::
+epsilonLowReWallFunctionFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ epsilonWallFunctionFvPatchScalarField(p, iF),
+ yPlusLam_(yPlusLam(kappa_, E_))
+{}
+
+
+epsilonLowReWallFunctionFvPatchScalarField::
+epsilonLowReWallFunctionFvPatchScalarField
+(
+ const epsilonLowReWallFunctionFvPatchScalarField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ epsilonWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
+ yPlusLam_(ptf.yPlusLam_)
+{}
+
+
+epsilonLowReWallFunctionFvPatchScalarField::
+epsilonLowReWallFunctionFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ epsilonWallFunctionFvPatchScalarField(p, iF, dict),
+ yPlusLam_(yPlusLam(kappa_, E_))
+{}
+
+
+epsilonLowReWallFunctionFvPatchScalarField::
+epsilonLowReWallFunctionFvPatchScalarField
+(
+ const epsilonLowReWallFunctionFvPatchScalarField& ewfpsf
+)
+:
+ epsilonWallFunctionFvPatchScalarField(ewfpsf),
+ yPlusLam_(ewfpsf.yPlusLam_)
+{}
+
+
+epsilonLowReWallFunctionFvPatchScalarField::
+epsilonLowReWallFunctionFvPatchScalarField
+(
+ const epsilonLowReWallFunctionFvPatchScalarField& ewfpsf,
+ const DimensionedField& iF
+)
+:
+ epsilonWallFunctionFvPatchScalarField(ewfpsf, iF),
+ yPlusLam_(ewfpsf.yPlusLam_)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void epsilonLowReWallFunctionFvPatchScalarField::updateCoeffs()
+{
+ if (updated())
+ {
+ return;
+ }
+
+ const label patchI = patch().index();
+
+ const RASModel& rasModel = db().lookupObject("RASProperties");
+ const scalarField& y = rasModel.y()[patchI];
+
+ volScalarField& G =
+ const_cast(db().lookupObject(GName_));
+
+ DimensionedField& epsilon =
+ const_cast&>
+ (
+ dimensionedInternalField()
+ );
+
+ const tmp tk = rasModel.k();
+ const volScalarField& k = tk();
+
+ const tmp tmu = rasModel.mu();
+ const scalarField& muw = tmu().boundaryField()[patchI];
+
+ const tmp tmut = rasModel.mut();
+ const volScalarField& mut = tmut();
+ const scalarField& mutw = mut.boundaryField()[patchI];
+
+ const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
+
+ const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
+ const scalarField magGradUw(mag(Uw.snGrad()));
+
+ const scalar Cmu25 = pow025(Cmu_);
+ const scalar Cmu75 = pow(Cmu_, 0.75);
+
+ // Set epsilon and G
+ forAll(mutw, faceI)
+ {
+ label faceCellI = patch().faceCells()[faceI];
+
+ scalar yPlus = Cmu25*sqrt(k[faceCellI])*y[faceI]/muw[faceI]/rhow[faceI];
+
+ if (yPlus > yPlusLam_)
+ {
+ epsilon[faceCellI] = Cmu75*pow(k[faceCellI], 1.5)/(kappa_*y[faceI]);
+ }
+ else
+ {
+ epsilon[faceCellI] = 2.0*Cmu25*pow(k[faceCellI], 1.5)/y[faceI];
+ }
+
+ G[faceCellI] =
+ (mutw[faceI] + muw[faceI])
+ *magGradUw[faceI]
+ *Cmu25*sqrt(k[faceCellI])
+ /(kappa_*y[faceI]);
+ }
+
+ fixedInternalValueFvPatchField::updateCoeffs();
+
+ // TODO: perform averaging for cells sharing more than one boundary face
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeField
+(
+ fvPatchScalarField,
+ epsilonLowReWallFunctionFvPatchScalarField
+);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace compressible
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H
new file mode 100644
index 0000000000..825adbf2c5
--- /dev/null
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H
@@ -0,0 +1,191 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 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 .
+
+Class
+ Foam::iompressible::RASModels::epsilonLowReWallFunctionFvPatchScalarField
+
+Group
+ grpCmpWallFunctions
+
+Description
+ This boundary condition provides a turbulence dissipation wall function
+ condition for low- and high-Reynolds number turbulent flow cases.
+
+ The condition can be applied to wall boundaries, whereby it inserts near
+ wall epsilon values directly into the epsilon equation to act as a
+ constraint.
+
+ The model operates in two modes, based on the computed laminar-to-turbulent
+ switch-over y+ value derived from kappa and E.
+
+ \heading Patch usage
+
+ \table
+ Property | Description | Required | Default value
+ Cmu | model coefficient | no | 0.09
+ kappa | Von Karman constant | no | 0.41
+ E | model coefficient | no | 9.8
+ \endtable
+
+ Example of the boundary condition specification:
+ \verbatim
+ myPatch
+ {
+ type epsilonLowReWallFunction;
+ }
+ \endverbatim
+
+SeeAlso
+ Foam::epsilonWallFunctionFvPatchScalarField
+
+SourceFiles
+ epsilonLowReWallFunctionFvPatchScalarField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef epsilonLowReWallFunctionFvPatchScalarField_H
+#define epsilonLowReWallFunctionFvPatchScalarField_H
+
+#include "epsilonWallFunctionFvPatchScalarField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace compressible
+{
+namespace RASModels
+{
+
+/*---------------------------------------------------------------------------*\
+ Class epsilonLowReWallFunctionFvPatchScalarField Declaration
+\*---------------------------------------------------------------------------*/
+
+class epsilonLowReWallFunctionFvPatchScalarField
+:
+ public epsilonWallFunctionFvPatchScalarField
+{
+
+protected:
+
+ // Protected data
+
+ //- Y+ at the edge of the laminar sublayer
+ scalar yPlusLam_;
+
+
+ // Protected Member Functions
+
+ //- Calculate the Y+ at the edge of the laminar sublayer
+ scalar yPlusLam(const scalar kappa, const scalar E);
+
+
+public:
+
+ //- Runtime type information
+ TypeName("compressible::epsilonLowReWallFunction");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ epsilonLowReWallFunctionFvPatchScalarField
+ (
+ const fvPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ epsilonLowReWallFunctionFvPatchScalarField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct by mapping given
+ // epsilonLowReWallFunctionFvPatchScalarField
+ // onto a new patch
+ epsilonLowReWallFunctionFvPatchScalarField
+ (
+ const epsilonLowReWallFunctionFvPatchScalarField&,
+ const fvPatch&,
+ const DimensionedField&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ epsilonLowReWallFunctionFvPatchScalarField
+ (
+ const epsilonLowReWallFunctionFvPatchScalarField&
+ );
+
+ //- Construct and return a clone
+ virtual tmp clone() const
+ {
+ return tmp
+ (
+ new epsilonLowReWallFunctionFvPatchScalarField(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ epsilonLowReWallFunctionFvPatchScalarField
+ (
+ const epsilonLowReWallFunctionFvPatchScalarField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp
+ (
+ new epsilonLowReWallFunctionFvPatchScalarField(*this, iF)
+ );
+ }
+
+
+ // Member functions
+
+ // Evaluation functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace compressible
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C
new file mode 100644
index 0000000000..07ea00c1b0
--- /dev/null
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C
@@ -0,0 +1,258 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "fWallFunctionFvPatchScalarField.H"
+#include "RASModel.H"
+#include "fvPatchFieldMapper.H"
+#include "volFields.H"
+#include "wallFvPatch.H"
+#include "v2f.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace compressible
+{
+namespace RASModels
+{
+
+// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
+
+void fWallFunctionFvPatchScalarField::checkType()
+{
+ if (!isA(patch()))
+ {
+ FatalErrorIn("fWallFunctionFvPatchScalarField::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 fWallFunctionFvPatchScalarField::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;
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+fWallFunctionFvPatchScalarField::fWallFunctionFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchField(p, iF),
+ Cmu_(0.09),
+ kappa_(0.41),
+ E_(9.8),
+ yPlusLam_(yPlusLam(kappa_, E_))
+{
+ checkType();
+}
+
+
+fWallFunctionFvPatchScalarField::fWallFunctionFvPatchScalarField
+(
+ const fWallFunctionFvPatchScalarField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ fixedValueFvPatchField(ptf, p, iF, mapper),
+ Cmu_(ptf.Cmu_),
+ kappa_(ptf.kappa_),
+ E_(ptf.E_),
+ yPlusLam_(ptf.yPlusLam_)
+{
+ checkType();
+}
+
+
+fWallFunctionFvPatchScalarField::fWallFunctionFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ fixedValueFvPatchField(p, iF, dict),
+ Cmu_(dict.lookupOrDefault("Cmu", 0.09)),
+ kappa_(dict.lookupOrDefault("kappa", 0.41)),
+ E_(dict.lookupOrDefault("E", 9.8)),
+ yPlusLam_(yPlusLam(kappa_, E_))
+{
+ checkType();
+}
+
+
+fWallFunctionFvPatchScalarField::fWallFunctionFvPatchScalarField
+(
+ const fWallFunctionFvPatchScalarField& v2wfpsf
+)
+:
+ fixedValueFvPatchField(v2wfpsf),
+ Cmu_(v2wfpsf.Cmu_),
+ kappa_(v2wfpsf.kappa_),
+ E_(v2wfpsf.E_),
+ yPlusLam_(v2wfpsf.yPlusLam_)
+{
+ checkType();
+}
+
+
+fWallFunctionFvPatchScalarField::fWallFunctionFvPatchScalarField
+(
+ const fWallFunctionFvPatchScalarField& v2wfpsf,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchField(v2wfpsf, iF),
+ Cmu_(v2wfpsf.Cmu_),
+ kappa_(v2wfpsf.kappa_),
+ E_(v2wfpsf.E_),
+ yPlusLam_(v2wfpsf.yPlusLam_)
+{
+ checkType();
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void fWallFunctionFvPatchScalarField::updateCoeffs()
+{
+ if (updated())
+ {
+ return;
+ }
+
+ const label patchI = patch().index();
+
+ const RASModel& rasModel = db().lookupObject("RASProperties");
+ const v2f& v2fModel = refCast(rasModel);
+
+ const scalarField& y = v2fModel.y()[patchI];
+
+ const tmp tk = v2fModel.k();
+ const volScalarField& k = tk();
+
+ const tmp tepsilon = v2fModel.epsilon();
+ const volScalarField& epsilon = tepsilon();
+
+ const tmp tv2 = v2fModel.v2();
+ const volScalarField& v2 = tv2();
+
+ const tmp tmu = v2fModel.mu();
+ const scalarField& muw = tmu().boundaryField()[patchI];
+
+ const scalarField& rhow = v2fModel.rho().boundaryField()[patchI];
+
+ const scalar Cmu25 = pow025(Cmu_);
+
+ scalarField& f = *this;
+
+ // Set f wall values
+ forAll(f, faceI)
+ {
+ label faceCellI = patch().faceCells()[faceI];
+
+ scalar uTau = Cmu25*sqrt(k[faceCellI]);
+
+ scalar yPlus = uTau*y[faceI]/muw[faceI]/rhow[faceI];
+
+ if (yPlus > yPlusLam_)
+ {
+ scalar N = 6.0;
+ scalar v2c = v2[faceCellI];
+ scalar epsc = epsilon[faceCellI];
+ scalar kc = k[faceCellI];
+
+ f[faceI] = N*v2c*epsc/(sqr(kc) + ROOTVSMALL);
+ f[faceI] /= sqr(uTau) + ROOTVSMALL;
+ }
+ else
+ {
+ f[faceI] = 0.0;
+ }
+ }
+
+ fixedValueFvPatchField::updateCoeffs();
+
+ // TODO: perform averaging for cells sharing more than one boundary face
+}
+
+
+void fWallFunctionFvPatchScalarField::evaluate
+(
+ const Pstream::commsTypes commsType
+)
+{
+ fixedValueFvPatchField::evaluate(commsType);
+}
+
+
+void fWallFunctionFvPatchScalarField::write(Ostream& os) const
+{
+ fixedValueFvPatchField::write(os);
+ os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
+ os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
+ os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
+ writeEntry("value", os);
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeField
+(
+ fvPatchScalarField,
+ fWallFunctionFvPatchScalarField
+);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace compressible
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.H
new file mode 100644
index 0000000000..b78613eeba
--- /dev/null
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.H
@@ -0,0 +1,206 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 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 .
+
+Class
+ Foam::compressible::RASModels::fWallFunctionFvPatchScalarField
+
+Group
+ grpCmpWallFunctions
+
+Description
+ This boundary condition provides a turbulence damping function, f, wall
+ function condition for low- and high Reynolds number, turbulent flow cases
+
+ The model operates in two modes, based on the computed laminar-to-turbulent
+ switch-over y+ value derived from kappa and E.
+
+ \heading Patch usage
+
+ \table
+ Property | Description | Required | Default value
+ Cmu | model coefficient | no | 0.09
+ kappa | Von Karman constant | no | 0.41
+ E | model coefficient | no | 9.8
+ \endtable
+
+ Example of the boundary condition specification:
+ \verbatim
+ myPatch
+ {
+ type fWallFunction;
+ }
+ \endverbatim
+
+SeeAlso
+ Foam::fixedValueFvPatchField
+
+SourceFiles
+ fWallFunctionFvPatchScalarField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef fWallFunctionFvPatchScalarField_H
+#define fWallFunctionFvPatchScalarField_H
+
+#include "fixedValueFvPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace compressible
+{
+namespace RASModels
+{
+
+/*---------------------------------------------------------------------------*\
+ Class fWallFunctionFvPatchScalarField Declaration
+\*---------------------------------------------------------------------------*/
+
+class fWallFunctionFvPatchScalarField
+:
+ public fixedValueFvPatchField
+{
+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
+
+ //- Check the type of the patch
+ virtual void checkType();
+
+ //- Calculate the Y+ at the edge of the laminar sublayer
+ scalar yPlusLam(const scalar kappa, const scalar E);
+
+
+public:
+
+ //- Runtime type information
+ TypeName("compressible::fWallFunction");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ fWallFunctionFvPatchScalarField
+ (
+ const fvPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ fWallFunctionFvPatchScalarField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct by mapping given fWallFunctionFvPatchScalarField
+ // onto a new patch
+ fWallFunctionFvPatchScalarField
+ (
+ const fWallFunctionFvPatchScalarField&,
+ const fvPatch&,
+ const DimensionedField&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ fWallFunctionFvPatchScalarField
+ (
+ const fWallFunctionFvPatchScalarField&
+ );
+
+ //- Construct and return a clone
+ virtual tmp clone() const
+ {
+ return tmp
+ (
+ new fWallFunctionFvPatchScalarField(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ fWallFunctionFvPatchScalarField
+ (
+ const fWallFunctionFvPatchScalarField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp
+ (
+ new fWallFunctionFvPatchScalarField(*this, iF)
+ );
+ }
+
+
+ // Member functions
+
+ // Evaluation functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+
+ //- Evaluate the patchField
+ virtual void evaluate(const Pstream::commsTypes);
+
+
+ // I-O
+
+ //- Write
+ virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace compressible
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C
new file mode 100644
index 0000000000..5f10ea4f22
--- /dev/null
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C
@@ -0,0 +1,257 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "kLowReWallFunctionFvPatchScalarField.H"
+#include "RASModel.H"
+#include "fvPatchFieldMapper.H"
+#include "volFields.H"
+#include "addToRunTimeSelectionTable.H"
+#include "wallFvPatch.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace compressible
+{
+namespace RASModels
+{
+
+// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
+
+void kLowReWallFunctionFvPatchScalarField::checkType()
+{
+ if (!isA(patch()))
+ {
+ FatalErrorIn("kLowReWallFunctionFvPatchScalarField::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);
+ }
+}
+
+
+// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
+
+scalar kLowReWallFunctionFvPatchScalarField::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;
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+kLowReWallFunctionFvPatchScalarField::kLowReWallFunctionFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchField(p, iF),
+ Cmu_(0.09),
+ kappa_(0.41),
+ E_(9.8),
+ Ceps2_(1.9),
+ yPlusLam_(yPlusLam(kappa_, E_))
+{
+ checkType();
+}
+
+
+kLowReWallFunctionFvPatchScalarField::kLowReWallFunctionFvPatchScalarField
+(
+ const kLowReWallFunctionFvPatchScalarField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ fixedValueFvPatchField(ptf, p, iF, mapper),
+ Cmu_(ptf.Cmu_),
+ kappa_(ptf.kappa_),
+ E_(ptf.E_),
+ Ceps2_(ptf.Ceps2_),
+ yPlusLam_(ptf.yPlusLam_)
+{
+ checkType();
+}
+
+
+kLowReWallFunctionFvPatchScalarField::kLowReWallFunctionFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ fixedValueFvPatchField(p, iF, dict),
+ Cmu_(dict.lookupOrDefault("Cmu", 0.09)),
+ kappa_(dict.lookupOrDefault("kappa", 0.41)),
+ E_(dict.lookupOrDefault("E", 9.8)),
+ Ceps2_(dict.lookupOrDefault("Ceps2", 1.9)),
+ yPlusLam_(yPlusLam(kappa_, E_))
+{
+ checkType();
+}
+
+
+kLowReWallFunctionFvPatchScalarField::kLowReWallFunctionFvPatchScalarField
+(
+ const kLowReWallFunctionFvPatchScalarField& kwfpsf
+)
+:
+ fixedValueFvPatchField(kwfpsf),
+ Cmu_(kwfpsf.Cmu_),
+ kappa_(kwfpsf.kappa_),
+ E_(kwfpsf.E_),
+ Ceps2_(kwfpsf.Ceps2_),
+ yPlusLam_(kwfpsf.yPlusLam_)
+{
+ checkType();
+}
+
+
+kLowReWallFunctionFvPatchScalarField::kLowReWallFunctionFvPatchScalarField
+(
+ const kLowReWallFunctionFvPatchScalarField& kwfpsf,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchField(kwfpsf, iF),
+ Cmu_(kwfpsf.Cmu_),
+ kappa_(kwfpsf.kappa_),
+ E_(kwfpsf.E_),
+ Ceps2_(kwfpsf.Ceps2_),
+ yPlusLam_(kwfpsf.yPlusLam_)
+{
+ checkType();
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void kLowReWallFunctionFvPatchScalarField::updateCoeffs()
+{
+ if (updated())
+ {
+ return;
+ }
+
+ const label patchI = patch().index();
+
+ const RASModel& rasModel = db().lookupObject("RASProperties");
+ const scalarField& y = rasModel.y()[patchI];
+
+ const tmp tk = rasModel.k();
+ const volScalarField& k = tk();
+
+ const tmp tmu = rasModel.mu();
+ const scalarField& muw = tmu().boundaryField()[patchI];
+
+ const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
+
+ const scalar Cmu25 = pow025(Cmu_);
+
+ scalarField& kw = *this;
+
+ // Set k wall values
+ forAll(kw, faceI)
+ {
+ label faceCellI = patch().faceCells()[faceI];
+
+ scalar uTau = Cmu25*sqrt(k[faceCellI]);
+
+ scalar yPlus = uTau*y[faceI]/muw[faceI]/rhow[faceI];
+
+ if (yPlus > yPlusLam_)
+ {
+ scalar Ck = -0.416;
+ scalar Bk = 8.366;
+ kw[faceI] = Ck/kappa_*log(yPlus) + Bk;
+ }
+ else
+ {
+ scalar C = 11.0;
+ scalar Cf = (1.0/sqr(yPlus + C) + 2.0*yPlus/pow3(C) - 1.0/sqr(C));
+ kw[faceI] = 2400.0/sqr(Ceps2_)*Cf;
+ }
+
+ kw[faceI] *= sqr(uTau);
+ }
+
+ fixedValueFvPatchField::updateCoeffs();
+
+ // TODO: perform averaging for cells sharing more than one boundary face
+}
+
+
+void kLowReWallFunctionFvPatchScalarField::evaluate
+(
+ const Pstream::commsTypes commsType
+)
+{
+ fixedValueFvPatchField::evaluate(commsType);
+}
+
+
+void kLowReWallFunctionFvPatchScalarField::write(Ostream& os) const
+{
+ fixedValueFvPatchField::write(os);
+ os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
+ os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
+ os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
+ os.writeKeyword("Ceps2") << Ceps2_ << token::END_STATEMENT << nl;
+ writeEntry("value", os);
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeField
+(
+ fvPatchScalarField,
+ kLowReWallFunctionFvPatchScalarField
+);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace compressible
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H
new file mode 100644
index 0000000000..d70f288653
--- /dev/null
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H
@@ -0,0 +1,210 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 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 .
+
+Class
+ Foam::compressible::RASModels::kLowReWallFunctionFvPatchScalarField
+
+Group
+ grpCmpWallFunctions
+
+Description
+ This boundary condition provides a turbulence kinetic energy wall function
+ condition for low- and high-Reynolds number turbulent flow cases.
+
+ The model operates in two modes, based on the computed laminar-to-turbulent
+ switch-over y+ value derived from kappa and E.
+
+ \heading Patch usage
+
+ \table
+ Property | Description | Required | Default value
+ Cmu | model coefficient | no | 0.09
+ kappa | Von Karman constant | no | 0.41
+ E | model coefficient | no | 9.8
+ Ceps2 | model coefficient | no | 1.9
+ \endtable
+
+ Example of the boundary condition specification:
+ \verbatim
+ myPatch
+ {
+ type kLowReWallFunction;
+ }
+ \endverbatim
+
+SeeAlso
+ Foam::fixedValueFvPatchField
+
+SourceFiles
+ kLowReWallFunctionFvPatchScalarField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef kLowReWallFunctionFvPatchScalarField_H
+#define kLowReWallFunctionFvPatchScalarField_H
+
+#include "fixedValueFvPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace compressible
+{
+namespace RASModels
+{
+
+/*---------------------------------------------------------------------------*\
+ Class kLowReWallFunctionFvPatchScalarField Declaration
+\*---------------------------------------------------------------------------*/
+
+class kLowReWallFunctionFvPatchScalarField
+:
+ public fixedValueFvPatchField
+{
+protected:
+
+ // Protected data
+
+ //- Cmu coefficient
+ scalar Cmu_;
+
+ //- Von Karman constant
+ scalar kappa_;
+
+ //- E coefficient
+ scalar E_;
+
+ //- Ceps2 coefficient
+ scalar Ceps2_;
+
+ //- Y+ at the edge of the laminar sublayer
+ scalar yPlusLam_;
+
+
+ // Protected Member Functions
+
+ //- Check the type of the patch
+ virtual void checkType();
+
+ //- Calculate the Y+ at the edge of the laminar sublayer
+ scalar yPlusLam(const scalar kappa, const scalar E);
+
+
+public:
+
+ //- Runtime type information
+ TypeName("compressible::kLowReWallFunction");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ kLowReWallFunctionFvPatchScalarField
+ (
+ const fvPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ kLowReWallFunctionFvPatchScalarField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct by mapping given kLowReWallFunctionFvPatchScalarField
+ // onto a new patch
+ kLowReWallFunctionFvPatchScalarField
+ (
+ const kLowReWallFunctionFvPatchScalarField&,
+ const fvPatch&,
+ const DimensionedField&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ kLowReWallFunctionFvPatchScalarField
+ (
+ const kLowReWallFunctionFvPatchScalarField&
+ );
+
+ //- Construct and return a clone
+ virtual tmp clone() const
+ {
+ return tmp
+ (
+ new kLowReWallFunctionFvPatchScalarField(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ kLowReWallFunctionFvPatchScalarField
+ (
+ const kLowReWallFunctionFvPatchScalarField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp
+ (
+ new kLowReWallFunctionFvPatchScalarField(*this, iF)
+ );
+ }
+
+
+ // Member functions
+
+ // Evaluation functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+
+ //- Evaluate the patchField
+ virtual void evaluate(const Pstream::commsTypes);
+
+
+ // I-O
+
+ //- Write
+ virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace compressible
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C
new file mode 100644
index 0000000000..f7c8643bae
--- /dev/null
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C
@@ -0,0 +1,248 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "v2WallFunctionFvPatchScalarField.H"
+#include "RASModel.H"
+#include "fvPatchFieldMapper.H"
+#include "volFields.H"
+#include "addToRunTimeSelectionTable.H"
+#include "wallFvPatch.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace compressible
+{
+namespace RASModels
+{
+
+// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
+
+void v2WallFunctionFvPatchScalarField::checkType()
+{
+ if (!isA(patch()))
+ {
+ FatalErrorIn("v2WallFunctionFvPatchScalarField::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 v2WallFunctionFvPatchScalarField::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;
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+v2WallFunctionFvPatchScalarField::v2WallFunctionFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchField(p, iF),
+ Cmu_(0.09),
+ kappa_(0.41),
+ E_(9.8),
+ yPlusLam_(yPlusLam(kappa_, E_))
+{
+ checkType();
+}
+
+
+v2WallFunctionFvPatchScalarField::v2WallFunctionFvPatchScalarField
+(
+ const v2WallFunctionFvPatchScalarField& ptf,
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const fvPatchFieldMapper& mapper
+)
+:
+ fixedValueFvPatchField(ptf, p, iF, mapper),
+ Cmu_(ptf.Cmu_),
+ kappa_(ptf.kappa_),
+ E_(ptf.E_),
+ yPlusLam_(ptf.yPlusLam_)
+{
+ checkType();
+}
+
+
+v2WallFunctionFvPatchScalarField::v2WallFunctionFvPatchScalarField
+(
+ const fvPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ fixedValueFvPatchField(p, iF, dict),
+ Cmu_(dict.lookupOrDefault("Cmu", 0.09)),
+ kappa_(dict.lookupOrDefault("kappa", 0.41)),
+ E_(dict.lookupOrDefault("E", 9.8)),
+ yPlusLam_(yPlusLam(kappa_, E_))
+{
+ checkType();
+}
+
+
+v2WallFunctionFvPatchScalarField::v2WallFunctionFvPatchScalarField
+(
+ const v2WallFunctionFvPatchScalarField& v2wfpsf
+)
+:
+ fixedValueFvPatchField(v2wfpsf),
+ Cmu_(v2wfpsf.Cmu_),
+ kappa_(v2wfpsf.kappa_),
+ E_(v2wfpsf.E_),
+ yPlusLam_(v2wfpsf.yPlusLam_)
+{
+ checkType();
+}
+
+
+v2WallFunctionFvPatchScalarField::v2WallFunctionFvPatchScalarField
+(
+ const v2WallFunctionFvPatchScalarField& v2wfpsf,
+ const DimensionedField& iF
+)
+:
+ fixedValueFvPatchField(v2wfpsf, iF),
+ Cmu_(v2wfpsf.Cmu_),
+ kappa_(v2wfpsf.kappa_),
+ E_(v2wfpsf.E_),
+ yPlusLam_(v2wfpsf.yPlusLam_)
+{
+ checkType();
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void v2WallFunctionFvPatchScalarField::updateCoeffs()
+{
+ if (updated())
+ {
+ return;
+ }
+
+ const label patchI = patch().index();
+
+ const RASModel& rasModel = db().lookupObject("RASProperties");
+ const scalarField& y = rasModel.y()[patchI];
+
+ const tmp tk = rasModel.k();
+ const volScalarField& k = tk();
+
+ const tmp tmu = rasModel.mu();
+ const scalarField& muw = tmu().boundaryField()[patchI];
+
+ const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
+
+ const scalar Cmu25 = pow025(Cmu_);
+
+ scalarField& v2 = *this;
+
+ // Set v2 wall values
+ forAll(v2, faceI)
+ {
+ label faceCellI = patch().faceCells()[faceI];
+
+ scalar uTau = Cmu25*sqrt(k[faceCellI]);
+
+ scalar yPlus = uTau*y[faceI]/muw[faceI]/rhow[faceI];
+
+ if (yPlus > yPlusLam_)
+ {
+ scalar Cv2 = 0.193;
+ scalar Bv2 = -0.94;
+ v2[faceI] = Cv2/kappa_*log(yPlus) + Bv2;
+ }
+ else
+ {
+ scalar Cv2 = 0.193;
+ v2[faceI] = Cv2*pow4(yPlus);
+ }
+
+ v2[faceI] *= sqr(uTau);
+ }
+
+ fixedValueFvPatchField::updateCoeffs();
+
+ // TODO: perform averaging for cells sharing more than one boundary face
+}
+
+
+void v2WallFunctionFvPatchScalarField::evaluate
+(
+ const Pstream::commsTypes commsType
+)
+{
+ fixedValueFvPatchField::evaluate(commsType);
+}
+
+
+void v2WallFunctionFvPatchScalarField::write(Ostream& os) const
+{
+ fixedValueFvPatchField::write(os);
+ os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl;
+ os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
+ os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
+ writeEntry("value", os);
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makePatchTypeField
+(
+ fvPatchScalarField,
+ v2WallFunctionFvPatchScalarField
+);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace compressible
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.H
new file mode 100644
index 0000000000..bfedbbddf5
--- /dev/null
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.H
@@ -0,0 +1,208 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 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 .
+
+Class
+ Foam::compressible::RASModels::v2WallFunctionFvPatchScalarField
+
+Group
+ grpCmpWallFunctions
+
+Description
+ This boundary condition provides a turbulence stress normal to streamlines
+ wall function condition for low- and high-Reynolds number, turbulent flow
+ cases.
+
+ The model operates in two modes, based on the computed laminar-to-turbulent
+ switch-over y+ value derived from kappa and E.
+
+
+ \heading Patch usage
+
+ \table
+ Property | Description | Required | Default value
+ Cmu | model coefficient | no | 0.09
+ kappa | Von Karman constant | no | 0.41
+ E | model coefficient | no | 9.8
+ \endtable
+
+ Example of the boundary condition specification:
+ \verbatim
+ myPatch
+ {
+ type v2WallFunction;
+ }
+ \endverbatim
+
+SeeAlso
+ Foam::fixedValueFvPatchField
+
+SourceFiles
+ v2WallFunctionFvPatchScalarField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef v2WallFunctionFvPatchScalarField_H
+#define v2WallFunctionFvPatchScalarField_H
+
+#include "fixedValueFvPatchField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace compressible
+{
+namespace RASModels
+{
+
+/*---------------------------------------------------------------------------*\
+ Class v2WallFunctionFvPatchScalarField Declaration
+\*---------------------------------------------------------------------------*/
+
+class v2WallFunctionFvPatchScalarField
+:
+ public fixedValueFvPatchField
+{
+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
+
+ //- Check the type of the patch
+ virtual void checkType();
+
+ //- Calculate the Y+ at the edge of the laminar sublayer
+ scalar yPlusLam(const scalar kappa, const scalar E);
+
+
+public:
+
+ //- Runtime type information
+ TypeName("compressible::v2WallFunction");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ v2WallFunctionFvPatchScalarField
+ (
+ const fvPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ v2WallFunctionFvPatchScalarField
+ (
+ const fvPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct by mapping given v2WallFunctionFvPatchScalarField
+ // onto a new patch
+ v2WallFunctionFvPatchScalarField
+ (
+ const v2WallFunctionFvPatchScalarField&,
+ const fvPatch&,
+ const DimensionedField&,
+ const fvPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ v2WallFunctionFvPatchScalarField
+ (
+ const v2WallFunctionFvPatchScalarField&
+ );
+
+ //- Construct and return a clone
+ virtual tmp clone() const
+ {
+ return tmp
+ (
+ new v2WallFunctionFvPatchScalarField(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ v2WallFunctionFvPatchScalarField
+ (
+ const v2WallFunctionFvPatchScalarField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp
+ (
+ new v2WallFunctionFvPatchScalarField(*this, iF)
+ );
+ }
+
+
+ // Member functions
+
+ // Evaluation functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+
+ //- Evaluate the patchField
+ virtual void evaluate(const Pstream::commsTypes);
+
+
+ // I-O
+
+ //- Write
+ virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace compressible
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/RAS/v2f/v2f.C b/src/turbulenceModels/compressible/RAS/v2f/v2f.C
new file mode 100644
index 0000000000..fa5c19503e
--- /dev/null
+++ b/src/turbulenceModels/compressible/RAS/v2f/v2f.C
@@ -0,0 +1,490 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "v2f.H"
+#include "fixedValueFvPatchField.H"
+#include "zeroGradientFvPatchField.H"
+#include "addToRunTimeSelectionTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace compressible
+{
+namespace RASModels
+{
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+defineTypeNameAndDebug(v2f, 0);
+addToRunTimeSelectionTable(RASModel, v2f, dictionary);
+
+// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
+
+wordList v2f::RBoundaryTypes() const
+{
+ const volScalarField::GeometricBoundaryField& bf(k_.boundaryField());
+
+ wordList bTypes
+ (
+ bf.size(),
+ zeroGradientFvPatchField::typeName
+ );
+
+ forAll(bf, patchI)
+ {
+ if (bf[patchI].fixesValue())
+ {
+ bTypes[patchI] = fixedValueFvPatchField::typeName;
+ }
+ }
+
+ return bTypes;
+}
+
+
+tmp v2f::davidsonCorrectNut
+(
+ const tmp& value
+) const
+{
+ return min(CmuKEps_*sqr(k_)/epsilon_, value);
+}
+
+
+tmp v2f::Ts() const
+{
+ return max(k_/epsilon_, 6.0*sqrt(mu()/rho_/epsilon_));
+}
+
+
+tmp v2f::Ls() const
+{
+ return
+ CL_*max(pow(k_, 1.5)/epsilon_, Ceta_*pow025(pow3(mu()/rho_)/epsilon_));
+}
+
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+v2f::v2f
+(
+ const volScalarField& rho,
+ const volVectorField& U,
+ const surfaceScalarField& phi,
+ const fluidThermo& thermophysicalModel,
+ const word& turbulenceModelName,
+ const word& modelName
+)
+:
+ RASModel(modelName, rho, U, phi, thermophysicalModel, turbulenceModelName),
+
+ Cmu_
+ (
+ dimensioned::lookupOrAddToDict
+ (
+ "Cmu",
+ coeffDict_,
+ 0.22
+ )
+ ),
+ CmuKEps_
+ (
+ dimensioned::lookupOrAddToDict
+ (
+ "CmuKEps",
+ coeffDict_,
+ 0.09
+ )
+ ),
+ C1_
+ (
+ dimensioned::lookupOrAddToDict
+ (
+ "C1",
+ coeffDict_,
+ 1.4
+ )
+ ),
+ C2_
+ (
+ dimensioned::lookupOrAddToDict
+ (
+ "C2",
+ coeffDict_,
+ 0.3
+ )
+ ),
+ CL_
+ (
+ dimensioned::lookupOrAddToDict
+ (
+ "CL",
+ coeffDict_,
+ 0.23
+ )
+ ),
+ Ceta_
+ (
+ dimensioned::lookupOrAddToDict
+ (
+ "Ceta",
+ coeffDict_,
+ 70.0
+ )
+ ),
+ Ceps2_
+ (
+ dimensioned::lookupOrAddToDict
+ (
+ "Ceps2",
+ coeffDict_,
+ 1.9
+ )
+ ),
+ Ceps3_
+ (
+ dimensioned::lookupOrAddToDict
+ (
+ "Ceps3",
+ coeffDict_,
+ -0.33
+ )
+ ),
+ sigmaK_
+ (
+ dimensioned::lookupOrAddToDict
+ (
+ "sigmaK",
+ coeffDict_,
+ 1.0
+ )
+ ),
+ sigmaEps_
+ (
+ dimensioned::lookupOrAddToDict
+ (
+ "sigmaEps",
+ coeffDict_,
+ 1.3
+ )
+ ),
+ Prt_
+ (
+ dimensioned::lookupOrAddToDict
+ (
+ "Prt",
+ coeffDict_,
+ 1.0
+ )
+ ),
+
+ k_
+ (
+ IOobject
+ (
+ "k",
+ runTime_.timeName(),
+ mesh_,
+ IOobject::MUST_READ,
+ IOobject::AUTO_WRITE
+ ),
+ mesh_
+ ),
+ epsilon_
+ (
+ IOobject
+ (
+ "epsilon",
+ runTime_.timeName(),
+ mesh_,
+ IOobject::MUST_READ,
+ IOobject::AUTO_WRITE
+ ),
+ mesh_
+ ),
+ v2_
+ (
+ IOobject
+ (
+ "v2",
+ runTime_.timeName(),
+ mesh_,
+ IOobject::MUST_READ,
+ IOobject::AUTO_WRITE
+ ),
+ mesh_
+ ),
+ f_
+ (
+ IOobject
+ (
+ "f",
+ runTime_.timeName(),
+ mesh_,
+ IOobject::MUST_READ,
+ IOobject::AUTO_WRITE
+ ),
+ mesh_
+ ),
+ mut_
+ (
+ IOobject
+ (
+ "mut",
+ runTime_.timeName(),
+ mesh_,
+ IOobject::MUST_READ,
+ IOobject::AUTO_WRITE
+ ),
+ mesh_
+ ),
+ alphat_
+ (
+ IOobject
+ (
+ "alphat",
+ runTime_.timeName(),
+ mesh_,
+ IOobject::MUST_READ,
+ IOobject::AUTO_WRITE
+ ),
+ mesh_
+ ),
+ v2Min_(dimensionedScalar("v2Min", v2_.dimensions(), SMALL)),
+ fMin_(dimensionedScalar("fMin", f_.dimensions(), 0.0))
+{
+ bound(k_, kMin_);
+ bound(epsilon_, epsilonMin_);
+ bound(v2_, v2Min_);
+ bound(f_, fMin_);
+
+ mut_ = rho_*davidsonCorrectNut(Cmu_*v2_*Ts());
+ mut_.correctBoundaryConditions();
+
+ alphat_ = mut_/Prt_;
+ alphat_.correctBoundaryConditions();
+
+ printCoeffs();
+}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+tmp v2f::R() const
+{
+ return tmp
+ (
+ new volSymmTensorField
+ (
+ IOobject
+ (
+ "R",
+ runTime_.timeName(),
+ mesh_,
+ IOobject::NO_READ,
+ IOobject::NO_WRITE
+ ),
+ ((2.0/3.0)*I)*k_ - (mut_/rho_)*dev(twoSymm(fvc::grad(U_))),
+ RBoundaryTypes()
+ )
+ );
+}
+
+
+tmp v2f::devRhoReff() const
+{
+ return tmp
+ (
+ new volSymmTensorField
+ (
+ IOobject
+ (
+ "devRhoReff",
+ runTime_.timeName(),
+ mesh_,
+ IOobject::NO_READ,
+ IOobject::NO_WRITE
+ ),
+ -muEff()*dev(twoSymm(fvc::grad(U_)))
+ )
+ );
+}
+
+
+tmp v2f::divDevRhoReff(volVectorField& U) const
+{
+ return
+ (
+ - fvm::laplacian(muEff(), U)
+ - fvc::div(muEff()*dev2(T(fvc::grad(U))))
+ );
+}
+
+
+bool v2f::read()
+{
+ if (RASModel::read())
+ {
+ Cmu_.readIfPresent(coeffDict());
+ CmuKEps_.readIfPresent(coeffDict());
+ C1_.readIfPresent(coeffDict());
+ C2_.readIfPresent(coeffDict());
+ CL_.readIfPresent(coeffDict());
+ Ceta_.readIfPresent(coeffDict());
+ Ceps2_.readIfPresent(coeffDict());
+ sigmaK_.readIfPresent(coeffDict());
+ sigmaEps_.readIfPresent(coeffDict());
+
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
+void v2f::correct()
+{
+ if (!turbulence_)
+ {
+ // Re-calculate viscosity
+ mut_ = rho_*Cmu_*sqr(k_)/epsilon_;
+ mut_.correctBoundaryConditions();
+
+ // Re-calculate thermal diffusivity
+ alphat_ = mut_/Prt_;
+ alphat_.correctBoundaryConditions();
+
+ return;
+ }
+
+ RASModel::correct();
+
+ volScalarField divU(fvc::div(phi_/fvc::interpolate(rho_)));
+
+ if (mesh_.moving())
+ {
+ divU += fvc::div(mesh_.phi());
+ }
+
+ // use N=6 so that f=0 at walls
+ const dimensionedScalar N("N", dimless, 6.0);
+
+ const volTensorField gradU(fvc::grad(U_));
+ const volScalarField S2(2*magSqr(dev(symm(gradU))));
+
+ const volScalarField G("RASModel.G", mut_*S2);
+ const volScalarField T(Ts());
+ const volScalarField L2("v2f.L2", sqr(Ls()));
+ const volScalarField alpha
+ (
+ "v2f::alpha",
+ 1.0/T*((C1_ - N)*v2_ - 2.0/3.0*k_*(C1_ - 1.0))
+ );
+
+ tmp Ceps1 = 1.4*(1.0 + 0.05*min(sqrt(k_/v2_), 100.0));
+
+ // Update epsilon (and possibly G) at the wall
+ epsilon_.boundaryField().updateCoeffs();
+
+ // Dissipation equation
+ tmp epsEqn
+ (
+ fvm::ddt(rho_, epsilon_)
+ + fvm::div(phi_, epsilon_)
+ - fvm::laplacian(DepsilonEff(), epsilon_)
+ ==
+ Ceps1()*G/T
+ - fvm::SuSp(((2.0/3.0)*Ceps1 + Ceps3_)*rho_*divU, epsilon_)
+ - fvm::Sp(Ceps2_*rho_/T, epsilon_)
+ );
+
+ epsEqn().relax();
+
+ epsEqn().boundaryManipulate(epsilon_.boundaryField());
+
+ solve(epsEqn);
+ bound(epsilon_, epsilonMin_);
+
+ // Turbulent kinetic energy equation
+ tmp kEqn
+ (
+ fvm::ddt(rho_, k_)
+ + fvm::div(phi_, k_)
+ - fvm::laplacian(DkEff(), k_)
+ ==
+ G
+ - fvm::SuSp((2.0/3.0)*rho_*divU, k_)
+ - fvm::Sp(rho_*epsilon_/k_, k_)
+ );
+
+ kEqn().relax();
+ solve(kEqn);
+ bound(k_, kMin_);
+
+ // Relaxation function equation
+ tmp fEqn
+ (
+ - fvm::laplacian(rho_, f_)
+ ==
+ - fvm::Sp(rho_/L2, f_)
+ - 1.0/L2/k_*(rho_*alpha - C2_*G)
+ );
+
+ fEqn().relax();
+ solve(fEqn);
+ bound(f_, fMin_);
+
+ // Turbulence stress normal to streamlines equation
+ tmp v2Eqn
+ (
+ fvm::ddt(rho_, v2_)
+ + fvm::div(phi_, v2_)
+ - fvm::laplacian(DkEff(), v2_)
+ ==
+ min(rho_*k_*f_, -rho_*alpha + C2_*G)
+ - fvm::Sp(rho_*N*epsilon_/k_, v2_)
+ );
+
+ v2Eqn().relax();
+ solve(v2Eqn);
+ bound(v2_, v2Min_);
+
+ // Re-calculate viscosity
+ mut_ = rho_*davidsonCorrectNut(Cmu_*v2_*T);
+ mut_.correctBoundaryConditions();
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace compressible
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/turbulenceModels/compressible/RAS/v2f/v2f.H b/src/turbulenceModels/compressible/RAS/v2f/v2f.H
new file mode 100644
index 0000000000..5b68a605d9
--- /dev/null
+++ b/src/turbulenceModels/compressible/RAS/v2f/v2f.H
@@ -0,0 +1,288 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+Class
+ Foam::compressible::RASModels::v2f
+
+Group
+ grpCmpRASTurbulence
+
+Description
+ Lien and Kalitzin's v2-f turbulence model for incompressible flows, with
+ a limit imposed on the turbulent viscosity given by Davidson et al.
+
+ The model solves for turbulence k and epsilon, with additional equations
+ for the turbulence stress normal to streamlines, v2, and elliptic damping
+ function, f. The variant implemented employs N=6, such that f=0 on walls.
+
+ Wall boundary conditions are:
+
+ k = kLowReWallFunction
+ epsilon = epsilonLowReWallFunction
+ v2 = v2WalLFunction
+ f = fWallFunction
+
+ These are applicable to both low- and high-Reynolds number flows.
+
+ Inlet values can be approximated by:
+
+ v2 = 2/3 k
+ f = zero-gradient
+
+
+ References:
+
+ Lien F-S, Kalitzin G, 2001. Computations of transonic flow with the v2-f
+ turbulence model. Int. J. Heat Fluid Flow 22, pp 53-61
+
+ Davidson L, Nielsen P, Sveningsson A, 2003. Modifications of the v2-f
+ model for computing the flow in a 3D wall jet. Turbulence, Heat and Mass
+ Transfer 4, pp 577-584
+
+ The default model coefficients are given as:
+ \verbatim
+ v2fCoeffs
+ {
+ Cmu 0.22;
+ CmuKEps 0.09;
+ C1 1.4;
+ C2 0.3;
+ CL 0.23;
+ Ceta 70;
+ Ceps2 1.9;
+ sigmaEps 1.3;
+ sigmaK 1;
+ }
+ \endverbatim
+
+Note
+ If the kLowReWallFunction is employed, a velocity variant of the turbulent
+ viscosity wall function should be used, e.g. nutUWallFunction. Turbulence
+ k variants (nutk...) for this case will not behave correctly.
+
+SeeAlso
+ Foam::kEpsilon
+ Foam::kLowReWallFunctionFvPatchScalarField
+ Foam::epsilonLowReWallFunctionFvPatchScalarField
+ Foam::v2WallFunctionFvPatchScalarField
+ Foam::fWallFunctionFvPatchScalarField
+
+SourceFiles
+ v2f.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef compressiblev2f_H
+#define compressiblev2f_H
+
+#include "RASModel.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace compressible
+{
+namespace RASModels
+{
+
+/*---------------------------------------------------------------------------*\
+ Class v2f Declaration
+\*---------------------------------------------------------------------------*/
+
+class v2f
+:
+ public RASModel
+{
+
+protected:
+
+ // Protected data
+
+ // Model coefficients
+
+ dimensionedScalar Cmu_;
+ dimensionedScalar CmuKEps_;
+ dimensionedScalar C1_;
+ dimensionedScalar C2_;
+ dimensionedScalar CL_;
+ dimensionedScalar Ceta_;
+ dimensionedScalar Ceps2_;
+ dimensionedScalar Ceps3_;
+ dimensionedScalar sigmaK_;
+ dimensionedScalar sigmaEps_;
+ dimensionedScalar Prt_;
+
+ // Fields
+
+ //- Turbulence kinetic energy
+ volScalarField k_;
+
+ //- Turbulence dissipation
+ volScalarField epsilon_;
+
+ //- Turbulence stress normal to streamlines
+ volScalarField v2_;
+
+ //- Damping function
+ volScalarField f_;
+
+ //- Turbulence viscosity
+ volScalarField mut_;
+
+ //- Turbulence thermal diffusivity
+ volScalarField alphat_;
+
+
+ // Bounding values
+
+ dimensionedScalar v2Min_;
+ dimensionedScalar fMin_;
+
+
+ // Protected Member Functions
+
+ //- Return boundary type names for the R field
+ wordList RBoundaryTypes() const;
+
+ //- Apply Davidson correction to nut
+ tmp davidsonCorrectNut
+ (
+ const tmp& value
+ ) const;
+
+ //- Return time scale, Ts
+ tmp Ts() const;
+
+ //- Return length scale, Ls
+ tmp Ls() const;
+
+
+public:
+
+ //- Runtime type information
+ TypeName("v2f");
+
+ // Constructors
+
+ //- Construct from components
+ v2f
+ (
+ const volScalarField& rho,
+ const volVectorField& U,
+ const surfaceScalarField& phi,
+ const fluidThermo& thermophysicalModel,
+ const word& turbulenceModelName = turbulenceModel::typeName,
+ const word& modelName = typeName
+ );
+
+
+ //- Destructor
+ virtual ~v2f()
+ {}
+
+
+ // Member Functions
+
+ //- Return the effective diffusivity for k
+ tmp DkEff() const
+ {
+ return tmp
+ (
+ new volScalarField("DkEff", mut_/sigmaK_ + mu())
+ );
+ }
+
+ //- Return the effective diffusivity for epsilon
+ tmp DepsilonEff() const
+ {
+ return tmp
+ (
+ new volScalarField("DepsilonEff", mut_/sigmaEps_ + mu())
+ );
+ }
+
+ //- Return the turbulence viscosity
+ virtual tmp mut() const
+ {
+ return mut_;
+ }
+
+ //- Return the turbulence thermal diffusivity
+ virtual tmp alphat() const
+ {
+ return alphat_;
+ }
+
+ //- Return the turbulence kinetic energy
+ virtual tmp k() const
+ {
+ return k_;
+ }
+
+ //- Return the turbulence kinetic energy dissipation rate
+ virtual tmp epsilon() const
+ {
+ return epsilon_;
+ }
+
+ //- Return turbulence stress normal to streamlines
+ virtual tmp v2() const
+ {
+ return v2_;
+ }
+
+ //- Return the damping function
+ virtual tmp f() const
+ {
+ return f_;
+ }
+
+ //- Return the Reynolds stress tensor
+ virtual tmp R() const;
+
+ //- Return the effective stress tensor including the laminar stress
+ virtual tmp devRhoReff() const;
+
+ //- Return the source term for the momentum equation
+ virtual tmp divDevRhoReff(volVectorField& U) const;
+
+ //- Solve the turbulence equations and correct the turbulence viscosity
+ virtual void correct();
+
+ //- Read RASProperties dictionary
+ virtual bool read();
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace RASModels
+} // End namespace compressible
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //