45 patch().boundaryMesh().mesh()
50 qByKappa = sumq/
kappa();
71 patch().boundaryMesh().mesh()
74 sumKappaByDeltaNbr = ttm.
kappaEff(patch().index())*patch().deltaCoeffs();
76 sumKappaTByDeltaNbr = sumKappaByDeltaNbr()*patchInternalField();
78 qNbr = ttm.
qCorr(patch().index());
89 patch().boundaryMesh().mesh()
95 internalField().name()
100 qNbr = ttm.
qCorr(patch().index());
112 result.
ref() += field;
122 result = field().clone();
138 mixedFvPatchScalarField(
p, iF,
dict, false),
139 TnbrName_(
dict.lookupOrDefault<
word>(
"Tnbr",
"T")),
140 qrNbrName_(
dict.lookupOrDefault<
word>(
"qrNbr",
"none")),
141 qrName_(
dict.lookupOrDefault<
word>(
"qr",
"none")),
156 if (
dict.found(
"thicknessLayers"))
158 dict.lookup(
"thicknessLayers") >> thicknessLayers_;
159 dict.lookup(
"kappaLayers") >> kappaLayers_;
161 if (thicknessLayers_.
size() > 0)
164 forAll(thicknessLayers_, i)
166 wallKappaByDelta_ += thicknessLayers_[i]/kappaLayers_[i];
168 wallKappaByDelta_ = 1/wallKappaByDelta_;
172 if (
dict.found(
"qs"))
174 if (
dict.found(
"Qs"))
177 <<
"Either qs or Qs should be specified, not both"
183 else if (
dict.found(
"Qs"))
185 Qs_ =
dict.lookup<scalar>(
"Qs");
194 if (
dict.found(
"refValue"))
228 mixedFvPatchScalarField(psf,
p, iF, mapper),
229 TnbrName_(psf.TnbrName_),
230 qrNbrName_(psf.qrNbrName_),
231 qrName_(psf.qrName_),
232 thicknessLayers_(psf.thicknessLayers_),
233 kappaLayers_(psf.kappaLayers_),
236 wallKappaByDelta_(psf.wallKappaByDelta_)
249 mixedFvPatchScalarField(psf, iF),
250 TnbrName_(psf.TnbrName_),
251 qrNbrName_(psf.qrNbrName_),
252 qrName_(psf.qrName_),
253 thicknessLayers_(psf.thicknessLayers_),
254 kappaLayers_(psf.kappaLayers_),
257 wallKappaByDelta_(psf.wallKappaByDelta_)
270 mapper(*
this, ptf, [&](){
return patchInternalField(); });
271 mapper(refValue(), ptf.refValue(), [&](){ return patchInternalField(); });
272 mapper(refGrad(), ptf.refGrad(), scalar(0));
273 mapper(valueFraction(), ptf.valueFraction(), scalar(0));
278 mapper(qs_(), ptf.qs_());
289 map(refCast<const coupledTemperatureFvPatchScalarField>(ptf), mapper);
298 mixedFvPatchScalarField::reset(ptf);
301 refCast<const coupledTemperatureFvPatchScalarField>(ptf);
303 if (tiptf.qs_.valid())
305 qs_().reset(tiptf.qs_());
330 if (!isA<coupledTemperatureFvPatchScalarField>(TpNbr))
333 <<
"Patch field for " << internalField().name() <<
" on "
334 << this->patch().name() <<
" is of type "
335 << coupledTemperatureFvPatchScalarField::typeName
336 <<
endl <<
"The neighbouring patch field "
337 << internalField().
name() <<
" on "
338 << patchNbr.
name() <<
" is required to be the same, but is "
343 refCast<const coupledTemperatureFvPatchScalarField>(TpNbr);
352 if (qrName_ !=
"none")
354 sumq += patch().lookupPatchField<
volScalarField, scalar>(qrName_);
357 if (qrNbrName_ !=
"none")
359 sumq += mapper.fromNeighbour
371 getThis(
kappa, sumKappaTByDelta, sumKappaByDelta, sumq, qByKappa);
379 if (wallKappaByDelta_ == 0)
381 coupledTemperatureNbr.
getNbr
388 add(sumKappaTByDelta, mapper.fromNeighbour(sumKappaTByDeltaNbr));
389 add(sumKappaByDelta, mapper.fromNeighbour(sumKappaByDeltaNbr));
395 coupledTemperatureNbr.
getNbr(TwNbr, qNbr);
401 wallKappaByDelta_*mapper.fromNeighbour(TwNbr)
407 sumq += mapper.fromNeighbour(qNbr);
411 this->valueFraction() =
412 sumKappaByDelta()/(
kappa()*patch().deltaCoeffs() + sumKappaByDelta());
414 this->refValue() = (sumKappaTByDelta() + sumq)/sumKappaByDelta();
416 this->refGrad() = qByKappa;
418 mixedFvPatchScalarField::updateCoeffs();
424 Info<< patch().boundaryMesh().mesh().name() <<
':'
425 << patch().name() <<
':'
426 << this->internalField().name() <<
" <- "
428 << patchNbr.
name() <<
':'
429 << this->internalField().name() <<
" :"
430 <<
" heat transfer rate:" << Q
431 <<
" walltemperature "
432 <<
" min:" <<
gMin(*
this)
433 <<
" max:" <<
gMax(*
this)
450 writeEntryIfDifferent<word>(os,
"Tnbr",
"T", TnbrName_);
451 writeEntryIfDifferent<word>(os,
"qrNbr",
"none", qrNbrName_);
452 writeEntryIfDifferent<word>(os,
"qr",
"none", qrName_);
458 else if (qs_.valid())
463 if (thicknessLayers_.size())
465 writeEntry(os,
"thicknessLayers", thicknessLayers_);
486 turbulentTemperatureCoupledBaffleMixed,
487 "compressible::turbulentTemperatureCoupledBaffleMixed"
495 turbulentTemperatureCoupledBaffleMixed,
496 "compressible::turbulentTemperatureCoupledBaffleMixed"
505 turbulentTemperatureRadCoupledMixed,
506 "compressible::turbulentTemperatureRadCoupledMixed"
514 turbulentTemperatureRadCoupledMixed,
515 "compressible::turbulentTemperatureRadCoupledMixed"
#define forAll(list, i)
Loop across all elements in list.
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.
Generic GeometricField class.
virtual const fileName & name() const
Return the name of the stream.
void size(const label)
Override size to be inconsistent with allocated storage.
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 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.
coupledTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
void add(tmp< scalarField > &result, const tmp< scalarField > &field) const
Add field to result which may have not been previously set.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Abstract base class for field mapping.
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gSum(const FieldField< Field, Type > &f)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimPower
const dimensionSet dimLength
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
addBackwardCompatibleToRunTimeSelectionTable(fvPatchScalarField, coupledTemperatureFvPatchScalarField, patchMapper, turbulentTemperatureCoupledBaffleMixed, "compressible::turbulentTemperatureCoupledBaffleMixed")
const dimensionSet dimTime
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
VolField< scalar > volScalarField
Type gAverage(const FieldField< Field, Type > &f)
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Type gMin(const FieldField< Field, Type > &f)
Type gMax(const FieldField< Field, Type > &f)
const unitConversion unitFraction
static const label differentPatch