104 mixedFvPatchScalarField(
p, iF,
dict, false),
138 haveEmissivity_(
dict.
found(
"emissivity")),
147 h_.
valid() || haveEmissivity_
157 relax_(
dict.lookupOrDefault<scalar>(
"relaxation", units::
fraction, 1)),
159 qrRelax_(
dict.lookupOrDefault<scalar>(
"qrRelaxation", units::
fraction, 1)),
162 qrName_ !=
word::null
174 if (haveEmissivity_ && (emissivity_ < 0 || emissivity_ > 1))
177 <<
"Emissivity must be in the range 0 to 1"
181 if (
dict.found(
"refValue"))
215 mixedFvPatchScalarField(ptf,
p, iF, mapper),
230 haveEmissivity_(ptf.haveEmissivity_),
231 emissivity_(ptf.emissivity_),
234 qrName_(ptf.qrName_),
235 qrRelax_(ptf.qrRelax_),
238 qrName_ !=
word::null
239 ? mapper(ptf.qrPrevious_)()
252 mixedFvPatchScalarField(ptf, iF),
266 haveEmissivity_(ptf.haveEmissivity_),
267 emissivity_(ptf.emissivity_),
270 qrName_(ptf.qrName_),
271 qrRelax_(ptf.qrRelax_),
272 qrPrevious_(ptf.qrPrevious_)
304 mixedFvPatchScalarField::map(ptf, mapper);
308 h_->map(!mapper.
direct());
312 refCast<const externalTemperatureFvPatchScalarField>(ptf);
316 mapper(qrPrevious_, tiptf.qrPrevious_);
326 mixedFvPatchScalarField::reset(ptf);
334 refCast<const externalTemperatureFvPatchScalarField>(ptf);
338 qrPrevious_.reset(tiptf.qrPrevious_);
351 const scalar t =
time().value();
359 getKappa(
kappa, sumKappaTcByDelta, sumKappaByDelta,
T, sumq);
377 const scalarField qr(qrRelax_*qrCurrent + (1 - qrRelax_)*qrPrevious_);
385 const scalar Ta = h_.valid() || haveEmissivity_ ? Ta_->value(t) : NaN;
410 plusEqOp(sumKappaTcByDelta, hEff*Ta);
417 sumKappaByDelta.
valid()
418 ? kappaByDelta + sumKappaByDelta()
423 if (sumKappaByDelta.
valid())
425 valueFraction() = sumKappaByDelta()/kappaPlusSumKappaByDelta();
429 valueFraction() =
Zero;
434 if (sumKappaByDelta.
valid())
439 max(sumKappaTcByDelta, small*kappaByDelta*patchInternalField())
440 /
max(sumKappaByDelta, small*kappaByDelta)
445 plusEqOp(trefValue, sumq()/kappaPlusSumKappaByDelta());
447 if (trefValue.
valid())
449 refValue() = trefValue;
459 refGrad() = sumq*patch().deltaCoeffs()/kappaPlusSumKappaByDelta();
470 valueFraction() = 1 - relax_*(1 -
f);
471 refValue() = (
f*relax_*refValue() + (1 - relax_)*
T)/valueFraction();
474 mixedFvPatchScalarField::updateCoeffs();
480 Info<< patch().mesh().name() <<
':'
481 << patch().name() <<
':'
482 << this->internalField().name() <<
" :"
483 <<
" heat transfer rate:" << Q
484 <<
" walltemperature "
485 <<
" min:" <<
gMin(*
this)
486 <<
" max:" <<
gMax(*
this)
520 if (h_.valid() || haveEmissivity_)
536 writeEntry(os,
"valueFraction", valueFraction());
556 externalWallHeatFluxTemperature,
557 "externalWallHeatFluxTemperature"
565 externalWallHeatFluxTemperature,
566 "externalWallHeatFluxTemperature"
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet & dimensions() const
Return dimensions.
Run-time selectable general function of one variable.
DimensionedField with a corresponding run-time selected function to evaluate and update the field.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
This boundary condition applies a heat flux condition to temperature on an external wall....
virtual void getKappa(scalarField &kappa, tmp< scalarField > &sumKappaTcByDelta, tmp< scalarField > &sumKappaByDelta, tmp< scalarField > &T, tmp< scalarField > &sumq) const
Get the patch kappa, kappa*Tc/delta, kappa/delta,.
void plusEqOp(tmp< scalarField > &tf, const scalar d) const
Plus-equals op for a tmp field. Will initialise the tmp if empty.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, fvMesh > &iF) const
Construct and return a clone setting internal field reference.
void write(Ostream &) const
Write.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void map(const fvPatchScalarField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
externalTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, fvMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual ~externalTemperatureFvPatchScalarField()
Destructor.
Abstract base class for field mapping.
virtual bool direct() const
Is the mapper direct?
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
Write.
friend Ostream & operator(Ostream &, const fvPatchField< Type > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Abstract base class for all fluid and solid thermophysical transport models.
virtual tmp< scalarField > qCorr(const label patchi) const =0
Return the patch heat flux correction [W/m^2].
virtual tmp< volScalarField > kappaEff() const =0
Effective thermal turbulent conductivity.
A class for managing temporary objects.
bool valid() const
Is this temporary object valid,.
T * ptr() const
Return tmp pointer for reuse.
A class for handling words, derived from string.
static const word null
An empty word.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
bool valid(const PtrList< ModelType > &l)
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
tmp< SurfaceField< Type > > snGrad(const VolField< Type > &vf, const word &name)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
Type gMin(const UList< Type > &f, const label comm)
errorManipArg< error, int > exit(error &err, const int errNo=1)
void writeEntryIfDifferent(Ostream &os, const word &entryName, const EntryType &value1, const EntryType &value2)
Helper function to write the keyword and entry only if the.
Type gAverage(const UList< Type > &f, const label comm)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet & dimLength
makePatchTypeField(fvPatchScalarField, atmosphericBoundaryLayerTurbulentEpsilonFvPatchScalarField)
Type gSum(const UList< Type > &f, const label comm)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
addBackwardCompatibleToRunTimeSelectionTable(fvPatchScalarField, coupledTemperatureFvPatchScalarField, patchMapper, turbulentTemperatureCoupledBaffleMixed, "compressible::turbulentTemperatureCoupledBaffleMixed")
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
VolField< scalar > volScalarField
const dimensionSet & dimPower
Type gMax(const UList< Type > &f, const label comm)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet & dimArea
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
const dimensionSet & dimTemperature
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)