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().objectRegistry::template lookupObject
362 thermophysicalTransportModel::typeName,
363 internalField().
group()
371 patch().template lookupPatchField<volScalarField, scalar>(TName_);
376 if (qrName_ !=
"none")
378 qr = patch().template lookupPatchField<volScalarField, scalar>
381 qr = qrRelaxation_*qr + (1.0 - qrRelaxation_)*qrPrevious_;
387 scalarField myKDelta(patch().deltaCoeffs()*kappaw);
397 kappas[i] = solid().kappa(0.0, (Tp[i] + nbrTp[i])/2.0);
404 valueFraction() = alpha/(alpha + myKDelta);
406 refValue() = (KDeltaSolid*nbrTp + Qs()/2.0)/
alpha;
411 Info<< patch().boundaryMesh().mesh().name() <<
':' 412 << patch().name() <<
':' 413 << this->internalField().name() <<
" <- " 414 << nbrPatch.
name() <<
':' 415 << this->internalField().name() <<
" :" 417 <<
" walltemperature " 418 <<
" min:" <<
gMin(*
this)
419 <<
" max:" <<
gMax(*
this)
428 mixedFvPatchScalarField::updateCoeffs();
431 template<
class sol
idType>
439 writeEntry(os,
"thickness", baffleThickness()());
446 writeEntry(os,
"qrRelaxation", qrRelaxation_);
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
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.
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.
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)
virtual const fluidThermo & thermo() const =0
Access function to incompressible transport model.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
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...
virtual const volScalarField & T() const
Temperature [K].
static int & msgType()
Message tag of standard messages.
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.
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)
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 ...
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
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).
Class containing processor-to-processor mapping information.
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)
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)