47 static const scalar Cmu(0.09);
48 static const scalar
kappa(0.41);
51 int main(
int argc,
char *argv[])
55 "apply a simplified boundary-layer model to the velocity and\n" 56 "turbulence fields based on the 1/7th power-law." 63 "specify the boundary-layer thickness" 69 "boundary-layer thickness as Cbl * mean distance to wall" 71 argList::addBoolOption
82 <<
"Neither option 'ybl' or 'Cbl' have been provided to calculate " 83 <<
"the boundary-layer thickness.\n" 84 <<
"Please choose either 'ybl' OR 'Cbl'." 90 <<
"Both 'ybl' and 'Cbl' have been provided to calculate " 91 <<
"the boundary-layer thickness.\n" 92 <<
"Please choose either 'ybl' OR 'Cbl'." 98 #include "createFields.H" 106 Info<<
"Setting boundary layer velocity" <<
nl <<
endl;
107 scalar yblv = ybl.value();
110 if (
y[celli] <= yblv)
113 U[celli] *=
::pow(
y[celli]/yblv, (1.0/7.0));
116 mask.correctBoundaryConditions();
122 #include "createPhi.H" 127 autoPtr<incompressible::momentumTransportModel>
turbulence 132 if (isA<incompressible::RASModel>(
turbulence()))
157 k = (1 - mask)*k + mask*
sqr(nut/(ck0*
min(
y, ybl)));
158 k.correctBoundaryConditions();
165 tmp<volScalarField> tepsilon =
turbulence->epsilon();
168 epsilon = (1 - mask)*epsilon + mask*ce0*k*
sqrt(k)/
min(
y, ybl);
192 refCast<const incompressible::RASModel>(
turbulence());
194 omega = (1 - mask)*omega + mask*ce0*
sqrt(k)/(Cmu*
min(
y, ybl));
195 bound(omega, rasModel.omegaMin());
205 IOobject nuTildaHeader
228 Info<<
nl <<
"ExecutionTime = " <<
runTime.elapsedCpuTime() <<
" s" 229 <<
" ClockTime = " <<
runTime.elapsedClockTime() <<
" s"
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
#define forAll(list, i)
Loop across all elements in list.
virtual Ostream & write(const char)=0
Write character.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar pow025(const dimensionedScalar &ds)
bool optionFound(const word &opt) const
Return true if the named option is found.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
autoPtr< BasicCompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleMomentumTransportModel::transportModel &transport)
tmp< fvMatrix< Type > > S(const Pair< tmp< volScalarField::Internal >> &, const GeometricField< Type, fvPatchField, volMesh > &)
Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar(dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar(dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::momentumTransportModel > turbulence(compressible::momentumTransportModel::New(rho, U, phi, thermo))
Bound the given scalar field if it has gone unbounded.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
volScalarField & bound(volScalarField &, const dimensionedScalar &lowerBound)
Bound the given scalar field if it has gone unbounded.
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::argList args(argc, argv)
singlePhaseTransportModel laminarTransport(U, phi)
RASModel< momentumTransportModel > RASModel
Typedefs for turbulence, RAS and LES models for compressible flow based on the standard laminar trans...