50 solidificationMeltingSource,
51 "solidificationMeltingSource"
70 void Foam::fv::solidificationMelting::readCoeffs()
95 Foam::fv::solidificationMelting::Cp()
const
101 const basicThermo&
thermo =
102 mesh().lookupObject<basicThermo>(physicalProperties::typeName);
107 case thermoMode::lookup:
109 if (CpName_ ==
"CpRef")
111 scalar CpRef = coeffs().lookup<scalar>(
"CpRef");
122 extrapolatedCalculatedFvPatchScalarField::typeName
135 <<
"Unhandled thermo mode: " << thermoModeTypeNames_[mode_]
140 return tmp<volScalarField>(
nullptr);
146 if (mesh().foundObject<uniformDimensionedVectorField>(
"g"))
150 return value.
value();
154 return coeffs().lookup(
"g");
159 void Foam::fv::solidificationMelting::update
164 if (curTimeIndex_ == mesh().time().
timeIndex())
172 <<
" - updating phase indicator" <<
endl;
186 const scalar Tc =
T[celli];
187 const scalar Cpc =
Cp[celli];
188 const scalar alpha1New =
197 + (Tliq_ - Tsol_)*(alpha1_[celli] - alpha1e_)/(1 - alpha1e_)
201 alpha1_[celli] =
max(0,
min(alpha1New, 1));
208 + (Tliq_ - Tsol_)*(alpha1_[celli] - alpha1e_)/(1 - alpha1e_)
212 alpha1_.correctBoundaryConditions();
214 curTimeIndex_ = mesh().time().timeIndex();
218 template<
class RhoFieldType>
219 void Foam::fv::solidificationMelting::apply
221 const RhoFieldType&
rho,
222 fvMatrix<scalar>& eqn
227 Info<<
type() <<
": applying source to " << eqn.psi().name() <<
endl;
253 const word& modelType,
259 set_(mesh, coeffs()),
270 phiName_(
word::null),
278 this->
name() +
":alpha1",
286 zeroGradientFvPatchScalarField::typeName
289 deltaT_(set_.nCells(), 0)
304 mesh().lookupObject<
basicThermo>(physicalProperties::typeName);
308 case thermoMode::lookup:
366 const scalar Vc = V[celli];
367 const scalar alpha1c = alpha1_[celli];
369 const scalar
S = -Cu_*
sqr(1.0 - alpha1c)/(
pow3(alpha1c) + q_);
370 const vector Sb = rhoRef_*g*beta_*deltaT_[i];
401 set_.topoChange(map);
416 set_.distribute(map);
scalar Cp(const scalar p, const scalar T) const
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static const List< word > & null()
Return a null List.
Initialise the NamedEnum HashTable from the static list of names.
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
Base-class for fluid and solid thermodynamic properties.
A list of keyword definitions, which are a keyword followed by any number of values (e....
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T, if not found return the given default.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Mesh data needed to do the Finite Volume discretisation.
Finite volume model abstract base class.
const dictionary & coeffs() const
Return dictionary.
virtual bool read(const dictionary &dict)
Read source dictionary.
This source is designed to model the effect of solidification and melting processes,...
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
virtual void addSup(const volScalarField &he, fvMatrix< scalar > &eqn) const
Add explicit contribution to enthalpy equation.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read source dictionary.
static const NamedEnum< thermoMode, 2 > thermoModeTypeNames_
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
solidificationMelting(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for managing temporary objects.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Calculate the first temporal derivative.
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
addBackwardCompatibleToRunTimeSelectionTable(fvConstraint, fixedTemperature, dictionary, fixedTemperatureConstraint, "fixedTemperatureConstraint")
tmp< VolField< Type > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
tmp< VolField< Type > > Su(const VolField< Type > &su, const VolField< Type > &vf)
tmp< VolField< Type > > Sp(const volScalarField &sp, const VolField< Type > &vf)
tmp< fvMatrix< Type > > S(const Pair< tmp< volScalarField::Internal >> &, const VolField< Type > &)
List< word > wordList
A List of words.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet dimEnergy
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar pow3(const dimensionedScalar &ds)
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)
const dimensionSet dimless
const dimensionSet dimTemperature
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
UniformDimensionedField< vector > uniformDimensionedVectorField
VolField< scalar > volScalarField
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimMass
UList< label > labelUList
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
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.
fluidMulticomponentThermo & thermo