Go to the documentation of this file.
45 VoFSolidificationMeltingSource,
54 void Foam::fv::VoFSolidificationMeltingSource::update()
64 <<
" - updating solid phase fraction" <<
endl;
69 const twoPhaseMixtureThermo&
thermo
83 const label celli =
cells_[i];
85 alphaSolid_[celli] =
min
87 relax_*alphaVoF[celli]*alphaSolidT_->value(TVoF[celli])
88 + (1 - relax_)*alphaSolid_[celli],
99 Foam::word Foam::fv::VoFSolidificationMeltingSource::alphaSolidName()
const
101 const twoPhaseMixtureThermo&
thermo
103 mesh_.lookupObject<twoPhaseMixtureThermo>
117 Foam::fv::VoFSolidificationMeltingSource::VoFSolidificationMeltingSource
119 const word& sourceName,
120 const word& modelType,
121 const dictionary&
dict,
125 cellSetOption(sourceName, modelType,
dict,
mesh),
126 alphaSolidT_(Function1<scalar>::
New(
"alphaSolidT", coeffs_)),
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,
143 zeroGradientFvPatchScalarField::typeName
147 fieldNames_.setSize(2);
148 fieldNames_[0] =
"U";
149 fieldNames_[1] =
"T";
150 applied_.setSize(fieldNames_.size(),
false);
158 fvMatrix<scalar>& eqn,
162 apply(geometricOneField(), eqn);
169 fvMatrix<scalar>& eqn,
179 fvMatrix<vector>& eqn,
185 Info<<
type() <<
": applying source to " << eqn.psi().name() <<
endl;
195 const label celli = cells_[i];
196 const scalar Vc = V[celli];
197 const scalar alphaFluid = 1 - alphaSolid_[celli];
199 const scalar S = Cu_*
sqr(1 - alphaFluid)/(
pow3(alphaFluid) + q_);
209 fvMatrix<vector>& eqn,
int debug
Static debugging option.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to enthalpy equation.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
A class for handling words, derived from Foam::string.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimEnergy
psiReactionThermo & thermo
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Ostream & endl(Ostream &os)
Add newline and flush stream.
const word name_
Source name.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
const fvMesh & mesh_
Reference to the mesh database.
#define forAll(list, i)
Loop across all elements in list.
dimensionedScalar pow3(const dimensionedScalar &ds)
messageStream Info
Information stream (uses stdout - output is on the master only)
labelList cells_
Set of cells to apply source to.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const Type & lookupObject(const word &name, const bool recursive=false) const
word dictName() const
The local dictionary name (final part of scoped name)
Macros for easy insertion into run-time selection tables.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
void correctBoundaryConditions()
Correct boundary field.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
static void apply(bitSet &selection, const Detail::parcelSelection::actionType action, const Predicate &accept, const UList< Type > &list, const AccessOp &aop)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const Time & time() const
Return the top-level database.
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)
label timeIndex() const
Return current time index.