42 VoFSolidificationMeltingSource,
51 void Foam::fv::VoFSolidificationMeltingSource::update()
53 if (curTimeIndex_ == mesh_.time().timeIndex())
61 <<
" - updating solid phase fraction" <<
endl;
64 alphaSolid_.oldTime();
66 const twoPhaseMixtureThermo&
thermo 68 mesh_.lookupObject<twoPhaseMixtureThermo>
80 const label celli = cells_[i];
82 alphaSolid_[celli] =
min 84 relax_*alphaVoF[celli]*alphaSolidT_->value(TVoF[celli])
85 + (1 - relax_)*alphaSolid_[celli],
90 alphaSolid_.correctBoundaryConditions();
92 curTimeIndex_ = mesh_.time().timeIndex();
96 Foam::word Foam::fv::VoFSolidificationMeltingSource::alphaSolidName()
const 98 const twoPhaseMixtureThermo&
thermo 100 mesh_.lookupObject<twoPhaseMixtureThermo>
116 const word& sourceName,
117 const word& modelType,
118 const dictionary& dict,
122 cellSetOption(sourceName, modelType, dict, mesh),
123 alphaSolidT_(Function1<scalar>::
New(
"alphaSolidT", coeffs_)),
125 relax_(coeffs_.lookupOrDefault(
"relax", 0.9)),
126 Cu_(coeffs_.lookupOrDefault<scalar>(
"Cu", 100000)),
127 q_(coeffs_.lookupOrDefault(
"q", 0.001)),
135 IOobject::READ_IF_PRESENT,
140 zeroGradientFvPatchScalarField::typeName
144 fieldNames_.setSize(2);
145 fieldNames_[0] =
"U";
146 fieldNames_[1] =
"T";
147 applied_.setSize(fieldNames_.size(),
false);
155 fvMatrix<scalar>& eqn,
159 apply(geometricOneField(), eqn);
166 fvMatrix<scalar>& eqn,
176 fvMatrix<vector>& eqn,
182 Info<<
type() <<
": applying source to " << eqn.psi().name() <<
endl;
192 const label celli = cells_[i];
193 const scalar Vc = V[celli];
194 const scalar alphaFluid = 1 - alphaSolid_[celli];
196 const scalar S = Cu_*
sqr(1 - alphaFluid)/(
pow3(alphaFluid) + q_);
206 fvMatrix<vector>& eqn,
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.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
addToRunTimeSelectionTable(option, fixedTemperatureConstraint, dictionary)
rhoReactionThermo & thermo
Macros for easy insertion into run-time selection tables.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
const word dictName() const
Return the local dictionary name (final part of scoped name)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static word groupName(Name name, const word &group)
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to enthalpy equation.
VoFSolidificationMeltingSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const dimensionSet dimEnergy
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.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)