nutWallFunctions: Generalised for RAS and LES

nuSgsUSpaldingWallFunction removed, now use nutUSpaldingWallFunction
This commit is contained in:
Henry
2012-07-03 10:34:20 +01:00
parent 668a0e95b5
commit ef2bc10d11
33 changed files with 241 additions and 638 deletions

View File

@ -34,6 +34,7 @@ Description
#include "LESModel.H"
#include "nearWallDist.H"
#include "wallDist.H"
#include "wallFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -30,7 +30,7 @@ License
#include "compressible/LES/LESModel/LESModel.H"
#include "wallFvPatch.H"
#include "nearWallDist.H"
//#include "wallDist.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -53,7 +53,6 @@ SourceFiles
#include "fvc.H"
#include "fvMatrices.H"
#include "incompressible/transportModel/transportModel.H"
#include "wallFvPatch.H"
#include "bound.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"

View File

@ -28,10 +28,4 @@ mixedSmagorinsky/mixedSmagorinsky.C
kOmegaSSTSAS/kOmegaSSTSAS.C
/* Wall functions */
wallFunctions=derivedFvPatchFields/wallFunctions
nuSgsWallFunctions=$(wallFunctions)/nuSgsWallFunctions
$(nuSgsWallFunctions)/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C
LIB = $(FOAM_LIBBIN)/libincompressibleLESModels

View File

