51 mixedFvPatchScalarField(
p, iF),
58 TnbrName_(
"undefined-Tnbr")
60 this->refValue() =
Zero;
61 this->refGrad() =
Zero;
62 this->valueFraction() = 1.0;
75 mixedFvPatchScalarField(ptf,
p, iF, mapper),
83 TnbrName_(ptf.TnbrName_),
84 thicknessLayers_(ptf.thicknessLayers_),
85 thicknessLayer_(ptf.thicknessLayer_.
clone(
p.patch())),
86 kappaLayers_(ptf.kappaLayers_),
87 kappaLayer_(ptf.kappaLayer_.
clone(
p.patch()))
99 mixedFvPatchScalarField(
p, iF),
112 <<
"' not type '" << mappedPatchBase::typeName <<
"'"
113 <<
"\n for patch " <<
p.name()
114 <<
" of field " << internalField().name()
115 <<
" in file " << internalField().objectPath()
120 <<
"This BC has been superseded by "
121 <<
"compressible::turbulentTemperatureRadCoupledMixed "
122 <<
"which has more functionalities and it can handle "
123 <<
"the assemble coupled option for energy. "
127 if (
dict.readIfPresent(
"thicknessLayers", thicknessLayers_))
129 dict.readEntry(
"kappaLayers", kappaLayers_);
148 if (this->readMixedEntries(
dict))
157 valueFraction() = 1.0;
183 mixedFvPatchScalarField(wtcsf, iF),
191 TnbrName_(wtcsf.TnbrName_),
192 thicknessLayers_(wtcsf.thicknessLayers_),
193 thicknessLayer_(wtcsf.thicknessLayer_.
clone(patch().patch())),
194 kappaLayers_(wtcsf.kappaLayers_),
195 kappaLayer_(wtcsf.kappaLayer_.
clone(patch().patch()))
205 mixedFvPatchScalarField(wtcsf),
213 TnbrName_(wtcsf.TnbrName_),
214 thicknessLayers_(wtcsf.thicknessLayers_),
215 thicknessLayer_(wtcsf.thicknessLayer_.clone(patch().patch())),
216 kappaLayers_(wtcsf.kappaLayers_),
217 kappaLayer_(wtcsf.kappaLayer_.
clone(patch().patch()))
228 mixedFvPatchScalarField::autoMap(
mapper);
233 thicknessLayer_().autoMap(
mapper);
234 kappaLayer_().autoMap(
mapper);
245 mixedFvPatchScalarField::rmap(ptf, addr);
257 thicknessLayer_().rmap(tiptf.thicknessLayer_(), addr);
258 kappaLayer_().rmap(tiptf.kappaLayer_(), addr);
273 if (thicknessLayer_ || thicknessLayers_.
size())
282 const scalar t = db().time().timeOutputValue();
284 thicknessLayer_().value(t)
285 /kappaLayer_().value(t);
287 if (thicknessLayers_.
size())
289 forAll(thicknessLayers_, iLayer)
291 KDelta += thicknessLayers_[iLayer]/kappaLayers_[iLayer];
298 tk = KDelta/patch().deltaCoeffs();
317 const mappedPatchBase& mpp =
321 this->internalField()
326 const tmp<scalarField> myKDelta = kappaTp*patch().deltaCoeffs();
335 const label nbrPatchID = mpp.samplePolyPatch().index();
336 const auto& nbrPatch = nbrMesh.boundary()[nbrPatchID];
349 nbrIntFld = nbrField.patchInternalField();
350 nbrKDelta = nbrField.kappa(nbrField)*nbrPatch.deltaCoeffs();
356 nbrIntFld = patchInternalField();
357 nbrKDelta = myKDelta.ref();
378 this->refValue() = nbrIntFld;
379 this->refGrad() =
Zero;
380 this->valueFraction() = nbrKDelta/(nbrKDelta + myKDelta());
382 mixedFvPatchScalarField::updateCoeffs();
391 Info<<
patch().boundaryMesh().mesh().name() <<
':'
392 <<
patch().name() <<
':'
393 << this->internalField().name() <<
" <- "
394 << mpp.sampleRegion() <<
':'
395 << mpp.samplePatch() <<
':'
396 << this->internalField().name() <<
" :"
397 <<
" heat transfer rate:" << Q
398 <<
" walltemperature "
399 <<
" min:" <<
limits.min()
400 <<
" max:" <<
limits.max()
417 <<
"This BC does not support energy coupling "
418 <<
"Use compressible::turbulentTemperatureRadCoupledMixed "
419 <<
"which has more functionalities and it can handle "
420 <<
"the assemble coupled option for energy. "
426turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::coeffs
428 fvMatrix<scalar>& matrix,
429 const Field<scalar>& coeffs,
434 <<
"This BC does not support energy coupling "
435 <<
"Use compressible::turbulentTemperatureRadCoupledMixed "
436 <<
"which has more functionalities and it can handle "
437 <<
"the assemble coupled option for energy. "
450 os.writeEntry(
"Tnbr", TnbrName_);
453 thicknessLayer_().writeData(
os);
454 kappaLayer_().writeData(
os);
456 if (thicknessLayers_.
size())
471 turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
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...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
@ MUST_READ
Reading required.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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.
static int incrMsgType(int val=1) noexcept
Increment the message tag for standard messages.
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< fvPatchField< scalar > > clone() const
Return a clone.
virtual tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field. Override temperatureCoupledBase::kappa to in...
virtual void rmap(const fvPatchField< scalar > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void write(Ostream &os) const
Write.
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.
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
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...
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...
virtual void write(Ostream &os) const
Write.
static const mappedPatchBase & mapper(const fvPatch &p, const DimensionedField< scalar, volMesh > &iF)
mappedPatchFieldBase(const mappedPatchBase &mapper, const fvPatchField< scalar > &patchField, const word &fieldName, const bool setAverage, const scalar average, const word &interpolationScheme)
void distribute(const word &fieldName, Field< T > &newValues) const
virtual void write(Ostream &) const
Write.
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.
void write(Ostream &os) const
Write.
virtual void rmap(const fvPatchField< scalar > &, const labelList &)=0
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field.
temperatureCoupledBase(const fvPatch &patch, const KMethodType method=KMethodType::mtFluidThermo)
Default construct from patch, using fluidThermo (default) or specified method.
A class for managing temporary objects.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
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 a concrete fvPatchField type and add to run-time tables Example, (fvPatchScalarField,...
#define WarningInFunction
Report a warning using Foam::Warning.
Namespace for handling debugging switches.
const std::string patch
OpenFOAM patch number as a std::string.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Type gAverage(const FieldField< Field, Type > &f, const label comm)
The global arithmetic average of a FieldField.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Type gSum(const FieldField< Field, Type > &f)
List< label > labelList
A List of labels.
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.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
errorManip< error > abort(error &err)
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
fvPatchField< scalar > fvPatchScalarField
#define forAll(list, i)
Loop across all elements in list.