42 if (!isA<wallFvPatch>(
patch()))
44 FatalErrorIn(
"epsilonWallFunctionFvPatchScalarField::checkType()")
45 <<
"Invalid wall function specification" <<
nl 46 <<
" Patch type for patch " <<
patch().
name()
47 <<
" must be wall" <<
nl 48 <<
" Current patch type is " <<
patch().type() <<
nl <<
endl 75 const volScalarField::GeometricBoundaryField& bf = epsilon.
boundaryField();
80 if (isA<epsilonWallFunctionFvPatchScalarField>(bf[
patchi]))
100 const volScalarField::GeometricBoundaryField& bf = epsilon.
boundaryField();
127 if (isA<epsilonWallFunctionFvPatchScalarField>(bf[
patchi]))
129 epsilonPatches.append(patchi);
134 weights[faceCells[i]]++;
160 const volScalarField::GeometricBoundaryField& bf = epsilon.
boundaryField();
163 refCast<const epsilonWallFunctionFvPatchScalarField>(bf[
patchi]);
216 const scalar Cmu75 =
pow(
Cmu_, 0.75);
236 scalar w = cornerWeights[facei];
238 epsilon[celli] += w*Cmu75*
pow(k[celli], 1.5)/(
kappa_*y[facei]);
242 *(nutw[facei] + nuw[facei])
244 *Cmu25*
sqrt(k[celli])
429 const_cast<FieldType&
> 440 G[celli] = G0[celli];
441 epsilon[celli] = epsilon0[celli];
481 const_cast<FieldType&
> 493 scalar w = weights[facei];
499 G[celli] = (1.0 - w)*G[celli] + w*G0[celli];
500 epsilon[celli] = (1.0 - w)*epsilon[celli] + w*epsilon0[celli];
501 epsilonf[facei] = epsilon[celli];
543 label nConstrainedCells = 0;
553 label celli = faceCells[facei];
555 constraintCells.
append(celli);
556 constraintEpsilon.append(epsilon[celli]);
563 <<
": number of constrained cells = " << nConstrainedCells
dimensionedScalar sqrt(const dimensionedScalar &ds)
virtual void manipulateMatrix(fvMatrix< Type > &matrix)
Manipulate matrix.
scalarField & G(bool init=false)
Return non-const access to the master's G field.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
virtual void write(Ostream &) const
Write.
Mesh data needed to do the Finite Volume discretisation.
This boundary condition provides a turbulence dissipation wall function condition for high Reynolds n...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
const dimensionedScalar G0
Conductance quantum: default SI units: [S].
dimensioned< scalar > mag(const dimensioned< Type > &)
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
bool initialised_
Initialised flag.
bool empty() const
Return true if the UList is empty (ie, size() is zero).
const char *const group
Group name for atomic constants.
word GName() const
Helper function to return the name of the turbulence G field.
bool changing() const
Is mesh changing (topology changing and/or moving)
virtual void calculateTurbulenceFields(const turbulenceModel &turbulence, scalarField &G0, scalarField &epsilon0)
Main driver to calculate the turbulence fields.
virtual tmp< volScalarField > nu() const =0
Return the laminar viscosity.
static scalar tolerance_
Tolerance used in weighted calculations.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
void size(const label)
Override size to be inconsistent with allocated storage.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
Foam::fvPatchFieldMapper.
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 const labelUList & faceCells() const
Return faceCells.
virtual void calculate(const turbulenceModel &turbulence, const List< scalar > &cornerWeights, const fvPatch &patch, scalarField &G, scalarField &epsilon)
Calculate the epsilon and G.
const Mesh & mesh() const
Return mesh.
List< List< scalar > > cornerWeights_
List of averaging corner weights.
scalar kappa_
Von Karman constant.
bool updated() const
Return true if the boundary condition has already been updated.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual void manipulateMatrix(fvMatrix< scalar > &matrix)
Manipulate matrix.
const word & name() const
Return name.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static word groupName(Name name, const word &group)
const Time & time() const
Return the top-level database.
void setSize(const label)
Reset size of List.
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch as patch field.
const dimensionedScalar e
Elementary charge.
label k
Boltzmann constant.
scalar Cmu_
Cmu coefficient.
dimensionedScalar pow025(const dimensionedScalar &ds)
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
virtual void writeLocalEntries(Ostream &) const
Write local wall function variables.
Macros for easy insertion into run-time selection tables.
const nearWallDist & y() const
Return the near wall distances.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
errorManip< error > abort(error &err)
label index() const
Return the index of this patch in the fvBoundaryMesh.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Abstract base class for turbulence models (RAS, LES and laminar).
label master_
Master patch ID.
scalarField G_
Local copy of turbulence G field.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
scalarField & epsilon(bool init=false)
Return non-const access to the master's epsilon field.
const objectRegistry & db() const
Return local objectRegistry.
bool manipulatedMatrix() const
Return true if the matrix has already been manipulated.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
virtual void setMaster()
Set the master patch - master is responsible for updating all.
virtual void write(Ostream &) const
Write.
virtual epsilonWallFunctionFvPatchScalarField & epsilonPatch(const label patchi)
Helper function to return non-const access to an epsilon patch.
label size() const
Return the number of elements in the UList.
virtual void operator==(const fvPatchField< Type > &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
static const word propertiesName
Default name of the turbulence properties dictionary.
virtual tmp< volScalarField > k() const =0
Return the turbulence kinetic energy.
virtual void checkType()
Check the type of the patch.
const DimensionedField< Type, volMesh > & dimensionedInternalField() const
Return dimensioned internal field reference.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const volVectorField & U() const
Access function to velocity field.
virtual void createAveragingWeights()
Create the averaging weights for cells which are bounded by.
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
virtual tmp< volScalarField > nut() const =0
Return the turbulence viscosity.
virtual label & master()
Return non-const access to the master patch ID.
scalarField epsilon_
Local copy of turbulence epsilon field.
virtual label size() const
Return size.
const fvPatch & patch() const
Return patch.
epsilonWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A class for managing temporary objects.
const dimensionedScalar epsilon0
Electric constant: default SI units: [F/m].
void setValues(const labelUList &cells, const UList< Type > &values)
Set solution in given cells to the specified values.
prefixOSstream Pout(cout,"Pout")