Go to the documentation of this file.
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());
152 if (
dict.found(
"refValue"))
165 if (
dict.found(
"value"))
188 const externalCoupledTemperatureMixedFvPatchScalarField& rhs
191 externalCoupledMixedFvPatchField<scalar>(rhs),
192 outTempType_(rhs.outTempType_),
193 refTempType_(rhs.refTempType_),
194 Tref_(rhs.Tref_.clone())
206 outTempType_(rhs.outTempType_),
207 refTempType_(rhs.refTempType_),
208 Tref_(rhs.Tref_.clone())
219 const label patchi =
patch().index();
231 internalField().
group()
235 static word thermoName(
"thermophysicalProperties");
237 if (db().foundObject<cmpTurbModelType>(turbName))
239 const cmpTurbModelType& turbModel =
240 db().lookupObject<cmpTurbModelType>(turbName);
246 qDot = turbModel.alphaEff(patchi)*hep.
snGrad();
248 else if (db().foundObject<basicThermo>(thermoName))
250 const basicThermo&
thermo = db().lookupObject<basicThermo>(thermoName);
254 qDot =
thermo.alpha().boundaryField()[patchi]*hep.snGrad();
259 <<
"Condition requires either compressible turbulence and/or "
268 tmp<scalarField> tfluid;
270 if (refTempType_ == refTemperatureType::USER)
273 const scalar currTref =
274 Tref_->value(this->db().time().timeOutputValue());
281 tfluid = patchInternalField();
292 const scalar deltaT =
mag(Twall[i] - Tfluid[i]);
295 htc[i] =
sign(qDot[i])*qDot[i]/deltaT;
299 const Field<scalar>& magSf = this->
patch().magSf();
301 const UList<scalar>& Tout =
303 outTempType_ == outputTemperatureType::FLUID
325 ISstream& iss =
dynamic_cast<ISstream&
>(is);
332 IStringStream lineStr(line);
335 >> this->refValue()[facei]
336 >> this->refGrad()[facei]
337 >> this->valueFraction()[facei];
351 outputTemperatureNames[outTempType_]
356 refTemperatureNames[refTempType_]
361 Tref_->writeData(
os);
373 externalCoupledTemperatureMixedFvPatchScalarField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
fvPatchField< scalar > fvPatchScalarField
virtual void operator=(const UList< Type > &)
virtual tmp< Field< Type > > snGrad() const
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual scalarField & valueFraction()
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
A class for handling words, derived from Foam::string.
ISstream & getLine(std::string &str, char delim='\n')
constexpr const char *const group
virtual Field< scalar > & refValue()
A class for managing temporary objects.
static constexpr const zero Zero
virtual void writeData(Ostream &os) const
static const word propertiesName
virtual Field< scalar > & refGrad()
Generic input stream using a standard (STL) stream.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
friend Ostream & operator(Ostream &, const fvPatchField< Type > &)
Abstract base-class for fluid and solid thermodynamic properties.
Ostream & endl(Ostream &os)
EnumType get(const word &enumName) const
dimensionedScalar sign(const dimensionedScalar &ds)
Generic templated field type.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual tmp< Field< Type > > patchInternalField() const
virtual void write(Ostream &) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
virtual void write(Ostream &os) const
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
#define FatalErrorInFunction
virtual void readData(Istream &is)
const objectRegistry & db() const
Templated wrapper class to provide compressible turbulence models thermal diffusivity based thermal t...
externalCoupledTemperatureMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const dimensionedScalar e
static tmp< T > New(Args &&... args)
virtual void writeHeader(Ostream &os) const
Ostream & writeEntry(const keyType &key, const T &value)
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Foam::fvPatchFieldMapper.
This boundary condition provides a temperatue interface to an external application.
static word groupName(StringType base, const word &group)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
#define WarningInFunction
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)