20 "add_interpolation_method_physics");
33 "fluid_heat_transfer_physics",
35 "WCNSLinearFVFluidHeatTransferPhysics generating the fluid energy equation");
37 params.addParamNamesToGroup(
"fluid_heat_transfer_physics",
"Phase change");
38 params.addClassDescription(
"Define the additional terms for a mixture model for the two phase " 39 "weakly-compressible Navier Stokes equations using the linearized " 40 "segregated finite volume discretization");
43 params.addParam<
bool>(
"add_gravity_term_in_slip_velocity",
45 "Whether to add the gravity term in the slip velocity vector computation");
52 _add_phase_equation(_has_scalar_equation),
53 _phase_1_fraction_name(getParam<MooseFunctorName>(
"phase_1_fraction_name")),
54 _phase_2_fraction_name(_passive_scalar_names[0]),
55 _phase_1_density(getParam<MooseFunctorName>(
"phase_1_density_name")),
56 _phase_1_viscosity(getParam<MooseFunctorName>(
"phase_1_viscosity_name")),
57 _phase_1_specific_heat(getParam<MooseFunctorName>(
"phase_1_specific_heat_name")),
58 _phase_1_thermal_conductivity(getParam<MooseFunctorName>(
"phase_1_thermal_conductivity_name")),
59 _phase_2_density(getParam<MooseFunctorName>(
"phase_2_density_name")),
60 _phase_2_viscosity(getParam<MooseFunctorName>(
"phase_2_viscosity_name")),
61 _phase_2_specific_heat(getParam<MooseFunctorName>(
"phase_2_specific_heat_name")),
62 _phase_2_thermal_conductivity(getParam<MooseFunctorName>(
"phase_2_thermal_conductivity_name")),
63 _use_external_mixture_properties(getParam<bool>(
"use_external_mixture_properties")),
64 _use_drift_flux(getParam<bool>(
"add_drift_flux_momentum_terms")),
65 _use_advection_slip(getParam<bool>(
"add_advection_slip_term"))
69 paramError(
"phase_fraction_name",
"Only one phase fraction currently supported.");
71 paramError(
"phase_fraction_inlet_functors",
"Only one phase fraction currently supported");
77 getParam<PhysicsName>(
"fluid_heat_transfer_physics"),
true);
80 !getCoupledPhysics<const WCNSLinearFVFluidHeatTransferPhysics>(
true).empty())
82 "fluid_heat_transfer_physics",
83 "We currently do not support creating both a phase transport equation and fluid heat " 84 "transfer physics that are not coupled together");
103 mooseError(
"Specific heat name for Physics '",
105 "' should be 'cp_mixture'");
111 "' should be 'rho_mixture'");
123 if (
isParamSetByUser(
"alpha_exchange") && getParam<bool>(
"add_phase_change_energy_term"))
125 "A phase exchange coefficient cannot be specified if the phase change is handled " 126 "with a phase change heat loss model");
129 "First phase fraction name should be different from second phase fraction name");
132 "Drift flux model cannot be used at the same time as the advection slip model");
133 if (!getParam<bool>(
"add_drift_flux_momentum_terms"))
135 if (!getParam<bool>(
"use_dispersed_phase_drag_model"))
148 const auto tol = 1e-2;
149 if (
_problem->mesh().allFaceInfo().empty())
150 _problem->mesh().setupFiniteVolumeMeshData();
151 for (
const auto & fi :
_problem->mesh().allFaceInfo())
153 if (fi.skewnessCorrectionVector().norm() >
tol * fi.dCNMag())
156 " requires skewness correction. We currently do not support mixture flow with " 157 "buoyancy and mesh skewness. Please contact a MOOSE or Navier Stokes module " 158 "developer if you require this.");
172 getParam<bool>(
"add_phase_change_energy_term"))
184 params.
set<MooseFunctorName>(
"u_slip") =
"vel_slip_x";
186 params.
set<MooseFunctorName>(
"v_slip") =
"vel_slip_y";
188 params.
set<MooseFunctorName>(
"w_slip") =
"vel_slip_z";
199 params.set<MooseFunctorName>(
"coeff") = getParam<MooseFunctorName>(
NS::alpha_exchange);
201 "LinearFVReaction",
prefix() +
"phase_interface_reaction", params);
208 params.set<MooseFunctorName>(
"scaling_factor") = getParam<MooseFunctorName>(
NS::alpha_exchange);
216 mooseError(
"Phase change energy source not implemented at this time for linear finite volume");
222 const std::vector<std::string> components = {
"x",
"y",
"z"};
225 const auto object_type =
"LinearWCNSFV2PMomentumDriftFlux";
232 params.set<
MooseEnum>(
"momentum_component") = components[
dim];
233 params.set<
MooseEnum>(
"density_interp_method") = getParam<MooseEnum>(
"density_interp_method");
242 mooseError(
"Phase advection slip not implemented at this time for linear finite volume");
257 params.set<std::vector<OutputName>>(
"outputs") = {
"all"};
263 paramError(
"Phase 2 fraction should be defined as a variable or auxiliary variable");
273 params.set<std::vector<OutputName>>(
"outputs") = {
"all"};
282 params.set<std::vector<MooseFunctorName>>(
"prop_names") = {
283 "rho_mixture",
"mu_mixture",
"cp_mixture",
"k_mixture"};
287 params.set<std::vector<MooseFunctorName>>(
"phase_2_names") = {
_phase_1_density,
291 params.set<std::vector<MooseFunctorName>>(
"phase_1_names") = {
_phase_2_density,
296 if (getParam<bool>(
"output_all_properties"))
297 params.set<std::vector<OutputName>>(
"outputs") = {
"all"};
298 params.set<
bool>(
"limit_phase_fraction") =
true;
300 "WCNSLinearFVMixtureFunctorMaterial",
prefix() +
"mixture_material", params);
307 const std::vector<std::string> vel_components = {
"u",
"v",
"w"};
308 const std::vector<std::string> components = {
"x",
"y",
"z"};
313 params.set<MooseFunctorName>(
"slip_velocity_name") =
"vel_slip_" + components[
dim];
314 params.set<
MooseEnum>(
"momentum_component") = components[
dim];
316 params.set<std::vector<VariableName>>(vel_components[
j]) = {
319 params.set<MooseFunctorName>(
NS::mu) =
"mu_mixture";
321 if (getParam<bool>(
"add_gravity_term_in_slip_velocity"))
324 params.set<MooseFunctorName>(
"linear_coef_name") =
325 getParam<MooseFunctorName>(
"slip_linear_friction_name");
326 else if (getParam<bool>(
"use_dispersed_phase_drag_model"))
327 params.set<MooseFunctorName>(
"linear_coef_name") =
"Darcy_coefficient";
331 params.set<MooseFunctorName>(
"linear_coef_name") =
334 params.set<MooseFunctorName>(
"linear_coef_name") =
"0";
338 "WCNSFV2PSlipVelocityFunctorMaterial created by this Physics required a scalar " 339 "field linear friction factor.");
340 params.set<MooseFunctorName>(
"particle_diameter") =
341 getParam<MooseFunctorName>(
"particle_diameter");
342 if (getParam<bool>(
"output_all_properties"))
345 params.set<std::vector<OutputName>>(
"outputs") = {
"all"};
348 "Slip velocity functor material output currently unsupported in Physics " 349 "in transient conditions.");
352 "WCNSFV2PSlipVelocityFunctorMaterial",
prefix() +
"slip_" + components[
dim], params);
357 if (getParam<bool>(
"use_dispersed_phase_drag_model"))
359 const std::vector<std::string> vel_components = {
"u",
"v",
"w"};
363 params.set<MooseFunctorName>(
"drag_coef_name") =
"Darcy_coefficient";
365 params.set<MooseFunctorName>(vel_components[
j]) = {
367 params.set<MooseFunctorName>(
NS::density) =
"rho_mixture";
368 params.set<MooseFunctorName>(
NS::mu) =
"mu_mixture";
369 params.set<MooseFunctorName>(
"particle_diameter") =
370 getParam<MooseFunctorName>(
"particle_diameter");
371 if (getParam<bool>(
"output_all_properties"))
372 params.set<std::vector<OutputName>>(
"outputs") = {
"all"};
374 "NSFVDispersePhaseDragFunctorMaterial",
prefix() +
"dispersed_drag", params);
std::string prefix() const
static InputParameters validParams()
bool hasFlowEquations() const
Whether the physics is actually creating the flow equations.
const std::vector< std::string > & getVelocityNames() const
To interface with other Physics.
void assignBlocks(InputParameters ¶ms, const std::vector< SubdomainName > &blocks) const
void paramError(const std::string ¶m, Args... args) const
void addAdvectionSlipTerm()
const bool _use_advection_slip
Whether to add the advection slip term to each component of the momentum equation.
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
const MooseFunctorName _phase_1_thermal_conductivity
Name of the thermal conductivity of the first phase.
const MooseFunctorName _phase_1_specific_heat
Name of the specific heat of the first phase.
void addPhaseDriftFluxTerm()
static const std::string density
InputParameters getValidParams(const std::string &name) const
void mooseInfoRepeated(Args &&... args)
const bool _add_phase_equation
Convenience boolean to keep track of whether the phase transport equation is requested.
Creates all the objects needed to solve the Navier Stokes scalar transport equations using the linear...
std::vector< NonlinearVariableName > _passive_scalar_names
Names of the passive scalar variables.
virtual MooseFunctorName getLinearFrictionCoefName() const =0
Get the name of the linear friction coefficient. Returns an empty string if no friction.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
registerWCNSFVScalarTransportBaseTasks("NavierStokesApp", WCNSLinearFVTwoPhaseMixturePhysics)
const MooseFunctorName & densityName() const
Return the name of the density functor.
void addPhaseChangeEnergySource()
const MooseFunctorName _phase_2_thermal_conductivity
Name of the thermal conductivity of the other phase.
const MooseFunctorName _phase_1_fraction_name
Name of the first phase fraction (usually, liquid)
bool _has_energy_equation
Convenience boolean to keep track of whether the fluid energy equation is present.
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...
const MooseFunctorName _phase_1_density
Name of the density of the first phase.
virtual FEProblemBase & getProblem()
WCNSLinearFVTwoPhaseMixturePhysics(const InputParameters ¶meters)
const MooseFunctorName _phase_2_fraction_name
Name of the second phase fraction (usually, dispersed or advected by the liquid)
const std::string & name() const
void addPhaseInterfaceTerm()
Functions adding kernels for the other physics.
const MooseFunctorName & getSpecificHeatName() const
Get the name of the specific heat material property.
RealVectorValue gravityVector() const
Return the gravity vector.
bool hasEnergyEquation() const
Whether the physics is actually creating the heat equation.
static const std::string mu
static InputParameters commonMixtureParams()
const bool _use_drift_flux
Whether to add the drift flux momentum terms to each component momentum equation. ...
const MooseFunctorName _phase_2_viscosity
Name of the dynamic viscosity of the other phase.
virtual void addFVKernels() override
static const std::string alpha_exchange
const MooseFunctorName _phase_1_viscosity
Name of the dynamic viscosity of the first phase.
const WCNSLinearFVFluidHeatTransferPhysics * _fluid_energy_physics
Fluid heat transfer physics.
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
static InputParameters validParams()
static void renamePassiveScalarToMixtureParams(InputParameters ¶ms)
const bool _use_external_mixture_properties
Whether to define the mixture model internally or use fluid properties instead.
Creates all the objects needed to solve the mixture model for the weakly-compressible and incompressi...
const MooseFunctorName _phase_2_specific_heat
Name of the specific heat of the other phase.
const UserObjectName & rhieChowUOName() const
Return the name of the Rhie Chow user object.
IntRange< T > make_range(T beg, T end)
registerNavierStokesPhysicsBaseTasks("NavierStokesApp", WCNSLinearFVTwoPhaseMixturePhysics)
void mooseError(Args &&... args) const
virtual void setSlipVelocityParams(InputParameters ¶ms) const override
Adds the slip velocity parameters.
std::shared_ptr< FEProblemBase > & _problem
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
registerMooseAction("NavierStokesApp", WCNSLinearFVTwoPhaseMixturePhysics, "add_interpolation_method_physics")
const MooseFunctorName & densityName() const
bool isParamValid(const std::string &name) const
virtual void addFVKernels() override
bool isParamSetByUser(const std::string &name) const
virtual void addMaterials() override
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
const MooseFunctorName _phase_2_density
Name of the density of the other phase.
virtual void checkIntegrity() const override
void paramInfo(const std::string ¶m, Args... args) const