Go to the documentation of this file.
59 static const scalar Cmu(0.09);
60 static const scalar
kappa(0.41);
64 void correctProcessorPatches
66 GeometricField<Type, fvPatchField, volMesh>& vf
69 if (!Pstream::parRun())
77 auto& bf = vf.boundaryFieldRef();
81 if (
isA<processorFvPatchField<Type>>(bf[patchi]))
83 bf[patchi].initEvaluate();
89 if (
isA<processorFvPatchField<Type>>(bf[patchi]))
91 bf[patchi].evaluate();
99 const word& fieldName,
108 mesh.time().timeName(),
119 pf = (1 - mask)*pf + mask*boundaryLayerField;
126 correctProcessorPatches<scalar>(
fld);
146 mesh.time().timeName(),
158 pf = (1 - mask)*pf + mask*epsilonBL/(Cmu*kBL + SMALL);
165 correctProcessorPatches<scalar>(omega);
176 const word& fieldName,
183 mesh.time().timeName(),
199 correctProcessorPatches<scalar>(
fld);
207 tmp<volScalarField> calcNut
222 ).typeHeaderOk<IOdictionary>(
true)
234 autoPtr<compressible::turbulenceModel>
turbulence
255 #include "createPhi.H"
260 autoPtr<incompressible::turbulenceModel>
turbulence
273 int main(
int argc,
char *argv[])
277 "Apply a simplified boundary-layer model to the velocity and"
278 " turbulence fields based on the 1/7th power-law."
287 "Specify the boundary-layer thickness"
293 "Boundary-layer thickness as Cbl * mean distance to wall"
295 argList::addBoolOption
297 "writeTurbulenceFields",
298 "Write the turbulence fields"
300 argList::addOptionCompat
302 "writeTurbulenceFields", {
"write-nut", 1906}
310 <<
"Neither option 'ybl' or 'Cbl' have been provided to calculate "
311 <<
"the boundary-layer thickness.\n"
312 <<
"Please choose either 'ybl' OR 'Cbl'."
318 <<
"Both 'ybl' and 'Cbl' have been provided to calculate "
319 <<
"the boundary-layer thickness.\n"
320 <<
"Please choose either 'ybl' OR 'Cbl'."
324 const bool writeTurbulenceFields =
args.
found(
"writeTurbulenceFields");
328 #include "createFields.H"
335 Info<<
"Setting boundary layer velocity" <<
nl <<
endl;
336 const scalar yblv = ybl.value();
339 if ((
y[celli] > 0) && (
y[celli] <= yblv))
342 U[celli] *=
::pow(
y[celli]/yblv, (1.0/7.0));
345 mask.correctBoundaryConditions();
346 correctProcessorPatches<vector>(
U);
348 if (writeTurbulenceFields)
359 correctProcessorPatches<scalar>(
nut);
373 blendField(
"k",
mesh, mask, kBL);
374 blendField(
"epsilon",
mesh, mask, epsilonBL);
375 calcOmegaField(
mesh, mask, kBL, epsilonBL);
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
Info<< "Reading field U\n"<< 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("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
const word dictName("faMeshDefinition")
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Ostream & endl(Ostream &os)
const dimensionedScalar kappa
label min(const labelHashSet &set, label minValue=labelMax)
dimensionedScalar pow025(const dimensionedScalar &ds)
surfacesMesh setField(triSurfaceToAgglom)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
virtual bool write(const token &tok)=0
Creates and initialises the face-flux field phi.
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
GeometricField< vector, fvPatchField, volMesh > volVectorField
const TargetType * isA(const Type &t)
#define FatalErrorInFunction
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::argList args(argc, argv)
singlePhaseTransportModel laminarTransport(U, phi)
bool found(const word &optName) const
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
Info<< "Reading thermophysical properties\n"<< endl;autoPtr< psiReactionThermo > pThermo(psiReactionThermo::New(mesh))