43 VoFSolidificationMeltingSource,
52 void Foam::fv::VoFSolidificationMeltingSource::readCoeffs()
56 relax_ = coeffs().lookupOrDefault<scalar>(
"relax", 0.9);
57 Cu_ = coeffs().lookupOrDefault<scalar>(
"Cu", 100000);
58 q_ = coeffs().lookupOrDefault<scalar>(
"q", 0.001);
62 void Foam::fv::VoFSolidificationMeltingSource::update()
const 72 <<
" - updating solid phase fraction" <<
endl;
75 alphaSolid_.oldTime();
77 const twoPhaseMixtureThermo&
thermo 79 mesh().lookupObject<twoPhaseMixtureThermo>
93 const label celli = cells[i];
95 alphaSolid_[celli] =
min 97 relax_*alphaVoF[celli]*alphaSolidT_->value(TVoF[celli])
98 + (1 - relax_)*alphaSolid_[celli],
103 alphaSolid_.correctBoundaryConditions();
105 curTimeIndex_ =
mesh().time().timeIndex();
109 Foam::word Foam::fv::VoFSolidificationMeltingSource::alphaSolidName()
const 111 const twoPhaseMixtureThermo&
thermo 113 mesh().lookupObject<twoPhaseMixtureThermo>
130 const word& modelType,
131 const dictionary& dict,
135 fvModel(name, modelType, dict, mesh),
136 set_(coeffs(), mesh),
149 IOobject::READ_IF_PRESENT,
154 zeroGradientFvPatchScalarField::typeName
173 fvMatrix<scalar>& eqn,
174 const word& fieldName
179 Info<<
type() <<
": applying source to " << eqn.psi().name() <<
endl;
184 const twoPhaseMixtureThermo&
thermo 186 mesh().lookupObject<twoPhaseMixtureThermo>
196 eqn += L_/CpVoF*(
fvc::ddt(rho, alphaSolid_));
200 eqn += L_*(
fvc::ddt(rho, alphaSolid_));
208 fvMatrix<vector>& eqn,
209 const word& fieldName
214 Info<<
type() <<
": applying source to " << eqn.psi().name() <<
endl;
226 const label celli = cells[i];
227 const scalar Vc = V[celli];
228 const scalar alphaFluid = 1 - alphaSolid_[celli];
230 const scalar
S = Cu_*
sqr(1 - alphaFluid)/(
pow3(alphaFluid) + q_);
232 Sp[celli] -= Vc*rho[celli]*
S;
239 const mapPolyMesh& mpm
242 set_.updateMesh(mpm);
defineTypeNameAndDebug(fixedTemperatureConstraint, 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.
fluidReactionThermo & thermo
dimensionedSymmTensor sqr(const dimensionedVector &dv)
virtual bool read(const dictionary &dict)
Read source dictionary.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
const fvMesh & mesh() const
Return const access to the mesh database.
Macros for easy insertion into run-time selection tables.
const word dictName() const
Return the local dictionary name (final part of scoped name)
VoFSolidificationMeltingSource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Calculate the first temporal derivative.
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
tmp< fvMatrix< Type > > S(const Pair< tmp< volScalarField::Internal >> &, const GeometricField< Type, fvPatchField, volMesh > &)
static word groupName(Name name, const word &group)
const dictionary & coeffs() const
Return dictionary.
List< label > labelList
A List of labels.
virtual bool read(const dictionary &dict)
Read source dictionary.
const dimensionSet dimEnergy
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const dimensionSet dimMass
virtual void updateMesh(const mapPolyMesh &)
Update for mesh changes.
word name(const complex &)
Return a string representation of a complex.
addToRunTimeSelectionTable(fvConstraint, fixedTemperatureConstraint, dictionary)
List< word > wordList
A List of words.
dimensionedScalar pow3(const dimensionedScalar &ds)
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.
virtual void addSup(const volScalarField &rho, fvMatrix< scalar > &eqn, const word &fieldName) const
Add explicit contribution to compressible enthalpy equation.
virtual wordList addSupFields() const
Return the list of fields for which the option adds source term.
const dimensionSet dimTemperature
static autoPtr< Function1< scalar > > New(const word &name, const dictionary &dict)
Selector.