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>
72 mixedFvPatchScalarField(p, iF),
79 qrPrevious_(p.
size(), 0.0),
85 if (dict.
found(
"thickness"))
95 if (dict.
found(
"qrPrevious"))
100 if (dict.
found(
"refValue") && baffleActivated_)
112 valueFraction() = 0.0;
117 template<
class sol
idType>
128 mixedFvPatchScalarField(ptf, p, iF, mapper),
130 baffleActivated_(ptf.baffleActivated_),
131 thickness_(mapper(ptf.thickness_)),
132 Qs_(mapper(ptf.Qs_)),
133 solidDict_(ptf.solidDict_),
134 solidPtr_(ptf.solidPtr_),
135 qrPrevious_(mapper(ptf.qrPrevious_)),
136 qrRelaxation_(ptf.qrRelaxation_),
141 template<
class sol
idType>
150 mixedFvPatchScalarField(ptf, iF),
152 baffleActivated_(ptf.baffleActivated_),
153 thickness_(ptf.thickness_),
155 solidDict_(ptf.solidDict_),
156 solidPtr_(ptf.solidPtr_),
157 qrPrevious_(ptf.qrPrevious_),
158 qrRelaxation_(ptf.qrRelaxation_),
165 template<
class sol
idType>
170 const label nbrPatchi = samplePolyPatch().index();
172 return (patchi < nbrPatchi);
176 template<
class sol
idType>
181 if (solidPtr_.empty())
183 solidPtr_.reset(
new solidType(solidDict_));
193 refCast<const thermalBaffle1DFvPatchScalarField>
195 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
198 return nbrField.solid();
203 template<
class sol
idType>
209 if (thickness_.size() != patch().size())
214 )<<
" Field thickness has not been specified " 215 <<
" for patch " << this->patch().name()
228 refCast<const thermalBaffle1DFvPatchScalarField>
230 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
244 template<
class sol
idType>
259 refCast<const thermalBaffle1DFvPatchScalarField>
261 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
272 template<
class sol
idType>
280 mixedFvPatchScalarField::autoMap(m);
284 m(thickness_, thickness_);
290 template<
class sol
idType>
297 mixedFvPatchScalarField::rmap(ptf, addr);
300 refCast<const thermalBaffle1DFvPatchScalarField>(ptf);
304 thickness_.
rmap(tiptf.thickness_, addr);
305 Qs_.rmap(tiptf.Qs_, addr);
310 template<
class sol
idType>
326 const label nbrPatchi = samplePolyPatch().index();
328 if (baffleActivated_)
333 db().objectRegistry::template lookupObject
340 thermophysicalTransportModel::typeName,
341 internalField().
group()
349 patch().template lookupPatchField<volScalarField, scalar>(TName_);
354 if (qrName_ !=
"none")
356 qr = patch().template lookupPatchField<volScalarField, scalar>
359 qr = qrRelaxation_*qr + (1.0 - qrRelaxation_)*qrPrevious_;
365 scalarField myKDelta(patch().deltaCoeffs()*kappaw);
375 kappas[i] = solid().kappa(0.0, (Tp[i] + nbrTp[i])/2.0);
382 valueFraction() = alpha/(alpha + myKDelta);
384 refValue() = (KDeltaSolid*nbrTp + Qs()/2.0)/
alpha;
389 Info<< patch().boundaryMesh().mesh().name() <<
':' 390 << patch().name() <<
':' 391 << this->internalField().name() <<
" <- " 392 << nbrPatch.
name() <<
':' 393 << this->internalField().name() <<
" :" 395 <<
" walltemperature " 396 <<
" min:" <<
gMin(*
this)
397 <<
" max:" <<
gMax(*
this)
406 mixedFvPatchScalarField::updateCoeffs();
409 template<
class sol
idType>
417 writeEntry(os,
"thickness", baffleThickness()());
424 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.
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.
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,.
virtual const volScalarField & T() const =0
Temperature [K].
#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.
A class for managing temporary objects.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)