35 namespace compressible
40 template<
class sol
idType>
49 mixedFvPatchScalarField(p, iF),
51 baffleActivated_(
true),
56 qrPrevious_(p.
size()),
58 qrName_(
"undefined-qr")
62 template<
class sol
idType>
73 mixedFvPatchScalarField(ptf, p, iF, mapper),
75 baffleActivated_(ptf.baffleActivated_),
76 thickness_(mapper(ptf.thickness_)),
78 solidDict_(ptf.solidDict_),
79 solidPtr_(ptf.solidPtr_),
80 qrPrevious_(mapper(ptf.qrPrevious_)),
81 qrRelaxation_(ptf.qrRelaxation_),
86 template<
class sol
idType>
96 mixedFvPatchScalarField(p, iF),
103 qrPrevious_(p.
size(), 0.0),
109 if (dict.
found(
"thickness"))
114 if (dict.
found(
"Qs"))
119 if (dict.
found(
"qrPrevious"))
124 if (dict.
found(
"refValue") && baffleActivated_)
136 valueFraction() = 0.0;
142 template<
class sol
idType>
150 mixedFvPatchScalarField(ptf),
152 baffleActivated_(ptf.baffleActivated_),
153 thickness_(ptf.thickness_),
155 solidDict_(ptf.solidDict_),
156 solidPtr_(ptf.solidPtr_),
157 qrPrevious_(ptf.qrPrevious_),
158 qrRelaxation_(ptf.qrRelaxation_),
163 template<
class sol
idType>
172 mixedFvPatchScalarField(ptf, iF),
174 baffleActivated_(ptf.baffleActivated_),
175 thickness_(ptf.thickness_),
177 solidDict_(ptf.solidDict_),
178 solidPtr_(ptf.solidPtr_),
179 qrPrevious_(ptf.qrPrevious_),
180 qrRelaxation_(ptf.qrRelaxation_),
187 template<
class sol
idType>
192 const label nbrPatchi = samplePolyPatch().index();
194 return (patchi < nbrPatchi);
198 template<
class sol
idType>
203 if (solidPtr_.empty())
205 solidPtr_.reset(
new solidType(solidDict_));
215 refCast<const thermalBaffle1DFvPatchScalarField>
217 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
220 return nbrField.solid();
225 template<
class sol
idType>
231 if (thickness_.size() != patch().size())
236 )<<
" Field thickness has not been specified " 237 <<
" for patch " << this->patch().name()
250 refCast<const thermalBaffle1DFvPatchScalarField>
252 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
266 template<
class sol
idType>
281 refCast<const thermalBaffle1DFvPatchScalarField>
283 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
294 template<
class sol
idType>
302 mixedFvPatchScalarField::autoMap(m);
306 m(thickness_, thickness_);
312 template<
class sol
idType>
319 mixedFvPatchScalarField::rmap(ptf, addr);
322 refCast<const thermalBaffle1DFvPatchScalarField>(ptf);
326 thickness_.
rmap(tiptf.thickness_, addr);
327 Qs_.rmap(tiptf.Qs_, addr);
332 template<
class sol
idType>
348 const label nbrPatchi = samplePolyPatch().index();
350 if (baffleActivated_)
355 db().template lookupObject<compressible::turbulenceModel>
364 patch().template lookupPatchField<volScalarField, scalar>(TName_);
369 if (qrName_ !=
"none")
371 qr = patch().template lookupPatchField<volScalarField, scalar>
374 qr = qrRelaxation_*qr + (1.0 - qrRelaxation_)*qrPrevious_;
380 scalarField myKDelta(patch().deltaCoeffs()*kappaw);
384 turbModel.transport().T().boundaryField()[nbrPatchi];
391 kappas[i] = solid().kappa(0.0, (Tp[i] + nbrTp[i])/2.0);
398 valueFraction() = alpha/(alpha + myKDelta);
400 refValue() = (KDeltaSolid*nbrTp + Qs()/2.0)/
alpha;
405 Info<< patch().boundaryMesh().mesh().name() <<
':' 406 << patch().name() <<
':' 407 << this->internalField().name() <<
" <- " 408 << nbrPatch.
name() <<
':' 409 << this->internalField().name() <<
" :" 411 <<
" walltemperature " 412 <<
" min:" <<
gMin(*
this)
413 <<
" max:" <<
gMax(*
this)
422 mixedFvPatchScalarField::updateCoeffs();
425 template<
class sol
idType>
433 writeEntry(os,
"thickness", baffleThickness()());
440 writeEntry(os,
"qrRelaxation", qrRelaxation_);
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual void write(Ostream &) const
Write.
virtual tmp< volScalarField > kappaEff() const
Effective thermal turbulent diffusivity for temperature.
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...
Type gMin(const FieldField< Field, Type > &f)
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
T & ref() const
Return non-const reference or generate a fatal error.
virtual void write(Ostream &) const
Write as a dictionary.
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.
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
const mapDistribute & map() const
Return reference to the parallel distribution map.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const polyPatch & patch() const
Return the polyPatch.
Foam::fvPatchFieldMapper.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
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)
Class containing processor-to-processor mapping information.
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)
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.
virtual const word & name() const
Return name.
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
A class for managing temporary objects.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)