57 solidificationMeltingSource,
70 Foam::fv::solidificationMeltingSource::Cp()
const 84 if (CpName_ ==
"CpRef")
86 scalar CpRef =
readScalar(coeffs_.lookup(
"CpRef"));
95 mesh_.time().timeName(),
107 extrapolatedCalculatedFvPatchScalarField::typeName
121 <<
"Unhandled thermo mode: " << thermoModeTypeNames_[mode_]
130 Foam::vector Foam::fv::solidificationMeltingSource::g()
const 136 return value.
value();
140 return coeffs_.lookup(
"g");
145 void Foam::fv::solidificationMeltingSource::update(
const volScalarField& Cp)
147 if (curTimeIndex_ == mesh_.time().timeIndex())
154 Info<<
type() <<
": " << name_ <<
" - updating phase indicator" <<
endl;
164 const label celli = cells_[i];
166 const scalar Tc = T[celli];
167 const scalar Cpc = Cp[celli];
168 const scalar alpha1New =
177 + (Tliq_ - Tsol_)*(alpha1_[celli] - alpha1e_)/(1 - alpha1e_)
181 alpha1_[celli] =
max(0,
min(alpha1New, 1));
188 + (Tliq_ - Tsol_)*(alpha1_[celli] - alpha1e_)/(1 - alpha1e_)
192 alpha1_.correctBoundaryConditions();
194 curTimeIndex_ = mesh_.time().timeIndex();
200 Foam::fv::solidificationMeltingSource::solidificationMeltingSource
202 const word& sourceName,
203 const word& modelType,
210 Tliq_(coeffs_.lookupOrDefault(
"Tliq", Tsol_)),
211 alpha1e_(coeffs_.lookupOrDefault(
"alpha1e", 0.0)),
213 relax_(coeffs_.lookupOrDefault(
"relax", 0.9)),
214 mode_(thermoModeTypeNames_.read(coeffs_.lookup(
"thermoMode"))),
215 rhoRef_(
readScalar(coeffs_.lookup(
"rhoRef"))),
216 TName_(coeffs_.lookupOrDefault<
word>(
"T",
"T")),
217 CpName_(coeffs_.lookupOrDefault<
word>(
"Cp",
"Cp")),
218 UName_(coeffs_.lookupOrDefault<
word>(
"U",
"U")),
219 phiName_(coeffs_.lookupOrDefault<
word>(
"phi",
"phi")),
220 Cu_(coeffs_.lookupOrDefault<scalar>(
"Cu", 100000)),
221 q_(coeffs_.lookupOrDefault(
"q", 0.001)),
235 zeroGradientFvPatchScalarField::typeName
238 deltaT_(cells_.size(), 0)
240 fieldNames_.setSize(2);
241 fieldNames_[0] = UName_;
250 fieldNames_[1] = thermo.
he().
name();
255 fieldNames_[1] = TName_;
261 <<
"Unhandled thermo mode: " << thermoModeTypeNames_[mode_]
266 applied_.setSize(fieldNames_.size(),
false);
316 const label celli = cells_[i];
318 const scalar Vc = V[celli];
319 const scalar alpha1c = alpha1_[celli];
321 const scalar S = -Cu_*
sqr(1.0 - alpha1c)/(
pow3(alpha1c) + q_);
322 const vector Sb = rhoRef_*g*beta_*deltaT_[i];
defineTypeNameAndDebug(option, 0)
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
Abstract base-class for fluid and solid thermodynamic properties.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
static const NamedEnum< thermoMode, 2 > thermoModeTypeNames_
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const GeometricField< Type, fvPatchField, volMesh > & psi() const
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
addToRunTimeSelectionTable(option, fixedTemperatureConstraint, dictionary)
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
rhoReactionThermo & thermo
const Time & time() const
Return the top-level database.
Initialise the NamedEnum HashTable from the static list of names.
Macros for easy insertion into run-time selection tables.
virtual volScalarField & he()=0
Enthalpy/Internal energy [J/kg].
const word dictName() const
Return the local dictionary name (final part of scoped name)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
A class for handling words, derived from string.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
const Type & value() const
Return const reference to value.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
errorManip< error > abort(error &err)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual tmp< volScalarField > Cp() const =0
Heat capacity at constant pressure [J/kg/K].
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
const dimensionSet dimEnergy
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to enthalpy equation.
dimensionedScalar pow3(const dimensionedScalar &ds)
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Cell-set options abtract base class. Provides a base set of controls, e.g.:
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
A class for managing temporary objects.
const dimensionedVector & g
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...