43template<
class sol
idType>
52 mixedFvPatchScalarField(
p, iF),
54 baffleActivated_(
true),
59 qrPrevious_(
p.size()),
61 qrName_(
"undefined-qr")
65template<
class sol
idType>
76 mixedFvPatchScalarField(ptf,
p, iF, mapper),
78 baffleActivated_(ptf.baffleActivated_),
79 thickness_(ptf.thickness_, mapper),
81 solidDict_(ptf.solidDict_),
82 solidPtr_(ptf.solidPtr_),
83 qrPrevious_(ptf.qrPrevious_, mapper),
84 qrRelaxation_(ptf.qrRelaxation_),
89template<
class sol
idType>
99 mixedFvPatchScalarField(
p, iF),
101 baffleActivated_(
dict.getOrDefault(
"baffleActivated", true)),
106 qrPrevious_(
p.size(),
Zero),
109 dict.getOrDefaultCompat(
"qrRelaxation", {{
"relaxation", 1712}}, 1)
111 qrName_(
dict.getOrDefault<word>(
"qr",
"none"))
115 if (
dict.found(
"thickness"))
120 if (
dict.found(
"qs"))
125 if (
dict.found(
"qrPrevious"))
130 if (baffleActivated_ && this->readMixedEntries(
dict))
139 valueFraction() = 0.0;
145template<
class sol
idType>
149 const thermalBaffle1DFvPatchScalarField& ptf
153 mixedFvPatchScalarField(ptf),
155 baffleActivated_(ptf.baffleActivated_),
156 thickness_(ptf.thickness_),
158 solidDict_(ptf.solidDict_),
159 solidPtr_(ptf.solidPtr_),
160 qrPrevious_(ptf.qrPrevious_),
161 qrRelaxation_(ptf.qrRelaxation_),
166template<
class sol
idType>
175 mixedFvPatchScalarField(ptf, iF),
177 baffleActivated_(ptf.baffleActivated_),
178 thickness_(ptf.thickness_),
180 solidDict_(ptf.solidDict_),
181 solidPtr_(ptf.solidPtr_),
182 qrPrevious_(ptf.qrPrevious_),
183 qrRelaxation_(ptf.qrRelaxation_),
190template<
class sol
idType>
193 const label patchi = patch().index();
195 const label nbrPatchi = samplePolyPatch().index();
197 return (patchi < nbrPatchi);
201template<
class sol
idType>
202const solidType& thermalBaffle1DFvPatchScalarField<solidType>::solid()
const
208 solidPtr_.reset(
new solidType(solidDict_));
214 const fvPatch& nbrPatch =
215 patch().boundaryMesh()[samplePolyPatch().index()];
220 nbrPatch.template lookupPatchField<volScalarField>(TName_)
223 return nbrField.solid();
228template<
class sol
idType>
234 if (thickness_.size() !=
patch().size())
237 <<
"Field thickness has not been specified"
238 " for patch " << this->
patch().name()
248 const fvPatch& nbrPatch =
249 patch().boundaryMesh()[samplePolyPatch().index()];
253 nbrPatch.template lookupPatchField<volScalarField>(TName_)
257 auto& thickness = tthickness.ref();
259 mapDist.distribute(thickness);
265template<
class sol
idType>
266tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::qs()
const
276 const fvPatch& nbrPatch =
277 patch().boundaryMesh()[samplePolyPatch().index()];
282 nbrPatch.template lookupPatchField<volScalarField>(TName_)
286 auto& qs = tqs.ref();
288 mapDist.distribute(qs);
294template<
class sol
idType>
302 mixedFvPatchScalarField::autoMap(m);
306 thickness_.autoMap(m);
312template<
class sol
idType>
319 mixedFvPatchScalarField::rmap(ptf, addr);
321 const thermalBaffle1DFvPatchScalarField& tiptf =
326 thickness_.rmap(tiptf.thickness_, addr);
327 qs_.rmap(tiptf.qs_, addr);
332template<
class sol
idType>
345 const label patchi = patch().index();
347 const label nbrPatchi = samplePolyPatch().index();
349 if (baffleActivated_)
351 const fvPatch& nbrPatch = patch().boundaryMesh()[nbrPatchi];
354 db().template lookupObject<compressible::turbulenceModel>
360 const scalarField kappaw(turbModel.kappaEff(patchi));
363 patch().template lookupPatchField<volScalarField>(TName_);
368 if (qrName_ !=
"none")
370 qr = patch().template lookupPatchField<volScalarField>(qrName_);
372 qr = qrRelaxation_*qr + (1.0 - qrRelaxation_)*qrPrevious_;
376 tmp<scalarField> Ti = patchInternalField();
382 turbModel.transport().
T().boundaryField()[nbrPatchi];
383 mapDist.distribute(nbrTp);
389 kappas[i] = solid().kappa(0.0, (Tp[i] + nbrTp[i])/2.0);
398 refValue() = (KDeltaSolid*nbrTp + qs()/2.0)/
alpha;
407 Info<<
patch().boundaryMesh().mesh().name() <<
':'
408 <<
patch().name() <<
':'
409 << this->internalField().name() <<
" <- "
410 << nbrPatch.name() <<
':'
411 << this->internalField().name() <<
" :"
413 <<
" walltemperature "
414 <<
" min:" <<
limits.min()
415 <<
" max:" <<
limits.max()
423 mixedFvPatchScalarField::updateCoeffs();
426template<
class sol
idType>
434 baffleThickness()().writeEntry(
"thickness",
os);
435 qs()().writeEntry(
"qs",
os);
439 qrPrevious_.writeEntry(
"qrPrevious",
os);
440 os.writeEntry(
"qr", qrName_);
441 os.writeEntry(
"qrRelaxation", qrRelaxation_);
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors).
@ MUST_READ
Reading required.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual tmp< volScalarField > kappaEff() const
Return the effective turbulent thermal diffusivity for temperature.
const transportModel & transport() const
Access function to incompressible transport model.
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.
This BC solves a steady 1D thermal baffle.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void write(Ostream &) const
Write.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
thermalBaffle1DFvPatchScalarField(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 FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual const word & name() const
Return name.
Class containing processor-to-processor mapping information.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute List data using default commsType, default flip/negate operator.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
const mapDistribute & map() const
Return reference to the parallel distribution map.
bool owner() const
Is it owner.
@ NEARESTPATCHFACE
nearest face on selected patch
virtual void write(Ostream &os) const
Write as a dictionary.
const polyPatch & samplePolyPatch() const
Get the patch on the region.
mappedPatchBase(const polyPatch &)
Construct from patch.
virtual void write(Ostream &) const
Write.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
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.
List< label > labelList
A List of labels.
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.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
MinMax< Type > gMinMax(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0).
errorManipArg< error, int > exit(error &err, const int errNo=1)
fvPatchField< scalar > fvPatchScalarField
#define forAll(list, i)
Loop across all elements in list.