@ -1,199 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "nuSgsUSpaldingWallFunctionFvPatchScalarField.H"
#include "LESModel.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace incompressible
{
namespace LESModels
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
nuSgsUSpaldingWallFunctionFvPatchScalarField::
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchScalarField(p, iF),
kappa_(0.41),
E_(9.8)
{}
nuSgsUSpaldingWallFunctionFvPatchScalarField::
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const nuSgsUSpaldingWallFunctionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
kappa_(ptf.kappa_),
E_(ptf.E_)
{}
nuSgsUSpaldingWallFunctionFvPatchScalarField::
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF, dict),
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
E_(dict.lookupOrDefault<scalar>("E", 9.8))
{}
nuSgsUSpaldingWallFunctionFvPatchScalarField::
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const nuSgsUSpaldingWallFunctionFvPatchScalarField& nwfpsf
)
:
fixedValueFvPatchScalarField(nwfpsf),
kappa_(nwfpsf.kappa_),
E_(nwfpsf.E_)
{}
nuSgsUSpaldingWallFunctionFvPatchScalarField::
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const nuSgsUSpaldingWallFunctionFvPatchScalarField& nwfpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchScalarField(nwfpsf, iF),
kappa_(nwfpsf.kappa_),
E_(nwfpsf.E_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void nuSgsUSpaldingWallFunctionFvPatchScalarField::evaluate
(
const Pstream::commsTypes
)
{
const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
const label patchi = patch().index();
const fvPatchVectorField& U = lesModel.U().boundaryField()[patchi];
const scalarField nuw = lesModel.nu()().boundaryField()[patchi];
const scalarField& ry = patch().deltaCoeffs();
const scalarField magUp(mag(U.patchInternalField() - U));
scalarField& nuSgsw = *this;
const scalarField magFaceGradU(mag(U.snGrad()));
forAll(nuSgsw, facei)
{
scalar magUpara = magUp[facei];
scalar utau = sqrt((nuSgsw[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);
nuSgsw[facei] =
max(sqr(max(utau, 0))/magFaceGradU[facei] - nuw[facei], 0.0);
}
else
{
nuSgsw[facei] = 0;
}
}
fixedValueFvPatchScalarField::evaluate();
}
void nuSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
nuSgsUSpaldingWallFunctionFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels
} // End namespace incompressible
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,165 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::incompressible::LESModels::
nuSgsUSpaldingWallFunctionFvPatchScalarField
Description
Wall function boundary condition for walls, based on velocity, using
Spaldings law to give a continuous nuSgs profile to the wall (y+ = 0)
SourceFiles
nuSgsUSpaldingWallFunctionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef nuSgsUSpaldingWallFunctionFvPatchScalarField_H
#define nuSgsUSpaldingWallFunctionFvPatchScalarField_H
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace incompressible
{
namespace LESModels
{
/*---------------------------------------------------------------------------*\
Class nuSgsUSpaldingWallFunctionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class nuSgsUSpaldingWallFunctionFvPatchScalarField
:
public fixedValueFvPatchScalarField
{
// Private data
//- Von Karman constant
scalar kappa_;
//- E constant
scalar E_;
public:
//- Runtime type information
TypeName("nuSgsUSpaldingWallFunction");
// Constructors
//- Construct from patch and internal field
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// nuSgsUSpaldingWallFunctionFvPatchScalarField
// onto a new patch
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const nuSgsUSpaldingWallFunctionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const nuSgsUSpaldingWallFunctionFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new nuSgsUSpaldingWallFunctionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
nuSgsUSpaldingWallFunctionFvPatchScalarField
(
const nuSgsUSpaldingWallFunctionFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new nuSgsUSpaldingWallFunctionFvPatchScalarField(*this, iF)
);
}
// Member functions
// Evaluation functions
//- Evaluate the patchField
virtual void evaluate
(
const Pstream::commsTypes commsType=Pstream::blocking
);
// I-O
//- Write
void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels
} // End namespace incompressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -22,14 +22,17 @@ kkLOmega/kkLOmega.C
wallFunctions = derivedFvPatchFields/wallFunctions
nutWallFunctions = $(wallFunctions)/nutWallFunctions
$(nutWallFunctions)/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutWallFunction/nutWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C
$(nutWallFunctions)/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C
epsilonWallFunctions = $(wallFunctions)/epsilonWallFunctions
$(epsilonWallFunctions)/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C

View File

@ -26,6 +26,7 @@ License
#include "NonlinearKEShih.H"
#include "addToRunTimeSelectionTable.H"
#include "wallFvPatch.H"
#include "nutkWallFunctionFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "RASModel.H"
#include "wallFvPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -82,9 +81,7 @@ RASModel::RASModel
kMin_("kMin", sqr(dimVelocity), SMALL),
epsilonMin_("epsilonMin", kMin_.dimensions()/dimTime, SMALL),
omegaMin_("omegaMin", dimless/dimTime, SMALL),
y_(mesh_)
omegaMin_("omegaMin", dimless/dimTime, SMALL)
{
kMin_.readIfPresent(*this);
epsilonMin_.readIfPresent(*this);
@ -156,57 +153,9 @@ autoPtr<RASModel> RASModel::New
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
scalar RASModel::yPlusLam(const scalar kappa, const scalar E) const
{
scalar ypl = 11.0;
for (int i=0; i<10; i++)
{
ypl = log(max(E*ypl, 1))/kappa;
}
return ypl;
}
tmp<scalarField> RASModel::yPlus(const label patchNo, const scalar Cmu) const
{
const fvPatch& curPatch = mesh_.boundary()[patchNo];
tmp<scalarField> tYp(new scalarField(curPatch.size()));
scalarField& Yp = tYp();
if (isA<wallFvPatch>(curPatch))
{
Yp = pow025(Cmu)
*y_[patchNo]
*sqrt(k()().boundaryField()[patchNo].patchInternalField())
/nu()().boundaryField()[patchNo];
}
else
{
WarningIn
(
"tmp<scalarField> RASModel::yPlus(const label patchNo) const"
) << "Patch " << patchNo << " is not a wall. Returning null field"
<< nl << endl;
Yp.setSize(0);
}
return tYp;
}
void RASModel::correct()
{
turbulenceModel::correct();
if (turbulence_ && mesh_.changing())
{
y_.correct();
}
}

View File

@ -44,7 +44,6 @@ SourceFiles
#include "incompressible/turbulenceModel/turbulenceModel.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "nearWallDist.H"
#include "fvm.H"
#include "fvc.H"
#include "fvMatrices.H"
@ -94,9 +93,6 @@ protected:
//- Lower limit for omega
dimensionedScalar omegaMin_;
//- Near wall distance boundary field
nearWallDist y_;
// Protected Member Functions
@ -208,15 +204,6 @@ public:
return omegaMin_;
}
//- Return the near wall distances
const nearWallDist& y() const
{
return y_;
}
//- Calculate y+ at the edge of the laminar sublayer
scalar yPlusLam(const scalar kappa, const scalar E) const;
//- Const access to the coefficients dictionary
const dictionary& coeffDict() const
{
@ -233,13 +220,6 @@ public:
);
}
//- Return yPlus for the given patch
virtual tmp<scalarField> yPlus
(
const label patchI,
const scalar Cmu
) const;
//- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct();

View File

@ -29,6 +29,8 @@ License
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
#include "wallFvPatch.H"
#include "nutkWallFunctionFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -55,23 +57,6 @@ void epsilonWallFunctionFvPatchScalarField::checkType()
}
scalar epsilonWallFunctionFvPatchScalarField::calcYPlusLam
(
const scalar kappa,
const scalar E
) const
{
scalar ypl = 11.0;
for (int i=0; i<10; i++)
{
ypl = log(E*ypl)/kappa;
}
return ypl;
}
void epsilonWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
{
writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
@ -94,7 +79,7 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField
Cmu_(0.09),
kappa_(0.41),
E_(9.8),
yPlusLam_(calcYPlusLam(kappa_, E_))
yPlusLam_(nutkWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_))
{
checkType();
}
@ -131,7 +116,7 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField
Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
E_(dict.lookupOrDefault<scalar>("E", 9.8)),
yPlusLam_(calcYPlusLam(kappa_, E_))
yPlusLam_(nutkWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_))
{
checkType();
}

View File

@ -82,9 +82,6 @@ protected:
//- Check the type of the patch
virtual void checkType();
//- Calculate the Y+ at the edge of the laminar sublayer
virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
//- Write local wall function variables
virtual void writeLocalEntries(Ostream&) const;

View File

@ -54,7 +54,7 @@ nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(p, iF)
nutWallFunctionFvPatchScalarField(p, iF)
{}
@ -66,7 +66,7 @@ nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField
const fvPatchFieldMapper& mapper
)
:
nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
{}
@ -77,7 +77,7 @@ nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField
const dictionary& dict
)
:
nutkWallFunctionFvPatchScalarField(p, iF, dict)
nutWallFunctionFvPatchScalarField(p, iF, dict)
{}
@ -86,7 +86,7 @@ nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField
const nutLowReWallFunctionFvPatchScalarField& nlrwfpsf
)
:
nutkWallFunctionFvPatchScalarField(nlrwfpsf)
nutWallFunctionFvPatchScalarField(nlrwfpsf)
{}
@ -96,10 +96,27 @@ nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(nlrwfpsf, iF)
nutWallFunctionFvPatchScalarField(nlrwfpsf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
tmp<scalarField> nutLowReWallFunctionFvPatchScalarField::yPlus() const
{
const label patchi = patch().index();
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const scalarField& y = turbModel.y()[patchi];
const tmp<volScalarField> tnu = turbModel.nu();
const volScalarField& nu = tnu();
const scalarField& nuw = nu.boundaryField()[patchi];
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
return y*sqrt(nuw*mag(Uw.snGrad()))/nuw;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField

View File

@ -38,7 +38,7 @@ SourceFiles
#ifndef nutLowReWallFunctionFvPatchScalarField_H
#define nutLowReWallFunctionFvPatchScalarField_H
#include "nutkWallFunctionFvPatchScalarField.H"
#include "nutWallFunctionFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -55,7 +55,7 @@ namespace RASModels
class nutLowReWallFunctionFvPatchScalarField
:
public nutkWallFunctionFvPatchScalarField
public nutWallFunctionFvPatchScalarField
{
protected:
@ -132,6 +132,12 @@ public:
new nutLowReWallFunctionFvPatchScalarField(*this, iF)
);
}
// Member functions
//- Calculate and return the yPlus at the boundary
virtual tmp<scalarField> yPlus() const;
};

View File

@ -42,14 +42,15 @@ namespace RASModels
tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const label patchi = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const tmp<volScalarField> tnu = rasModel.nu();
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const scalarField& y = turbModel.y()[patchi];
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
const tmp<volScalarField> tnu = turbModel.nu();
const volScalarField& nu = tnu();
const scalarField& nuw = nu.boundaryField()[patchI];
const scalarField& nuw = nu.boundaryField()[patchi];
// The flow velocity at the adjacent cell centre
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
@ -78,13 +79,14 @@ tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::calcYPlus
const scalarField& magUp
) const
{
const label patchI = patch().index();
const label patchi = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const tmp<volScalarField> tnu = rasModel.nu();
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const scalarField& y = turbModel.y()[patchi];
const tmp<volScalarField> tnu = turbModel.nu();
const volScalarField& nu = tnu();
const scalarField& nuw = nu.boundaryField()[patchI];
const scalarField& nuw = nu.boundaryField()[patchi];
tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0));
scalarField& yPlus = tyPlus();
@ -200,7 +202,7 @@ nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(p, iF),
nutWallFunctionFvPatchScalarField(p, iF),
roughnessHeight_(pTraits<scalar>::zero),
roughnessConstant_(pTraits<scalar>::zero),
roughnessFactor_(pTraits<scalar>::zero)
@ -215,7 +217,7 @@ nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField
const fvPatchFieldMapper& mapper
)
:
nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
roughnessHeight_(ptf.roughnessHeight_),
roughnessConstant_(ptf.roughnessConstant_),
roughnessFactor_(ptf.roughnessFactor_)
@ -229,7 +231,7 @@ nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField
const dictionary& dict
)
:
nutkWallFunctionFvPatchScalarField(p, iF, dict),
nutWallFunctionFvPatchScalarField(p, iF, dict),
roughnessHeight_(readScalar(dict.lookup("roughnessHeight"))),
roughnessConstant_(readScalar(dict.lookup("roughnessConstant"))),
roughnessFactor_(readScalar(dict.lookup("roughnessFactor")))
@ -241,7 +243,7 @@ nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField
const nutURoughWallFunctionFvPatchScalarField& rwfpsf
)
:
nutkWallFunctionFvPatchScalarField(rwfpsf),
nutWallFunctionFvPatchScalarField(rwfpsf),
roughnessHeight_(rwfpsf.roughnessHeight_),
roughnessConstant_(rwfpsf.roughnessConstant_),
roughnessFactor_(rwfpsf.roughnessFactor_)
@ -254,7 +256,7 @@ nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(rwfpsf, iF),
nutWallFunctionFvPatchScalarField(rwfpsf, iF),
roughnessHeight_(rwfpsf.roughnessHeight_),
roughnessConstant_(rwfpsf.roughnessConstant_),
roughnessFactor_(rwfpsf.roughnessFactor_)
@ -265,10 +267,11 @@ nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField
tmp<scalarField> nutURoughWallFunctionFvPatchScalarField::yPlus() const
{
const label patchI = patch().index();
const label patchi = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
tmp<scalarField> magUp = mag(Uw.patchInternalField() - Uw);
return calcYPlus(magUp());

View File

@ -35,7 +35,7 @@ SourceFiles
#ifndef nutURoughWallFunctionFvPatchScalarField_H
#define nutURoughWallFunctionFvPatchScalarField_H
#include "nutkWallFunctionFvPatchScalarField.H"
#include "nutWallFunctionFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,7 +52,7 @@ namespace RASModels
class nutURoughWallFunctionFvPatchScalarField
:
public nutkWallFunctionFvPatchScalarField
public nutWallFunctionFvPatchScalarField
{
// Private data

View File

@ -42,14 +42,15 @@ namespace RASModels
tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const label patchi = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
const scalarField magGradU(mag(Uw.snGrad()));
const tmp<volScalarField> tnu = rasModel.nu();
const tmp<volScalarField> tnu = turbModel.nu();
const volScalarField& nu = tnu();
const scalarField& nuw = nu.boundaryField()[patchI];
const scalarField& nuw = nu.boundaryField()[patchi];
return max
(
@ -64,14 +65,15 @@ tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::calcUTau
const scalarField& magGradU
) const
{
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patch().index()];
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const scalarField& y = turbModel.y()[patch().index()];
const fvPatchVectorField& Uw =
rasModel.U().boundaryField()[patch().index()];
turbModel.U().boundaryField()[patch().index()];
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
const scalarField& nuw = rasModel.nu()().boundaryField()[patch().index()];
const scalarField& nuw = turbModel.nu()().boundaryField()[patch().index()];
const scalarField& nutw = *this;
tmp<scalarField> tuTau(new scalarField(patch().size(), 0.0));
@ -124,7 +126,7 @@ nutUSpaldingWallFunctionFvPatchScalarField
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(p, iF)
nutWallFunctionFvPatchScalarField(p, iF)
{}
@ -137,7 +139,7 @@ nutUSpaldingWallFunctionFvPatchScalarField
const fvPatchFieldMapper& mapper
)
:
nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
{}
@ -149,7 +151,7 @@ nutUSpaldingWallFunctionFvPatchScalarField
const dictionary& dict
)
:
nutkWallFunctionFvPatchScalarField(p, iF, dict)
nutWallFunctionFvPatchScalarField(p, iF, dict)
{}
@ -159,7 +161,7 @@ nutUSpaldingWallFunctionFvPatchScalarField
const nutUSpaldingWallFunctionFvPatchScalarField& wfpsf
)
:
nutkWallFunctionFvPatchScalarField(wfpsf)
nutWallFunctionFvPatchScalarField(wfpsf)
{}
@ -170,7 +172,7 @@ nutUSpaldingWallFunctionFvPatchScalarField
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(wfpsf, iF)
nutWallFunctionFvPatchScalarField(wfpsf, iF)
{}
@ -178,14 +180,15 @@ nutUSpaldingWallFunctionFvPatchScalarField
tmp<scalarField> nutUSpaldingWallFunctionFvPatchScalarField::yPlus() const
{
const label patchI = patch().index();
const label patchi = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const tmp<volScalarField> tnu = rasModel.nu();
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const scalarField& y = turbModel.y()[patchi];
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
const tmp<volScalarField> tnu = turbModel.nu();
const volScalarField& nu = tnu();
const scalarField& nuw = nu.boundaryField()[patchI];
const scalarField& nuw = nu.boundaryField()[patchi];
return y*calcUTau(mag(Uw.snGrad()))/nuw;
}

View File

@ -36,7 +36,7 @@ SourceFiles
#ifndef nutUSpaldingWallFunctionFvPatchScalarField_H
#define nutUSpaldingWallFunctionFvPatchScalarField_H
#include "nutkWallFunctionFvPatchScalarField.H"
#include "nutWallFunctionFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -53,7 +53,7 @@ namespace RASModels
class nutUSpaldingWallFunctionFvPatchScalarField
:
public nutkWallFunctionFvPatchScalarField
public nutWallFunctionFvPatchScalarField
{
protected:

View File

@ -42,16 +42,17 @@ namespace RASModels
tmp<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const label patchi = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const scalarField& y = turbModel.y()[patchi];
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
const scalarField magGradU(mag(Uw.snGrad()));
const tmp<volScalarField> tnu = rasModel.nu();
const tmp<volScalarField> tnu = turbModel.nu();
const volScalarField& nu = tnu();
const scalarField& nuw = nu.boundaryField()[patchI];
const scalarField& nuw = nu.boundaryField()[patchi];
return
max
@ -90,7 +91,7 @@ nutUTabulatedWallFunctionFvPatchScalarField
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(p, iF),
nutWallFunctionFvPatchScalarField(p, iF),
uPlusTableName_("undefined-uPlusTableName"),
uPlusTable_
(
@ -117,7 +118,7 @@ nutUTabulatedWallFunctionFvPatchScalarField
const fvPatchFieldMapper& mapper
)
:
nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
uPlusTableName_(ptf.uPlusTableName_),
uPlusTable_(ptf.uPlusTable_)
{}
@ -131,7 +132,7 @@ nutUTabulatedWallFunctionFvPatchScalarField
const dictionary& dict
)
:
nutkWallFunctionFvPatchScalarField(p, iF, dict),
nutWallFunctionFvPatchScalarField(p, iF, dict),
uPlusTableName_(dict.lookup("uPlusTable")),
uPlusTable_
(
@ -155,7 +156,7 @@ nutUTabulatedWallFunctionFvPatchScalarField
const nutUTabulatedWallFunctionFvPatchScalarField& wfpsf
)
:
nutkWallFunctionFvPatchScalarField(wfpsf),
nutWallFunctionFvPatchScalarField(wfpsf),
uPlusTableName_(wfpsf.uPlusTableName_),
uPlusTable_(wfpsf.uPlusTable_)
{}
@ -168,7 +169,7 @@ nutUTabulatedWallFunctionFvPatchScalarField
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(wfpsf, iF),
nutWallFunctionFvPatchScalarField(wfpsf, iF),
uPlusTableName_(wfpsf.uPlusTableName_),
uPlusTable_(wfpsf.uPlusTable_)
{}
@ -178,15 +179,16 @@ nutUTabulatedWallFunctionFvPatchScalarField
tmp<scalarField> nutUTabulatedWallFunctionFvPatchScalarField::yPlus() const
{
const label patchI = patch().index();
const label patchi = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const scalarField& y = turbModel.y()[patchi];
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
const tmp<volScalarField> tnu = rasModel.nu();
const tmp<volScalarField> tnu = turbModel.nu();
const volScalarField& nu = tnu();
const scalarField& nuw = nu.boundaryField()[patchI];
const scalarField& nuw = nu.boundaryField()[patchi];
const scalarField Rey(magUp*y/nuw);
return Rey/(calcUPlus(Rey) + ROOTVSMALL);

View File

@ -39,7 +39,7 @@ SourceFiles
#ifndef nutUTabulatedWallFunctionFvPatchScalarField_H
#define nutUTabulatedWallFunctionFvPatchScalarField_H
#include "nutkWallFunctionFvPatchScalarField.H"
#include "nutWallFunctionFvPatchScalarField.H"
#include "uniformInterpolationTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -57,7 +57,7 @@ namespace RASModels
class nutUTabulatedWallFunctionFvPatchScalarField
:
public nutkWallFunctionFvPatchScalarField
public nutWallFunctionFvPatchScalarField
{
protected:

View File

@ -42,14 +42,15 @@ namespace RASModels
tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const label patchi = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
const tmp<volScalarField> tnu = rasModel.nu();
const tmp<volScalarField> tnu = turbModel.nu();
const volScalarField& nu = tnu();
const scalarField& nuw = nu.boundaryField()[patchI];
const scalarField& nuw = nu.boundaryField()[patchi];
tmp<scalarField> tyPlus = calcYPlus(magUp);
scalarField& yPlus = tyPlus();
@ -75,13 +76,14 @@ tmp<scalarField> nutUWallFunctionFvPatchScalarField::calcYPlus
const scalarField& magUp
) const
{
const label patchI = patch().index();
const label patchi = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const tmp<volScalarField> tnu = rasModel.nu();
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const scalarField& y = turbModel.y()[patchi];
const tmp<volScalarField> tnu = turbModel.nu();
const volScalarField& nu = tnu();
const scalarField& nuw = nu.boundaryField()[patchI];
const scalarField& nuw = nu.boundaryField()[patchi];
tmp<scalarField> tyPlus(new scalarField(patch().size(), 0.0));
scalarField& yPlus = tyPlus();
@ -118,7 +120,7 @@ nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(p, iF)
nutWallFunctionFvPatchScalarField(p, iF)
{}
@ -130,7 +132,7 @@ nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField
const fvPatchFieldMapper& mapper
)
:
nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
{}
@ -141,7 +143,7 @@ nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField
const dictionary& dict
)
:
nutkWallFunctionFvPatchScalarField(p, iF, dict)
nutWallFunctionFvPatchScalarField(p, iF, dict)
{}
@ -150,7 +152,7 @@ nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField
const nutUWallFunctionFvPatchScalarField& sawfpsf
)
:
nutkWallFunctionFvPatchScalarField(sawfpsf)
nutWallFunctionFvPatchScalarField(sawfpsf)
{}
@ -160,7 +162,7 @@ nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField
const DimensionedField<scalar, volMesh>& iF
)
:
nutkWallFunctionFvPatchScalarField(sawfpsf, iF)
nutWallFunctionFvPatchScalarField(sawfpsf, iF)
{}
@ -168,9 +170,10 @@ nutUWallFunctionFvPatchScalarField::nutUWallFunctionFvPatchScalarField
tmp<scalarField> nutUWallFunctionFvPatchScalarField::yPlus() const
{
const label patchI = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI];
const label patchi = patch().index();
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];
const scalarField magUp(mag(Uw.patchInternalField() - Uw));
return calcYPlus(magUp);

View File

@ -35,7 +35,7 @@ SourceFiles
#ifndef nutUWallFunctionFvPatchScalarField_H
#define nutUWallFunctionFvPatchScalarField_H
#include "nutkWallFunctionFvPatchScalarField.H"
#include "nutWallFunctionFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,7 +52,7 @@ namespace RASModels
class nutUWallFunctionFvPatchScalarField
:
public nutkWallFunctionFvPatchScalarField
public nutWallFunctionFvPatchScalarField
{
protected:

View File

@ -65,15 +65,16 @@ scalar nutkRoughWallFunctionFvPatchScalarField::fnRough
tmp<scalarField> nutkRoughWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const label patchi = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const tmp<volScalarField> tk = rasModel.k();
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const scalarField& y = turbModel.y()[patchi];
const tmp<volScalarField> tk = turbModel.k();
const volScalarField& k = tk();
const tmp<volScalarField> tnu = rasModel.nu();
const tmp<volScalarField> tnu = turbModel.nu();
const volScalarField& nu = tnu();
const scalarField& nuw = nu.boundaryField()[patchI];
const scalarField& nuw = nu.boundaryField()[patchi];
const scalar Cmu25 = pow025(Cmu_);

View File

@ -1,4 +1,4 @@
/*---------------------------------------------------------------------------*\
/*---------------------------------------------------------------------------* \
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
@ -55,34 +55,18 @@ void nutkWallFunctionFvPatchScalarField::checkType()
}
scalar nutkWallFunctionFvPatchScalarField::calcYPlusLam
(
const scalar kappa,
const scalar E
) const
{
scalar ypl = 11.0;
for (int i=0; i<10; i++)
{
ypl = log(E*ypl)/kappa;
}
return ypl;
}
tmp<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const
{
const label patchI = patch().index();
const label patchi = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const tmp<volScalarField> tk = rasModel.k();
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const scalarField& y = turbModel.y()[patchi];
const tmp<volScalarField> tk = turbModel.k();
const volScalarField& k = tk();
const tmp<volScalarField> tnu = rasModel.nu();
const tmp<volScalarField> tnu = turbModel.nu();
const volScalarField& nu = tnu();
const scalarField& nuw = nu.boundaryField()[patchI];
const scalarField& nuw = nu.boundaryField()[patchi];
const scalar Cmu25 = pow025(Cmu_);
@ -125,7 +109,7 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
Cmu_(0.09),
kappa_(0.41),
E_(9.8),
yPlusLam_(calcYPlusLam(kappa_, E_))
yPlusLam_(yPlusLam(kappa_, E_))
{
checkType();
}
@ -160,7 +144,7 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
Cmu_(dict.lookupOrDefault<scalar>("Cmu", 0.09)),
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
E_(dict.lookupOrDefault<scalar>("E", 9.8)),
yPlusLam_(calcYPlusLam(kappa_, E_))
yPlusLam_(yPlusLam(kappa_, E_))
{
checkType();
}
@ -199,6 +183,23 @@ nutkWallFunctionFvPatchScalarField::nutkWallFunctionFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
scalar nutkWallFunctionFvPatchScalarField::yPlusLam
(
const scalar kappa,
const scalar E
)
{
scalar ypl = 11.0;
for (int i=0; i<10; i++)
{
ypl = log(max(E*ypl, 1))/kappa;
}
return ypl;
}
void nutkWallFunctionFvPatchScalarField::updateCoeffs()
{
if (updated())
@ -214,17 +215,18 @@ void nutkWallFunctionFvPatchScalarField::updateCoeffs()
tmp<scalarField> nutkWallFunctionFvPatchScalarField::yPlus() const
{
const label patchI = patch().index();
const label patchi = patch().index();
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalarField& y = rasModel.y()[patchI];
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>("turbulenceModel");
const scalarField& y = turbModel.y()[patchi];
const tmp<volScalarField> tk = rasModel.k();
const tmp<volScalarField> tk = turbModel.k();
const volScalarField& k = tk();
tmp<scalarField> kwc = k.boundaryField()[patchI].patchInternalField();
const tmp<volScalarField> tnu = rasModel.nu();
tmp<scalarField> kwc = k.boundaryField()[patchi].patchInternalField();
const tmp<volScalarField> tnu = turbModel.nu();
const volScalarField& nu = tnu();
const scalarField& nuw = nu.boundaryField()[patchI];
const scalarField& nuw = nu.boundaryField()[patchi];
return pow025(Cmu_)*y*sqrt(kwc)/nuw;
}

View File

@ -78,9 +78,6 @@ protected:
//- Check the type of the patch
virtual void checkType();
//- Calculate the Y+ at the edge of the laminar sublayer
virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
//- Calculate the turbulence viscosity
virtual tmp<scalarField> calcNut() const;
@ -159,6 +156,10 @@ public:
// Member functions
//- Calculate the Y+ at the edge of the laminar sublayer
static scalar yPlusLam(const scalar kappa, const scalar E);
// Evaluation functions
//- Calculate and return the yPlus at the boundary

View File

@ -29,6 +29,8 @@ License
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
#include "wallFvPatch.H"
#include "nutkWallFunctionFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -55,23 +57,6 @@ void omegaWallFunctionFvPatchScalarField::checkType()
}
scalar omegaWallFunctionFvPatchScalarField::calcYPlusLam
(
const scalar kappa,
const scalar E
) const
{
scalar ypl = 11.0;
for (int i=0; i<10; i++)
{
ypl = log(E*ypl)/kappa;
}
return ypl;
}
void omegaWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const
{
writeEntryIfDifferent<word>(os, "G", "RASModel::G", GName_);
@ -96,7 +81,7 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
kappa_(0.41),
E_(9.8),
beta1_(0.075),
yPlusLam_(calcYPlusLam(kappa_, E_))
yPlusLam_(nutkWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_))
{
checkType();
}
@ -135,7 +120,7 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
E_(dict.lookupOrDefault<scalar>("E", 9.8)),
beta1_(dict.lookupOrDefault<scalar>("beta1", 0.075)),
yPlusLam_(calcYPlusLam(kappa_, E_))
yPlusLam_(nutkWallFunctionFvPatchScalarField::yPlusLam(kappa_, E_))
{
checkType();
}

View File

@ -98,9 +98,6 @@ protected:
//- Check the type of the patch
virtual void checkType();
//- Calculate the Y+ at the edge of the laminar sublayer
virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
//- Write local wall function variables
virtual void writeLocalEntries(Ostream&) const;

View File

@ -33,7 +33,11 @@ Description
{
labelList cellBoundaryFaceCount(epsilon_.size(), 0);
scalar yPlusLam = this->yPlusLam(kappa_.value(), E_.value());
scalar yPlusLam = nutkWallFunctionFvPatchScalarField::yPlusLam
(
kappa_.value(),
E_.value()
);
const fvPatchList& patches = mesh_.boundary();

View File

@ -32,7 +32,11 @@ Description
{
const fvPatchList& patches = mesh_.boundary();
const scalar yPlusLam = this->yPlusLam(kappa_.value(), E_.value());
const scalar yPlusLam = nutkWallFunctionFvPatchScalarField::yPlusLam
(
kappa_.value(),
E_.value()
);
const volScalarField nuLam(this->nu());

View File

@ -26,6 +26,7 @@ License
#include "turbulenceModel.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "wallFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,7 +66,8 @@ turbulenceModel::turbulenceModel
U_(U),
phi_(phi),
transportModel_(transport)
transportModel_(transport),
y_(mesh_)
{}
@ -127,6 +129,11 @@ autoPtr<turbulenceModel> turbulenceModel::New
void turbulenceModel::correct()
{
transportModel_.correct();
if (mesh_.changing())
{
y_.correct();
}
}

View File

@ -48,6 +48,7 @@ SourceFiles
#include "surfaceFieldsFwd.H"
#include "fvMatricesFwd.H"
#include "incompressible/transportModel/transportModel.H"
#include "nearWallDist.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
@ -83,6 +84,9 @@ protected:
transportModel& transportModel_;
//- Near wall distance boundary field
nearWallDist y_;
private:
@ -167,6 +171,12 @@ public:
return transportModel_;
}
//- Return the near wall distances
const nearWallDist& y() const
{
return y_;
}
//- Return the laminar viscosity
inline tmp<volScalarField> nu() const
{

View File

@ -40,7 +40,7 @@ boundaryField
lowerWall
{
type nuSgsUSpaldingWallFunction;
type nutUSpaldingWallFunction;
value uniform 0.0544766;
}
@ -51,7 +51,7 @@ boundaryField
"motorBike_.*"
{
type nuSgsUSpaldingWallFunction;
type nutUSpaldingWallFunction;
value uniform 0.0544766;
}

View File

@ -53,16 +53,16 @@ functions
{
functionObjectLibs ( "libfieldFunctionObjects.so" );
type readFields;
fields ( p U );
fields (p U);
}
streamLines
{
type streamLine;
outputControl outputTime;
setFormat vtk;
U U;
UName U;
trackForward true;
fields ( p U );
fields (p U);
lifeTime 10000;
nSubCycle 5;
cloudName particleTracks;
@ -71,8 +71,8 @@ functions
{
type uniform;
axis x;
start ( -1.001 1e-07 0.0011 );
end ( -1.001 1e-07 1.0011 );
start (-1.001 1e-07 0.0011);
end (-1.001 1e-07 1.0011);
nPoints 20;
}
}
@ -84,7 +84,20 @@ functions
surfaceFormat vtk;
fields ( p U );
interpolationScheme cellPoint;
surfaces ( yNormal { type cuttingPlane ; planeType pointAndNormal ; pointAndNormalDict { basePoint ( 0 0 0 ) ; normalVector ( 0 1 0 ) ; } interpolate true ; } );
surfaces
(
yNormal
{
type cuttingPlane;
planeType pointAndNormal;
pointAndNormalDict
{
basePoint (0 0 0);
normalVector (0 1 0);
}
interpolate true;
}
);
}
forces
{
@ -98,10 +111,10 @@ functions
rhoName rhoInf;
log true;
rhoInf 1;
liftDir ( 0 0 1 );
dragDir ( 1 0 0 );
CofR ( 0.72 0 0 );
pitchAxis ( 0 1 0 );
liftDir (0 0 1);
dragDir (1 0 0);
CofR (0.72 0 0);
pitchAxis (0 1 0);
magUInf 20;
lRef 1.42;
Aref 0.75;