diff --git a/src/TurbulenceModels/incompressible/Make/files b/src/TurbulenceModels/incompressible/Make/files
index 4d4d5729bd..f0800b1a49 100644
--- a/src/TurbulenceModels/incompressible/Make/files
+++ b/src/TurbulenceModels/incompressible/Make/files
@@ -3,7 +3,6 @@ incompressibleTurbulenceModel.C
turbulentTransportModels/turbulentTransportModels.C
turbulentTransportModels/RAS/kOmega/kOmega.C
turbulentTransportModels/RAS/RNGkEpsilon/RNGkEpsilon.C
-turbulentTransportModels/RAS/v2f/v2f.C
turbulentTransportModels/RAS/qZeta/qZeta.C
turbulentTransportModels/RAS/kkLOmega/kkLOmega.C
turbulentTransportModels/RAS/LamBremhorstKE/LamBremhorstKE.C
@@ -13,8 +12,10 @@ turbulentTransportModels/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C
turbulentTransportModels/RAS/nonlinearKEShih/nonlinearKEShih.C
BCs = turbulentTransportModels/RAS/derivedFvPatchFields
+/*
$(BCs)/wallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C
$(BCs)/wallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C
+*/
turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/derivedFvPatchFields/wallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/derivedFvPatchFields/wallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C
deleted file mode 100644
index fa2652446b..0000000000
--- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/derivedFvPatchFields/wallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C
+++ /dev/null
@@ -1,267 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 2012-2015 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 "v2f.H"
-#include "fvPatchFieldMapper.H"
-#include "volFields.H"
-#include "wallFvPatch.H"
-#include "addToRunTimeSelectionTable.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-namespace incompressible
-{
-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);
- }
-}
-
-
-void fWallFunctionFvPatchScalarField::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;
-}
-
-
-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 turbulenceModel& turbulence = db().lookupObject
- (
- IOobject::groupName
- (
- turbulenceModel::propertiesName,
- dimensionedInternalField().group()
- )
- );
- const v2f& v2fModel = refCast(turbulence);
-
- 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 tnuw = turbulence.nu(patchi);
- const scalarField& nuw = tnuw();
-
- 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]/nuw[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
-{
- writeLocalEntries(os);
- fixedValueFvPatchField::write(os);
-}
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-makePatchTypeField
-(
- fvPatchScalarField,
- fWallFunctionFvPatchScalarField
-);
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace RASModels
-} // End namespace incompressible
-} // End namespace Foam
-
-// ************************************************************************* //
diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/derivedFvPatchFields/wallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/derivedFvPatchFields/wallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.H
deleted file mode 100644
index d99d161026..0000000000
--- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/derivedFvPatchFields/wallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.H
+++ /dev/null
@@ -1,209 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 2012-2015 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::RASModels::fWallFunctionFvPatchScalarField
-
-Group
- grpWallFunctions
-
-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 incompressible
-{
-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();
-
- //- Write local wall function variables
- virtual void writeLocalEntries(Ostream&) const;
-
- //- Calculate the Y+ at the edge of the laminar sublayer
- scalar yPlusLam(const scalar kappa, const scalar E);
-
-
-public:
-
- //- Runtime type information
- TypeName("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 incompressible
-} // End namespace Foam
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
-// ************************************************************************* //
diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/derivedFvPatchFields/wallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/derivedFvPatchFields/wallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C
deleted file mode 100644
index c2df8e4a94..0000000000
--- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/derivedFvPatchFields/wallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C
+++ /dev/null
@@ -1,258 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 2012-2015 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 "turbulenceModel.H"
-#include "fvPatchFieldMapper.H"
-#include "volFields.H"
-#include "addToRunTimeSelectionTable.H"
-#include "wallFvPatch.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-namespace incompressible
-{
-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);
- }
-}
-
-
-void v2WallFunctionFvPatchScalarField::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;
-}
-
-
-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 turbulenceModel& turbulence = db().lookupObject
- (
- IOobject::groupName
- (
- turbulenceModel::propertiesName,
- dimensionedInternalField().group()
- )
- );
- const scalarField& y = turbulence.y()[patchi];
-
- const tmp tk = turbulence.k();
- const volScalarField& k = tk();
-
- const tmp tnuw = turbulence.nu(patchi);
- const scalarField& nuw = tnuw();
-
- 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]/nuw[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
-{
- writeLocalEntries(os);
- fixedValueFvPatchField::write(os);
-}
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-makePatchTypeField
-(
- fvPatchScalarField,
- v2WallFunctionFvPatchScalarField
-);
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace RASModels
-} // End namespace incompressible
-} // End namespace Foam
-
-// ************************************************************************* //
diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/derivedFvPatchFields/wallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.H b/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/derivedFvPatchFields/wallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.H
deleted file mode 100644
index e4e8fdafa0..0000000000
--- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/derivedFvPatchFields/wallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.H
+++ /dev/null
@@ -1,211 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 2012-2015 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::RASModels::v2WallFunctionFvPatchScalarField
-
-Group
- grpWallFunctions
-
-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 incompressible
-{
-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();
-
- //- Write local wall function variables
- virtual void writeLocalEntries(Ostream&) const;
-
- //- Calculate the Y+ at the edge of the laminar sublayer
- scalar yPlusLam(const scalar kappa, const scalar E);
-
-
-public:
-
- //- Runtime type information
- TypeName("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 incompressible
-} // End namespace Foam
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
-// ************************************************************************* //
diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
index 46051f0a67..3e5e056ecb 100644
--- a/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
+++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
@@ -203,7 +203,7 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
// Retrieve turbulence properties from model
- const turbulenceModel& turbulence = db().lookupObject
+ const turbulenceModel& turbModel = db().lookupObject
(
IOobject::groupName
(
@@ -213,11 +213,11 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
);
const scalar Cmu25 = pow(Cmu_, 0.25);
- const scalarField& y = turbulence.y()[patchi];
- const tmp tnu = turbulence.nu();
+ const scalarField& y = turbModel.y()[patchi];
+ const tmp tnu = turbModel.nu();
const volScalarField& nu = tnu();
const scalarField& nuw = nu.boundaryField()[patchi];
- const tmp tk = turbulence.k();
+ const tmp tk = turbModel.k();
const volScalarField& k = tk();
const IOdictionary& transportProperties =
diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/turbulentTransportModels.C b/src/TurbulenceModels/incompressible/turbulentTransportModels/turbulentTransportModels.C
index 791ea15db4..6ae16a7864 100644
--- a/src/TurbulenceModels/incompressible/turbulentTransportModels/turbulentTransportModels.C
+++ b/src/TurbulenceModels/incompressible/turbulentTransportModels/turbulentTransportModels.C
@@ -67,6 +67,9 @@ makeRASModel(LaunderSharmaKE);
#include "kOmegaSST.H"
makeRASModel(kOmegaSST);
+#include "v2f.H"
+makeRASModel(v2f);
+
#include "LRR.H"
makeRASModel(LRR);
diff --git a/src/TurbulenceModels/turbulenceModels/Make/files b/src/TurbulenceModels/turbulenceModels/Make/files
index 8fc5627614..1faa13d7db 100644
--- a/src/TurbulenceModels/turbulenceModels/Make/files
+++ b/src/TurbulenceModels/turbulenceModels/Make/files
@@ -52,13 +52,11 @@ kqRWallFunctions = $(wallFunctions)/kqRWallFunctions
$(kqRWallFunctions)/kqRWallFunction/kqRWallFunctionFvPatchFields.C
$(kqRWallFunctions)/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C
-/*
v2WallFunctions = $(wallFunctions)/v2WallFunctions
$(v2WallFunctions)/v2WallFunction/v2WallFunctionFvPatchScalarField.C
fWallFunctions = $(wallFunctions)/fWallFunctions
$(fWallFunctions)/fWallFunction/fWallFunctionFvPatchScalarField.C
-*/
RASBCs = RAS/derivedFvPatchFields
diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
index 666a6fca7c..8a136069e1 100644
--- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
+++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
@@ -126,7 +126,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs()
}
// Lookup Cmu corresponding to the turbulence model selected
- const turbulenceModel& turbulence = db().lookupObject
+ const turbulenceModel& turbModel = db().lookupObject
(
IOobject::groupName
(
@@ -136,7 +136,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs()
);
const scalar Cmu =
- turbulence.coeffDict().lookupOrDefault("Cmu", 0.09);
+ turbModel.coeffDict().lookupOrDefault("Cmu", 0.09);
const scalar Cmu75 = pow(Cmu, 0.75);
diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
index 7db0599d11..4c19cf6a0f 100644
--- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
+++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
@@ -122,7 +122,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs()
}
// Lookup Cmu corresponding to the turbulence model selected
- const turbulenceModel& turbulence = db().lookupObject
+ const turbulenceModel& turbModel = db().lookupObject
(
IOobject::groupName
(
@@ -132,7 +132,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs()
);
const scalar Cmu =
- turbulence.coeffDict().lookupOrDefault("Cmu", 0.09);
+ turbModel.coeffDict().lookupOrDefault("Cmu", 0.09);
const scalar Cmu25 = pow(Cmu, 0.25);
diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/v2f/v2f.C b/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C
similarity index 58%
rename from src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/v2f/v2f.C
rename to src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C
index 5ad4914970..a281ef4fa5 100644
--- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/v2f/v2f.C
+++ b/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C
@@ -27,49 +27,47 @@ License
#include "bound.H"
#include "fixedValueFvPatchField.H"
#include "zeroGradientFvPatchField.H"
-#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
-namespace incompressible
-{
namespace RASModels
{
-// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
-
-defineTypeNameAndDebug(v2f, 0);
-addToRunTimeSelectionTable(RASModel, v2f, dictionary);
-
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-tmp v2f::Ts() const
+template
+tmp v2f::Ts() const
{
- return max(k_/epsilon_, 6.0*sqrt(nu()/epsilon_));
+ return max(k_/epsilon_, 6.0*sqrt(this->nu()/epsilon_));
}
-tmp v2f::Ls() const
+template
+tmp v2f::Ls() const
{
- return CL_*max(pow(k_, 1.5)/epsilon_, Ceta_*pow025(pow3(nu())/epsilon_));
+ return
+ CL_*max(pow(k_, 1.5)
+ /epsilon_, Ceta_*pow025(pow3(this->nu())/epsilon_));
}
-void v2f::correctNut()
+template
+void v2f::correctNut()
{
- nut_ = min(CmuKEps_*sqr(k_)/epsilon_, Cmu_*v2_*Ts());
- nut_.correctBoundaryConditions();
+ this->nut_ = min(CmuKEps_*sqr(k_)/epsilon_, this->Cmu_*v2_*Ts());
+ this->nut_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
-v2f::v2f
+template
+v2f::v2f
(
- const geometricOneField& alpha,
- const geometricOneField& rho,
+ const alphaField& alpha,
+ const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
@@ -78,7 +76,7 @@ v2f::v2f
const word& type
)
:
- eddyViscosity
+ eddyViscosity >
(
type,
alpha,
@@ -89,13 +87,14 @@ v2f::v2f
transport,
propertiesName
),
+ v2fBase(),
Cmu_
(
dimensioned::lookupOrAddToDict
(
"Cmu",
- coeffDict_,
+ this->coeffDict_,
0.22
)
),
@@ -104,7 +103,7 @@ v2f::v2f
dimensioned::lookupOrAddToDict
(
"CmuKEps",
- coeffDict_,
+ this->coeffDict_,
0.09
)
),
@@ -113,7 +112,7 @@ v2f::v2f
dimensioned::lookupOrAddToDict
(
"C1",
- coeffDict_,
+ this->coeffDict_,
1.4
)
),
@@ -122,7 +121,7 @@ v2f::v2f
dimensioned::lookupOrAddToDict
(
"C2",
- coeffDict_,
+ this->coeffDict_,
0.3
)
),
@@ -131,7 +130,7 @@ v2f::v2f
dimensioned::lookupOrAddToDict
(
"CL",
- coeffDict_,
+ this->coeffDict_,
0.23
)
),
@@ -140,7 +139,7 @@ v2f::v2f
dimensioned::lookupOrAddToDict
(
"Ceta",
- coeffDict_,
+ this->coeffDict_,
70.0
)
),
@@ -149,16 +148,25 @@ v2f::v2f
dimensioned::lookupOrAddToDict
(
"Ceps2",
- coeffDict_,
+ this->coeffDict_,
1.9
)
),
+ Ceps3_
+ (
+ dimensioned::lookupOrAddToDict
+ (
+ "Ceps3",
+ this->coeffDict_,
+ -0.33
+ )
+ ),
sigmaK_
(
dimensioned::lookupOrAddToDict
(
"sigmaK",
- coeffDict_,
+ this->coeffDict_,
1.0
)
),
@@ -167,7 +175,7 @@ v2f::v2f
dimensioned::lookupOrAddToDict
(
"sigmaEps",
- coeffDict_,
+ this->coeffDict_,
1.3
)
),
@@ -177,80 +185,82 @@ v2f::v2f
IOobject
(
IOobject::groupName("k", U.group()),
- runTime_.timeName(),
- mesh_,
+ this->runTime_.timeName(),
+ this->mesh_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
- mesh_
+ this->mesh_
),
epsilon_
(
IOobject
(
IOobject::groupName("epsilon", U.group()),
- runTime_.timeName(),
- mesh_,
+ this->runTime_.timeName(),
+ this->mesh_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
- mesh_
+ this->mesh_
),
v2_
(
IOobject
(
IOobject::groupName("v2", U.group()),
- runTime_.timeName(),
- mesh_,
+ this->runTime_.timeName(),
+ this->mesh_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
- mesh_
+ this->mesh_
),
f_
(
IOobject
(
IOobject::groupName("f", U.group()),
- runTime_.timeName(),
- mesh_,
+ this->runTime_.timeName(),
+ this->mesh_,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
- mesh_
+ this->mesh_
),
v2Min_(dimensionedScalar("v2Min", v2_.dimensions(), SMALL)),
fMin_(dimensionedScalar("fMin", f_.dimensions(), 0.0))
{
- bound(k_, kMin_);
- bound(epsilon_, epsilonMin_);
+ bound(k_, this->kMin_);
+ bound(epsilon_, this->epsilonMin_);
bound(v2_, v2Min_);
bound(f_, fMin_);
if (type == typeName)
{
+ this->printCoeffs(type);
correctNut();
- printCoeffs(type);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-bool v2f::read()
+template
+bool v2f::read()
{
- if (eddyViscosity::read())
+ if (eddyViscosity >::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());
+ Cmu_.readIfPresent(this->coeffDict());
+ CmuKEps_.readIfPresent(this->coeffDict());
+ C1_.readIfPresent(this->coeffDict());
+ C2_.readIfPresent(this->coeffDict());
+ CL_.readIfPresent(this->coeffDict());
+ Ceta_.readIfPresent(this->coeffDict());
+ Ceps2_.readIfPresent(this->coeffDict());
+ Ceps3_.readIfPresent(this->coeffDict());
+ sigmaK_.readIfPresent(this->coeffDict());
+ sigmaEps_.readIfPresent(this->coeffDict());
return true;
}
@@ -261,32 +271,45 @@ bool v2f::read()
}
-void v2f::correct()
+template
+void v2f::correct()
{
- eddyViscosity::correct();
-
- if (!turbulence_)
+ if (!this->turbulence_)
{
return;
}
- // use N=6 so that f=0 at walls
+ // Local references
+ const alphaField& alpha = this->alpha_;
+ const rhoField& rho = this->rho_;
+ const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_;
+ const volVectorField& U = this->U_;
+ volScalarField& nut = this->nut_;
+
+ eddyViscosity >::correct();
+
+ volScalarField divU(fvc::div(fvc::absolute(this->phi(), U)));
+
+ // Use N=6 so that f=0 at walls
const dimensionedScalar N("N", dimless, 6.0);
- const volTensorField gradU(fvc::grad(U_));
+ const volTensorField gradU(fvc::grad(U));
const volScalarField S2(2*magSqr(dev(symm(gradU))));
- const volScalarField G(GName(), nut_*S2);
+ const volScalarField G(this->GName(), nut*S2);
const volScalarField T(Ts());
const volScalarField L2(type() + ":L2", sqr(Ls()));
- const volScalarField alpha
+ const volScalarField v2fAlpha
(
- "v2f:alpha",
+ type() + ":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_), scalar(100.0)));
+ const volScalarField Ceps1
+ (
+ "Ceps1",
+ 1.4*(1.0 + 0.05*min(sqrt(k_/v2_), scalar(100.0)))
+ );
// Update epsilon (and possibly G) at the wall
epsilon_.boundaryField().updateCoeffs();
@@ -294,12 +317,13 @@ void v2f::correct()
// Dissipation equation
tmp epsEqn
(
- fvm::ddt(epsilon_)
- + fvm::div(phi_, epsilon_)
- - fvm::laplacian(DepsilonEff(), epsilon_)
+ fvm::ddt(alpha, rho, epsilon_)
+ + fvm::div(alphaRhoPhi, epsilon_)
+ - fvm::laplacian(alpha*rho*DepsilonEff(), epsilon_)
==
- Ceps1*G/T
- - fvm::Sp(Ceps2_/T, epsilon_)
+ Ceps1*alpha*rho*G/T
+ - fvm::SuSp(((2.0/3.0)*Ceps1 + Ceps3_)*alpha*rho*divU, epsilon_)
+ - fvm::Sp(Ceps2_*alpha*rho/T, epsilon_)
);
epsEqn().relax();
@@ -307,23 +331,24 @@ void v2f::correct()
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn);
- bound(epsilon_, epsilonMin_);
+ bound(epsilon_, this->epsilonMin_);
// Turbulent kinetic energy equation
tmp kEqn
(
- fvm::ddt(k_)
- + fvm::div(phi_, k_)
- - fvm::laplacian(DkEff(), k_)
+ fvm::ddt(alpha, rho, k_)
+ + fvm::div(alphaRhoPhi, k_)
+ - fvm::laplacian(alpha*rho*DkEff(), k_)
==
- G
- - fvm::Sp(epsilon_/k_, k_)
+ alpha*rho*G
+ - fvm::SuSp((2.0/3.0)*alpha*rho*divU, k_)
+ - fvm::Sp(alpha*rho*epsilon_/k_, k_)
);
kEqn().relax();
solve(kEqn);
- bound(k_, kMin_);
+ bound(k_, this->kMin_);
// Relaxation function equation
@@ -332,7 +357,7 @@ void v2f::correct()
- fvm::laplacian(f_)
==
- fvm::Sp(1.0/L2, f_)
- - 1.0/L2/k_*(alpha - C2_*G)
+ - 1.0/L2/k_*(v2fAlpha - C2_*G)
);
fEqn().relax();
@@ -343,12 +368,12 @@ void v2f::correct()
// Turbulence stress normal to streamlines equation
tmp v2Eqn
(
- fvm::ddt(v2_)
- + fvm::div(phi_, v2_)
- - fvm::laplacian(DkEff(), v2_)
+ fvm::ddt(alpha, rho, v2_)
+ + fvm::div(alphaRhoPhi, v2_)
+ - fvm::laplacian(alpha*rho*DkEff(), v2_)
==
- min(k_*f_, -alpha + C2_*G)
- - fvm::Sp(N*epsilon_/k_, v2_)
+ alpha*rho*min(k_*f_, C2_*G - v2fAlpha)
+ - fvm::Sp(N*alpha*rho*epsilon_/k_, v2_)
);
v2Eqn().relax();
@@ -362,7 +387,6 @@ void v2f::correct()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
-} // End namespace incompressible
} // End namespace Foam
// ************************************************************************* //
diff --git a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/v2f/v2f.H b/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.H
similarity index 81%
rename from src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/v2f/v2f.H
rename to src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.H
index 631f548b49..9ce1dca854 100644
--- a/src/TurbulenceModels/incompressible/turbulentTransportModels/RAS/v2f/v2f.H
+++ b/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.H
@@ -22,14 +22,15 @@ License
along with OpenFOAM. If not, see .
Class
- Foam::incompressible::RASModels::v2f
+ Foam::RASModels::v2f
Group
- grpIcoRASTurbulence
+ grpRASTurbulence
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.
+ Lien and Kalitzin's v2-f turbulence model for incompressible and
+ compressible flows, with a limit imposed on the turbulent viscosity given
+ by Davidson et al.
The model solves for turbulence kinetic energy k and turbulence dissipation
rate epsilon, with additional equations for the turbulence stress normal to
@@ -74,6 +75,7 @@ Description
CL 0.23;
Ceta 70;
Ceps2 1.9;
+ Ceps3 -0.33;
sigmaEps 1.3;
sigmaK 1;
}
@@ -99,15 +101,13 @@ SourceFiles
#ifndef v2f_H
#define v2f_H
-#include "turbulentTransportModel.H"
+#include "RASModel.H"
#include "eddyViscosity.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
-namespace incompressible
-{
namespace RASModels
{
@@ -115,9 +115,40 @@ namespace RASModels
Class v2f Declaration
\*---------------------------------------------------------------------------*/
+class v2fBase
+{
+public:
+
+ //- Runtime type information
+ TypeName("v2fBase");
+
+
+ // Constructors
+
+ v2fBase()
+ {}
+
+
+ //- Destructor
+ virtual ~v2fBase()
+ {}
+
+
+ // Member Functions
+
+ //- Return turbulence stress normal to streamlines
+ virtual tmp v2() const = 0;
+
+ //- Return the damping function
+ virtual tmp f() const = 0;
+};
+
+
+template
class v2f
:
- public eddyViscosity
+ public eddyViscosity >,
+ public v2fBase
{
protected:
@@ -133,6 +164,7 @@ protected:
dimensionedScalar CL_;
dimensionedScalar Ceta_;
dimensionedScalar Ceps2_;
+ dimensionedScalar Ceps3_;
dimensionedScalar sigmaK_;
dimensionedScalar sigmaEps_;
@@ -171,16 +203,22 @@ protected:
public:
+ typedef typename BasicTurbulenceModel::alphaField alphaField;
+ typedef typename BasicTurbulenceModel::rhoField rhoField;
+ typedef typename BasicTurbulenceModel::transportModel transportModel;
+
+
//- Runtime type information
TypeName("v2f");
+
// Constructors
//- Construct from components
v2f
(
- const geometricOneField& alpha,
- const geometricOneField& rho,
+ const alphaField& alpha,
+ const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
@@ -205,7 +243,11 @@ public:
{
return tmp
(
- new volScalarField("DkEff", nut_/sigmaK_ + nu())
+ new volScalarField
+ (
+ "DkEff",
+ this->nut_/sigmaK_ + this->nu()
+ )
);
}
@@ -214,7 +256,11 @@ public:
{
return tmp
(
- new volScalarField("DepsilonEff", nut_/sigmaEps_ + nu())
+ new volScalarField
+ (
+ "DepsilonEff",
+ this->nut_/sigmaEps_ + this->nu()
+ )
);
}
@@ -250,11 +296,16 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
-} // End namespace incompressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+#ifdef NoRepository
+# include "v2f.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
#endif
// ************************************************************************* //
diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C
index 5ff91831f3..c5c31269eb 100644
--- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C
+++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C
@@ -37,6 +37,8 @@ namespace Foam
namespace RASModels
{
+ defineTypeNameAndDebug(v2fBase, 0);
+
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void fWallFunctionFvPatchScalarField::checkType()
@@ -173,7 +175,7 @@ void fWallFunctionFvPatchScalarField::updateCoeffs()
const label patchi = patch().index();
- const turbulenceModel& turbulence = db().lookupObject
+ const turbulenceModel& turbModel = db().lookupObject
(
IOobject::groupName
(
@@ -181,20 +183,20 @@ void fWallFunctionFvPatchScalarField::updateCoeffs()
dimensionedInternalField().group()
)
);
- const v2f& v2fModel = refCast(turbulence);
+ const v2fBase& v2fModel = refCast(turbModel);
- const scalarField& y = v2fModel.y()[patchi];
+ const scalarField& y = turbModel.y()[patchi];
- const tmp tk = v2fModel.k();
+ const tmp tk = turbModel.k();
const volScalarField& k = tk();
- const tmp tepsilon = v2fModel.epsilon();
+ const tmp tepsilon = turbModel.epsilon();
const volScalarField& epsilon = tepsilon();
const tmp tv2 = v2fModel.v2();
const volScalarField& v2 = tv2();
- const tmp tnuw = turbulence.nu(patchi);
+ const tmp tnuw = turbModel.nu(patchi);
const scalarField& nuw = tnuw();
const scalar Cmu25 = pow025(Cmu_);
diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C
index f6a16def4b..8749bc02a4 100644
--- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C
+++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C
@@ -170,7 +170,7 @@ void kLowReWallFunctionFvPatchScalarField::updateCoeffs()
const label patchi = patch().index();
- const turbulenceModel& turbulence = db().lookupObject
+ const turbulenceModel& turbModel = db().lookupObject
(
IOobject::groupName
(
@@ -178,12 +178,12 @@ void kLowReWallFunctionFvPatchScalarField::updateCoeffs()
dimensionedInternalField().group()
)
);
- const scalarField& y = turbulence.y()[patchi];
+ const scalarField& y = turbModel.y()[patchi];
- const tmp tk = turbulence.k();
+ const tmp tk = turbModel.k();
const volScalarField& k = tk();
- const tmp tnuw = turbulence.nu(patchi);
+ const tmp tnuw = turbModel.nu(patchi);
const scalarField& nuw = tnuw();
const scalar Cmu25 = pow025(Cmu_);
diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C
index 174b2a2bc8..9392408888 100644
--- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C
+++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C
@@ -40,7 +40,7 @@ tmp nutkAtmRoughWallFunctionFvPatchScalarField::calcNut() const
{
const label patchi = patch().index();
- const turbulenceModel& turbulence = db().lookupObject
+ const turbulenceModel& turbModel = db().lookupObject
(
IOobject::groupName
(
@@ -48,10 +48,10 @@ tmp nutkAtmRoughWallFunctionFvPatchScalarField::calcNut() const
dimensionedInternalField().group()
)
);
- const scalarField& y = turbulence.y()[patchi];
- const tmp tk = turbulence.k();
+ const scalarField& y = turbModel.y()[patchi];
+ const tmp tk = turbModel.k();
const volScalarField& k = tk();
- const tmp tnuw = turbulence.nu(patchi);
+ const tmp tnuw = turbModel.nu(patchi);
const scalarField& nuw = tnuw();
const scalar Cmu25 = pow025(Cmu_);
diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
index 05b659f051..da6130662a 100644
--- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
+++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
@@ -173,7 +173,7 @@ omegaWallFunctionFvPatchScalarField::omegaPatch(const label patchi)
void omegaWallFunctionFvPatchScalarField::calculateTurbulenceFields
(
- const turbulenceModel& turbulence,
+ const turbulenceModel& turbModel,
scalarField& G0,
scalarField& omega0
)
@@ -187,7 +187,7 @@ void omegaWallFunctionFvPatchScalarField::calculateTurbulenceFields
const List& w = cornerWeights_[patchi];
- opf.calculate(turbulence, w, opf.patch(), G0, omega0);
+ opf.calculate(turbModel, w, opf.patch(), G0, omega0);
}
}
@@ -206,7 +206,7 @@ void omegaWallFunctionFvPatchScalarField::calculateTurbulenceFields
void omegaWallFunctionFvPatchScalarField::calculate
(
- const turbulenceModel& turbulence,
+ const turbulenceModel& turbModel,
const List& cornerWeights,
const fvPatch& patch,
scalarField& G,
@@ -215,20 +215,20 @@ void omegaWallFunctionFvPatchScalarField::calculate
{
const label patchi = patch.index();
- const scalarField& y = turbulence.y()[patchi];
+ const scalarField& y = turbModel.y()[patchi];
const scalar Cmu25 = pow025(Cmu_);
- const tmp tk = turbulence.k();
+ const tmp tk = turbModel.k();
const volScalarField& k = tk();
- const tmp tnuw = turbulence.nu(patchi);
+ const tmp tnuw = turbModel.nu(patchi);
const scalarField& nuw = tnuw();
- const tmp tnutw = turbulence.nut(patchi);
+ const tmp tnutw = turbModel.nut(patchi);
const scalarField& nutw = tnutw();
- const fvPatchVectorField& Uw = turbulence.U().boundaryField()[patchi];
+ const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
const scalarField magGradUw(mag(Uw.snGrad()));
@@ -413,7 +413,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
return;
}
- const turbulenceModel& turbulence = db().lookupObject
+ const turbulenceModel& turbModel = db().lookupObject
(
IOobject::groupName
(
@@ -427,7 +427,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
if (patch().index() == master_)
{
createAveragingWeights();
- calculateTurbulenceFields(turbulence, G(true), omega(true));
+ calculateTurbulenceFields(turbModel, G(true), omega(true));
}
const scalarField& G0 = this->G();
@@ -438,7 +438,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs()
FieldType& G =
const_cast
(
- db().lookupObject(turbulence.GName())
+ db().lookupObject(turbModel.GName())
);
FieldType& omega = const_cast(dimensionedInternalField());
@@ -465,7 +465,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs
return;
}
- const turbulenceModel& turbulence = db().lookupObject
+ const turbulenceModel& turbModel = db().lookupObject
(
IOobject::groupName
(
@@ -479,7 +479,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs
if (patch().index() == master_)
{
createAveragingWeights();
- calculateTurbulenceFields(turbulence, G(true), omega(true));
+ calculateTurbulenceFields(turbModel, G(true), omega(true));
}
const scalarField& G0 = this->G();
@@ -490,7 +490,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs
FieldType& G =
const_cast
(
- db().lookupObject(turbulence.GName())
+ db().lookupObject(turbModel.GName())
);
FieldType& omega = const_cast(dimensionedInternalField());
diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C
index ce40a41ae6..5351ea669a 100644
--- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C
+++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C
@@ -173,7 +173,7 @@ void v2WallFunctionFvPatchScalarField::updateCoeffs()
const label patchi = patch().index();
- const turbulenceModel& turbulence = db().lookupObject
+ const turbulenceModel& turbModel = db().lookupObject
(
IOobject::groupName
(
@@ -181,12 +181,12 @@ void v2WallFunctionFvPatchScalarField::updateCoeffs()
dimensionedInternalField().group()
)
);
- const scalarField& y = turbulence.y()[patchi];
+ const scalarField& y = turbModel.y()[patchi];
- const tmp tk = turbulence.k();
+ const tmp tk = turbModel.k();
const volScalarField& k = tk();
- const tmp tnuw = turbulence.nu(patchi);
+ const tmp tnuw = turbModel.nu(patchi);
const scalarField& nuw = tnuw();
const scalar Cmu25 = pow025(Cmu_);