44 { KMethodType::mtFluidThermo,
"fluidThermo" },
45 { KMethodType::mtSolidThermo,
"solidThermo" },
46 { KMethodType::mtDirectionalSolidThermo,
"directionalSolidThermo" },
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: "
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
211 method_(base.method_),
212 kappaName_(base.kappaName_),
213 alphaName_(base.alphaName_),
214 alphaAniName_(base.alphaAniName_),
229 kappaFunction1_().autoMap(mapper);
240 const fvPatchField<scalar>& ptf,
250 kappaFunction1_().rmap(tcb->kappaFunction1_(), 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"
338 case mtDirectionalSolidThermo:
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"
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);
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Abstract base-class for fluid and solid thermodynamic properties.
virtual tmp< volScalarField > kappa() const =0
Thermal diffusivity for temperature of mixture [J/m/s/K].
virtual volScalarField & p()
Pressure [Pa].
static const word dictName
The dictionary name ("thermophysicalProperties").
virtual tmp< volScalarField > Cp() const =0
Heat capacity at constant pressure [J/kg/K].
virtual const volScalarField & alpha() const
Thermal diffusivity for enthalpy of mixture [kg/m/s].
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Fundamental fluid thermodynamic properties.
Mesh data needed to do the Finite Volume discretisation.
const word & name() const
Return reference to name.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
static const word phasePropertiesName
Default name of the phase properties dictionary.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
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...
const polyMesh & mesh() const noexcept
Return the mesh reference.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
Fundamental solid thermodynamic properties.
Common functions used in temperature coupled boundaries.
virtual tmp< scalarField > alpha(const scalarField &Tp) const
Given patch temperature calculate corresponding alphaEff field.
autoPtr< PatchFunction1< scalar > > alphaFunction1_
Function1 for alpha.
const word alphaName_
Name of thermal diffusivity.
virtual void autoMap(const fvPatchFieldMapper &)=0
Map (and resize as needed) from self given a mapping object.
KMethodType
Type of supplied Kappa.
@ mtDirectionalSolidThermo
const word alphaAniName_
Name of the non-isotropic alpha (for directional solidThermo).
const word & kappaName() const noexcept
Name of thermal conductivity field.
void write(Ostream &os) const
Write.
virtual void rmap(const fvPatchField< scalar > &, const labelList &)=0
Reverse map the given fvPatchField onto this fvPatchField.
const word & alphaName() const noexcept
Name of thermal diffusivity field.
const fvPatch & patch_
Underlying patch.
static const Enum< KMethodType > KMethodTypeNames_
const KMethodType method_
How to get K.
virtual tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field.
temperatureCoupledBase(const fvPatch &patch, const KMethodType method=KMethodType::mtFluidThermo)
Default construct from patch, using fluidThermo (default) or specified method.
const word kappaName_
Name of thermal conductivity field (if looked up from database).
autoPtr< PatchFunction1< scalar > > kappaFunction1_
Function1 for kappa.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
A class for managing temporary objects.
Abstract base class for turbulence models (RAS, LES and laminar).
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
const std::string patch
OpenFOAM patch number as a std::string.
List< label > labelList
A List of labels.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
psiReactionThermo & thermo