Go to the documentation of this file.
56 solidificationMeltingSource,
106 zeroGradientFvPatchScalarField::typeName
135 return value.
value();
139 return coeffs_.lookup(
"g");
146 if (curTimeIndex_ == mesh_.time().timeIndex())
153 Info<<
type() <<
": " << name_ <<
" - updating phase indicator" <<
endl;
163 label cellI = cells_[i];
165 scalar Tc =
T[cellI];
166 scalar Cpc = Cp[cellI];
167 scalar alpha1New = alpha1_[cellI] + relax_*Cpc*(Tc - Tmelt_)/L_;
169 alpha1_[cellI] =
max(0,
min(alpha1New, 1));
170 deltaT_[i] = Tc - Tmelt_;
173 alpha1_.correctBoundaryConditions();
175 curTimeIndex_ = mesh_.time().timeIndex();
183 const word& sourceName,
184 const word& modelType,
192 relax_(coeffs_.lookupOrDefault(
"relax", 0.9)),
193 mode_(thermoModeTypeNames_.read(coeffs_.lookup(
"thermoMode"))),
194 rhoRef_(
readScalar(coeffs_.lookup(
"rhoRef"))),
195 TName_(coeffs_.lookupOrDefault<
word>(
"TName",
"T")),
196 CpName_(coeffs_.lookupOrDefault<
word>(
"CpName",
"Cp")),
197 UName_(coeffs_.lookupOrDefault<
word>(
"UName",
"U")),
198 phiName_(coeffs_.lookupOrDefault<
word>(
"phiName",
"phi")),
199 Cu_(coeffs_.lookupOrDefault<scalar>(
"Cu", 100000)),
200 q_(coeffs_.lookupOrDefault(
"q", 0.001)),
207 mesh.time().timeName(),
214 zeroGradientFvPatchScalarField::typeName
217 deltaT_(cells_.size(), 0)
219 fieldNames_.setSize(2);
220 fieldNames_[0] = UName_;
229 fieldNames_[1] =
thermo.he().name();
234 fieldNames_[1] = TName_;
240 <<
"Unhandled thermo mode: " << thermoModeTypeNames_[mode_]
245 applied_.setSize(2,
false);
295 label cellI = cells_[i];
297 scalar Vc = V[cellI];
298 scalar alpha1c = alpha1_[cellI];
300 scalar S = -Cu_*
sqr(1.0 - alpha1c)/(
pow3(alpha1c) + q_);
301 vector Sb = rhoRef_*
g*beta_*deltaT_[i];
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
A class for handling words, derived from string.
Cell-set options abtract base class. Provides a base set of controls, e.g.
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
const dimensionSet dimEnergy
static const word dictName
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
vector g() const
Return the gravity vector.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Abstract base-class for fluid and solid thermodynamic properties.
const dimensionedVector & g
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type & value() const
Return const reference to value.
void update(const volScalarField &Cp)
Update the model.
const word name_
Source name.
static const NamedEnum< thermoMode, 2 > thermoModeTypeNames_
const GeometricField< Type, fvPatchField, volMesh > & psi() const
const fvMesh & mesh_
Reference to the mesh database.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
word CpName_
Name of specific heat capacity field - default = "Cp" (optional)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
tmp< GeometricField< Type, fvPatchField, volMesh > > Su(const GeometricField< Type, fvPatchField, volMesh > &su, const GeometricField< Type, fvPatchField, volMesh > &vf)
dimensionedScalar pow3(const dimensionedScalar &ds)
dictionary coeffs_
Dictionary containing source coefficients.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
tmp< volScalarField > Cp() const
Return the specific heat capacity field.
A list of keyword definitions, which are a keyword followed by any number of values (e....
solidificationMeltingSource(const solidificationMeltingSource &)
Disallow default bitwise copy construct.
Macros for easy insertion into run-time selection tables.
Generic dimensioned Type class.
Mesh data needed to do the Finite Volume discretisation.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
errorManip< error > abort(error &err)
thermoMode mode_
Thermodynamics mode.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
defineTypeNameAndDebug(option, 0)
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldI)
Add explicit contribution to enthalpy equation.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
addToRunTimeSelectionTable(option, fixedTemperatureConstraint, dictionary)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
const Time & time() const
Return the top-level database.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
tmp< GeometricField< Type, fvPatchField, volMesh > > Sp(const volScalarField &sp, const GeometricField< Type, fvPatchField, volMesh > &vf)
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Generic GeometricField class.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Initialise the NamedEnum HashTable from the static list of names.