36 namespace compressible
48 mixedFvPatchScalarField(p, iF),
50 TnbrName_(
"undefined-Tnbr"),
56 this->refValue() = 0.0;
57 this->refGrad() = 0.0;
58 this->valueFraction() = 1.0;
70 mixedFvPatchScalarField(p, iF),
72 TnbrName_(dict.
lookup(
"Tnbr")),
78 if (!isA<mappedPatchBase>(this->patch().patch()))
81 <<
"' not type '" << mappedPatchBase::typeName <<
"'" 82 <<
"\n for patch " << p.
name()
83 <<
" of field " << internalField().name()
84 <<
" in file " << internalField().objectPath()
88 if (dict.
found(
"thicknessLayers"))
90 dict.
lookup(
"thicknessLayers") >> thicknessLayers_;
91 dict.
lookup(
"kappaLayers") >> kappaLayers_;
93 if (thicknessLayers_.size() > 0)
96 forAll(thicknessLayers_, iLayer)
98 contactRes_ += thicknessLayers_[iLayer]/kappaLayers_[iLayer];
100 contactRes_ = 1.0/contactRes_;
104 if (dict.
found(
"qs"))
106 if (dict.
found(
"Qs"))
109 <<
"Either qs or Qs should be specified, not both" 115 else if (dict.
found(
"Qs"))
120 dict.
lookup<scalar>(
"Qs")/
gSum(patch().magSf())
126 if (dict.
found(
"refValue"))
138 valueFraction() = 1.0;
152 mixedFvPatchScalarField(ptf, p, iF, mapper),
154 TnbrName_(ptf.TnbrName_),
155 thicknessLayers_(ptf.thicknessLayers_),
156 kappaLayers_(ptf.kappaLayers_),
157 qs_(mapper(ptf.qs_)),
158 contactRes_(ptf.contactRes_)
169 mixedFvPatchScalarField(ptf, iF),
171 TnbrName_(ptf.TnbrName_),
172 thicknessLayers_(ptf.thicknessLayers_),
173 kappaLayers_(ptf.kappaLayers_),
175 contactRes_(ptf.contactRes_)
195 refCast<const mappedPatchBase>(patch().patch());
199 refCast<const fvMesh>(nbrMesh).
boundary()[samplePatchi];
209 if (!isA<thisType>(nbrTp))
212 <<
"Patch field for " << internalField().name() <<
" on " 213 << patch().name() <<
" is of type " << thisType::typeName
214 <<
endl <<
"The neighbouring patch field " << TnbrName_ <<
" on " 215 << nbrPatch.
name() <<
" is required to be the same, but is " 219 const thisType& nbrField = refCast<const thisType>(nbrTp);
225 if (contactRes_ == 0.0)
227 nbrIntFld.
ref() = nbrField.patchInternalField();
228 nbrKDelta.ref() = nbrField.kappa(nbrField)*nbrPatch.
deltaCoeffs();
232 nbrIntFld.ref() = nbrField;
233 nbrKDelta.ref() = contactRes_;
256 this->refValue() = nbrIntFld();
257 this->refGrad() = qs_/
kappa(*
this);
258 this->valueFraction() = nbrKDelta()/(nbrKDelta() + myKDelta());
260 mixedFvPatchScalarField::updateCoeffs();
266 Info<< patch().boundaryMesh().mesh().name() <<
':' 267 << patch().name() <<
':' 268 << this->internalField().name() <<
" <- " 269 << nbrMesh.name() <<
':' 270 << nbrPatch.
name() <<
':' 271 << this->internalField().name() <<
" :" 272 <<
" heat transfer rate:" << Q
273 <<
" walltemperature " 274 <<
" min:" <<
gMin(*
this)
275 <<
" max:" <<
gMax(*
this)
292 writeEntry(os,
"thicknessLayers", thicknessLayers_);
Mixed boundary condition for temperature, to be used for heat-transfer on back-to-back baffles...
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.
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
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...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
const polyMesh & sampleMesh() const
Get the region mesh.
T & ref() const
Return non-const reference or generate a fatal error.
virtual void write(Ostream &) const
Write.
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...
static int & msgType()
Message tag of standard messages.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Type gSum(const FieldField< Field, Type > &f)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Foam::fvPatchFieldMapper.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
faceListList boundary(nPatches)
virtual label size() const
Return size.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Type gMax(const FieldField< Field, Type > &f)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
const GeometricField::Patch & lookupPatchField(const word &name) const
Lookup and return the patchField of the named field from the.
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
Common functions used in temperature coupled boundaries.
#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)
const scalarField & deltaCoeffs() const
Return the face - cell distance coeffient.
label index() const
Return the index of this patch in the boundaryMesh.
virtual void operator=(const UList< Type > &)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Mesh consisting of general polyhedral cells.
virtual const word & name() const
Return name.
A class for managing temporary objects.
const polyPatch & samplePolyPatch() const
Get the patch on the region.
void write(Ostream &) const
Write.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
makePatchTypeField(fvPatchScalarField, thermalBaffleFvPatchScalarField)
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.