36 namespace compressible
41 template<
class sol
idType>
50 mixedFvPatchScalarField(
p, iF,
dict, false),
52 baffleActivated_(
dict.lookupOrDefault<bool>(
"baffleActivated", true)),
58 ? new solidType(
"solid",
dict)
61 qrPrevious_(
p.size(), 0.0),
62 qrRelaxation_(
dict.lookupOrDefault<scalar>(
"qrRelaxation",
dimless, 1)),
63 qrName_(
dict.lookupOrDefault<
word>(
"qr",
"none"))
79 if (
dict.found(
"thickness"))
89 if (
dict.found(
"qrPrevious"))
95 if (
dict.found(
"refValue") && baffleActivated_)
115 valueFraction() = 0.0;
120 template<
class sol
idType>
130 mixedFvPatchScalarField(ptf,
p, iF, mapper),
132 baffleActivated_(ptf.baffleActivated_),
133 thickness_(mapper(ptf.thickness_)),
134 qs_(mapper(ptf.qs_)),
135 solidPtr_(ptf.solidPtr_),
136 qrPrevious_(mapper(ptf.qrPrevious_)),
137 qrRelaxation_(ptf.qrRelaxation_),
142 template<
class sol
idType>
150 mixedFvPatchScalarField(ptf, iF),
152 baffleActivated_(ptf.baffleActivated_),
153 thickness_(ptf.thickness_),
155 solidPtr_(ptf.solidPtr_),
156 qrPrevious_(ptf.qrPrevious_),
157 qrRelaxation_(ptf.qrRelaxation_),
164 template<
class sol
idType>
173 template<
class sol
idType>
174 const thermalBaffle1DFvPatchScalarField<solidType>&
175 thermalBaffle1DFvPatchScalarField<solidType>::nbrField()
const
182 refCast<const fvMesh>(nbrMesh).boundary()[nbrPatchi];
185 refCast<const thermalBaffle1DFvPatchScalarField>
187 nbrPatch.template lookupPatchField<volScalarField, scalar>
195 template<
class sol
idType>
196 const solidType& thermalBaffle1DFvPatchScalarField<solidType>::solid()
const
200 if (solidPtr_.empty())
210 return nbrField().solid();
215 template<
class sol
idType>
216 tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::
217 baffleThickness()
const
221 if (thickness_.size() != patch().size())
224 <<
" Field thickness has not been specified "
225 <<
" for patch " << this->patch().name()
233 const mappedFvPatchBaseBase& mapper =
235 return mapper.fromNeighbour(nbrField().baffleThickness());
240 template<
class sol
idType>
241 tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::qs()
const
249 const mappedFvPatchBaseBase& mapper =
251 return mapper.fromNeighbour(nbrField().qs());
256 template<
class sol
idType>
263 mixedFvPatchScalarField::map(ptf, mapper);
266 refCast<const thermalBaffle1DFvPatchScalarField>(ptf);
270 mapper(thickness_, tiptf.thickness_);
271 mapper(qs_, tiptf.qs_);
276 template<
class sol
idType>
282 mixedFvPatchScalarField::reset(ptf);
285 refCast<const thermalBaffle1DFvPatchScalarField>(ptf);
289 thickness_.reset(tiptf.thickness_);
290 qs_.reset(tiptf.qs_);
295 template<
class sol
idType>
311 if (baffleActivated_)
314 db().objectRegistry::template lookupObject
321 thermophysicalTransportModel::typeName,
322 internalField().
group()
328 patch().template lookupPatchField<volScalarField, scalar>(TName_);
334 if (qrName_ !=
"none")
336 qr = patch().template lookupPatchField<volScalarField, scalar>
339 qr = qrRelaxation_*qr + (1.0 - qrRelaxation_)*qrPrevious_;
343 const scalarField kappaDelta(kappap*patch().deltaCoeffs());
346 const scalarField nbrTp(mapper.fromNeighbour(nbrField()));
352 kappas[i] = solid().kappa(0.0, (Tp[i] + nbrTp[i])/2.0);
355 const scalarField kappaByDeltaSolid(kappas/baffleThickness());
361 refValue() = (kappaByDeltaSolid*nbrTp + qs()/2.0)/
alpha;
366 Info<< patch().boundaryMesh().mesh().name() <<
':'
367 << patch().name() <<
':'
368 << this->internalField().name() <<
" <- "
369 << nbrField().patch().name() <<
':'
370 << this->internalField().name() <<
" :"
372 <<
" walltemperature "
373 <<
" min:" <<
gMin(*
this)
374 <<
" max:" <<
gMax(*
this)
383 mixedFvPatchScalarField::updateCoeffs();
387 template<
class sol
idType>
394 writeEntry(os,
"thickness", baffleThickness()());
401 writeEntry(os,
"qrRelaxation", qrRelaxation_);
#define forAll(list, i)
Loop across all elements in list.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet & dimensions() const
Return dimensions.
static word groupName(Name name, const word &group)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static int & msgType()
Message tag of standard messages.
This BC solves a steady 1D thermal baffle.
virtual void write(Ostream &) const
Write.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void map(const fvPatchScalarField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
thermalBaffle1DFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Abstract base class for field mapping.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
friend Ostream & operator(Ostream &, const fvPatchField< Type > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
label index() const
Return the index of this patch in the fvBoundaryMesh.
Base class for fv patches that provide mapping between two fv patches.
const fvPatch & nbrFvPatch() const
Get the patch to map from.
static const mappedFvPatchBaseBase & getMap(const fvPatch &patch)
Cast the given fvPatch to a mappedFvPatchBaseBase. Handle errors.
const fvMesh & nbrMesh() const
Get the mesh for the region to map from.
static void validateMapForField(const PatchField &field, const FieldType &iF, const dictionary &context, const label froms=from::any)
Validate that the map exists and is appropriate for the given.
Mesh consisting of general polyhedral cells.
Abstract base class for all fluid and solid thermophysical transport models.
virtual tmp< volScalarField > kappaEff() const =0
Effective thermal turbulent conductivity.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
const char *const group
Group name for atomic constants.
tmp< SurfaceField< Type > > snGrad(const VolField< Type > &vf, const word &name)
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimPower
const dimensionSet dimless
const dimensionSet dimLength
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Type gAverage(const FieldField< Field, Type > &f)
const dimensionSet dimArea
Type gMin(const FieldField< Field, Type > &f)
Type gMax(const FieldField< Field, Type > &f)
const unitConversion unitFraction
static const label differentPatch
static const label sameRegion