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 fv::cellSetOption(sourceName, modelType,
dict,
mesh),
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";
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,
word dictName() const
The local dictionary name (final part of scoped name)
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
const word zeroGradientType
A zeroGradient patch field type.
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
const fvMesh & mesh_
Reference to the mesh database.
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)
Ostream & endl(Ostream &os)
Add newline and flush stream.
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.
const Time & time() const
Return the top-level database.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
psiReactionThermo & thermo
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
const word name_
Source name.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
label timeIndex() const noexcept
Return the current time index.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to enthalpy equation.
int debug
Static debugging option.
const dimensionSet dimEnergy
labelList cells_
Set of cells to apply source to.
dimensionedScalar pow3(const dimensionedScalar &ds)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
void correctBoundaryConditions()
Correct boundary field.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
static constexpr const zero Zero
Global zero (0)