44turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::
45turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
51 mixedFvPatchScalarField(
p, iF),
65 TnbrName_(
"undefined-Tnbr")
67 this->refValue() = 0.0;
68 this->refGrad() = 0.0;
69 this->valueFraction() = 1.0;
73turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::
74turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
82 mixedFvPatchScalarField(ptf,
p, iF, mapper),
90 TnbrName_(ptf.TnbrName_),
91 thicknessLayers_(ptf.thicknessLayers_),
92 thicknessLayer_(ptf.thicknessLayer_.clone(
p.patch())),
93 kappaLayers_(ptf.kappaLayers_),
94 kappaLayer_(ptf.kappaLayer_.clone(
p.patch()))
98turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::
99turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
106 mixedFvPatchScalarField(
p, iF),
116 if (!isA<mappedPatchBase>(this->patch().patch()))
120 <<
"\n for patch " <<
p.
name()
121 <<
" of field " << internalField().name()
122 <<
" in file " << internalField().objectPath()
127 <<
"This BC has been superseded by "
128 <<
"compressible::turbulentTemperatureRadCoupledMixed "
129 <<
"which has more functionalities and it can handle "
130 <<
"the assemble coupled option for energy. "
167 valueFraction() = 1.0;
186turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::
187turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
193 mixedFvPatchScalarField(wtcsf, iF),
201 TnbrName_(wtcsf.TnbrName_),
202 thicknessLayers_(wtcsf.thicknessLayers_),
203 thicknessLayer_(wtcsf.thicknessLayer_.clone(patch().patch())),
204 kappaLayers_(wtcsf.kappaLayers_),
205 kappaLayer_(wtcsf.kappaLayer_.clone(patch().patch()))
209turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::
210turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
215 mixedFvPatchScalarField(wtcsf),
223 TnbrName_(wtcsf.TnbrName_),
224 thicknessLayers_(wtcsf.thicknessLayers_),
225 thicknessLayer_(wtcsf.thicknessLayer_.clone(patch().patch())),
226 kappaLayers_(wtcsf.kappaLayers_),
227 kappaLayer_(wtcsf.kappaLayer_.clone(patch().patch()))
238 mixedFvPatchScalarField::autoMap(
mapper);
243 thicknessLayer_().autoMap(
mapper);
244 kappaLayer_().autoMap(
mapper);
255 mixedFvPatchScalarField::rmap(ptf, addr);
267 thicknessLayer_().rmap(tiptf.thicknessLayer_(), addr);
268 kappaLayer_().rmap(tiptf.kappaLayer_(), addr);
283 if (thicknessLayer_ || thicknessLayers_.
size())
292 const scalar t = db().time().timeOutputValue();
294 thicknessLayer_().value(t)
295 /kappaLayer_().value(t);
297 if (thicknessLayers_.
size())
299 forAll(thicknessLayers_, iLayer)
301 KDelta += thicknessLayers_[iLayer]/kappaLayers_[iLayer];
308 tk = KDelta/patch().deltaCoeffs();
332 this->internalField()
345 const auto& nbrMesh = refCast<const fvMesh>(mpp.
sampleMesh());
347 const auto& nbrPatch = nbrMesh.boundary()[nbrPatchID];
363 nbrIntFld = nbrField.patchInternalField();
364 nbrKDelta = nbrField.
kappa(nbrField)*nbrPatch.deltaCoeffs();
370 nbrIntFld = patchInternalField();
371 nbrKDelta = myKDelta.
ref();
392 this->refValue() = nbrIntFld;
393 this->refGrad() = 0.0;
394 this->valueFraction() = nbrKDelta/(nbrKDelta + myKDelta());
396 mixedFvPatchScalarField::updateCoeffs();
400 scalar Q =
gSum(kappaTp*patch().magSf()*snGrad());
402 Info<< patch().boundaryMesh().mesh().name() <<
':'
403 << patch().name() <<
':'
404 << this->internalField().name() <<
" <- "
407 << this->internalField().name() <<
" :"
408 <<
" heat transfer rate:" << Q
409 <<
" walltemperature "
410 <<
" min:" <<
gMin(*
this)
411 <<
" max:" <<
gMax(*
this)
429 <<
"This BC does not support energy coupling "
430 <<
"Use compressible::turbulentTemperatureRadCoupledMixed "
431 <<
"which has more functionalities and it can handle "
432 <<
"the assemble coupled option for energy. "
446 <<
"This BC does not support energy coupling "
447 <<
"Use compressible::turbulentTemperatureRadCoupledMixed "
448 <<
"which has more functionalities and it can handle "
449 <<
"the assemble coupled option for energy. "
473 mixedFvPatchScalarField::write(
os);
477 thicknessLayer_().writeData(
os);
478 kappaLayer_().writeData(
os);
480 if (thicknessLayers_.
size())
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...
const word & name() const noexcept
Return the object name.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
static autoPtr< PatchFunction1< Type > > NewIfPresent(const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
An optional selector.
void writeEntry(Ostream &os) const
Write the UList with its compound type.
void size(const label n)
Older name for setAddressableSize.
static int & msgType() noexcept
Message tag of standard messages.
const dictionary & coeffs() const
Return const dictionary of the model.
Mixed boundary condition for temperature, to be used for heat-transfer on back-to-back baffles....
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< scalarField > kappa(const scalarField &Tp) const
virtual void rmap(const fvPatchField< scalar > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void manipulateMatrix(fvMatrix< scalar > &m, const label iMatrix, const direction cmpt)
Manipulate matrix.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
virtual bool write()
Write the output fields.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void operator=(const UList< scalar > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
const polyMesh & sampleMesh() const
Get the region mesh.
const polyPatch & samplePolyPatch() const
Get the patch on the region.
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE)
const word & sampleRegion() const
Region to sample.
bool sameWorld() const
Is sample world the local world?
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
static const mappedPatchBase & mapper(const fvPatch &p, const DimensionedField< scalar, volMesh > &iF)
Check that patch is of correct type.
void distribute(const word &fieldName, Field< T > &newValues) const
label index() const noexcept
The index of this patch in the boundaryMesh.
Common functions used in temperature coupled boundaries.
virtual void autoMap(const fvPatchFieldMapper &)=0
Map (and resize as needed) from self given a mapping object.
virtual void rmap(const fvPatchField< scalar > &, const labelList &)=0
Reverse map the given fvPatchField onto this fvPatchField.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Type gSum(const FieldField< Field, Type > &f)
To & refCast(From &r)
Reference type cast template function.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
Type gAverage(const FieldField< Field, Type > &f)
Type gMin(const FieldField< Field, Type > &f)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gMax(const FieldField< Field, Type > &f)
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
The type name used in ensight case files.