diff --git a/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutStandardRoughWallFunction/nutStandardRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutStandardRoughWallFunction/nutStandardRoughWallFunctionFvPatchScalarField.C deleted file mode 100644 index cf74e31813..0000000000 --- a/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutStandardRoughWallFunction/nutStandardRoughWallFunctionFvPatchScalarField.C +++ /dev/null @@ -1,300 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ 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 2 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, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "nutStandardRoughWallFunctionFvPatchScalarField.H" -#include "RASModel.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace incompressible -{ -namespace RASModels -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -nutStandardRoughWallFunctionFvPatchScalarField:: -nutStandardRoughWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedValueFvPatchScalarField(p, iF), - roughnessHeight_(pTraits::zero), - roughnessConstant_(pTraits::zero), - roughnessFudgeFactor_(pTraits::zero) -{} - - -nutStandardRoughWallFunctionFvPatchScalarField:: -nutStandardRoughWallFunctionFvPatchScalarField -( - const nutStandardRoughWallFunctionFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchScalarField(ptf, p, iF, mapper), - roughnessHeight_(ptf.roughnessHeight_), - roughnessConstant_(ptf.roughnessConstant_), - roughnessFudgeFactor_(ptf.roughnessFudgeFactor_) -{} - - -nutStandardRoughWallFunctionFvPatchScalarField:: -nutStandardRoughWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedValueFvPatchScalarField(p, iF, dict), - roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))), - roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))), - roughnessFudgeFactor_(readScalar(dict.lookup("roughnessFudgeFactor"))) -{} - - -nutStandardRoughWallFunctionFvPatchScalarField:: -nutStandardRoughWallFunctionFvPatchScalarField -( - const nutStandardRoughWallFunctionFvPatchScalarField& tppsf -) -: - fixedValueFvPatchScalarField(tppsf), - roughnessHeight_(tppsf.roughnessHeight_), - roughnessConstant_(tppsf.roughnessConstant_), - roughnessFudgeFactor_(tppsf.roughnessFudgeFactor_) -{} - - -nutStandardRoughWallFunctionFvPatchScalarField:: -nutStandardRoughWallFunctionFvPatchScalarField -( - const nutStandardRoughWallFunctionFvPatchScalarField& tppsf, - const DimensionedField& iF -) -: - fixedValueFvPatchScalarField(tppsf, iF), - roughnessHeight_(tppsf.roughnessHeight_), - roughnessConstant_(tppsf.roughnessConstant_), - roughnessFudgeFactor_(tppsf.roughnessFudgeFactor_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void nutStandardRoughWallFunctionFvPatchScalarField::evaluate -( - const Pstream::commsTypes -) -{ - const RASModel& rasModel - = db().lookupObject("RASProperties"); - - const scalar kappa = rasModel.kappa().value(); - const scalar E = rasModel.E().value(); - const scalar yPlusLam = 11.225; - - // The reciprical of the distance to the adjacent cell centre. - const scalarField& ry = patch().deltaCoeffs(); - - const fvPatchVectorField& U = - patch().lookupPatchField("U"); - - // The flow velocity at the adjacent cell centre. - scalarField magUp = mag(U.patchInternalField() - U); - - const scalarField& nuw = - patch().lookupPatchField("nu"); - scalarField& nutw = *this; - - scalarField magFaceGradU = mag(U.snGrad()); - - if(roughnessHeight_ > 0.0) - { - // Rough Walls. - const scalar c_1 = 1/(90 - 2.25) + roughnessConstant_; - static const scalar c_2 = 2.25/(90 - 2.25); - static const scalar c_3 = 2.0*atan(1.0)/log(90/2.25); - static const scalar c_4 = c_3*log(2.25); - - //if (KsPlusBasedOnYPlus_) - { - // If KsPlus is based on YPlus the extra term added to the law - // of the wall will depend on yPlus. - forAll(nutw, facei) - { - const scalar magUpara = magUp[facei]; - const scalar Re = magUpara/(nuw[facei]*ry[facei]); - const scalar kappaRe = kappa*Re; - - scalar yPlus = yPlusLam; - const scalar ryPlusLam = 1.0/yPlus; - - int iter = 0; - scalar yPlusLast = 0.0; - scalar dKsPlusdYPlus = roughnessHeight_*ry[facei]; - - // Enforce the roughnessHeight to be less than the distance to - // the first cell centre. - if(dKsPlusdYPlus > 1) - { - dKsPlusdYPlus = 1; - } - - // Fudge factor to get results to be similar to fluent - // (at least difference between rough and smooth). - dKsPlusdYPlus *= roughnessFudgeFactor_; - - do - { - yPlusLast = yPlus; - - // The non-dimensional roughness height. - scalar KsPlus = yPlus*dKsPlusdYPlus; - - // The extra term in the law-of-the-wall. - scalar G = 0.0; - - scalar yPlusGPrime = 0.0; - - if (KsPlus >= 90) - { - const scalar t_1 = 1 + roughnessConstant_*KsPlus; - G = log(t_1); - yPlusGPrime = roughnessConstant_*KsPlus/t_1; - } - else if (KsPlus > 2.25) - { - const scalar t_1 = c_1*KsPlus - c_2; - const scalar t_2 = c_3*log(KsPlus) - c_4; - const scalar sint_2 = sin(t_2); - const scalar logt_1 = log(t_1); - G = logt_1*sint_2; - yPlusGPrime = - (c_1*sint_2*KsPlus/t_1) + (c_3*logt_1*cos(t_2)); - } - - scalar denom = 1.0 + log(E* yPlus) - G - yPlusGPrime; - if(mag(denom) > VSMALL) - { - yPlus = (kappaRe + yPlus*(1 - yPlusGPrime))/denom; - } - else - { - // Ensure immediate end and nutw = 0. - yPlus = 0; - } - - } while - ( - mag(ryPlusLam*(yPlus - yPlusLast)) > 0.0001 - && ++iter < 10 - && yPlus > VSMALL - ); - - if (yPlus > yPlusLam) - { - nutw[facei] = nuw[facei]*(yPlus*yPlus/Re - 1); - } - else - { - nutw[facei] = 0.0; - } - } - } - } - else - { - // Smooth Walls. - forAll(nutw, facei) - { - const scalar magUpara = magUp[facei]; - const scalar Re = magUpara/(nuw[facei]*ry[facei]); - const scalar kappaRe = kappa*Re; - - scalar yPlus = yPlusLam; - const scalar ryPlusLam = 1.0/yPlus; - - int iter = 0; - scalar yPlusLast = 0.0; - - do - { - yPlusLast = yPlus; - yPlus = (kappaRe + yPlus)/(1.0 + log(E*yPlus)); - - } while(mag(ryPlusLam*(yPlus - yPlusLast)) > 0.0001 && ++iter < 10); - - if (yPlus > yPlusLam) - { - nutw[facei] = nuw[facei]*(yPlus*yPlus/Re - 1); - } - else - { - nutw[facei] = 0.0; - } - } - } -} - - -void nutStandardRoughWallFunctionFvPatchScalarField::write(Ostream& os) const -{ - fixedValueFvPatchScalarField::write(os); - os.writeKeyword("roughnessHeight") - << roughnessHeight_ << token::END_STATEMENT << nl; - os.writeKeyword("roughnessConstant") - << roughnessConstant_ << token::END_STATEMENT << nl; - os.writeKeyword("roughnessFudgeFactor") - << roughnessFudgeFactor_ << token::END_STATEMENT << nl; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField -( - fvPatchScalarField, - nutStandardRoughWallFunctionFvPatchScalarField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace incompressible -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutStandardRoughWallFunction/nutStandardRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutStandardRoughWallFunction/nutStandardRoughWallFunctionFvPatchScalarField.H deleted file mode 100644 index df3007b10f..0000000000 --- a/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutStandardRoughWallFunction/nutStandardRoughWallFunctionFvPatchScalarField.H +++ /dev/null @@ -1,200 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ 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 2 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, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Class - Foam::incompressible::RASModels::nutStandardRoughWallFunctionFvPatchScalarField - -Description - Wall function boundary condition for rough walls - -SourceFiles - nutStandardWallFunctionFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef nutStandardRoughWallFunctionFvPatchScalarField_H -#define nutStandardRoughWallFunctionFvPatchScalarField_H - -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace incompressible -{ -namespace RASModels -{ - -/*---------------------------------------------------------------------------*\ - Class nutWallFunctionFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class nutStandardRoughWallFunctionFvPatchScalarField -: - public fixedValueFvPatchScalarField -{ - // Private data - - scalar roughnessHeight_; - scalar roughnessConstant_; - scalar roughnessFudgeFactor_; - - -public: - - //- Runtime type information - TypeName("nutStandardRoughWallFunction"); - - - // Constructors - - //- Construct from patch and internal field - nutStandardRoughWallFunctionFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - nutStandardRoughWallFunctionFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given - // nutStandardRoughWallFunctionFvPatchScalarField - // onto a new patch - nutStandardRoughWallFunctionFvPatchScalarField - ( - const nutStandardRoughWallFunctionFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - nutStandardRoughWallFunctionFvPatchScalarField - ( - const nutStandardRoughWallFunctionFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new nutStandardRoughWallFunctionFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - nutStandardRoughWallFunctionFvPatchScalarField - ( - const nutStandardRoughWallFunctionFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new nutStandardRoughWallFunctionFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - // Access - - //- Return the fluctuation scale - const scalar& roughnessHeight() const - { - return roughnessHeight_; - } - - //- Return reference to the fluctuation scale to allow adjustment - scalar& roughnessHeight() - { - return roughnessHeight_; - } - - - //- Return the fluctuation scale - const scalar& roughnessConstant() const - { - return roughnessConstant_; - } - - //- Return reference to the fluctuation scale to allow adjustment - scalar& roughnessConstant() - { - return roughnessConstant_; - } - - //- Return the fluctuation scale - const scalar& roughnessFudgeFactor() const - { - return roughnessFudgeFactor_; - } - - //- Return reference to the fluctuation scale to allow adjustment - scalar& roughnessFudgeFactor() - { - return roughnessFudgeFactor_; - } - - - // Evaluation functions - - //- Evaluate the patchField - virtual void evaluate - ( - const Pstream::commsTypes commsType=Pstream::blocking - ); - - - //- Write - virtual void write(Ostream& os) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace incompressible -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutStandardWallFunction/nutStandardWallFunctionFvPatchScalarField.C b/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutStandardWallFunction/nutStandardWallFunctionFvPatchScalarField.C deleted file mode 100644 index ddbb424255..0000000000 --- a/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutStandardWallFunction/nutStandardWallFunctionFvPatchScalarField.C +++ /dev/null @@ -1,169 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ 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 2 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, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "nutStandardWallFunctionFvPatchScalarField.H" -#include "RASModel.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace incompressible -{ -namespace RASModels -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -nutStandardWallFunctionFvPatchScalarField:: -nutStandardWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedValueFvPatchScalarField(p, iF) -{} - - -nutStandardWallFunctionFvPatchScalarField:: -nutStandardWallFunctionFvPatchScalarField -( - const nutStandardWallFunctionFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchScalarField(ptf, p, iF, mapper) -{} - - -nutStandardWallFunctionFvPatchScalarField:: -nutStandardWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedValueFvPatchScalarField(p, iF, dict) -{} - - -nutStandardWallFunctionFvPatchScalarField:: -nutStandardWallFunctionFvPatchScalarField -( - const nutStandardWallFunctionFvPatchScalarField& tppsf -) -: - fixedValueFvPatchScalarField(tppsf) -{} - - -nutStandardWallFunctionFvPatchScalarField:: -nutStandardWallFunctionFvPatchScalarField -( - const nutStandardWallFunctionFvPatchScalarField& tppsf, - const DimensionedField& iF -) -: - fixedValueFvPatchScalarField(tppsf, iF) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void nutStandardWallFunctionFvPatchScalarField::evaluate -( - const Pstream::commsTypes -) -{ - const RASModel& rasModel - = db().lookupObject("RASProperties"); - - scalar kappa = rasModel.kappa().value(); - scalar E = rasModel.E().value(); - scalar yPlusLam = rasModel.yPlusLam(); - - const scalarField& ry = patch().deltaCoeffs(); - - const fvPatchVectorField& U = - patch().lookupPatchField("U"); - - scalarField magUp = mag(U.patchInternalField() - U); - - const scalarField& nuw = - patch().lookupPatchField("nu"); - scalarField& nutw = *this; - - scalarField magFaceGradU = mag(U.snGrad()); - - forAll(nutw, facei) - { - scalar magUpara = magUp[facei]; - - scalar kappaRe = kappa*magUpara/(nuw[facei]*ry[facei]); - - scalar yPlus = yPlusLam; - scalar ryPlusLam = 1.0/yPlus; - - int iter = 0; - scalar yPlusLast = 0.0; - - do - { - yPlusLast = yPlus; - yPlus = (kappaRe + yPlus)/(1.0 + log(E*yPlus)); - - } while(mag(ryPlusLam*(yPlus - yPlusLast)) > 0.01 && ++iter < 10 ); - - if (yPlus > yPlusLam) - { - nutw[facei] = nuw[facei]*(yPlus*kappa/log(E*yPlus) - 1); - } - else - { - nutw[facei] = 0.0; - } - } -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField(fvPatchScalarField, nutStandardWallFunctionFvPatchScalarField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace incompressible -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutStandardWallFunction/nutStandardWallFunctionFvPatchScalarField.H b/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutStandardWallFunction/nutStandardWallFunctionFvPatchScalarField.H deleted file mode 100644 index f4042e7f5f..0000000000 --- a/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutStandardWallFunction/nutStandardWallFunctionFvPatchScalarField.H +++ /dev/null @@ -1,151 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ 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 2 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, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Class - Foam::incompressible::RASModels::nutStandardWallFunctionFvPatchScalarField - -Description - Wall function boundary condition for walls - -SourceFiles - nutStandardWallFunctionFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef nutStandardWallFunctionFvPatchScalarField_H -#define nutStandardWallFunctionFvPatchScalarField_H - -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace incompressible -{ -namespace RASModels -{ - -/*---------------------------------------------------------------------------*\ - Class nutWallFunctionFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class nutStandardWallFunctionFvPatchScalarField -: - public fixedValueFvPatchScalarField -{ - // Private data - - -public: - - //- Runtime type information - TypeName("nutStandardWallFunction"); - - - // Constructors - - //- Construct from patch and internal field - nutStandardWallFunctionFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - nutStandardWallFunctionFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given nutStandardWallFunctionFvPatchScalarField - // onto a new patch - nutStandardWallFunctionFvPatchScalarField - ( - const nutStandardWallFunctionFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - nutStandardWallFunctionFvPatchScalarField - ( - const nutStandardWallFunctionFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new nutStandardWallFunctionFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - nutStandardWallFunctionFvPatchScalarField - ( - const nutStandardWallFunctionFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new nutStandardWallFunctionFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - // Evaluation functions - - //- Evaluate the patchField - virtual void evaluate - ( - const Pstream::commsTypes commsType=Pstream::blocking - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace incompressible -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C b/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C deleted file mode 100644 index 2fab6a7429..0000000000 --- a/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C +++ /dev/null @@ -1,173 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ 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 2 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, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "nutWallFunctionFvPatchScalarField.H" -#include "RASModel.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace incompressible -{ -namespace RASModels -{ - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedValueFvPatchScalarField(p, iF) -{} - - -nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField -( - const nutWallFunctionFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchScalarField(ptf, p, iF, mapper) -{} - - -nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedValueFvPatchScalarField(p, iF, dict) -{} - - -nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField -( - const nutWallFunctionFvPatchScalarField& tppsf -) -: - fixedValueFvPatchScalarField(tppsf) -{} - - -nutWallFunctionFvPatchScalarField::nutWallFunctionFvPatchScalarField -( - const nutWallFunctionFvPatchScalarField& tppsf, - const DimensionedField& iF -) -: - fixedValueFvPatchScalarField(tppsf, iF) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void nutWallFunctionFvPatchScalarField::evaluate(const Pstream::commsTypes) -{ - const RASModel& rasModel - = db().lookupObject("RASProperties"); - - scalar kappa = rasModel.kappa().value(); - scalar E = rasModel.E().value(); - - const scalarField& ry = patch().deltaCoeffs(); - - const fvPatchVectorField& U = - patch().lookupPatchField("U"); - - scalarField magUp = mag(U.patchInternalField() - U); - - const scalarField& nuw = - patch().lookupPatchField("nu"); - - scalarField& nutw = *this; - - scalarField magFaceGradU = mag(U.snGrad()); - - forAll(nutw, facei) - { - scalar magUpara = magUp[facei]; - - scalar utau = sqrt((nutw[facei] + nuw[facei])*magFaceGradU[facei]); - - if (utau > VSMALL) - { - int iter = 0; - scalar err = GREAT; - - do - { - scalar kUu = min(kappa*magUpara/utau, 50); - scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); - - scalar f = - - utau/(ry[facei]*nuw[facei]) - + magUpara/utau - + 1/E*(fkUu - 1.0/6.0*kUu*sqr(kUu)); - - scalar df = - 1.0/(ry[facei]*nuw[facei]) - + magUpara/sqr(utau) - + 1/E*kUu*fkUu/utau; - - scalar utauNew = utau + f/df; - err = mag((utau - utauNew)/utau); - utau = utauNew; - - } while (utau > VSMALL && err > 0.01 && ++iter < 10); - - nutw[facei] = - max(sqr(max(utau, 0))/magFaceGradU[facei] - nuw[facei], 0.0); - } - else - { - nutw[facei] = 0; - } - } -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField(fvPatchScalarField, nutWallFunctionFvPatchScalarField); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace incompressible -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H b/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H deleted file mode 100644 index 218599b59c..0000000000 --- a/src/turbulenceModels/RAS/incompressible/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H +++ /dev/null @@ -1,151 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ 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 2 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, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Class - Foam::incompressible::RASModels::nutWallFunctionFvPatchScalarField - -Description - Wall function boundary condition for walls - -SourceFiles - nutWallFunctionFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef nutWallFunctionFvPatchScalarField_H -#define nutWallFunctionFvPatchScalarField_H - -#include "fixedValueFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace incompressible -{ -namespace RASModels -{ - -/*---------------------------------------------------------------------------*\ - Class nutWallFunctionFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class nutWallFunctionFvPatchScalarField -: - public fixedValueFvPatchScalarField -{ - // Private data - - -public: - - //- Runtime type information - TypeName("nutWallFunction"); - - - // Constructors - - //- Construct from patch and internal field - nutWallFunctionFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - nutWallFunctionFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given nutWallFunctionFvPatchScalarField - // onto a new patch - nutWallFunctionFvPatchScalarField - ( - const nutWallFunctionFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - nutWallFunctionFvPatchScalarField - ( - const nutWallFunctionFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new nutWallFunctionFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - nutWallFunctionFvPatchScalarField - ( - const nutWallFunctionFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new nutWallFunctionFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - // Evaluation functions - - //- Evaluate the patchField - virtual void evaluate - ( - const Pstream::commsTypes commsType=Pstream::blocking - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace incompressible -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* //