55 { thermoMode::mdThermo,
"thermo" },
56 { thermoMode::mdLookup,
"lookup" },
63Foam::fv::solidificationMeltingSource::Cp()
const
77 if (CpName_ ==
"CpRef")
79 const scalar CpRef =
coeffs_.
get<scalar>(
"CpRef");
98 extrapolatedCalculatedFvPatchScalarField::typeName
122 if (curTimeIndex_ == mesh_.time().timeIndex())
129 Info<<
type() <<
": " << name_ <<
" - updating phase indicator" <<
endl;
132 if (mesh_.topoChanging())
134 deltaT_.resize(cells_.size());
144 label celli = cells_[i];
146 scalar Tc =
T[celli];
147 scalar Cpc =
Cp[celli];
148 scalar alpha1New = alpha1_[celli] + relax_*Cpc*(Tc - Tmelt_)/L_;
150 alpha1_[celli] =
max(0,
min(alpha1New, 1));
151 deltaT_[i] = Tc - Tmelt_;
154 alpha1_.correctBoundaryConditions();
156 curTimeIndex_ = mesh_.time().timeIndex();
164 const word& sourceName,
165 const word& modelType,
171 Tmelt_(coeffs_.get<scalar>(
"Tmelt")),
172 L_(coeffs_.get<scalar>(
"L")),
173 relax_(coeffs_.getOrDefault<scalar>(
"relax", 0.9)),
174 mode_(thermoModeTypeNames_.get(
"thermoMode", coeffs_)),
175 rhoRef_(coeffs_.get<scalar>(
"rhoRef")),
176 TName_(coeffs_.getOrDefault<
word>(
"T",
"T")),
177 CpName_(coeffs_.getOrDefault<
word>(
"Cp",
"Cp")),
178 UName_(coeffs_.getOrDefault<
word>(
"U",
"U")),
179 phiName_(coeffs_.getOrDefault<
word>(
"phi",
"phi")),
180 Cu_(coeffs_.getOrDefault<scalar>(
"Cu", 100000)),
181 q_(coeffs_.getOrDefault<scalar>(
"q", 0.001)),
182 beta_(coeffs_.get<scalar>(
"beta")),
195 zeroGradientFvPatchScalarField::typeName
198 deltaT_(cells_.size(), 0)
276 label celli = cells_[i];
278 scalar Vc = V[celli];
279 scalar alpha1c = alpha1_[celli];
281 scalar S = -Cu_*
sqr(1.0 - alpha1c)/(
pow3(alpha1c) + q_);
282 vector Sb(rhoRef_*
g*beta_*deltaT_[i]);
306 coeffs_.readEntry(
"Tmelt", Tmelt_);
307 coeffs_.readEntry(
"L", L_);
309 coeffs_.readIfPresent(
"relax", relax_);
311 thermoModeTypeNames_.readEntry(
"thermoMode", coeffs_, mode_);
313 coeffs_.readEntry(
"rhoRef", rhoRef_);
314 coeffs_.readIfPresent(
"T", TName_);
315 coeffs_.readIfPresent(
"U", UName_);
317 coeffs_.readIfPresent(
"Cu", Cu_);
318 coeffs_.readIfPresent(
"q", q_);
320 coeffs_.readEntry(
"beta", beta_);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
const uniformDimensionedVectorField & g
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
void resize(const label len)
Adjust allocated size of list.
virtual bool read()
Re-read model coefficients if they have changed.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static word timeName(const scalar t, const int precision=precision_)
Abstract base-class for fluid and solid thermodynamic properties.
static const word dictName
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
A special matrix type and solver, designed for finite volume solutions of scalar equations....
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
Field< Type > & source() noexcept
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Intermediate abstract class for handling cell-set options for the derived fvOptions.
Base abstract class for handling finite volume options (i.e. fvOption).
const fvMesh & mesh_
Reference to the mesh database.
wordList fieldNames_
Field names to apply source to - populated by derived models.
dictionary coeffs_
Dictionary containing source coefficients.
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
const word name_
Source name.
This source is designed to model the effect of solidification and melting processes,...
thermoMode
Options for the thermo mode specification.
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to enthalpy equation.
static const Enum< thermoMode > thermoModeTypeNames_
Names for thermoMode.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
virtual bool update()
Update the mesh for both mesh motion and topology change.
const Type & lookupObject(const word &name, const bool recursive=false) const
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const volScalarField & Cp
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimEnergy
dimensionedScalar pow3(const dimensionedScalar &ds)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
static void apply(bitSet &selection, const Detail::parcelSelection::actionType action, const Predicate &accept, const UList< Type > &list, const AccessOp &aop)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
#define forAll(list, i)
Loop across all elements in list.