40 Foam::externalCoupledTemperatureMixedFvPatchScalarField::
43 Foam::externalCoupledTemperatureMixedFvPatchScalarField::outputTemperatureNames
45 { outputTemperatureType::FLUID,
"fluid" },
46 { outputTemperatureType::WALL,
"wall" },
52 Foam::externalCoupledTemperatureMixedFvPatchScalarField::
55 Foam::externalCoupledTemperatureMixedFvPatchScalarField::refTemperatureNames
57 { refTemperatureType::CELL,
"cell" },
58 { refTemperatureType::USER,
"user" },
69 if (outTempType_ == outputTemperatureType::WALL)
71 os <<
"# Values: area Twall qDot htc" <<
endl;
75 os <<
"# Values: area Tfluid qDot htc" <<
endl;
90 outTempType_(outputTemperatureType::WALL),
91 refTempType_(refTemperatureType::CELL),
106 outTempType_(rhs.outTempType_),
107 refTempType_(rhs.refTempType_),
108 Tref_(rhs.Tref_.clone())
122 outTempType_(outputTemperatureType::WALL),
125 refTemperatureNames.getOrDefault
129 refTemperatureType::CELL
134 if (
dict.found(
"outputTemperature"))
136 outTempType_ = outputTemperatureNames.
get(
"outputTemperature",
dict);
141 <<
"outputTemperature not specified " 143 <<
"using 'wall' as compatibility default" <<
nl 147 if (refTempType_ == refTemperatureType::USER)
149 Tref_ = Function1<scalar>::New(
"Tref",
dict, &
db());
177 const externalCoupledTemperatureMixedFvPatchScalarField& rhs
180 externalCoupledMixedFvPatchField<scalar>(rhs),
181 outTempType_(rhs.outTempType_),
182 refTempType_(rhs.refTempType_),
183 Tref_(rhs.Tref_.clone())
195 outTempType_(rhs.outTempType_),
196 refTempType_(rhs.refTempType_),
197 Tref_(rhs.Tref_.clone())
208 const label patchi =
patch().index();
220 internalField().
group()
224 static word thermoName(
"thermophysicalProperties");
226 if (db().foundObject<cmpTurbModelType>(turbName))
228 const cmpTurbModelType& turbModel =
229 db().lookupObject<cmpTurbModelType>(turbName);
235 qDot = turbModel.alphaEff(patchi)*hep.
snGrad();
237 else if (db().foundObject<basicThermo>(thermoName))
239 const basicThermo&
thermo = db().lookupObject<basicThermo>(thermoName);
248 <<
"Condition requires either compressible turbulence and/or " 259 if (refTempType_ == refTemperatureType::USER)
262 const scalar currTref =
263 Tref_->value(this->db().time().timeOutputValue());
270 this->patchInternalField(Tfluid);
279 const scalar deltaT =
mag(Twall[i] - Tfluid[i]);
282 htc[i] =
sign(qDot[i])*qDot[i]/deltaT;
286 const Field<scalar>& magSf = this->
patch().magSf();
288 const UList<scalar>& Tout =
290 outTempType_ == outputTemperatureType::FLUID
312 ISstream& iss =
dynamic_cast<ISstream&
>(is);
319 IStringStream lineStr(line);
322 >> this->refValue()[facei]
323 >> this->refGrad()[facei]
324 >> this->valueFraction()[facei];
338 outputTemperatureNames[outTempType_]
343 refTemperatureNames[refTempType_]
348 Tref_->writeData(
os);
360 externalCoupledTemperatureMixedFvPatchScalarField
bool readValueEntry(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "value" entry into *this.
EnumType get(const word &enumName) const
The enumeration corresponding to the given name.
dimensionedScalar sign(const dimensionedScalar &ds)
Extends the mixed boundary condition with serialisation functions.
const objectRegistry & db() const
The associated objectRegistry.
Abstract base-class for fluid and solid thermodynamic properties.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::buffered)
Evaluate the patch field.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
externalCoupledTemperatureMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual const volScalarField & alpha() const
Thermal diffusivity for enthalpy of mixture [kg/m/s].
void extrapolateInternal()
Assign the patch field from the internal field.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
Macros for easy insertion into run-time selection tables.
virtual volScalarField & he()=0
Enthalpy/Internal energy [J/kg].
virtual Field< scalar > & refValue()
#define forAll(list, i)
Loop across all elements in list.
constexpr const char *const group
Group name for atomic constants.
bool readMixedEntries(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the 'refValue', 'refGradient' and 'valueFraction' entries into their respective places...
psiReactionThermo & thermo
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
virtual void writeData(Ostream &os) const
Write data.
const dimensionedScalar e
Elementary charge.
fvPatchField< scalar > fvPatchScalarField
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual scalarField & valueFraction()
A FieldMapper for finite-volume patch fields.
virtual void writeHeader(Ostream &os) const
Write header.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
This boundary condition provides a temperatue interface to an external application.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual void write(Ostream &os) const
Write.
OBJstream os(runTime.globalPath()/outputName)
virtual void readData(Istream &is)
Read data.
#define WarningInFunction
Report a warning using Foam::Warning.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
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.
virtual void write(Ostream &) const
Write.
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
virtual Field< scalar > & refGrad()
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
static constexpr const zero Zero
Global zero (0)