41 filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::filmModel()
const 45 const UPtrList<const ModelType> models
47 db().time().csorted<ModelType>()
50 for (
const ModelType& mdl : models)
52 if (mdl.regionMesh().name() == filmRegionName_)
58 DynamicList<word> modelNames(models.size());
59 for (
const ModelType& mdl : models)
61 modelNames.push_back(mdl.regionMesh().name());
65 <<
"Unable to locate film region " << filmRegionName_
66 <<
". Available regions include: " << modelNames
69 return models.front();
75 filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::pyrModel()
const 79 const UPtrList<const ModelType> models
81 db().time().csorted<ModelType>()
84 for (
const ModelType& mdl : models)
86 if (mdl.regionMesh().name() == pyrolysisRegionName_)
92 DynamicList<word> modelNames(models.size());
93 for (
const ModelType& mdl : models)
95 modelNames.push_back(mdl.regionMesh().name());
99 <<
"Unable to locate pyrolysis region " << pyrolysisRegionName_
100 <<
". Available regions include: " << modelNames
103 return models.front();
116 mixedFvPatchScalarField(
p, iF),
118 filmRegionName_(
"surfaceFilmProperties"),
119 pyrolysisRegionName_(
"pyrolysisProperties"),
120 TnbrName_(
"undefined-Tnbr"),
121 qrName_(
"undefined-qr"),
122 convectiveScaling_(1.0),
126 this->refValue() = 0.0;
127 this->refGrad() = 0.0;
128 this->valueFraction() = 1.0;
141 mixedFvPatchScalarField(psf,
p, iF, mapper),
143 filmRegionName_(psf.filmRegionName_),
144 pyrolysisRegionName_(psf.pyrolysisRegionName_),
145 TnbrName_(psf.TnbrName_),
146 qrName_(psf.qrName_),
147 convectiveScaling_(psf.convectiveScaling_),
148 filmDeltaDry_(psf.filmDeltaDry_),
149 filmDeltaWet_(psf.filmDeltaWet_)
161 mixedFvPatchScalarField(
p, iF),
165 dict.getOrDefault<
word>(
"filmRegion",
"surfaceFilmProperties")
169 dict.getOrDefault<
word>(
"pyrolysisRegion",
"pyrolysisProperties")
173 convectiveScaling_(
dict.getOrDefault<scalar>(
"convectiveScaling", 1)),
174 filmDeltaDry_(
dict.
get<scalar>(
"filmDeltaDry")),
175 filmDeltaWet_(
dict.
get<scalar>(
"filmDeltaWet"))
177 if (!isA<mappedPatchBase>(this->
patch().
patch()))
180 <<
"' not type '" << mappedPatchBase::typeName <<
"'" 181 <<
"\n for patch " <<
p.name()
182 <<
" of field " << internalField().name()
183 <<
" in file " << internalField().objectPath()
189 if (this->readMixedEntries(
dict))
198 valueFraction() = 1.0;
206 const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField& psf,
207 const DimensionedField<scalar, volMesh>& iF
210 mixedFvPatchScalarField(psf, iF),
211 temperatureCoupledBase(
patch(), psf),
212 filmRegionName_(psf.filmRegionName_),
213 pyrolysisRegionName_(psf.pyrolysisRegionName_),
214 TnbrName_(psf.TnbrName_),
215 qrName_(psf.qrName_),
216 convectiveScaling_(psf.convectiveScaling_),
217 filmDeltaDry_(psf.filmDeltaDry_),
218 filmDeltaWet_(psf.filmDeltaWet_)
229 mixedFvPatchScalarField::autoMap(mapper);
240 mixedFvPatchScalarField::rmap(ptf, addr);
242 const auto& fpptf = refCast<const myType>(ptf);
256 const auto& mpp = refCast<const mappedPatchBase>(
patch().patch());
258 const label patchi =
patch().index();
259 const label nbrPatchi = mpp.samplePolyPatch().index();
260 const polyMesh&
mesh =
patch().boundaryMesh().mesh();
261 const polyMesh& nbrMesh = mpp.sampleMesh();
262 const fvPatch& nbrPatch =
263 refCast<const fvMesh>(nbrMesh).
boundary()[nbrPatchi];
267 const auto& nbrField =
268 refCast<const myType>
274 scalarField nbrIntFld(nbrField.patchInternalField());
275 mpp.distribute(nbrIntFld);
283 scalarField KDeltaNbr(nbrK*nbrPatch.deltaCoeffs());
284 mpp.distribute(KDeltaNbr);
298 label coupledPatchi = -1;
299 label filmPatchi = -1;
300 if (pyrolysisRegionName_ ==
mesh.name())
304 coupledPatchi = patchi;
305 if (qrName_ !=
"none")
311 filmPatchi = pyrolysis.nbrCoupledPatchID(film, coupledPatchi);
313 const scalarField htcw(film.htcw().h()().boundaryField()[filmPatchi]);
317 pyrolysis.mapRegionPatchField
328 const scalarField Ts(film.Ts().boundaryField()[filmPatchi]);
330 pyrolysis.mapRegionPatchField
341 pyrolysis.mapRegionPatchField<scalar>
349 else if (pyrolysis.primaryMesh().name() ==
mesh.name())
353 coupledPatchi = nbrPatch.index();
354 if (qrName_ !=
"none")
359 filmPatchi = pyrolysis.nbrCoupledPatchID(film, coupledPatchi);
361 htcwfilm = film.htcw().h()().boundaryField()[filmPatchi];
362 film.toPrimary(filmPatchi, htcwfilm);
367 film.toPrimary(filmPatchi, Tfilm);
369 filmDelta = film.delta().boundaryField()[filmPatchi];
370 film.toPrimary(filmPatchi, filmDelta);
375 <<
type() <<
" condition is intended to be applied to either the " 376 <<
"primary or pyrolysis regions only" 387 (filmDelta - filmDeltaDry_)/(filmDeltaWet_ - filmDeltaDry_),
394 const scalarField qConv(ratio*htcwfilm*(Tfilm - Tp)*convectiveScaling_);
398 valueFraction() =
alpha/(
alpha + (1.0 - ratio)*myKDelta);
399 refValue() = ratio*Tfilm + (1.0 - ratio)*(KDeltaNbr*nbrIntFld)/
alpha;
401 mixedFvPatchScalarField::updateCoeffs();
407 scalar Qt =
gSum((qConv + qRad)*
patch().magSf());
410 <<
patch().name() <<
':' 411 << this->internalField().name() <<
" <- " 412 << nbrMesh.name() <<
':' 413 << nbrPatch.name() <<
':' 414 << this->internalField().name() <<
" :" <<
nl 415 <<
" convective heat[W] : " << Qc <<
nl 416 <<
" radiative heat [W] : " << qr <<
nl 417 <<
" total heat [W] : " << Qt <<
nl 418 <<
" wall temperature " 419 <<
" min:" <<
gMin(*
this)
420 <<
" max:" <<
gMax(*
this)
433 os.writeEntryIfDifferent<word>
436 "surfaceFilmProperties",
439 os.writeEntryIfDifferent<word>
442 "pyrolysisProperties",
445 os.writeEntry(
"Tnbr", TnbrName_);
446 os.writeEntry(
"qr", qrName_);
447 os.writeEntry(
"convectiveScaling", convectiveScaling_);
448 os.writeEntry(
"filmDeltaDry", filmDeltaDry_);
449 os.writeEntry(
"filmDeltaWet", filmDeltaWet_);
459 filmPyrolysisRadiativeCoupledMixedFvPatchScalarField
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
List< scalar > scalarList
List of scalar.
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)
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.
Type gSum(const FieldField< Field, Type > &f)
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.
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)
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)
virtual void write(Ostream &) const
Write.
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Foam::regionModels::pyrolysisModels::pyrolysisModel pyrolysisModelType
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
static constexpr const zero Zero
Global zero (0)