38 filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
41 HashTable<const filmModelType*> models
46 if (iter()->regionMesh().
name() == filmRegionName_)
52 DynamicList<word> modelNames;
55 modelNames.append(iter()->regionMesh().
name());
60 "const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::" 62 "filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::" 65 <<
"Unable to locate film region " << filmRegionName_
66 <<
". Available regions include: " << modelNames
69 return **models.begin();
75 filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::
78 HashTable<const pyrolysisModelType*> models =
83 if (iter()->regionMesh().
name() == pyrolysisRegionName_)
89 DynamicList<word> modelNames;
92 modelNames.append(iter()->regionMesh().
name());
98 "const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::" 99 "pyrolysisModelType& " 100 "filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::" 103 <<
"Unable to locate pyrolysis region " << pyrolysisRegionName_
104 <<
". Available regions include: " << modelNames
107 return **models.begin();
120 mixedFvPatchScalarField(p, iF),
122 filmRegionName_(
"surfaceFilmProperties"),
123 pyrolysisRegionName_(
"pyrolysisProperties"),
124 TnbrName_(
"undefined-Tnbr"),
125 QrName_(
"undefined-Qr"),
126 convectiveScaling_(1.0),
130 this->refValue() = 0.0;
131 this->refGrad() = 0.0;
132 this->valueFraction() = 1.0;
145 mixedFvPatchScalarField(psf, p, iF, mapper),
147 filmRegionName_(psf.filmRegionName_),
148 pyrolysisRegionName_(psf.pyrolysisRegionName_),
149 TnbrName_(psf.TnbrName_),
150 QrName_(psf.QrName_),
151 convectiveScaling_(psf.convectiveScaling_),
152 filmDeltaDry_(psf.filmDeltaDry_),
153 filmDeltaWet_(psf.filmDeltaWet_)
165 mixedFvPatchScalarField(p, iF),
175 TnbrName_(dict.
lookup(
"Tnbr")),
176 QrName_(dict.
lookup(
"Qr")),
177 convectiveScaling_(dict.
lookupOrDefault<scalar>(
"convectiveScaling", 1.0)),
181 if (!isA<mappedPatchBase>(this->patch().patch()))
185 "filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::" 186 "filmPyrolysisRadiativeCoupledMixedFvPatchScalarField\n" 188 " const fvPatch& p,\n" 189 " const DimensionedField<scalar, volMesh>& iF,\n" 190 " const dictionary& dict\n" 192 ) <<
"\n patch type '" << p.type()
193 <<
"' not type '" << mappedPatchBase::typeName <<
"'" 194 <<
"\n for patch " << p.
name()
202 if (dict.
found(
"refValue"))
214 valueFraction() = 1.0;
226 mixedFvPatchScalarField(psf, iF),
228 filmRegionName_(psf.filmRegionName_),
229 pyrolysisRegionName_(psf.pyrolysisRegionName_),
230 TnbrName_(psf.TnbrName_),
231 QrName_(psf.QrName_),
232 convectiveScaling_(psf.convectiveScaling_),
233 filmDeltaDry_(psf.filmDeltaDry_),
234 filmDeltaWet_(psf.filmDeltaWet_)
249 refCast<const mappedPatchBase>(patch().patch());
251 const label patchI = patch().index();
256 refCast<const fvMesh>(nbrMesh).
boundary()[nbrPatchI];
271 scalarField nbrIntFld(nbrField.patchInternalField());
295 label coupledPatchI = -1;
296 if (pyrolysisRegionName_ == mesh.
name())
298 coupledPatchI = patchI;
299 if (QrName_ !=
"none")
307 coupledPatchI = nbrPatch.
index();
308 if (QrName_ !=
"none")
317 "void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::" 320 <<
type() <<
" condition is intended to be applied to either the " 321 <<
"primary or pyrolysis regions only" 363 (filmDelta - filmDeltaDry_)/(filmDeltaWet_ - filmDeltaDry_),
370 scalarField qConv(ratio*htcwfilm*(Tfilm - Tp)*convectiveScaling_);
376 valueFraction() = alpha/(alpha + (1.0 - ratio)*myKDelta);
378 refValue() = ratio*Tfilm + (1.0 - ratio)*(KDeltaNbr*nbrIntFld)/
alpha;
380 mixedFvPatchScalarField::updateCoeffs();
384 scalar Qc =
gSum(qConv*patch().magSf());
385 scalar Qr =
gSum(qRad*patch().magSf());
386 scalar Qt =
gSum((qConv + qRad)*patch().magSf());
389 << patch().name() <<
':' 391 << nbrMesh.
name() <<
':' 392 << nbrPatch.
name() <<
':' 394 <<
" convective heat[W] : " << Qc <<
nl 395 <<
" radiative heat [W] : " << Qr <<
nl 396 <<
" total heat [W] : " << Qt <<
nl 397 <<
" wall temperature " 398 <<
" min:" <<
gMin(*
this)
399 <<
" max:" <<
gMax(*
this)
412 writeEntryIfDifferent<word>
416 "surfaceFilmProperties",
419 writeEntryIfDifferent<word>
423 "pyrolysisProperties",
428 os.writeKeyword(
"convectiveScaling") << convectiveScaling_
430 os.writeKeyword(
"filmDeltaDry") << filmDeltaDry_
432 os.writeKeyword(
"filmDeltaWet") << filmDeltaWet_
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
virtual void operator=(const UList< Type > &)
faceListList boundary(nPatches)
const word & name() const
Return reference to name.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
filmPyrolysisRadiativeCoupledMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
const polyMesh & sampleMesh() const
Get the region mesh.
const scalarField & deltaCoeffs() const
Return the face - cell distance coeffient.
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
word name(const complex &)
Return a string representation of a complex.
tmp< scalarField > K() const
Get corresponding K field.
void distribute(List< Type > &lst) const
Wrapper around map/interpolate data distribution.
label index() const
Return the index of this patch in the boundaryMesh.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void write(Ostream &) const
Write.
label nbrCoupledPatchID(const regionModel &nbrRegion, const label regionPatchI) const
Return the coupled patch ID paired with coupled patch.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Foam::fvPatchFieldMapper.
const Time & time() const
Return the reference to the time database.
Base class for pyrolysis models.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual const volScalarField & Ts() const
Return the film surface temperature [K].
const word & name() const
Return name.
const GeometricField::PatchFieldType & lookupPatchField(const word &name, const GeometricField *=NULL, const Type *=NULL) const
Lookup and return the patchField of the named field from the.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Type gSum(const FieldField< Field, Type > &f)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const polyPatch & samplePolyPatch() const
Get the patch on the region.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
virtual void write(Ostream &) const
Write.
Foam::regionModels::pyrolysisModels::pyrolysisModel pyrolysisModelType
virtual tmp< volScalarField > h() const =0
Return the heat transfer coefficient [W/m2/K].
Macros for easy insertion into run-time selection tables.
Foam::regionModels::surfaceFilmModels::thermoSingleLayer filmModelType
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
errorManip< error > abort(error &err)
const word & name() const
Return name.
Type gMin(const FieldField< Field, Type > &f)
label index() const
Return the index of this patch in the fvBoundaryMesh.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
tmp< Foam::Field< Type > > mapRegionPatchField(const regionModel &nbrRegion, const label regionPatchI, const label nbrPatchI, const Field< Type > &nbrField, const bool flip=false) const
Map patch field from another region model to local patch.
rDeltaT dimensionedInternalField()
Mesh consisting of general polyhedral cells.
const fvMesh & primaryMesh() const
Return the reference to the primary mesh database.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Type gAverage(const FieldField< Field, Type > &f)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
temperatureCoupledBase(const fvPatch &patch, const word &calculationMethod, const word &kappaName, const word &alphaAniName)
Construct from patch and K name.
tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const heatTransferModel & htcw() const
Return const access to the (wall) heat transfer model.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
HashTable< const Type * > lookupClass(const bool strict=false) const
Lookup and return all objects of the given Type.
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
To & refCast(From &r)
Reference type cast template function.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
virtual label size() const
Return size.
Type gMax(const FieldField< Field, Type > &f)
void toPrimary(const label regionPatchI, List< Type > ®ionField) const
Convert a local region field to the primary region.