41 template<
class sol
idType>
50 mixedFvPatchScalarField(p, iF),
52 baffleActivated_(
true),
57 QrPrevious_(p.
size()),
59 QrName_(
"undefined-Qr")
63 template<
class sol
idType>
74 mixedFvPatchScalarField(ptf, p, iF, mapper),
76 baffleActivated_(ptf.baffleActivated_),
77 thickness_(ptf.thickness_, mapper),
79 solidDict_(ptf.solidDict_),
80 solidPtr_(ptf.solidPtr_),
81 QrPrevious_(ptf.QrPrevious_, mapper),
82 QrRelaxation_(ptf.QrRelaxation_),
87 template<
class sol
idType>
97 mixedFvPatchScalarField(p, iF),
104 QrPrevious_(p.
size(), 0.0),
110 if (dict.
found(
"thickness"))
115 if (dict.
found(
"Qs"))
120 if (dict.
found(
"QrPrevious"))
125 if (dict.
found(
"refValue") && baffleActivated_)
137 valueFraction() = 0.0;
143 template<
class sol
idType>
151 mixedFvPatchScalarField(ptf),
153 baffleActivated_(ptf.baffleActivated_),
154 thickness_(ptf.thickness_),
156 solidDict_(ptf.solidDict_),
157 solidPtr_(ptf.solidPtr_),
158 QrPrevious_(ptf.QrPrevious_),
159 QrRelaxation_(ptf.QrRelaxation_),
164 template<
class sol
idType>
173 mixedFvPatchScalarField(ptf, iF),
175 baffleActivated_(ptf.baffleActivated_),
176 thickness_(ptf.thickness_),
178 solidDict_(ptf.solidDict_),
179 solidPtr_(ptf.solidPtr_),
180 QrPrevious_(ptf.QrPrevious_),
181 QrRelaxation_(ptf.QrRelaxation_),
188 template<
class sol
idType>
193 const label nbrPatchi = samplePolyPatch().index();
195 return (patchi < nbrPatchi);
199 template<
class sol
idType>
204 if (solidPtr_.empty())
206 solidPtr_.reset(
new solidType(solidDict_));
216 refCast<const thermalBaffle1DFvPatchScalarField>
218 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
221 return nbrField.solid();
226 template<
class sol
idType>
232 if (thickness_.size() != patch().size())
236 " template<class solidType>" 237 " tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>" 238 " baffleThickness() const",
240 )<<
" Field thickness has not been specified " 241 <<
" for patch " << this->patch().name()
254 refCast<const thermalBaffle1DFvPatchScalarField>
256 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
270 template<
class sol
idType>
285 refCast<const thermalBaffle1DFvPatchScalarField>
287 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
298 template<
class sol
idType>
304 mixedFvPatchScalarField::autoMap(m);
308 thickness_.autoMap(m);
314 template<
class sol
idType>
321 mixedFvPatchScalarField::rmap(ptf, addr);
324 refCast<const thermalBaffle1DFvPatchScalarField>(ptf);
328 thickness_.
rmap(tiptf.thickness_, addr);
329 Qs_.rmap(tiptf.Qs_, addr);
334 template<
class sol
idType>
350 const label nbrPatchi = samplePolyPatch().index();
352 if (baffleActivated_)
357 db().template lookupObject<compressible::turbulenceModel>
366 patch().template lookupPatchField<volScalarField, scalar>(TName_);
371 if (QrName_ !=
"none")
373 Qr = patch().template lookupPatchField<volScalarField, scalar>
376 Qr = QrRelaxation_*Qr + (1.0 - QrRelaxation_)*QrPrevious_;
382 scalarField myKDelta(patch().deltaCoeffs()*kappaw);
386 turbModel.transport().T().boundaryField()[nbrPatchi];
393 kappas[i] = solid().kappa(0.0, (Tp[i] + nbrTp[i])/2.0);
400 valueFraction() = alpha/(alpha + myKDelta);
402 refValue() = (KDeltaSolid*nbrTp + Qs()/2.0)/
alpha;
407 Info<< patch().boundaryMesh().mesh().name() <<
':' 408 << patch().name() <<
':' 410 << nbrPatch.
name() <<
':' 413 <<
" walltemperature " 414 <<
" min:" <<
gMin(*
this)
415 <<
" max:" <<
gMax(*
this)
424 mixedFvPatchScalarField::updateCoeffs();
427 template<
class sol
idType>
435 baffleThickness()().writeEntry(
"thickness", os);
436 Qs()().writeEntry(
"Qs", os);
440 QrPrevious_.writeEntry(
"QrPrevious", os);
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
virtual void operator=(const UList< Type > &)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual tmp< volScalarField > kappaEff() const
Return the effective turbulent thermal diffusivity for temperature.
static void distribute(const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const labelListList &constructMap, List< T > &, const int tag=UPstream::msgType())
Distribute data. Note:schedule only used for Pstream::scheduled.
Class containing processor-to-processor mapping information.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Foam::fvPatchFieldMapper.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
const word & name() const
Return name.
virtual void write(Ostream &) const
Write.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const mapDistribute & map() const
Return reference to the parallel distribution map.
const polyPatch & patch() const
Return the polyPatch.
Ostream & endl(Ostream &os)
Add newline and flush stream.
thermalBaffle1DFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
static int & msgType()
Message tag of standard messages.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Type gMin(const FieldField< Field, Type > &f)
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
rDeltaT dimensionedInternalField()
Type gAverage(const FieldField< Field, Type > &f)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
static const word propertiesName
Default name of the turbulence properties dictionary.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual label size() const
Return size.
This function object calculates and outputs the second invariant of the velocity gradient tensor [1/s...
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
Type gMax(const FieldField< Field, Type > &f)
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
A class for managing temporary objects.
virtual void write(Ostream &) const
Write as a dictionary.