25 params.
renameParam(
"passive_scalar_face_interpolation",
26 "phase_face_interpolation",
27 "The numerical scheme to interpolate the phase fraction variable to the "
28 "face (separate from the advected quantity interpolation)");
34 "fluid_heat_transfer_physics",
36 "WCNSFVFluidHeatTransferPhysics generating the fluid energy equation");
39 params.
addClassDescription(
"Define the additional terms for a mixture model for the two phase "
40 "weakly-compressible Navier Stokes equations");
50 "use_external_mixture_properties",
52 "Whether to use the simple NSFVMixtureFunctorMaterial or use a more complex model "
53 "defined outside of the Physics");
54 params.
addParam<
bool>(
"output_all_properties",
56 "Whether to output every functor material property defined to Exodus");
61 params.
addParam<
bool>(
"add_phase_change_energy_term",
63 "Whether to add a phase change term based on the latent heat of fusion in "
64 "the energy equation");
67 params.
addParam<
bool>(
"add_drift_flux_momentum_terms",
69 "Whether to add the drift flux terms to the momentum equation");
70 MooseEnum coeff_interp_method(
"average harmonic",
"harmonic");
73 "Face interpolation method for the density in the drift flux term.");
75 "add_advection_slip_term",
false,
"Whether to use the advection-slip model");
77 "slip_linear_friction_name",
78 "Name of the functor providing the scalar linear friction coefficient");
82 "phase_1_fraction_name",
83 "Name of the first phase fraction variable, it will be created as a functor material "
84 "property if it does not exist already.");
86 "Name of the density functor for phase 1");
88 "Name of the viscosity functor for phase 1");
90 "Name of the specific heat functor for phase 1");
91 params.
addRequiredParam<MooseFunctorName>(
"phase_1_thermal_conductivity_name",
92 "Name of the thermal conductivity functor for phase 1");
96 "Name of the density functor for phase 2");
98 "Name of the viscosity functor for phase 2");
100 "Name of the specific heat functor for phase 2");
101 params.
addRequiredParam<MooseFunctorName>(
"phase_2_thermal_conductivity_name",
102 "Name of the thermal conductivity functor for phase 2");
106 "particle_diameter", 1,
"Particle size if using a dispersed phase");
107 params.
addParam<
bool>(
"use_dispersed_phase_drag_model",
109 "Adds a linear friction term with the dispersed phase drag model");
113 "phase_1_specific_heat_name phase_1_thermal_conductivity_name "
114 "phase_2_density_name phase_2_viscosity_name "
115 "phase_2_specific_heat_name phase_2_thermal_conductivity_name "
116 "use_external_mixture_properties",
117 "Mixture material properties");
133 params.
addParam<
bool>(
"add_scalar_equation",
true,
"");
135 "add_phase_transport_equation",
136 "Whether to add the phase transport equation.");
139 "initial_phase_fraction",
140 "Initial value of the main phase fraction variable");
142 "phase_fraction_diffusivity",
143 "Functor names for the diffusivities used for the main phase fraction.");
146 "phase_2_fraction_name",
147 "Name of the second phase fraction variable (can be a dispersed phase)");
150 params.
suppressParameter<std::vector<MooseFunctorName>>(
"passive_scalar_source");
152 "passive_scalar_coupled_source");
153 params.
suppressParameter<std::vector<std::vector<Real>>>(
"passive_scalar_coupled_source_coeff");
157 "phase_fraction_inlet_type",
158 "Types for the inlet boundary for the phase fraction.");
159 params.
renameParam(
"passive_scalar_inlet_functors",
160 "phase_fraction_inlet_functors",
161 "Functors describing the inlet phase fraction boundary condition.");
164 params.
renameParam(
"passive_scalar_advection_interpolation",
165 "phase_advection_interpolation",
166 "The numerical scheme to use for interpolating the phase fraction variable, "
167 "as an advected quantity, to the face.");
169 "passive_scalar_two_term_bc_expansion",
170 "phase_two_term_bc_expansion",
171 "If a two-term Taylor expansion is needed for the determination of the boundary values"
172 "of the phase fraction.");
177 "The scaling factor for the phase transport equation");
184 _add_phase_equation(_has_scalar_equation),
185 _phase_1_fraction_name(getParam<MooseFunctorName>(
"phase_1_fraction_name")),
186 _phase_2_fraction_name(_passive_scalar_names[0]),
187 _phase_1_density(getParam<MooseFunctorName>(
"phase_1_density_name")),
188 _phase_1_viscosity(getParam<MooseFunctorName>(
"phase_1_viscosity_name")),
189 _phase_1_specific_heat(getParam<MooseFunctorName>(
"phase_1_specific_heat_name")),
190 _phase_1_thermal_conductivity(getParam<MooseFunctorName>(
"phase_1_thermal_conductivity_name")),
191 _phase_2_density(getParam<MooseFunctorName>(
"phase_2_density_name")),
192 _phase_2_viscosity(getParam<MooseFunctorName>(
"phase_2_viscosity_name")),
193 _phase_2_specific_heat(getParam<MooseFunctorName>(
"phase_2_specific_heat_name")),
194 _phase_2_thermal_conductivity(getParam<MooseFunctorName>(
"phase_2_thermal_conductivity_name")),
195 _use_external_mixture_properties(getParam<bool>(
"use_external_mixture_properties")),
196 _use_drift_flux(getParam<bool>(
"add_drift_flux_momentum_terms")),
197 _use_advection_slip(getParam<bool>(
"add_advection_slip_term"))
201 paramError(
"phase_fraction_name",
"Only one phase fraction currently supported.");
203 paramError(
"phase_fraction_inlet_functors",
"Only one phase fraction currently supported");
209 getParam<PhysicsName>(
"fluid_heat_transfer_physics"),
true);
212 !getCoupledPhysics<const WCNSFVFluidHeatTransferPhysics>(
true).empty())
214 "fluid_heat_transfer_physics",
215 "We currently do not support creating both a phase transport equation and fluid heat "
216 "transfer physics that are not coupled together");
232 mooseError(
"Density name should for Physics '",
234 "' should be 'rho_mixture'");
236 mooseError(
"Specific heat name should for Physics '",
238 "' should be 'cp_mixture'");
243 mooseError(
"Density name should for Physics ,",
245 "' should be 'rho_mixture'");
258 if (
isParamSetByUser(
"alpha_exchange") && getParam<bool>(
"add_phase_change_energy_term"))
260 "A phase exchange coefficient cannot be specified if the phase change is handled "
261 "with a phase change heat loss model");
264 "First phase fraction name should be different from second phase fraction name");
267 "Drift flux model cannot be used at the same time as the advection slip model");
268 if (!getParam<bool>(
"add_drift_flux_momentum_terms"))
270 if (!getParam<bool>(
"use_dispersed_phase_drag_model"))
283 getParam<bool>(
"add_phase_change_energy_term"))
295 params.
set<MooseFunctorName>(
"u_slip") =
"vel_slip_x";
297 params.
set<MooseFunctorName>(
"v_slip") =
"vel_slip_y";
299 params.
set<MooseFunctorName>(
"w_slip") =
"vel_slip_z";
309 params.set<MooseFunctorName>(
"alpha") = getParam<MooseFunctorName>(
NS::alpha_exchange);
321 params.set<MooseFunctorName>(
NS::density) =
"rho_mixture";
332 const std::vector<std::string> components = {
"x",
"y",
"z"};
337 params.set<NonlinearVariableName>(
"variable") =
339 params.set<MooseFunctorName>(
"u_slip") =
"vel_slip_x";
341 params.set<MooseFunctorName>(
"v_slip") =
"vel_slip_y";
343 params.set<MooseFunctorName>(
"w_slip") =
"vel_slip_z";
346 params.set<
MooseEnum>(
"momentum_component") = components[
dim];
347 params.set<
MooseEnum>(
"density_interp_method") = getParam<MooseEnum>(
"density_interp_method");
350 "WCNSFV2PMomentumDriftFlux",
prefix() +
"drift_flux_" + components[
dim], params);
357 const std::vector<std::string> components = {
"x",
"y",
"z"};
362 params.set<NonlinearVariableName>(
"variable") =
364 params.set<MooseFunctorName>(
"u_slip") =
"vel_slip_x";
366 params.set<MooseFunctorName>(
"v_slip") =
"vel_slip_y";
368 params.set<MooseFunctorName>(
"w_slip") =
"vel_slip_z";
372 params.set<
MooseEnum>(
"momentum_component") = components[
dim];
373 params.set<
MooseEnum>(
"advected_interp_method") =
375 params.set<
MooseEnum>(
"velocity_interp_method") =
379 "WCNSFV2PMomentumAdvectionSlip",
prefix() +
"advection_slip_" + components[
dim], params);
395 params.set<std::vector<OutputName>>(
"outputs") = {
"all"};
401 paramError(
"Phase 2 fraction should be defined as a variable or auxiliary variable");
411 params.set<std::vector<OutputName>>(
"outputs") = {
"all"};
420 params.set<std::vector<MooseFunctorName>>(
"prop_names") = {
421 "rho_mixture",
"mu_mixture",
"cp_mixture",
"k_mixture"};
425 params.set<std::vector<MooseFunctorName>>(
"phase_2_names") = {
_phase_1_density,
429 params.set<std::vector<MooseFunctorName>>(
"phase_1_names") = {
_phase_2_density,
434 if (getParam<bool>(
"output_all_properties"))
435 params.set<std::vector<OutputName>>(
"outputs") = {
"all"};
442 const std::vector<std::string> vel_components = {
"u",
"v",
"w"};
443 const std::vector<std::string> components = {
"x",
"y",
"z"};
448 params.set<MooseFunctorName>(
"slip_velocity_name") =
"vel_slip_" + components[
dim];
449 params.set<
MooseEnum>(
"momentum_component") = components[
dim];
450 for (
const auto j : make_range(
dimension()))
451 params.set<std::vector<VariableName>>(vel_components[j]) = {
454 params.set<MooseFunctorName>(
NS::mu) =
"mu_mixture";
458 params.set<MooseFunctorName>(
"linear_coef_name") =
459 getParam<MooseFunctorName>(
"slip_linear_friction_name");
460 else if (getParam<bool>(
"use_dispersed_phase_drag_model"))
461 params.set<MooseFunctorName>(
"linear_coef_name") =
"Darcy_coefficient";
465 params.set<MooseFunctorName>(
"linear_coef_name") =
468 params.set<MooseFunctorName>(
"linear_coef_name") =
"0";
472 "WCNSFV2PSlipVelocityFunctorMaterial created by this Physics required a scalar "
473 "field linear friction factor.");
474 params.set<MooseFunctorName>(
"particle_diameter") =
475 getParam<MooseFunctorName>(
"particle_diameter");
476 if (getParam<bool>(
"output_all_properties"))
479 params.set<std::vector<OutputName>>(
"outputs") = {
"all"};
482 "Slip velocity functor material output currently unsupported in Physics "
483 "in transient conditions.");
486 "WCNSFV2PSlipVelocityFunctorMaterial",
prefix() +
"slip_" + components[
dim], params);
491 if (getParam<bool>(
"use_dispersed_phase_drag_model"))
493 const std::vector<std::string> vel_components = {
"u",
"v",
"w"};
497 params.set<MooseFunctorName>(
"drag_coef_name") =
"Darcy_coefficient";
498 for (
const auto j : make_range(
dimension()))
499 params.set<MooseFunctorName>(vel_components[j]) = {
501 params.set<MooseFunctorName>(
NS::density) =
"rho_mixture";
502 params.set<MooseFunctorName>(
NS::mu) =
"mu_mixture";
503 params.set<MooseFunctorName>(
"particle_diameter") =
504 getParam<MooseFunctorName>(
"particle_diameter");
505 if (getParam<bool>(
"output_all_properties"))
506 params.set<std::vector<OutputName>>(
"outputs") = {
"all"};
508 "NSFVDispersePhaseDragFunctorMaterial",
prefix() +
"dispersed_drag", params);
void mooseInfoRepeated(Args &&... args)
registerMooseAction("NavierStokesApp", WCNSFVTwoPhaseMixturePhysics, "add_functor_material")
registerNavierStokesPhysicsBaseTasks("NavierStokesApp", WCNSFVTwoPhaseMixturePhysics)
registerWCNSFVScalarTransportBaseTasks("NavierStokesApp", WCNSFVTwoPhaseMixturePhysics)
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
InputParameters getValidParams(const std::string &name) const
void paramInfo(const std::string ¶m, Args... args) const
const std::string & name() const
void paramError(const std::string ¶m, Args... args) const
bool isParamSetByUser(const std::string &name) const
void mooseError(Args &&... args) const
bool isParamValid(const std::string &name) const
virtual FEProblemBase & getProblem()
void assignBlocks(InputParameters ¶ms, const std::vector< SubdomainName > &blocks) const
unsigned int dimension() const
std::string prefix() const
virtual void addFVKernels()
std::vector< SubdomainName > _blocks
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
const MooseFunctorName & densityName() const
bool hasFlowEquations() const
Whether the physics is actually creating the flow equations.
virtual MooseFunctorName getLinearFrictionCoefName() const =0
Get the name of the linear friction coefficient. Returns an empty string if no friction.
const std::vector< std::string > & getVelocityNames() const
To interface with other Physics.
RealVectorValue gravityVector() const
Return the gravity vector.
const MooseEnum & getVelocityFaceInterpolationMethod() const
Get the face interpolation method for velocity.
const UserObjectName & rhieChowUOName() const
Return the name of the Rhie Chow user object.
const MooseEnum & getMomentumFaceInterpolationMethod() const
Get the face interpolation method for momentum (mostly used in the stress terms)
const MooseFunctorName & densityName() const
Return the name of the density functor.
const VariableName & getFluidTemperatureName() const
Get the name of the fluid temperature variable.
const MooseFunctorName & getSpecificHeatName() const
Get the name of the specific heat material property.
bool hasEnergyEquation() const
Whether the physics is actually creating the heat equation.
std::vector< NonlinearVariableName > _passive_scalar_names
Names of the passive scalar variables.
std::vector< std::vector< MooseFunctorName > > _passive_scalar_inlet_functors
Functors describing the inlet boundary values. See passive_scalar_inlet_types for what the functors a...
Creates all the objects needed to solve the Navier Stokes scalar transport equations using the nonlin...
static InputParameters validParams()
Creates all the objects needed to solve the mixture terms for the weakly-compressible and incompressi...
void addAdvectionSlipTerm()
static InputParameters validParams()
virtual void addFVKernels() override
const WCNSFVFluidHeatTransferPhysics * _fluid_energy_physics
Fluid heat transfer physics.
WCNSFVTwoPhaseMixturePhysics(const InputParameters ¶meters)
const bool _use_advection_slip
Whether to add the advection slip term to each component of the momentum equation.
const bool _use_drift_flux
Whether to add the drift flux momentum terms to each component momentum equation.
const MooseFunctorName _phase_1_fraction_name
Name of the first phase fraction (usually, liquid)
virtual void setSlipVelocityParams(InputParameters ¶ms) const override
Adds the slip velocity parameters.
void addPhaseDriftFluxTerm()
virtual void addFunctorMaterials() override
static InputParameters commonMixtureParams()
void addPhaseInterfaceTerm()
Functions adding kernels for the other physics.
const MooseFunctorName _phase_1_density
Name of the density of the other phase.
static void renamePassiveScalarToMixtureParams(InputParameters ¶ms)
const MooseFunctorName _phase_1_specific_heat
Name of the specific heat of the other phase.
const MooseFunctorName _phase_1_thermal_conductivity
Name of the thermal conductivity of the other phase.
void addPhaseChangeEnergySource()
const MooseFunctorName _phase_2_fraction_name
Name of the second phase fraction (usually, dispersed or advected by the liquid)
const MooseFunctorName _phase_1_viscosity
Name of the dyanmic viscosity of the other phase.
const bool _add_phase_equation
Convenience boolean to keep track of whether the phase transport equation is requested.
const bool _use_external_mixture_properties
Whether to define the mixture model internally or use fluid properties instead.
const MooseFunctorName _phase_2_density
Name of the density of the other phase.
bool _has_energy_equation
Convenience boolean to keep track of whether the fluid energy equation is present.
const MooseFunctorName _phase_2_viscosity
Name of the dynamic viscosity of the other phase.
const MooseFunctorName _phase_2_specific_heat
Name of the specific heat of the other phase.
const MooseFunctorName _phase_2_thermal_conductivity
Name of the thermal conductivity of the other phase.
static const std::string latent_heat
static const std::string density
static const std::string T_solidus
static const std::string mu
static const std::string T_liquidus
static const std::string alpha_exchange