51 mixedFvPatchScalarField(
p, iF),
58 TnbrName_(
"undefined-Tnbr")
60 this->refValue() =
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),
109 if (!isA<mappedPatchBase>(this->
patch().
patch()))
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;
179 const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField& wtcsf,
180 const DimensionedField<scalar, volMesh>& iF
183 mixedFvPatchScalarField(wtcsf, iF),
184 temperatureCoupledBase(
patch(), wtcsf),
185 mappedPatchFieldBase<scalar>
187 mappedPatchFieldBase<scalar>::mapper(
patch(), 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_),
228 mixedFvPatchScalarField::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];
317 const mappedPatchBase& mpp =
321 this->internalField()
326 const tmp<scalarField> myKDelta = kappaTp*
patch().deltaCoeffs();
334 const auto& nbrMesh = refCast<const fvMesh>(mpp.sampleMesh());
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();
388 Info<<
patch().boundaryMesh().mesh().name() <<
':' 389 <<
patch().name() <<
':' 390 << this->internalField().name() <<
" <- " 391 << mpp.sampleRegion() <<
':' 392 << mpp.samplePatch() <<
':' 393 << this->internalField().name() <<
" :" 394 <<
" heat transfer rate:" << Q
395 <<
" walltemperature " 396 <<
" min:" <<
gMin(*
this)
397 <<
" max:" <<
gMax(*
this)
414 <<
"This BC does not support energy coupling " 415 <<
"Use compressible::turbulentTemperatureRadCoupledMixed " 416 <<
"which has more functionalities and it can handle " 417 <<
"the assemble coupled option for energy. " 423 turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::coeffs
425 fvMatrix<scalar>& matrix,
426 const Field<scalar>& coeffs,
431 <<
"This BC does not support energy coupling " 432 <<
"Use compressible::turbulentTemperatureRadCoupledMixed " 433 <<
"which has more functionalities and it can handle " 434 <<
"the assemble coupled option for energy. " 447 os.writeEntry(
"Tnbr", TnbrName_);
450 thicknessLayer_().writeData(
os);
451 kappaLayer_().writeData(
os);
453 if (thicknessLayers_.
size())
468 turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Mixed boundary condition for temperature, to be used for heat-transfer on back-to-back baffles...
void size(const label n)
Older name for setAddressableSize.
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static int incrMsgType(int val=1) noexcept
Increment the message tag for standard messages.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
static const mappedPatchBase & mapper(const fvPatch &p, const DimensionedField< Type, volMesh > &iF)
Check that patch is of correct type.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
virtual void write(Ostream &os) const
Write.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
virtual tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual void rmap(const fvPatchField< scalar > &, const labelList &)=0
Reverse map the given fvPatchField onto this fvPatchField.
static int & msgType() noexcept
Message tag of standard messages.
virtual void autoMap(const fvPatchFieldMapper &)=0
Map (and resize as needed) from self given a mapping object.
void write(Ostream &os) const
Write.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
makePatchTypeField(fvPatchScalarField, alphatFixedDmdtWallBoilingWallFunctionFvPatchScalarField)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Type gSum(const FieldField< Field, Type > &f)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
fvPatchField< scalar > fvPatchScalarField
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A FieldMapper for finite-volume patch 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.
errorManip< error > abort(error &err)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
int debug
Static debugging option.
Type gMax(const FieldField< Field, Type > &f)
OBJstream os(runTime.globalPath()/outputName)
Common functions used in temperature coupled boundaries.
#define WarningInFunction
Report a warning using Foam::Warning.
Type gAverage(const FieldField< Field, Type > &f)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
static autoPtr< PatchFunction1< Type > > NewIfPresent(const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
An optional selector.
messageStream Info
Information stream (stdout output on master, null elsewhere)
void writeEntry(Ostream &os) const
Write the UList with its compound type.
virtual void write(Ostream &) const
Write.
virtual void rmap(const fvPatchField< scalar > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field. Override temperatureCoupledBase::kappa to in...
A class for managing temporary objects.
void distribute(const word &fieldName, Field< T > &newValues) const
Wrapper for mapDistribute::distribute that knows about dabase mapping.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
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.
virtual void write(Ostream &os) const
Write.
static constexpr const zero Zero
Global zero (0)