44 { KMethodType::mtFluidThermo,
"fluidThermo" },
45 { KMethodType::mtSolidThermo,
"solidThermo" },
46 { KMethodType::mtDirectionalSolidThermo,
"directionalSolidThermo" },
47 { KMethodType::mtLookup,
"lookup" },
48 { KMethodType::mtFunction,
"function" }
57 const KMethodType method
65 kappaFunction1_(nullptr),
66 alphaFunction1_(nullptr)
75 <<
"Cannot construct kappaMethod: " 91 const KMethodType method,
92 const word& kappaName,
93 const word& alphaName,
94 const word& alphaAniName
99 kappaName_(kappaName),
100 alphaName_(alphaName),
101 alphaAniName_(alphaAniName),
102 kappaFunction1_(nullptr),
103 alphaFunction1_(nullptr)
110 <<
"Cannot construct kappaMethod: " 125 const fvPatch&
patch,
126 const dictionary&
dict 130 method_(KMethodTypeNames_.
get(
"kappaMethod",
dict)),
131 kappaName_(
dict.getOrDefault<word>(
"kappa", word::null)),
132 alphaName_(
dict.getOrDefault<word>(
"alpha", word::null)),
133 alphaAniName_(
dict.getOrDefault<word>(
"alphaAni", word::null)),
134 kappaFunction1_(nullptr),
135 alphaFunction1_(nullptr)
141 if (!
dict.found(
"alphaAni"))
144 <<
"Did not find entry 'alphaAni'" 145 " required for 'kappaMethod' " 155 if (!
dict.found(
"kappa"))
158 <<
"Did not find entry 'kappa'" 159 " required for 'kappaMethod' " 161 <<
"Please set 'kappa' to the name of" 162 " a volScalar or volSymmTensor field" <<
nl 197 const temperatureCoupledBase& base
211 method_(base.method_),
212 kappaName_(base.kappaName_),
213 alphaName_(base.alphaName_),
214 alphaAniName_(base.alphaAniName_),
215 kappaFunction1_(base.kappaFunction1_.clone(patch_.
patch())),
216 alphaFunction1_(base.alphaFunction1_.clone(patch_.
patch()))
229 kappaFunction1_().autoMap(mapper);
233 alphaFunction1_().autoMap(mapper);
240 const fvPatchField<scalar>& ptf,
244 const auto* tcb = isA<temperatureCoupledBase>(ptf);
250 kappaFunction1_().rmap(tcb->kappaFunction1_(), addr);
254 alphaFunction1_().rmap(tcb->alphaFunction1_(), addr);
266 const label patchi = patch_.index();
283 return ptr->kappaEff(patchi);
293 return ptr->kappa(patchi);
303 return ptr->kappa(patchi);
316 return ptr->kappaEff(patchi);
321 <<
"Using kappaMethod " << KMethodTypeNames_[method_]
322 <<
", but thermo package not available\n" 330 const solidThermo&
thermo =
338 case mtDirectionalSolidThermo:
340 const solidThermo&
thermo =
378 return n & wallValues &
n;
384 <<
"Did not find field '" << kappaName_
386 <<
" patch " << patch_.name() <<
nl 387 <<
"Please set 'kappa' to the name of" 388 " a volScalar or volSymmTensor field" 389 ", or use another method" <<
nl 390 <<
" " <<
flatOutput(KMethodTypeNames_.sortedToc()) <<
nl 396 case KMethodType::mtFunction:
398 const auto& tm = patch_.patch().boundaryMesh().mesh().time();
399 return kappaFunction1_->value(tm.timeOutputValue());
406 <<
"Unimplemented method " << KMethodTypeNames_[method_] <<
nl 407 <<
"Please set 'kappaMethod' to one of " 409 <<
"If kappaMethod=lookup, also set 'kappa' to the name of" 410 " a volScalar or volSymmTensor field" <<
nl 427 const label patchi = patch_.index();
444 return ptr->alphaEff(patchi);
454 return ptr->alpha(patchi);
464 return ptr->alpha(patchi);
474 return ptr->alpha(patchi);
479 <<
"Using kappaMethod " << KMethodTypeNames_[method_]
480 <<
", but thermo package not available\n" 488 const solidThermo&
thermo =
495 case mtDirectionalSolidThermo:
502 return n & alphaAni &
n;
528 return n & wallValues &
n;
533 <<
"Did not find field '" << alphaName_
535 <<
" patch " << patch_.name() <<
nl 536 <<
"Please set 'alpha' to the name of" 537 " a volScalar or volSymmTensor field" 538 ", or use another method" <<
nl 539 <<
" " <<
flatOutput(KMethodTypeNames_.sortedToc()) <<
nl 545 case KMethodType::mtFunction:
547 const auto& tm = patch_.patch().boundaryMesh().mesh().time();
548 return alphaFunction1_->value(tm.timeOutputValue());
555 <<
"Unimplemented method " << KMethodTypeNames_[method_] <<
nl 556 <<
"Please set 'kappaMethod' to one of " 558 <<
"If kappaMethod=lookup, also set 'alpha' to the name of" 559 " a volScalar or volSymmTensor field" <<
nl 572 os.
writeEntry(
"kappaMethod", KMethodTypeNames_[method_]);
573 if (!kappaName_.empty())
577 if (!alphaAniName_.empty())
581 if (!alphaName_.empty())
587 kappaFunction1_->writeData(
os);
591 alphaFunction1_->writeData(
os);
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
word dictName() const
The local dictionary name (final part of scoped name)
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
const fvPatch & patch_
Underlying patch.
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
virtual tmp< volScalarField > kappa() const =0
Thermal diffusivity for temperature of mixture [J/m/s/K].
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static const word phasePropertiesName
Default name of the phase properties dictionary.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
autoPtr< PatchFunction1< scalar > > alphaFunction1_
Function1 for alpha.
KMethodType
Type of supplied Kappa.
constexpr char nl
The newline '\n' character (0x0a)
virtual tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field.
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
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 const volScalarField & alpha() const
Thermal diffusivity for enthalpy of mixture [kg/m/s].
virtual void rmap(const fvPatchField< scalar > &, const labelList &)=0
Reverse map the given fvPatchField onto this fvPatchField.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
virtual void autoMap(const fvPatchFieldMapper &)=0
Map (and resize as needed) from self given a mapping object.
void write(Ostream &os) const
Write.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
virtual volScalarField & p()
Pressure [Pa].
GeometricField< scalar, fvPatchField, volMesh > volScalarField
psiReactionThermo & thermo
autoPtr< PatchFunction1< scalar > > kappaFunction1_
Function1 for kappa.
const polyMesh & mesh() const noexcept
Return the mesh reference.
static const word propertiesName
Default name of the turbulence properties dictionary.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A FieldMapper for finite-volume patch fields.
temperatureCoupledBase(const fvPatch &patch, const KMethodType method=KMethodType::mtFluidThermo)
Default construct from patch, using fluidThermo (default) or specified method.
errorManip< error > abort(error &err)
OBJstream os(runTime.globalPath()/outputName)
virtual tmp< volScalarField > Cp() const =0
Heat capacity at constant pressure [J/kg/K].
const KMethodType method_
How to get K.
Common functions used in temperature coupled boundaries.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
const word & name() const
Return reference to name.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
const std::string patch
OpenFOAM patch number as a std::string.
static const Enum< KMethodType > KMethodTypeNames_
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< label > labelList
A List of labels.
A class for managing temporary objects.
const polyPatch & patch() const noexcept
Return the polyPatch.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...