42 scalar omegaWallFunctionFvPatchScalarField::tolerance_ = 1
e-5;
48 if (!isA<wallFvPatch>(
patch()))
51 <<
"Invalid wall function specification" <<
nl 52 <<
" Patch type for patch " <<
patch().
name()
53 <<
" must be wall" <<
nl 54 <<
" Current patch type is " <<
patch().type() <<
nl <<
endl 84 if (isA<omegaWallFunctionFvPatchScalarField>(bf[
patchi]))
131 if (isA<omegaWallFunctionFvPatchScalarField>(bf[
patchi]))
133 omegaPatches.append(patchi);
138 label celli = faceCells[i];
168 refCast<const omegaWallFunctionFvPatchScalarField>(bf[
patchi]);
240 scalar w = cornerWeights[facei];
242 scalar omegaVis = 6.0*nuw[facei]/(
beta1_*
sqr(y[facei]));
244 scalar omegaLog =
sqrt(k[celli])/(Cmu25*
kappa_*y[facei]);
246 omega[celli] += w*
sqrt(
sqr(omegaVis) +
sqr(omegaLog));
250 *(nutw[facei] + nuw[facei])
252 *Cmu25*
sqrt(k[celli])
439 const_cast<FieldType&
> 450 G[celli] = G0[celli];
451 omega[celli] = omega0[celli];
491 const_cast<FieldType&
> 503 scalar w = weights[facei];
509 G[celli] = (1.0 - w)*G[celli] + w*G0[celli];
510 omega[celli] = (1.0 - w)*omega[celli] + w*omega0[celli];
511 omegaf[facei] = omega[celli];
553 label nConstrainedCells = 0;
563 label celli = faceCells[facei];
565 constraintCells.
append(celli);
566 constraintomega.append(omega[celli]);
573 <<
": number of constrained cells = " << nConstrainedCells
const fvPatch & patch() const
Return patch.
const char *const group
Group name for atomic constants.
virtual void write(Ostream &) const
Write.
word GName() const
Helper function to return the name of the turbulence G field.
#define forAll(list, i)
Loop across all elements in list.
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 updateCoeffs()
Update the coefficients associated with the patch field.
const dimensionedScalar G0
Conductance quantum: default SI units: [S].
const double e
Elementary charge.
A list of keyword definitions, which are a keyword followed by any number of values (e...
omegaWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch as patch field.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
virtual void write(Ostream &) const
Write.
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.
virtual void updateWeightedCoeffs(const scalarField &weights)
Update the coefficients associated with the patch field.
const word & name() const
Return name.
const volVectorField & U() const
Access function to velocity field.
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)
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void createAveragingWeights()
Create the averaging weights for cells which are bounded by.
virtual void checkType()
Check the type of the patch.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
label k
Boltzmann constant.
scalar kappa_
Von Karman constant.
Abstract base class for turbulence models (RAS, LES and laminar).
scalar Cmu_
Cmu coefficient.
Macros for easy insertion into run-time selection tables.
virtual void operator==(const fvPatchField< Type > &)
scalarField & G(bool init=false)
Return non-const access to the master's G field.
virtual tmp< volScalarField > k() const =0
Return the turbulence kinetic energy.
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
virtual omegaWallFunctionFvPatchScalarField & omegaPatch(const label patchi)
Helper function to return non-const access to an omega patch.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
static const word propertiesName
Default name of the turbulence properties dictionary.
virtual void writeLocalEntries(Ostream &) const
Write local wall function variables.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
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.
Foam::fvPatchFieldMapper.
bool updated() const
Return true if the boundary condition has already been updated.
virtual label size() const
Return size.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
bool changing() const
Is mesh changing (topology changing and/or moving)
static scalar tolerance_
Tolerance used in weighted calculations.
virtual void calculateTurbulenceFields(const turbulenceModel &turbulence, scalarField &G0, scalarField &omega0)
Main driver to calculate the turbulence fields.
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.
bool initialised_
Initialised flag.
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...
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
prefixOSstream Pout(cout,"Pout")
virtual const labelUList & faceCells() const
Return faceCells.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
List< List< scalar > > cornerWeights_
List of averaging corner weights.
label size() const
Return the number of elements in the UList.
scalarField G_
Local copy of turbulence G field.
const objectRegistry & db() const
Return local objectRegistry.
label index() const
Return the index of this patch in the fvBoundaryMesh.
scalarField & omega(bool init=false)
Return non-const access to the master's omega field.
void setSize(const label)
Reset size of List.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
This boundary condition provides a wall function constraint on turbulnce specific dissipation...
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const Mesh & mesh() const
Return mesh.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static scalar yPlusLam(const scalar kappa, const scalar E)
Calculate the Y+ at the edge of the laminar sublayer.
Mesh data needed to do the Finite Volume discretisation.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
dimensioned< scalar > mag(const dimensioned< Type > &)
virtual void setMaster()
Set the master patch - master is responsible for updating all.
virtual tmp< volScalarField > nut() const =0
Return the turbulence viscosity.
A class for managing temporary objects.
label master_
Master patch ID.
virtual label & master()
Return non-const access to the master patch ID.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual void manipulateMatrix(fvMatrix< scalar > &matrix)
Manipulate matrix.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
scalar yPlusLam_
Y+ at the edge of the laminar sublayer.
scalarField omega_
Local copy of turbulence omega field.
scalar beta1_
beta1 coefficient
const nearWallDist & y() const
Return the near wall distances.
bool manipulatedMatrix() const
Return true if the matrix has already been manipulated.
const DimensionedField< Type, volMesh > & internalField() const
Return dimensioned internal field reference.
virtual void calculate(const turbulenceModel &turbulence, const List< scalar > &cornerWeights, const fvPatch &patch, scalarField &G, scalarField &omega)
Calculate the omega and G.
const Time & time() const
Return the top-level database.