43 mixedFvPatchScalarField(p, iF),
74 mixedFvPatchScalarField(p, iF),
76 haveQ_(dict.
found(
"Q")),
77 Q_(haveQ_ ? dict.
lookup<scalar>(
"Q") : NaN),
78 haveq_(dict.
found(
"q")),
80 haveh_(dict.
found(
"h")),
98 ? dict.
found(
"qrPrevious")
106 if (!haveQ_ && !haveq_ && !haveh_)
109 <<
"One or more of Q (heat power), q (heat flux), and h (heat " 110 <<
"transfer coefficient) must be specified" 114 if (thicknessLayers_.size() != kappaLayers_.size())
117 <<
"If either thicknessLayers or kappaLayers is specified, then " 118 <<
"both must be specified and be lists of the same length " 122 if (dict.
found(
"refValue"))
148 mixedFvPatchScalarField(ptf, p, iF, mapper),
157 emissivity_(ptf.emissivity_),
158 thicknessLayers_(ptf.thicknessLayers_),
159 kappaLayers_(ptf.kappaLayers_),
160 relaxation_(ptf.relaxation_),
161 qrName_(ptf.qrName_),
162 qrRelaxation_(ptf.qrRelaxation_),
165 qrName_ != word::null
166 ? mapper(ptf.qrPrevious_)()
179 mixedFvPatchScalarField(tppsf, iF),
181 haveQ_(tppsf.haveQ_),
183 haveq_(tppsf.haveq_),
185 haveh_(tppsf.haveh_),
187 Ta_(tppsf.Ta_,
false),
188 emissivity_(tppsf.emissivity_),
189 thicknessLayers_(tppsf.thicknessLayers_),
190 kappaLayers_(tppsf.kappaLayers_),
191 relaxation_(tppsf.relaxation_),
192 qrName_(tppsf.qrName_),
193 qrRelaxation_(tppsf.qrRelaxation_),
194 qrPrevious_(tppsf.qrPrevious_)
205 mixedFvPatchScalarField::autoMap(m);
217 if (qrName_ != word::null)
219 m(qrPrevious_, qrPrevious_);
230 mixedFvPatchScalarField::rmap(ptf, addr);
233 refCast<const externalWallHeatFluxTemperatureFvPatchScalarField>(ptf);
237 q_.
rmap(tiptf.q_, addr);
242 h_.rmap(tiptf.h_, addr);
245 if (qrName_ != word::null)
247 qrPrevious_.rmap(tiptf.qrPrevious_, addr);
257 mixedFvPatchScalarField::reset(ptf);
260 refCast<const externalWallHeatFluxTemperatureFvPatchScalarField>(ptf);
272 if (qrName_ != word::null)
274 qrPrevious_.reset(tiptf.qrPrevious_);
299 + (1 - qrRelaxation_)*qrPrevious_;
307 qTot += Q_/
gSum(patch().magSf());
317 refGrad() = qTot/
kappa(*
this);
323 scalar totalSolidRes = 0;
324 if (thicknessLayers_.
size())
326 forAll(thicknessLayers_, iLayer)
328 const scalar l = thicknessLayers_[iLayer];
329 if (kappaLayers_[iLayer] > 0)
331 totalSolidRes += l/kappaLayers_[iLayer];
336 const scalar Ta = Ta_->value(this->db().time().userTimeValue());
348 *((
pow3(Ta) +
pow3(Tp)) + Ta*Tp*(Ta + Tp))
359 this->
kappa(*
this)*patch().deltaCoeffs()
367 const scalar hpmqTot = hp[i] - qTot[i]/Tp[i];
368 refValue()[i] = hpTa[i]/hpmqTot;
369 valueFraction()[i] = hpmqTot/(hpmqTot + kappaDeltaCoeffs[i]);
373 refValue()[i] = (hpTa[i] + qTot[i])/hp[i];
374 valueFraction()[i] = hp[i]/(hp[i] + kappaDeltaCoeffs[i]);
381 relaxation_*valueFraction() + (1 - relaxation_)*valueFraction0;
383 relaxation_*refValue() + (1 - relaxation_)*refValue0;
385 mixedFvPatchScalarField::updateCoeffs();
391 Info<< patch().boundaryMesh().mesh().name() <<
':' 392 << patch().name() <<
':' 393 << this->internalField().name() <<
" :" 394 <<
" heat transfer rate:" << Q
395 <<
" walltemperature " 396 <<
" min:" <<
gMin(*
this)
397 <<
" max:" <<
gMax(*
this)
449 writeEntry(os,
"qrRelaxation", qrRelaxation_);
455 writeEntry(os,
"valueFraction", valueFraction());
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Run-time selectable general function of one variable.
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.
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)
void size(const label)
Override size to be inconsistent with allocated storage.
void writeEntryIfDifferent(Ostream &os, const word &entryName, const EntryType &value1, const EntryType &value2)
Helper function to write the keyword and entry only if the.
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.
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].
Type gSum(const FieldField< Field, Type > &f)
A class for handling words, derived from string.
Foam::fvPatchFieldMapper.
List< scalar > scalarList
A List of scalars.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const Type & value() const
Return const reference to value.
static const word null
An empty word.
virtual label size() const
Return size.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
volScalarField scalarField(fieldObject, mesh)
Type gMax(const FieldField< Field, Type > &f)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
dimensionedScalar pow3(const dimensionedScalar &ds)
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,.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
tmp< scalarField > kappa(const fvPatchScalarField &Tp) const
Given patch temperature calculate corresponding K field.
Type gAverage(const FieldField< Field, Type > &f)
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...
void write(Ostream &) const
Write.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.