36 namespace compressible
41 template<
class sol
idType>
49 mixedFvPatchScalarField(p, iF),
51 baffleActivated_(
true),
56 qrPrevious_(p.
size()),
58 qrName_(
"undefined-qr")
62 template<
class sol
idType>
71 mixedFvPatchScalarField(p, iF),
78 qrPrevious_(p.
size(), 0.0),
82 if (!isA<mappedPatchBase>(this->patch().patch()))
85 <<
"' not type '" << mappedPatchBase::typeName <<
"'" 86 <<
"\n for patch " << p.
name()
87 <<
" of field " << internalField().name()
88 <<
" in file " << internalField().objectPath()
94 if (dict.
found(
"thickness"))
103 else if (dict.
found(
"Qs"))
108 if (dict.
found(
"qrPrevious"))
113 if (dict.
found(
"refValue") && baffleActivated_)
125 valueFraction() = 0.0;
130 template<
class sol
idType>
140 mixedFvPatchScalarField(ptf, p, iF, mapper),
142 baffleActivated_(ptf.baffleActivated_),
143 thickness_(mapper(ptf.thickness_)),
144 qs_(mapper(ptf.qs_)),
145 solidDict_(ptf.solidDict_),
146 solidPtr_(ptf.solidPtr_),
147 qrPrevious_(mapper(ptf.qrPrevious_)),
148 qrRelaxation_(ptf.qrRelaxation_),
153 template<
class sol
idType>
161 mixedFvPatchScalarField(ptf, iF),
163 baffleActivated_(ptf.baffleActivated_),
164 thickness_(ptf.thickness_),
166 solidDict_(ptf.solidDict_),
167 solidPtr_(ptf.solidPtr_),
168 qrPrevious_(ptf.qrPrevious_),
169 qrRelaxation_(ptf.qrRelaxation_),
176 template<
class sol
idType>
180 refCast<const mappedPatchBase>(patch().patch());
186 <<
" must map to a patch field in the same region" 194 template<
class sol
idType>
199 refCast<const mappedPatchBase>(patch().patch());
203 refCast<const fvMesh>(nbrMesh).
boundary()[samplePatchi];
206 refCast<const thermalBaffle1DFvPatchScalarField>
208 nbrPatch.template lookupPatchField<volScalarField, scalar>
216 template<
class sol
idType>
221 if (solidPtr_.empty())
223 solidPtr_.
reset(
new solidType(solidDict_));
230 return nbrField().solid();
235 template<
class sol
idType>
241 if (thickness_.size() != patch().size())
244 <<
" Field thickness has not been specified " 245 <<
" for patch " << this->patch().name()
254 refCast<const mappedPatchBase>(patch().patch());
261 return nbrBaffleThickness;
266 template<
class sol
idType>
276 refCast<const mappedPatchBase>(patch().patch());
288 template<
class sol
idType>
294 mixedFvPatchScalarField::autoMap(m);
298 m(thickness_, thickness_);
304 template<
class sol
idType>
311 mixedFvPatchScalarField::rmap(ptf, addr);
314 refCast<const thermalBaffle1DFvPatchScalarField>(ptf);
318 thickness_.
rmap(tiptf.thickness_, addr);
319 qs_.rmap(tiptf.qs_, addr);
324 template<
class sol
idType>
330 mixedFvPatchScalarField::reset(ptf);
333 refCast<const thermalBaffle1DFvPatchScalarField>(ptf);
337 thickness_.
reset(tiptf.thickness_);
338 qs_.reset(tiptf.qs_);
343 template<
class sol
idType>
357 refCast<const mappedPatchBase>(patch().patch());
359 if (baffleActivated_)
362 db().objectRegistry::template lookupObject
369 thermophysicalTransportModel::typeName,
370 internalField().
group()
376 patch().template lookupPatchField<volScalarField, scalar>(TName_);
382 if (qrName_ !=
"none")
384 qr = patch().template lookupPatchField<volScalarField, scalar>
387 qr = qrRelaxation_*qr + (1.0 - qrRelaxation_)*qrPrevious_;
391 scalarField kappaDelta(kappap*patch().deltaCoeffs());
401 kappas[i] = solid().kappa(0.0, (Tp[i] + nbrTp[i])/2.0);
408 valueFraction() = alpha/(alpha + kappaDelta);
410 refValue() = (KDeltaSolid*nbrTp + qs()/2.0)/
alpha;
415 Info<< patch().boundaryMesh().mesh().name() <<
':' 416 << patch().name() <<
':' 417 << this->internalField().name() <<
" <- " 418 << nbrField().patch().name() <<
':' 419 << this->internalField().name() <<
" :" 421 <<
" walltemperature " 422 <<
" min:" <<
gMin(*
this)
423 <<
" max:" <<
gMax(*
this)
432 mixedFvPatchScalarField::updateCoeffs();
436 template<
class sol
idType>
443 writeEntry(os,
"thickness", baffleThickness()());
450 writeEntry(os,
"qrRelaxation", qrRelaxation_);
const char *const group
Group name for atomic constants.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
thermalBaffle1DFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
#define forAll(list, i)
Loop across all elements in list.
virtual void write(Ostream &) const
Write.
bool sameRegion() const
Cached sampleRegion != mesh.name()
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
const polyMesh & sampleMesh() const
Get the region mesh.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
static int & msgType()
Message tag of standard messages.
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.
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static word groupName(Name name, const word &group)
Foam::fvPatchFieldMapper.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
faceListList boundary(nPatches)
virtual label size() const
Return size.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Type gMax(const FieldField< Field, Type > &f)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Abstract base class for thermophysical transport models (RAS, LES and laminar).
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
virtual tmp< volScalarField > kappaEff() const =0
Effective thermal turbulent diffusivity for temperature.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Type gAverage(const FieldField< Field, Type > &f)
label index() const
Return the index of this patch in the boundaryMesh.
virtual void operator=(const UList< Type > &)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
This BC solves a steady 1D thermal baffle.
Mesh consisting of general polyhedral cells.
virtual const word & name() const
Return name.
A class for managing temporary objects.
const polyPatch & samplePolyPatch() const
Get the patch on the region.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)