41 filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
44 HashTable<const filmModelType*> models
49 if (iter()->regionMesh().
name() == filmRegionName_)
55 DynamicList<word> modelNames;
58 modelNames.append(iter()->regionMesh().
name());
62 <<
"Unable to locate film region " << filmRegionName_
63 <<
". Available regions include: " << modelNames
66 return **models.begin();
72 filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
75 HashTable<const pyrolysisModelType*> models =
80 if (iter()->regionMesh().
name() == pyrolysisRegionName_)
86 DynamicList<word> modelNames;
89 modelNames.append(iter()->regionMesh().
name());
93 <<
"Unable to locate pyrolysis region " << pyrolysisRegionName_
94 <<
". Available regions include: " << modelNames
97 return **models.begin();
110 mixedFvPatchScalarField(
p, iF),
112 filmRegionName_(
"surfaceFilmProperties"),
113 pyrolysisRegionName_(
"pyrolysisProperties"),
114 TnbrName_(
"undefined-Tnbr"),
115 qrName_(
"undefined-qr"),
116 convectiveScaling_(1.0),
120 this->refValue() = 0.0;
121 this->refGrad() = 0.0;
122 this->valueFraction() = 1.0;
135 mixedFvPatchScalarField(psf,
p, iF, mapper),
137 filmRegionName_(psf.filmRegionName_),
138 pyrolysisRegionName_(psf.pyrolysisRegionName_),
139 TnbrName_(psf.TnbrName_),
140 qrName_(psf.qrName_),
141 convectiveScaling_(psf.convectiveScaling_),
142 filmDeltaDry_(psf.filmDeltaDry_),
143 filmDeltaWet_(psf.filmDeltaWet_)
155 mixedFvPatchScalarField(
p, iF),
159 dict.getOrDefault<
word>(
"filmRegion",
"surfaceFilmProperties")
163 dict.getOrDefault<
word>(
"pyrolysisRegion",
"pyrolysisProperties")
167 convectiveScaling_(
dict.getOrDefault<scalar>(
"convectiveScaling", 1)),
168 filmDeltaDry_(
dict.
get<scalar>(
"filmDeltaDry")),
169 filmDeltaWet_(
dict.
get<scalar>(
"filmDeltaWet"))
171 if (!isA<mappedPatchBase>(this->
patch().
patch()))
174 <<
"' not type '" << mappedPatchBase::typeName <<
"'" 175 <<
"\n for patch " <<
p.name()
176 <<
" of field " << internalField().name()
177 <<
" in file " << internalField().objectPath()
183 if (
dict.found(
"refValue"))
195 valueFraction() = 1.0;
203 const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField& psf,
204 const DimensionedField<scalar, volMesh>& iF
207 mixedFvPatchScalarField(psf, iF),
208 temperatureCoupledBase(
patch(), psf),
209 filmRegionName_(psf.filmRegionName_),
210 pyrolysisRegionName_(psf.pyrolysisRegionName_),
211 TnbrName_(psf.TnbrName_),
212 qrName_(psf.qrName_),
213 convectiveScaling_(psf.convectiveScaling_),
214 filmDeltaDry_(psf.filmDeltaDry_),
215 filmDeltaWet_(psf.filmDeltaWet_)
226 mixedFvPatchScalarField::autoMap(mapper);
237 mixedFvPatchScalarField::rmap(ptf, addr);
257 const mappedPatchBase& mpp =
258 refCast<const mappedPatchBase>(
patch().patch());
260 const label patchi =
patch().index();
261 const label nbrPatchi = mpp.samplePolyPatch().index();
262 const polyMesh&
mesh =
patch().boundaryMesh().mesh();
263 const polyMesh& nbrMesh = mpp.sampleMesh();
264 const fvPatch& nbrPatch =
265 refCast<const fvMesh>(nbrMesh).
boundary()[nbrPatchi];
280 scalarField nbrIntFld(nbrField.patchInternalField());
281 mpp.distribute(nbrIntFld);
289 scalarField KDeltaNbr(nbrK*nbrPatch.deltaCoeffs());
290 mpp.distribute(KDeltaNbr);
304 label coupledPatchi = -1;
305 if (pyrolysisRegionName_ ==
mesh.name())
307 coupledPatchi = patchi;
308 if (qrName_ !=
"none")
314 else if (pyrolysis.primaryMesh().name() ==
mesh.name())
316 coupledPatchi = nbrPatch.index();
317 if (qrName_ !=
"none")
325 <<
type() <<
" condition is intended to be applied to either the " 326 <<
"primary or pyrolysis regions only" 330 const label filmPatchi = pyrolysis.nbrCoupledPatchID(film, coupledPatchi);
332 const scalarField htcw(film.htcw().h()().boundaryField()[filmPatchi]);
336 pyrolysis.mapRegionPatchField
348 Tfilm = film.Ts().boundaryField()[filmPatchi];
349 film.toPrimary(filmPatchi, Tfilm);
353 pyrolysis.mapRegionPatchField<scalar>
368 (filmDelta - filmDeltaDry_)/(filmDeltaWet_ - filmDeltaDry_),
375 scalarField qConv(ratio*htcwfilm*(Tfilm - Tp)*convectiveScaling_);
381 valueFraction() =
alpha/(
alpha + (1.0 - ratio)*myKDelta);
383 refValue() = ratio*Tfilm + (1.0 - ratio)*(KDeltaNbr*nbrIntFld)/
alpha;
385 mixedFvPatchScalarField::updateCoeffs();
391 scalar Qt =
gSum((qConv + qRad)*
patch().magSf());
394 <<
patch().name() <<
':' 395 << this->internalField().name() <<
" <- " 396 << nbrMesh.name() <<
':' 397 << nbrPatch.name() <<
':' 398 << this->internalField().name() <<
" :" <<
nl 399 <<
" convective heat[W] : " << Qc <<
nl 400 <<
" radiative heat [W] : " << qr <<
nl 401 <<
" total heat [W] : " << Qt <<
nl 402 <<
" wall temperature " 403 <<
" min:" <<
gMin(*
this)
404 <<
" max:" <<
gMax(*
this)
417 os.writeEntryIfDifferent<word>
420 "surfaceFilmProperties",
423 os.writeEntryIfDifferent<word>
426 "pyrolysisProperties",
429 os.writeEntry(
"Tnbr", TnbrName_);
430 os.writeEntry(
"qr", qrName_);
431 os.writeEntry(
"convectiveScaling", convectiveScaling_);
432 os.writeEntry(
"filmDeltaDry", filmDeltaDry_);
433 os.writeEntry(
"filmDeltaWet", filmDeltaWet_);
443 filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
Foam::regionModels::surfaceFilmModels::thermoSingleLayer filmModelType
virtual void rmap(const fvPatchField< scalar > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Mixed boundary condition for temperature, to be used in the flow and pyrolysis regions when a film re...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type gMin(const FieldField< Field, Type > &f)
tmp< scalarField > K() const
Get corresponding K field.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
Type & refCast(U &obj)
A dynamic_cast (for references) that generates FatalError on failed casts, uses the virtual type() me...
virtual tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual tmp< scalarField > alpha(const scalarField &Tp) const
Given patch temperature calculate corresponding alphaEff field.
virtual void rmap(const fvPatchField< scalar > &, const labelList &)=0
Reverse map the given fvPatchField onto this fvPatchField.
virtual void autoMap(const fvPatchFieldMapper &)=0
Map (and resize as needed) from self given a mapping object.
void write(Ostream &os) const
Write.
Lookup type of boundary radiation properties.
CGAL::Exact_predicates_exact_constructions_kernel K
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Type gSum(const FieldField< Field, Type > &f)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
fvPatchField< scalar > fvPatchScalarField
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A FieldMapper for finite-volume patch fields.
List< scalar > scalarList
A List of scalars.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
int debug
Static debugging option.
Type gMax(const FieldField< Field, Type > &f)
OBJstream os(runTime.globalPath()/outputName)
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Common functions used in temperature coupled boundaries.
Type gAverage(const FieldField< Field, Type > &f)
virtual void operator=(const UList< scalar > &)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
HashTable< const Type * > lookupClass(const bool strict=false) const
Return all objects with a class satisfying isA<Type>
Foam::regionModels::pyrolysisModels::pyrolysisModel pyrolysisModelType
const Time & time() const noexcept
Return the reference to the time database.
forAllConstIters(mixture.phases(), phase)
static constexpr const zero Zero
Global zero (0)