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_);
218 mixedFvPatchScalarField(tppsf, iF),
224 Ta_(tppsf.Ta_,
false),
225 relaxation_(tppsf.relaxation_),
226 emissivity_(tppsf.emissivity_),
227 qrPrevious_(tppsf.qrPrevious_),
228 qrRelaxation_(tppsf.qrRelaxation_),
229 qrName_(tppsf.qrName_),
230 thicknessLayers_(tppsf.thicknessLayers_),
231 kappaLayers_(tppsf.kappaLayers_)
242 mixedFvPatchScalarField::autoMap(m);
256 case fixedHeatTransferCoeff:
264 if (qrName_ !=
"none")
266 m(qrPrevious_, qrPrevious_);
277 mixedFvPatchScalarField::rmap(ptf, addr);
280 refCast<const externalWallHeatFluxTemperatureFvPatchScalarField>(ptf);
290 q_.
rmap(tiptf.q_, addr);
294 case fixedHeatTransferCoeff:
296 h_.rmap(tiptf.h_, addr);
302 if (qrName_ !=
"none")
304 qrPrevious_.rmap(tiptf.qrPrevious_, addr);
323 if (qrName_ !=
"none")
328 + (1 - qrRelaxation_)*qrPrevious_;
337 refGrad() = (Q_/
gSum(patch().magSf()) + qr)/
kappa(*
this);
345 refGrad() = (q_ + qr)/
kappa(*
this);
351 case fixedHeatTransferCoeff:
353 scalar totalSolidRes = 0;
354 if (thicknessLayers_.size())
356 forAll(thicknessLayers_, iLayer)
358 const scalar l = thicknessLayers_[iLayer];
359 if (kappaLayers_[iLayer] > 0)
361 totalSolidRes += l/kappaLayers_[iLayer];
366 const scalar Ta = Ta_->value(this->db().time().timeOutputValue());
378 *((
pow3(Ta) +
pow3(Tp)) + Ta*Tp*(Ta + Tp))
389 this->
kappa(*
this)*patch().deltaCoeffs()
398 const scalar hpmqr = hp[i] - qr[i]/Tp[i];
400 refValue()[i] = hpTa[i]/hpmqr;
401 valueFraction()[i] = hpmqr/(hpmqr + kappaDeltaCoeffs[i]);
405 refValue()[i] = (hpTa[i] + qr[i])/hp[i];
406 valueFraction()[i] = hp[i]/(hp[i] + kappaDeltaCoeffs[i]);
415 relaxation_*valueFraction()
416 + (1 - relaxation_)*valueFraction0;
418 refValue() = relaxation_*refValue() + (1 - relaxation_)*refValue0;
420 mixedFvPatchScalarField::updateCoeffs();
426 Info<< patch().boundaryMesh().mesh().name() <<
':' 427 << patch().name() <<
':' 428 << this->internalField().name() <<
" :" 429 <<
" heat transfer rate:" << Q
430 <<
" walltemperature " 431 <<
" min:" <<
gMin(*
this)
432 <<
" max:" <<
gMax(*
this)
446 writeEntry(os,
"mode", operationModeNames[mode_]);
463 case fixedHeatTransferCoeff:
478 if (thicknessLayers_.size())
480 writeEntry(os,
"thicknessLayers", thicknessLayers_);
490 if (qrName_ !=
"none")
492 writeEntry(os,
"qrRelaxation", qrRelaxation_);
499 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.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Type gMin(const FieldField< Field, Type > &f)
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
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
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...
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 &name, const dictionary &dict)
Selector.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.