15 "Linear FV elemental kernel that adds the apparent heat-capacity "
16 "phase-change source term: rho * L * (df/dT) * T_dot, with f the liquid "
21 params.
addRequiredParam<MooseFunctorName>(
"T_solidus",
"The solidus temperature.");
22 params.
addRequiredParam<MooseFunctorName>(
"T_liquidus",
"The liquidus temperature.");
24 MooseEnum smoothing(
"smooth sharp",
"smooth");
28 "Shape of the liquid fraction over the mushy interval. 'smooth' (default) uses a "
29 "smoothstep cubic function and 'sharp' uses a linear liquid fraction.");
36 _L(getFunctor<Real>(
"L")),
37 _rho(getFunctor<Real>(
NS::density)),
38 _T_solidus(getFunctor<Real>(
"T_solidus")),
39 _T_liquidus(getFunctor<Real>(
"T_liquidus")),
40 _smooth(getParam<
MooseEnum>(
"smoothing") ==
"smooth"),
41 _time_integrator(_sys.getTimeIntegrator(_var_num)),
42 _factor_history(_time_integrator.numStatesRequired(), 0.0),
43 _state_args(_time_integrator.numStatesRequired(), determineState())
53 const Real s = std::clamp((
T - T_sol) / dT_pc, 0.0, 1.0);
54 return 6.0 * s * (1.0 - s) / dT_pc;
58 if (
T > T_sol &&
T < T_sol + dT_pc)
70 const Real T_sol =
_T_solidus(elem_arg, state);
72 const Real dT_pc = T_liq - T_sol;
82 const Real rhoL =
_rho(elem_arg, state) *
_L(elem_arg, state);
95 const Real T_sol =
_T_solidus(elem_arg, state);
97 const Real dT_pc = T_liq - T_sol;
107 const Real rhoL =
_rho(elem_arg, state) *
_L(elem_arg, state);
registerMooseObject("NavierStokesApp", LinearFVPhaseChangeSource)
const Elem * elem() const
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
virtual void setCurrentElemInfo(const ElemInfo *elem_info)
const ElemInfo * _current_elem_info
static InputParameters validParams()
Real _current_elem_volume
MooseLinearVariableFV< Real > & _var
Finite-volume elemental kernel that adds the apparent heat-capacity phase-change source term: rho * L...
virtual void setCurrentElemInfo(const ElemInfo *elem_info) override
Real computeMatrixContribution() override
static InputParameters validParams()
LinearFVPhaseChangeSource(const InputParameters ¶ms)
Constructor.
const Moose::Functor< Real > & _rho
Density.
std::vector< Real > _factor_history
Current and older values of the material property multiplier.
const Moose::Functor< Real > & _T_solidus
Solidus Temperature.
const Moose::Functor< Real > & _T_liquidus
Liquidus Temperature.
const TimeIntegrator & _time_integrator
The time integrator to use in this kernel, will provide information on how many states are required i...
const Moose::Functor< Real > & _L
Latent heat.
const bool _smooth
Whether to use the smoothstep liquid fraction (true, default) or the linear ("sharp") liquid fraction...
Real computeDfDT(const Real T, const Real T_sol, const Real dT_pc) const
Compute df/dT at temperature T for the selected liquid-fraction shape.
Real computeRightHandSideContribution() override
virtual Real timeDerivativeRHSContribution(dof_id_type dof_id, const std::vector< Real > &factors={}) const
virtual Real timeDerivativeMatrixContribution(const Real factor) const
Real getElemValue(const ElemInfo &elem_info, const StateArg &state) const
Moose::StateArg determineState() const
static const std::string density