69 void Foam::fv::solidificationMeltingSource::readCoeffs()
94 Foam::fv::solidificationMeltingSource::Cp()
const
100 const basicThermo&
thermo =
101 mesh().lookupObject<basicThermo>(physicalProperties::typeName);
106 case thermoMode::lookup:
108 if (CpName_ ==
"CpRef")
110 scalar CpRef = coeffs().lookup<scalar>(
"CpRef");
121 extrapolatedCalculatedFvPatchScalarField::typeName
134 <<
"Unhandled thermo mode: " << thermoModeTypeNames_[mode_]
139 return tmp<volScalarField>(
nullptr);
143 Foam::vector Foam::fv::solidificationMeltingSource::g()
const
145 if (mesh().foundObject<uniformDimensionedVectorField>(
"g"))
149 return value.
value();
153 return coeffs().lookup(
"g");
158 void Foam::fv::solidificationMeltingSource::update
163 if (curTimeIndex_ == mesh().time().
timeIndex())
171 <<
" - updating phase indicator" <<
endl;
185 const scalar Tc =
T[celli];
186 const scalar Cpc =
Cp[celli];
187 const scalar alpha1New =
196 + (Tliq_ - Tsol_)*(alpha1_[celli] - alpha1e_)/(1 - alpha1e_)
200 alpha1_[celli] =
max(0,
min(alpha1New, 1));
207 + (Tliq_ - Tsol_)*(alpha1_[celli] - alpha1e_)/(1 - alpha1e_)
211 alpha1_.correctBoundaryConditions();
213 curTimeIndex_ = mesh().time().timeIndex();
222 const word& modelType,
228 set_(mesh, coeffs()),
239 phiName_(
word::null),
247 this->
name() +
":alpha1",
255 zeroGradientFvPatchScalarField::typeName
258 deltaT_(set_.nCells(), 0)
273 mesh().lookupObject<
basicThermo>(physicalProperties::typeName);
277 case thermoMode::lookup:
290 const word& fieldName
301 const word& fieldName
311 const word& fieldName
335 const scalar Vc = V[celli];
336 const scalar alpha1c = alpha1_[celli];
338 const scalar
S = -Cu_*
sqr(1.0 - alpha1c)/(
pow3(alpha1c) + q_);
339 const vector Sb = rhoRef_*g*beta_*deltaT_[i];
351 const word& fieldName
355 addSup(eqn, fieldName);
371 set_.topoChange(map);
386 set_.distribute(map);
scalar Cp(const scalar p, const scalar T) const
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &)
Return a temporary field constructed from name,.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static const List< word > & null()
Return a null List.
Initialise the NamedEnum HashTable from the static list of names.
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
Base-class for fluid and solid thermodynamic properties.
A list of keyword definitions, which are a keyword followed by any number of values (e....
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const Type & value() const
Return const reference to value.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
Finite volume model abstract base class.
const dictionary & coeffs() const
Return dictionary.
virtual bool read(const dictionary &dict)
Read source dictionary.
This source is designed to model the effect of solidification and melting processes,...
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
virtual void addSup(fvMatrix< scalar > &eqn, const word &fieldName) const
Add explicit contribution to enthalpy equation.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
solidificationMeltingSource(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
virtual bool read(const dictionary &dict)
Read source dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
static const NamedEnum< thermoMode, 2 > thermoModeTypeNames_
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for managing temporary objects.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
tmp< VolField< Type > > Su(const VolField< Type > &su, const VolField< Type > &vf)
tmp< VolField< Type > > Sp(const volScalarField &sp, const VolField< Type > &vf)
tmp< fvMatrix< Type > > S(const Pair< tmp< volScalarField::Internal >> &, const VolField< Type > &)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
List< word > wordList
A List of words.
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 dimensionSet dimEnergy
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar pow3(const dimensionedScalar &ds)
errorManip< error > abort(error &err)
const dimensionSet dimless
const dimensionSet dimTemperature
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
UniformDimensionedField< vector > uniformDimensionedVectorField
VolField< scalar > volScalarField
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimMass
word name(const complex &)
Return a string representation of a complex.
UList< label > labelUList
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
fluidMulticomponentThermo & thermo