49 qByKappa = sumq/
kappa();
73 sumKappaByDeltaNbr = ttm.
kappaEff(patch().index())*patch().deltaCoeffs();
75 sumKappaTByDeltaNbr = sumKappaByDeltaNbr()*patchInternalField();
77 qNbr = ttm.
qCorr(patch().index());
89 result.
ref() += field;
99 result = field().clone();
115 mixedFvPatchScalarField(
p, iF,
dict, false),
116 TnbrName_(
dict.lookupOrDefault<
word>(
"Tnbr",
"T")),
117 qrNbrName_(
dict.lookupOrDefault<
word>(
"qrNbr",
"none")),
118 qrName_(
dict.lookupOrDefault<
word>(
"qr",
"none")),
119 qrRelax_(
dict.lookupOrDefault<scalar>(
"qrRelaxation", units::
fraction, 1)),
122 qrName_ !=
word::null
152 if (
dict.found(
"qs"))
154 if (
dict.found(
"Qs"))
157 <<
"Either qs or Qs should be specified, not both"
163 else if (
dict.found(
"Qs"))
165 Qs_ =
dict.lookup<scalar>(
"Qs");
174 if (
dict.found(
"refValue"))
208 mixedFvPatchScalarField(psf,
p, iF, mapper),
209 TnbrName_(psf.TnbrName_),
210 qrNbrName_(psf.qrNbrName_),
211 qrName_(psf.qrName_),
212 qrRelax_(psf.qrRelax_),
215 qrName_ !=
word::null
216 ? mapper(psf.qrPrevious_)()
243 mixedFvPatchScalarField(psf, iF),
244 TnbrName_(psf.TnbrName_),
245 qrNbrName_(psf.qrNbrName_),
246 qrName_(psf.qrName_),
247 qrRelax_(psf.qrRelax_),
248 qrPrevious_(psf.qrPrevious_),
292 mapper(*
this, ptf, [&](){
return patchInternalField(); });
293 mapper(refValue(), ptf.refValue(), [&](){ return patchInternalField(); });
294 mapper(refGrad(), ptf.refGrad(), scalar(0));
295 mapper(valueFraction(), ptf.valueFraction(), scalar(0));
300 mapper(qs_(), ptf.qs_());
311 map(refCast<const coupledTemperatureFvPatchScalarField>(ptf), mapper);
315 h_->map(!mapper.
direct());
325 mixedFvPatchScalarField::reset(ptf);
328 refCast<const coupledTemperatureFvPatchScalarField>(ptf);
330 if (tiptf.qs_.valid())
332 qs_().reset(tiptf.qs_());
362 if (!isA<coupledTemperatureFvPatchScalarField>(TpNbr))
365 <<
"Patch field for " << internalField().name() <<
" on "
366 << this->patch().name() <<
" is of type "
368 <<
endl <<
"The neighbouring patch field "
369 << internalField().
name() <<
" on "
370 << patchNbr.
name() <<
" is required to be the same, but is "
375 refCast<const coupledTemperatureFvPatchScalarField>(TpNbr);
379 if (qrName_ !=
"none")
381 sumq += patch().lookupPatchField<
volScalarField, scalar>(qrName_);
384 if (qrNbrName_ !=
"none")
386 sumq += mapper.fromNeighbour
392 if (qrName_ !=
"none" || qrNbrName_ !=
"none")
394 sumq = qrRelax_*sumq + (1 - qrRelax_)*qrPrevious_;
409 getThis(
kappa, sumKappaTByDelta, sumKappaByDelta, sumq, qByKappa);
417 coupledTemperatureNbr.
getNbr
425 if (coupledTemperatureNbr.h_.valid())
429 coupledTemperatureNbr
434 coupledTemperatureNbr.h_()
435 /(coupledTemperatureNbr.h_() + sumKappaByDeltaNbr())
437 sumKappaTByDeltaNbr.
ref() *= hFactor;
438 sumKappaByDeltaNbr.
ref() *= hFactor;
443 mapper.fromNeighbour(sumKappaTByDeltaNbr)
448 mapper.fromNeighbour(sumKappaByDeltaNbr)
456 const scalarField hFactor(h_()/(h_() + sumKappaByDeltaNbrMapped()));
457 sumKappaTByDeltaNbrMapped.
ref() *= hFactor;
458 sumKappaByDeltaNbrMapped.
ref() *= hFactor;
461 add(sumKappaTByDelta, sumKappaTByDeltaNbrMapped);
462 add(sumKappaByDelta, sumKappaByDeltaNbrMapped);
466 sumq += mapper.fromNeighbour(qNbr);
470 this->valueFraction() =
471 sumKappaByDelta()/(
kappa()*patch().deltaCoeffs() + sumKappaByDelta());
473 this->refValue() = (sumKappaTByDelta() + sumq)/sumKappaByDelta();
475 this->refGrad() = qByKappa;
477 mixedFvPatchScalarField::updateCoeffs();
483 Info<< patch().mesh().name() <<
':'
484 << patch().name() <<
':'
485 << this->internalField().name() <<
" <- "
487 << patchNbr.
name() <<
':'
488 << this->internalField().name() <<
" :"
489 <<
" heat transfer rate:" << Q
490 <<
" walltemperature "
491 <<
" min:" <<
gMin(*
this)
492 <<
" max:" <<
gMax(*
this)
509 writeEntryIfDifferent<word>(os,
"Tnbr",
"T", TnbrName_);
510 writeEntryIfDifferent<word>(os,
"qrNbr",
"none", qrNbrName_);
512 if (qrName_ !=
"none")
523 else if (qs_.valid())
550 turbulentTemperatureCoupledBaffleMixed,
551 "compressible::turbulentTemperatureCoupledBaffleMixed"
559 turbulentTemperatureCoupledBaffleMixed,
560 "compressible::turbulentTemperatureCoupledBaffleMixed"
569 turbulentTemperatureRadCoupledMixed,
570 "compressible::turbulentTemperatureRadCoupledMixed"
578 turbulentTemperatureRadCoupledMixed,
579 "compressible::turbulentTemperatureRadCoupledMixed"
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.
DimensionedField with a corresponding run-time selected function to evaluate and update the field.
Generic GeometricField class.
virtual const fileName & name() const
Return the name of the stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static int & msgType()
Message tag of standard messages.
Mixed boundary condition for temperature, to be used for heat-transfer with another region in a CHT c...
virtual void getThis(tmp< scalarField > &kappa, tmp< scalarField > &sumKappaTByDelta, tmp< scalarField > &sumKappaByDelta, scalarField &qTot, tmp< scalarField > &qByKappa) const
Get the patch kappa, kappa*Tc/delta and kappa/delta and also the.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, fvMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual void write(Ostream &) const
Write.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
void map(const coupledTemperatureFvPatchScalarField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
virtual void getNbr(tmp< scalarField > &sumKappaTByDeltaNbr, tmp< scalarField > &sumKappaByDeltaNbr, tmp< scalarField > &qNbr) const
Get the neighbour patch kappa*Tc/delta and kappa/delta.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
void add(tmp< scalarField > &result, const tmp< scalarField > &field) const
Add field to result which may have not been previously set.
virtual ~coupledTemperatureFvPatchScalarField()
Destructor.
coupledTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, fvMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Abstract base class for field mapping.
virtual bool direct() const
Is the mapper direct?
const word & name() const
Return reference to name.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
friend Ostream & operator(Ostream &, const fvPatchField< Type > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual const word & name() const
Return name.
const GeometricField::Patch & lookupPatchField(const word &name) const
Lookup and return the patchField of the named field from the.
Base class for fv patches that provide mapping between two fv patches.
const fvPatch & nbrFvPatch() const
Get the patch to map from.
static const mappedFvPatchBaseBase & getMap(const fvPatch &patch)
Cast the given fvPatch to a mappedFvPatchBaseBase. Handle errors.
const fvMesh & nbrMesh() const
Get the mesh for the region to map from.
static void validateMapForField(const PatchField &field, const FieldType &iF, const dictionary &context, const label froms=from::any)
Validate that the map exists and is appropriate for the given.
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,.
bool isTmp() const
Return true if this is really a temporary object.
T & ref() const
Return non-const reference or generate a fatal error.
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool valid(const PtrList< ModelType > &l)
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
tmp< SurfaceField< Type > > snGrad(const VolField< Type > &vf, const word &name)
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
Type gMin(const UList< Type > &f, const label comm)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gAverage(const UList< Type > &f, const label comm)
void add(GeometricField< typename typeOfSum< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet & dimLength
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
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")
const dimensionSet & dimTime
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
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
const dimensionSet & dimTemperature
static const label differentPatch