54void Foam::fv::VoFSolidificationMeltingSource::update()
56 if (curTimeIndex_ ==
mesh_.time().timeIndex())
64 <<
" - updating solid phase fraction" <<
endl;
67 alphaSolid_.oldTime();
69 const twoPhaseMixtureThermo&
thermo
71 mesh_.lookupObject<twoPhaseMixtureThermo>
83 const label celli =
cells_[i];
85 alphaSolid_[celli] =
min
87 relax_*alphaVoF[celli]*alphaSolidT_->value(TVoF[celli])
88 + (1 - relax_)*alphaSolid_[celli],
93 alphaSolid_.correctBoundaryConditions();
95 curTimeIndex_ =
mesh_.time().timeIndex();
99Foam::word Foam::fv::VoFSolidificationMeltingSource::alphaSolidName()
const
101 const twoPhaseMixtureThermo&
thermo
103 mesh_.lookupObject<twoPhaseMixtureThermo>
117Foam::fv::VoFSolidificationMeltingSource::VoFSolidificationMeltingSource
119 const word& sourceName,
120 const word& modelType,
126 alphaSolidT_(Function1<scalar>::
New(
"alphaSolidT", coeffs_, &
mesh)),
128 relax_(coeffs_.getOrDefault(
"relax", 0.9)),
129 Cu_(coeffs_.getOrDefault<scalar>(
"Cu", 100000)),
130 q_(coeffs_.getOrDefault<scalar>(
"q", 0.001)),
138 IOobject::READ_IF_PRESENT,
147 fieldNames_.resize(2);
148 fieldNames_[0] =
"U";
149 fieldNames_[1] =
"T";
151 fv::option::resetApplied();
159 fvMatrix<scalar>& eqn,
163 apply(geometricOneField(), eqn);
170 fvMatrix<scalar>& eqn,
180 fvMatrix<vector>& eqn,
186 Info<<
type() <<
": applying source to " << eqn.psi().name() <<
endl;
196 const label celli = cells_[i];
197 const scalar Vc =
V[celli];
198 const scalar alphaFluid = 1 - alphaSolid_[celli];
200 const scalar S = Cu_*
sqr(1 - alphaFluid)/(
pow3(alphaFluid) + q_);
210 fvMatrix<vector>& eqn,
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
tmp< GeometricField< Type, PatchField, GeoMesh > > T() const
Return transpose (only if it is a tensor field).
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
static const word dictName
The dictionary name ("thermophysicalProperties").
Solidification and melting model for VoF simulations.
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to enthalpy equation.
Intermediate abstract class for handling cell-set options for the derived fvOptions.
labelList cells_
Set of cells to apply source to.
Base abstract class for handling finite volume options (i.e. fvOption).
const fvMesh & mesh_
Reference to the mesh database.
const word name_
Source name.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const expr V(m.psi().mesh().V())
const word zeroGradientType
A zeroGradient patch field type.
Namespace for finite-volume.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
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)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static constexpr const zero Zero
Global zero (0).
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
psiReactionThermo & thermo
#define forAll(list, i)
Loop across all elements in list.