67 mixedFvPatchScalarField(p, iF),
75 qrName_(
"undefined-qr"),
93 mixedFvPatchScalarField(p, iF),
95 mode_(operationModeNames.read(dict.
lookup(
"mode"))),
119 case fixedHeatTransferCoeff:
124 if (dict.
found(
"thicknessLayers"))
126 dict.
lookup(
"thicknessLayers") >> thicknessLayers_;
127 dict.
lookup(
"kappaLayers") >> kappaLayers_;
136 if (qrName_ !=
"none")
138 if (dict.
found(
"qrPrevious"))
148 if (dict.
found(
"refValue"))
174 mixedFvPatchScalarField(ptf, p, iF, mapper),
179 relaxation_(ptf.relaxation_),
180 emissivity_(ptf.emissivity_),
181 qrRelaxation_(ptf.qrRelaxation_),
182 qrName_(ptf.qrName_),
183 thicknessLayers_(ptf.thicknessLayers_),
184 kappaLayers_(ptf.kappaLayers_)
197 case fixedHeatTransferCoeff:
204 if (qrName_ !=
"none")
206 mapper(qrPrevious_, ptf.qrPrevious_);
217 mixedFvPatchScalarField(tppsf),
223 Ta_(tppsf.Ta_,
false),
224 relaxation_(tppsf.relaxation_),
225 emissivity_(tppsf.emissivity_),
226 qrPrevious_(tppsf.qrPrevious_),
227 qrRelaxation_(tppsf.qrRelaxation_),
228 qrName_(tppsf.qrName_),
229 thicknessLayers_(tppsf.thicknessLayers_),
230 kappaLayers_(tppsf.kappaLayers_)
241 mixedFvPatchScalarField(tppsf, iF),
247 Ta_(tppsf.Ta_,
false),
248 relaxation_(tppsf.relaxation_),
249 emissivity_(tppsf.emissivity_),
250 qrPrevious_(tppsf.qrPrevious_),
251 qrRelaxation_(tppsf.qrRelaxation_),
252 qrName_(tppsf.qrName_),
253 thicknessLayers_(tppsf.thicknessLayers_),
254 kappaLayers_(tppsf.kappaLayers_)
265 mixedFvPatchScalarField::autoMap(m);
279 case fixedHeatTransferCoeff:
287 if (qrName_ !=
"none")
289 m(qrPrevious_, qrPrevious_);
300 mixedFvPatchScalarField::rmap(ptf, addr);
303 refCast<const externalWallHeatFluxTemperatureFvPatchScalarField>(ptf);
313 q_.
rmap(tiptf.q_, addr);
317 case fixedHeatTransferCoeff:
319 h_.rmap(tiptf.h_, addr);
325 if (qrName_ !=
"none")
327 qrPrevious_.rmap(tiptf.qrPrevious_, addr);
346 if (qrName_ !=
"none")
351 + (1 - qrRelaxation_)*qrPrevious_;
360 refGrad() = (Q_/
gSum(patch().magSf()) + qr)/
kappa(*
this);
368 refGrad() = (q_ + qr)/
kappa(*
this);
374 case fixedHeatTransferCoeff:
376 scalar totalSolidRes = 0;
377 if (thicknessLayers_.size())
379 forAll(thicknessLayers_, iLayer)
381 const scalar l = thicknessLayers_[iLayer];
382 if (kappaLayers_[iLayer] > 0)
384 totalSolidRes += l/kappaLayers_[iLayer];
390 const scalar Ta = Ta_->value(this->db().time().timeOutputValue());
397 if (totalSolidRes > 0)
419 this->
kappa(*
this)*patch().deltaCoeffs()
428 const scalar hpmqr = hp[i] - qr[i]/Tp[i];
430 refValue()[i] = hpTa[i]/hpmqr;
431 valueFraction()[i] = hpmqr/(hpmqr + kappaDeltaCoeffs[i]);
435 refValue()[i] = (hpTa[i] + qr[i])/hp[i];
436 valueFraction()[i] = hp[i]/(hp[i] + kappaDeltaCoeffs[i]);
445 relaxation_*valueFraction()
446 + (1 - relaxation_)*valueFraction0;
448 refValue() = relaxation_*refValue() + (1 - relaxation_)*refValue0;
450 mixedFvPatchScalarField::updateCoeffs();
456 Info<< patch().boundaryMesh().mesh().name() <<
':' 457 << patch().name() <<
':' 458 << this->internalField().name() <<
" :" 459 <<
" heat transfer rate:" << Q
460 <<
" walltemperature " 461 <<
" min:" <<
gMin(*
this)
462 <<
" max:" <<
gMax(*
this)
476 writeEntry(os,
"mode", operationModeNames[mode_]);
493 case fixedHeatTransferCoeff:
508 if (thicknessLayers_.size())
510 writeEntry(os,
"thicknessLayers", thicknessLayers_);
520 if (qrName_ !=
"none")
522 writeEntry(os,
"qrRelaxation", qrRelaxation_);
529 writeEntry(os,
"valueFraction", valueFraction());
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
const dimensionedScalar & kappa
Coulomb constant: default SI units: [N.m2/C2].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Type gMin(const FieldField< Field, Type > &f)
const dimensionedScalar & sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
void size(const label)
Override size to be inconsistent with allocated storage.
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 void write(Ostream &) const
Write.
Initialise the NamedEnum HashTable from the static list of names.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Type gSum(const FieldField< Field, Type > &f)
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Foam::fvPatchFieldMapper.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const Type & value() const
Return const reference to value.
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)
dimensionedScalar pow3(const dimensionedScalar &ds)
static const NamedEnum< operationMode, 3 > operationModeNames
void setSize(const label)
Reset size of List.
Common functions used in temperature coupled boundaries.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
operationMode
Operation mode enumeration.
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...
dimensionedScalar pow4(const dimensionedScalar &ds)
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
externalWallHeatFluxTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
void write(Ostream &) const
Write.
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
This boundary condition applies a heat flux condition to temperature on an external wall in one of th...
void write(Ostream &) const
Write.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
static autoPtr< Function1< Type > > New(const word &entryName, const dictionary &dict)
Selector.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.