43 if (!isA<wallFvPatch>(
patch()))
46 <<
"Invalid wall function specification" <<
nl 47 <<
" Patch type for patch " <<
patch().
name()
48 <<
" must be wall" <<
nl 49 <<
" Current patch type is " <<
patch().type() <<
nl <<
endl 81 if (isA<epsilonWallFunctionFvPatchScalarField>(bf[
patchi]))
101 const volScalarField::Boundary& bf = epsilon.
boundaryField();
128 if (isA<epsilonWallFunctionFvPatchScalarField>(bf[
patchi]))
130 epsilonPatches.append(patchi);
135 weights[faceCells[i]]++;
161 const volScalarField::Boundary& bf = epsilon.
boundaryField();
164 refCast<const epsilonWallFunctionFvPatchScalarField>(bf[
patchi]);
217 const scalar Cmu75 =
pow(
Cmu_, 0.75);
237 const scalar
yPlus = Cmu25*y[facei]*
sqrt(k[celli])/nuw[facei];
239 const scalar w = cornerWeights[facei];
243 epsilon0[celli] += w*Cmu75*
pow(k[celli], 1.5)/(
kappa_*y[facei]);
247 *(nutw[facei] + nuw[facei])
249 *Cmu25*
sqrt(k[celli])
254 epsilon0[celli] += w*2.0*k[celli]*nuw[facei]/
sqr(y[facei]);
444 const_cast<FieldType&
> 455 G[celli] = G0[celli];
456 epsilon[celli] = epsilon0[celli];
496 const_cast<FieldType&
> 508 scalar w = weights[facei];
514 G[celli] = (1.0 - w)*G[celli] + w*G0[celli];
515 epsilon[celli] = (1.0 - w)*epsilon[celli] + w*epsilon0[celli];
516 epsilonf[facei] = epsilon[celli];
558 label nConstrainedCells = 0;
568 label celli = faceCells[facei];
570 constraintCells.
append(celli);
571 constraintEpsilon.append(epsilon[celli]);
578 <<
": number of constrained cells = " << nConstrainedCells
const char *const group
Group name for atomic constants.
bool changing() const
Is mesh changing (topology changing and/or moving)
#define forAll(list, i)
Loop across all elements in list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual void write(Ostream &) const
Write.
virtual void writeLocalEntries(Ostream &) const
Write local wall function variables.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
const dimensionedScalar G0
Conductance quantum: default SI units: [S].
scalar yPlusLam() const
Return the Y+ at the edge of the laminar sublayer.
virtual void calculate(const turbulenceModel &turbulence, const List< scalar > &cornerWeights, const fvPatch &patch, scalarField &G, scalarField &epsilon)
Calculate the epsilon and G.
const volVectorField & U() const
Access function to velocity field.
label index() const
Return the index of this patch in the fvBoundaryMesh.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool updated() const
Return true if the boundary condition has already been updated.
virtual void write(Ostream &) const
Write.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
scalarField G_
Local copy of turbulence G field.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
virtual tmp< volScalarField > nu() const =0
Return the laminar viscosity.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
dimensionedScalar pow025(const dimensionedScalar &ds)
virtual void manipulateMatrix(fvMatrix< scalar > &matrix)
Manipulate matrix.
static scalar tolerance_
Tolerance used in weighted calculations.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
label k
Boltzmann constant.
const Time & time() const
Return the top-level database.
bool manipulatedMatrix() const
Return true if the matrix has already been manipulated.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
word GName() const
Helper function to return the name of the turbulence G field.
const dimensionedScalar epsilon0
Electric constant: default SI units: [F/m].
Abstract base class for turbulence models (RAS, LES and laminar).
const word & name() const
Return name.
Macros for easy insertion into run-time selection tables.
virtual void operator==(const fvPatchField< Type > &)
virtual tmp< volScalarField > k() const =0
Return the turbulence kinetic energy.
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
label master_
Master patch ID.
const dimensionedScalar e
Elementary charge.
virtual label & master()
Return non-const access to the master patch ID.
static const word propertiesName
Default name of the turbulence properties dictionary.
virtual void calculateTurbulenceFields(const turbulenceModel &turbulence, scalarField &G0, scalarField &epsilon0)
Main driver to calculate the turbulence fields.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual const labelUList & faceCells() const
Return faceCells.
static word groupName(Name name, const word &group)
void setValues(const labelUList &cells, const UList< Type > &values)
Set solution in given cells to the specified values.
scalar yPlusLam_
y+ at the edge of the laminar sublayer
Foam::fvPatchFieldMapper.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
scalarField epsilon_
Local copy of turbulence epsilon field.
const nearWallDist & y() const
Return the near wall distances.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
virtual void manipulateMatrix(fvMatrix< Type > &matrix)
Manipulate matrix.
This boundary condition provides a turbulence dissipation wall constraint for low- and high-Reynolds ...
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const fvPatch & patch() const
Return patch.
scalarField & G(bool init=false)
Return non-const access to the master's G field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual label size() const
Return size.
virtual epsilonWallFunctionFvPatchScalarField & epsilonPatch(const label patchi)
Helper function to return non-const access to an epsilon patch.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch as patch field.
const Mesh & mesh() const
Return mesh.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
scalar kappa_
Von Karman constant.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
void setSize(const label)
Reset size of List.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
List< List< scalar > > cornerWeights_
List of averaging corner weights.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
virtual void updateWeightedCoeffs(const scalarField &weights)
Update the coefficients associated with the patch field.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
prefixOSstream Pout(cout, "Pout")
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Mesh data needed to do the Finite Volume discretisation.
scalar Cmu_
Cmu coefficient.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const objectRegistry & db() const
Return local objectRegistry.
virtual void checkType()
Check the type of the patch.
dimensioned< scalar > mag(const dimensioned< Type > &)
virtual void setMaster()
Set the master patch - master is responsible for updating all.
bool initialised_
Initialised flag.
virtual tmp< volScalarField > nut() const =0
Return the turbulence viscosity.
A class for managing temporary objects.
virtual void createAveragingWeights()
Create the averaging weights for cells which are bounded by.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
epsilonWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
label size() const
Return the number of elements in the UList.
const DimensionedField< Type, volMesh > & internalField() const
Return dimensioned internal field reference.
scalarField & epsilon(bool init=false)
Return non-const access to the master's epsilon field.