45 "fixed_heat_transfer_coefficient",
67 mixedFvPatchScalarField(p, iF),
73 QrPrevious_(p.
size()),
75 QrName_(
"undefined-Qr"),
81 valueFraction() = 1.0;
94 mixedFvPatchScalarField(ptf, p, iF, mapper),
100 QrPrevious_(ptf.QrPrevious_, mapper),
101 QrRelaxation_(ptf.QrRelaxation_),
102 QrName_(ptf.QrName_),
103 thicknessLayers_(ptf.thicknessLayers_),
104 kappaLayers_(ptf.kappaLayers_)
116 mixedFvPatchScalarField(p, iF),
122 QrPrevious_(p.
size(), 0.0),
130 mode_ = fixedHeatFlux;
135 mode_ = fixedHeatTransferCoeff;
138 if (dict.
found(
"thicknessLayers"))
140 dict.
lookup(
"thicknessLayers") >> thicknessLayers_;
141 dict.
lookup(
"kappaLayers") >> kappaLayers_;
148 "externalWallHeatFluxTemperatureFvPatchScalarField::" 149 "externalWallHeatFluxTemperatureFvPatchScalarField\n" 151 " const fvPatch& p,\n" 152 " const DimensionedField<scalar, volMesh>& iF,\n" 153 " const dictionary& dict\n" 155 ) <<
"\n patch type '" << p.type()
156 <<
"' either q or h and Ta were not found '" 157 <<
"\n for patch " << p.
name()
165 if (dict.
found(
"QrPrevious"))
170 if (dict.
found(
"refValue"))
182 valueFraction() = 1.0;
193 mixedFvPatchScalarField(tppsf),
199 QrPrevious_(tppsf.QrPrevious_),
200 QrRelaxation_(tppsf.QrRelaxation_),
201 QrName_(tppsf.QrName_),
202 thicknessLayers_(tppsf.thicknessLayers_),
203 kappaLayers_(tppsf.kappaLayers_)
214 mixedFvPatchScalarField(tppsf, iF),
220 QrPrevious_(tppsf.QrPrevious_),
221 QrRelaxation_(tppsf.QrRelaxation_),
222 QrName_(tppsf.QrName_),
223 thicknessLayers_(tppsf.thicknessLayers_),
224 kappaLayers_(tppsf.kappaLayers_)
235 mixedFvPatchScalarField::autoMap(m);
248 mixedFvPatchScalarField::rmap(ptf, addr);
251 refCast<const externalWallHeatFluxTemperatureFvPatchScalarField>(ptf);
253 q_.
rmap(tiptf.q_, addr);
254 h_.rmap(tiptf.h_, addr);
255 Ta_.rmap(tiptf.Ta_, addr);
270 if (QrName_ !=
"none")
274 Qr = QrRelaxation_*Qr + (1.0 - QrRelaxation_)*QrPrevious_;
282 refGrad() = (q_ + Qr)/
kappa(Tp);
284 valueFraction() = 0.0;
288 case fixedHeatTransferCoeff:
290 scalar totalSolidRes = 0.0;
291 if (thicknessLayers_.size() > 0)
293 forAll (thicknessLayers_, iLayer)
295 const scalar l = thicknessLayers_[iLayer];
296 if (kappaLayers_[iLayer] > 0.0)
298 totalSolidRes += l/kappaLayers_[iLayer];
302 hp = 1.0/(1.0/h_ + totalSolidRes);
306 refValue() = hp*Ta_/(hp - Qr);
308 (hp - Qr)/((hp - Qr) +
kappa(Tp)*patch().deltaCoeffs());
316 "externalWallHeatFluxTemperatureFvPatchScalarField" 318 ) <<
"Illegal heat flux mode " << operationModeNames[mode_]
323 mixedFvPatchScalarField::updateCoeffs();
329 Info<< patch().boundaryMesh().mesh().name() <<
':' 330 << patch().name() <<
':' 332 <<
" heat transfer rate:" << Q
333 <<
" walltemperature " 334 <<
" min:" <<
gMin(*
this)
335 <<
" max:" <<
gMax(*
this)
350 QrPrevious_.writeEntry(
"QrPrevious", os);
360 q_.writeEntry(
"q", os);
363 case fixedHeatTransferCoeff:
365 h_.writeEntry(
"h", os);
366 Ta_.writeEntry(
"Ta", os);
367 thicknessLayers_.writeEntry(
"thicknessLayers", os);
368 kappaLayers_.writeEntry(
"kappaLayers", os);
375 "void externalWallHeatFluxTemperatureFvPatchScalarField::write" 379 ) <<
"Illegal heat flux mode " << operationModeNames[mode_]
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
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 rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A class for handling words, derived from string.
void write(Ostream &) const
Write.
void size(const label)
Override size to be inconsistent with allocated storage.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Foam::fvPatchFieldMapper.
A list of keyword definitions, which are a keyword followed by any number of values (e...
const word & name() const
Return name.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Type gSum(const FieldField< Field, Type > &f)
externalWallHeatFluxTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
static const NamedEnum< operationMode, 3 > operationModeNames
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
operationMode
Operation mode enumeration.
void write(Ostream &) const
Write.
Macros for easy insertion into run-time selection tables.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
errorManip< error > abort(error &err)
Type gMin(const FieldField< Field, Type > &f)
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
Initialise the NamedEnum HashTable from the static list of names.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
rDeltaT dimensionedInternalField()
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Type gAverage(const FieldField< Field, Type > &f)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Common functions for use in temperature coupled boundaries.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
virtual label size() const
Return size.
This function object calculates and outputs the second invariant of the velocity gradient tensor [1/s...
This boundary condition supplies a heat flux condition for temperature on an external wall...
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Type gMax(const FieldField< Field, Type > &f)
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.