53 if (isA<epsilonWallFunctionFvPatchScalarField>(bf[
patchi]))
77 if (initialised_ && !mesh.
changing())
100 if (isA<epsilonWallFunctionFvPatchScalarField>(bf[
patchi]))
107 weights[faceCells[i]]++;
120 G_.setSize(internalField().size(), 0.0);
121 epsilon_.setSize(internalField().size(), 0.0);
136 refCast<const epsilonWallFunctionFvPatchScalarField>(bf[
patchi]);
157 if (!cornerWeights_[
patchi].empty())
170 if (!cornerWeights_[
patchi].empty())
207 const scalar Cmu75 =
pow(nutw.
Cmu(), 0.75);
214 const scalar
yPlus = Cmu25*
y[facei]*
sqrt(
k[celli])/nuw[facei];
216 const scalar w = cornerWeights[facei];
221 w*Cmu75*
pow(
k[celli], 1.5)/(nutw.
kappa()*
y[facei]);
225 *(nutw[facei] + nuw[facei])
227 *Cmu25*
sqrt(
k[celli])
298 if (patch().index() == master_)
308 return epsilonPatch(master_).G();
317 if (patch().index() == master_)
327 return epsilonPatch(master_).epsilon(init);
343 if (patch().index() == master_)
345 createAveragingWeights();
346 calculateTurbulenceFields(turbModel,
G(
true),
epsilon(
true));
354 const_cast<FieldType&
>
356 db().lookupObject<FieldType>(turbModel.
GName())
359 const_cast<FieldType&
>
364 scalarField weights(patch().magSf()/patch().patch().magFaceAreas());
367 scalar& w = weights[facei];
368 w = w <= tolerance_ ? 0 : (w - tolerance_)/(1 - tolerance_);
373 const scalar w = weights[facei];
374 const label celli = patch().faceCells()[facei];
376 G[celli] = (1 - w)*
G[celli] + w*
G0[celli];
391 if (manipulatedMatrix())
398 scalarField weights(patch().magSf()/patch().patch().magFaceAreas());
401 scalar& w = weights[facei];
402 w = w <= tolerance_ ? 0 : (w - tolerance_)/(1 - tolerance_);
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
Generic GeometricBoundaryField class.
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
void setSize(const label)
Reset size of List.
label size() const
Return the number of elements in the UPtrList.
A list of keyword definitions, which are a keyword followed by any number of values (e....
const word & name() const
Return const reference to name.
This boundary condition provides a turbulence dissipation wall constraint for low- and high-Reynolds ...
virtual label & master()
Return non-const access to the master patch ID.
virtual void manipulateMatrix(fvMatrix< scalar > &matrix)
Manipulate matrix.
static scalar tolerance_
Tolerance used in weighted calculations.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void createAveragingWeights()
Create the averaging weights for cells which are bounded by.
epsilonWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
label master_
Master patch ID.
scalarField & G(bool init=false)
Return non-const access to the master's G field.
virtual void calculateTurbulenceFields(const momentumTransportModel &turbModel, scalarField &G0, scalarField &epsilon0)
Main driver to calculate the turbulence fields.
virtual epsilonWallFunctionFvPatchScalarField & epsilonPatch(const label patchi)
Helper function to return non-const access to an epsilon patch.
scalarField & epsilon(bool init=false)
Return non-const access to the master's epsilon field.
virtual void setMaster()
Set the master patch - master is responsible for updating all.
virtual void calculate(const momentumTransportModel &turbModel, const List< scalar > &cornerWeights, const fvPatch &patch, scalarField &G, scalarField &epsilon)
Calculate the epsilon and G.
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
A special matrix type and solver, designed for finite volume solutions of scalar equations....
void setValues(const labelUList &cells, const ListType< Type > &values)
Set solution in given cells to the specified values.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
const DimensionedField< Type, volMesh > & internalField() const
Return dimensioned internal field reference.
virtual void operator==(const fvPatchField< Type > &)
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch as patch field.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void manipulateMatrix(fvMatrix< Type > &matrix)
Manipulate matrix.
const fvPatch & patch() const
Return patch.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
label index() const
Return the index of this patch in the fvBoundaryMesh.
virtual const labelUList & faceCells() const
Return faceCells.
Abstract base class for turbulence models (RAS, LES and laminar).
virtual tmp< volScalarField > k() const =0
Return the turbulence kinetic energy.
word GName() const
Helper function to return the name of the turbulence G field.
const volVectorField & U() const
Access function to velocity field.
const volScalarField::Boundary & y() const
Return the near wall distance.
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions,...
static scalar yPlusLam(const scalar kappa, const scalar E)
Calculate the Y+ at the edge of the laminar sublayer.
scalar kappa() const
Return kappa.
static const nutWallFunctionFvPatchScalarField & nutw(const momentumTransportModel &turbModel, const label patchi)
Return the nut patchField for the given wall patch.
scalar Cmu() const
Return Cmu.
bool changing() const
Is mesh changing.
A class for managing temporary objects.
const dimensionedScalar G0
Conductance quantum: default SI units: [S].
const dimensionedScalar e
Elementary charge.
const dimensionedScalar epsilon0
Electric constant: default SI units: [F/m].
const dimensionedScalar G
Newtonian constant of gravitation.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
const dimensionSet dimless
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< scalar > mag(const dimensioned< Type > &)
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
dimensionedScalar pow025(const dimensionedScalar &ds)