22#include "libmesh/fe.h"
23#include "libmesh/vector_value.h"
24#include "libmesh/string_to_enum.h"
38 "setting up incompressible Navier-Stokes equations.");
43 params.
addParam<std::vector<SubdomainName>>(
44 "block", {},
"The list of block ids (SubdomainID) on which NS equation is defined on");
47 params.
addParam<
bool>(
"boussinesq_approximation",
false,
"True to have Boussinesq approximation");
48 params.
addParam<MaterialPropertyName>(
49 "reference_temperature_name",
"temp_ref",
"Material property name for reference temperature");
50 params.
addParam<MaterialPropertyName>(
51 "thermal_expansion_name",
"alpha",
"The name of the thermal expansion");
53 params.
addParam<
bool>(
"add_temperature_equation",
false,
"True to add temperature equation");
56 params.
addParam<Real>(
"temperature_scaling", 1,
"Scaling for the temperature variable");
58 "initial_temperature", 0,
"The initial temperature, assumed constant everywhere");
59 params.
addParam<MaterialPropertyName>(
60 "thermal_conductivity_name",
"k",
"The name of the thermal conductivity");
61 params.
addParam<MaterialPropertyName>(
62 "specific_heat_name",
"cp",
"The name of the specific heat");
63 params.
addParam<std::vector<BoundaryName>>(
"natural_temperature_boundary",
64 std::vector<BoundaryName>(),
65 "Natural boundaries for temperature equation");
66 params.
addParam<std::vector<BoundaryName>>(
"fixed_temperature_boundary",
67 std::vector<BoundaryName>(),
68 "Dirichlet boundaries for temperature equation");
69 params.
addParam<std::vector<FunctionName>>(
70 "temperature_function", std::vector<FunctionName>(),
"Temperature on Dirichlet boundaries");
73 "has_heat_source",
false,
"Whether there is a heat source function object in the simulation");
74 params.
addParam<FunctionName>(
"heat_source_function",
"The function describing the heat source");
75 params.
addCoupledVar(
"heat_source_var",
"The coupled variable describing the heat source");
78 "gravity", RealVectorValue(0, 0, 0),
"Direction of the gravity vector");
80 params.
addParam<MaterialPropertyName>(
81 "dynamic_viscosity_name",
"mu",
"The name of the dynamic viscosity");
82 params.
addParam<MaterialPropertyName>(
"density_name",
"rho",
"The name of the density");
84 params.
addParam<
bool>(
"use_ad",
false,
"True to use AD");
86 "laplace",
true,
"Whether the viscous term of the momentum equations is in laplace form");
88 "integrate_p_by_parts",
true,
"Whether to integrate the pressure term by parts");
90 "convective_term",
true,
"Whether to include the convective term in Jacobian");
92 "supg",
false,
"Whether to perform SUPG stabilization of the momentum residuals");
94 "pspg",
false,
"Whether to perform PSPG stabilization of the mass equation");
95 params.
addParam<Real>(
"alpha", 1,
"Multiplicative factor on the stabilization parameter tau");
96 params.
addParam<
bool>(
"add_standard_velocity_variables_for_ad",
98 "True to convert vector velocity variables into standard aux variables");
102 "Whether the simulation has a force due to a coupled vector variable/vector function");
103 params.
addCoupledVar(
"coupled_force_var",
"The variable(s) providing the coupled force(s)");
104 params.
addParam<std::vector<FunctionName>>(
"coupled_force_vector_function",
105 "The function(s) standing in as a coupled force");
107 params.
addParam<std::vector<BoundaryName>>(
108 "velocity_boundary", std::vector<BoundaryName>(),
"Boundaries with given velocities");
109 params.
addParam<std::vector<FunctionName>>(
110 "velocity_function", std::vector<FunctionName>(),
"Functions for boundary velocities");
111 params.
addParam<
unsigned int>(
"pressure_pinned_node",
112 "The node where pressure needs to be pinned");
113 params.
addParam<std::vector<BoundaryName>>(
114 "no_bc_boundary", std::vector<BoundaryName>(),
"The so-called no-bc Boundaries");
115 params.
addParam<std::vector<BoundaryName>>(
116 "pressure_boundary", std::vector<BoundaryName>(),
"Boundaries with given pressures");
117 params.
addParam<std::vector<FunctionName>>(
118 "pressure_function", std::vector<FunctionName>(),
"Functions for boundary pressures");
123 "family", families,
"Specifies the family of FE shape functions to use for this variable");
126 "Specifies the order of the FE shape function to use "
127 "for this variable (additional orders not listed are "
129 params.
addParam<Real>(
"pressure_scaling", 1,
"Scaling for the pressure variable");
131 "velocity_scaling", RealVectorValue(1, 1, 1),
"Scaling for the velocity variables");
133 params.
addParam<Real>(
"initial_pressure", 0,
"The initial pressure, assumed constant everywhere");
137 params.
addParam<RealVectorValue>(
"initial_velocity",
138 RealVectorValue(1e-15, 1e-15, 1e-15),
139 "The initial velocity, assumed constant everywhere");
140 params.
addParam<std::string>(
"pressure_variable_name",
141 "A name for the pressure variable. If this is not provided, a "
142 "sensible default will be used.");
143 params.
addParam<NonlinearSystemName>(
144 "nl_sys",
"nl0",
"The nonlinear system that this action belongs to.");
147 "equation_type block gravity dynamic_viscosity_name density_name boussinesq_approximation "
148 "reference_temperature_name thermal_expansion_name",
150 params.
addParamNamesToGroup(
"use_ad laplace integrate_p_by_parts convective_term supg pspg alpha",
153 "no_bc_boundary pressure_boundary pressure_function",
154 "BoundaryCondition");
156 "family order pressure_scaling velocity_scaling initial_pressure initial_velocity",
159 "add_temperature_equation temperature_variable temperature_scaling initial_temperature "
160 "thermal_conductivity_name specific_heat_name natural_temperature_boundary "
161 "fixed_temperature_boundary temperature_function",
168 _type(getParam<
MooseEnum>(
"equation_type")),
169 _blocks(getParam<
std::vector<SubdomainName>>(
"block")),
170 _velocity_boundary(getParam<
std::vector<BoundaryName>>(
"velocity_boundary")),
171 _velocity_function(getParam<
std::vector<FunctionName>>(
"velocity_function")),
172 _pressure_boundary(getParam<
std::vector<BoundaryName>>(
"pressure_boundary")),
173 _pressure_function(getParam<
std::vector<FunctionName>>(
"pressure_function")),
174 _no_bc_boundary(getParam<
std::vector<BoundaryName>>(
"no_bc_boundary")),
175 _has_pinned_node(isParamValid(
"pressure_pinned_node")),
176 _pinned_node(
"ins_pinned_node"),
177 _fixed_temperature_boundary(getParam<
std::vector<BoundaryName>>(
"fixed_temperature_boundary")),
178 _temperature_function(getParam<
std::vector<FunctionName>>(
"temperature_function")),
179 _fe_type(Utility::string_to_enum<Order>(getParam<
MooseEnum>(
"order")),
180 Utility::string_to_enum<FEFamily>(getParam<
MooseEnum>(
"family"))),
181 _use_ad(getParam<bool>(
"use_ad")),
182 _temperature_variable_name(getParam<VariableName>(
"temperature_variable")),
183 _pressure_variable_name(isParamValid(
"pressure_variable_name")
184 ? getParam<
std::string>(
"pressure_variable_name")
189 "Size is not the same as the number of boundaries in 'pressure_boundary'");
192 "Size is not the same as the number of boundaries in 'fixed_temperature_boundary'");
200 if (getParam<bool>(
"boussinesq_approximation"))
201 mooseError(
"Boussinesq approximation has not been implemented for non-AD");
204 if (getParam<bool>(
"has_ambient_convection"))
208 "If 'has_ambient_convection' is true, then 'ambient_convection_alpha' must be set.");
211 mooseError(
"If 'has_ambient_convection' is true, then 'ambient_temperature' must be set.");
214 if (getParam<bool>(
"has_heat_source"))
217 bool has_function =
isParamValid(
"heat_source_function");
218 if (!has_coupled && !has_function)
219 mooseError(
"Either the 'heat_source_var' or 'heat_source_function' param must be "
221 "'INSADEnergySource' object");
222 else if (has_coupled && has_function)
223 mooseError(
"Both the 'heat_source_var' or 'heat_source_function' param are set for the "
224 "'INSADEnergySource' object. Please use one or the other.");
227 if (getParam<bool>(
"has_coupled_force"))
230 bool has_function =
isParamValid(
"coupled_force_vector_function");
231 if (!has_coupled && !has_function)
232 mooseError(
"Either the 'coupled_force_var' or 'coupled_force_vector_function' param must be "
234 "'INSADMomentumCoupledForce' object");
246 mooseError(
"The new mesh generator system is required to pin pressure");
249 params.
set<std::vector<BoundaryName>>(
"new_boundary") = {
_pinned_node};
250 params.
set<std::vector<unsigned int>>(
"nodes") = {
251 getParam<unsigned int>(
"pressure_pinned_node")};
259 for (
const auto & subdomain_name :
_blocks)
264 mooseError(
"RZ has not been added in action");
268 for (
auto &
id :
_mesh->meshSubdomains())
270 mooseError(
"RZ has not been added in action");
274 "Size is not the same as the number of boundaries in 'velocity_boundary' times "
275 "the mesh dimension");
295 mooseError(
"AD has to use LAGRANGE variable family");
305 auto vscaling = getParam<RealVectorValue>(
"velocity_scaling");
306 adparams.set<std::vector<Real>>(
"scaling").push_back(vscaling(0));
310 if (getParam<bool>(
"add_standard_velocity_variables_for_ad"))
321 auto vscaling = getParam<RealVectorValue>(
"velocity_scaling");
322 params.
set<std::vector<Real>>(
"scaling") = {vscaling(0)};
326 params.
set<std::vector<Real>>(
"scaling") = {vscaling(1)};
331 params.
set<std::vector<Real>>(
"scaling") = {vscaling(2)};
336 if (getParam<bool>(
"add_temperature_equation") &&
338 ->getNonlinearSystemBase(
_problem->nlSysNum(getParam<NonlinearSystemName>(
"nl_sys")))
341 params.
set<std::vector<Real>>(
"scaling") = {getParam<Real>(
"temperature_scaling")};
347 if (!getParam<bool>(
"pspg"))
350 params.
set<std::vector<Real>>(
"scaling") = {getParam<Real>(
"pressure_scaling")};
356 auto vvalue = getParam<RealVectorValue>(
"initial_velocity");
357 Real pvalue = getParam<Real>(
"initial_pressure");
361 if (vvalue.norm() != 0)
365 params.
set<Real>(
"x_value") = vvalue(0);
367 params.
set<Real>(
"y_value") = vvalue(1);
369 params.
set<Real>(
"z_value") = vvalue(2);
370 _problem->addInitialCondition(
"VectorConstantIC",
"velocity_ic", params);
379 params.
set<Real>(
"value") = vvalue(0);
382 if (vvalue(1) != 0 &&
_dim >= 2)
386 params.
set<Real>(
"value") = vvalue(1);
389 if (vvalue(2) != 0 &&
_dim >= 3)
393 params.
set<Real>(
"value") = vvalue(2);
398 if (getParam<bool>(
"add_temperature_equation"))
400 Real tvalue = getParam<Real>(
"initial_temperature");
403 params.
set<Real>(
"value") = tvalue;
404 _problem->addInitialCondition(
"ConstantIC",
"temperature_ic", params);
411 params.
set<Real>(
"value") = pvalue;
412 _problem->addInitialCondition(
"ConstantIC",
"pressure_ic", params);
418 if (
_type ==
"transient")
425 if (getParam<bool>(
"add_temperature_equation"))
428 if (
_use_ad && getParam<bool>(
"add_standard_velocity_variables_for_ad"))
446 if (getParam<bool>(
"add_temperature_equation"))
458 params.set<std::vector<SubdomainName>>(
"block") =
_blocks;
461 params.set<MaterialPropertyName>(
"mu_name") =
462 getParam<MaterialPropertyName>(
"dynamic_viscosity_name");
463 params.set<MaterialPropertyName>(
"rho_name") = getParam<MaterialPropertyName>(
"density_name");
468 set_common_parameters(params);
470 params.set<MaterialPropertyName>(
"cp_name") =
471 getParam<MaterialPropertyName>(
"specific_heat_name");
474 if (getParam<bool>(
"add_temperature_equation"))
476 if (getParam<bool>(
"supg") || getParam<bool>(
"pspg"))
479 set_common_3eqn_parameters(params);
480 params.
set<Real>(
"alpha") = getParam<Real>(
"alpha");
481 params.
set<MaterialPropertyName>(
"k_name") =
482 getParam<MaterialPropertyName>(
"thermal_conductivity_name");
483 _problem->addMaterial(
"INSADStabilized3Eqn",
"ins_ad_material", params);
488 set_common_3eqn_parameters(params);
489 _problem->addMaterial(
"INSAD3Eqn",
"ins_ad_material", params);
494 if (getParam<bool>(
"supg") || getParam<bool>(
"pspg"))
497 set_common_parameters(params);
498 params.
set<Real>(
"alpha") = getParam<Real>(
"alpha");
499 _problem->addMaterial(
"INSADTauMaterial",
"ins_ad_material", params);
504 set_common_parameters(params);
505 _problem->addMaterial(
"INSADMaterial",
"ins_ad_material", params);
516 const std::string kernel_type =
"INSADMomentumTimeDerivative";
519 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
521 _problem->addKernel(kernel_type,
"ins_velocity_time_deriv", params);
523 if (getParam<bool>(
"add_temperature_equation"))
525 const std::string kernel_type =
"INSADHeatConductionTimeDerivative";
529 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
530 _problem->addKernel(kernel_type,
"ins_temperature_time_deriv", params);
535 const std::string kernel_type =
"INSMomentumTimeDerivative";
538 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
539 params.
set<MaterialPropertyName>(
"rho_name") = getParam<MaterialPropertyName>(
"density_name");
542 for (
unsigned int component = 0; component <
_dim; ++component)
544 params.
set<NonlinearVariableName>(
"variable") = momentums[component];
545 _problem->addKernel(kernel_type, momentums[component] +
"_time_deriv", params);
548 if (getParam<bool>(
"add_temperature_equation"))
550 const std::string kernel_type =
"INSTemperatureTimeDerivative";
554 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
555 params.
set<MaterialPropertyName>(
"rho_name") = getParam<MaterialPropertyName>(
"density_name");
556 params.
set<MaterialPropertyName>(
"cp_name") =
557 getParam<MaterialPropertyName>(
"specific_heat_name");
558 _problem->addKernel(kernel_type,
"ins_temperature_time_deriv", params);
569 const std::string kernel_type =
"INSADMass";
573 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
574 _problem->addKernel(kernel_type,
"ins_mass", params);
577 if (getParam<bool>(
"pspg"))
579 const std::string kernel_type =
"INSADMassPSPG";
582 params.
set<MaterialPropertyName>(
"rho_name") = getParam<MaterialPropertyName>(
"density_name");
584 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
585 _problem->addKernel(kernel_type,
"ins_mass_pspg", params);
590 const std::string kernel_type =
"INSMass";
594 params.
set<
bool>(
"pspg") = getParam<bool>(
"pspg");
595 _problem->addKernel(kernel_type,
"ins_mass", params);
603 const static std::string coord[3] = {
"x",
"y",
"z"};
606 for (
unsigned int component = 0; component <
_dim; ++component)
608 params.
set<AuxVariableName>(
"variable") = momentums[component];
610 _problem->addAuxKernel(
"VectorVariableComponentAux", momentums[component] +
"_aux", params);
620 const std::string kernel_type =
"INSADMomentumAdvection";
624 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
625 _problem->addKernel(kernel_type,
"ins_momentum_convection", params);
629 const std::string kernel_type =
"INSADMomentumViscous";
632 params.
set<
MooseEnum>(
"viscous_form") = (getParam<bool>(
"laplace") ?
"laplace" :
"traction");
634 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
635 _problem->addKernel(kernel_type,
"ins_momentum_viscous", params);
639 const std::string kernel_type =
"INSADMomentumPressure";
643 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
644 params.
set<
bool>(
"integrate_p_by_parts") = getParam<bool>(
"integrate_p_by_parts");
646 _problem->addKernel(kernel_type,
"ins_momentum_pressure", params);
649 auto gravity = getParam<RealVectorValue>(
"gravity");
650 if (gravity.norm() != 0)
652 const std::string kernel_type =
"INSADGravityForce";
656 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
657 params.
set<RealVectorValue>(
"gravity") = gravity;
658 _problem->addKernel(kernel_type,
"ins_momentum_gravity", params);
661 if (getParam<bool>(
"supg"))
663 const std::string kernel_type =
"INSADMomentumSUPG";
667 params.
set<MaterialPropertyName>(
"tau_name") =
"tau";
669 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
670 _problem->addKernel(kernel_type,
"ins_momentum_supg", params);
673 if (getParam<bool>(
"boussinesq_approximation"))
675 const std::string kernel_type =
"INSADBoussinesqBodyForce";
679 params.
set<RealVectorValue>(
"gravity") = gravity;
680 params.
set<MaterialPropertyName>(
"alpha_name") =
681 getParam<MaterialPropertyName>(
"thermal_expansion_name");
682 params.
set<MaterialPropertyName>(
"ref_temp") =
683 getParam<MaterialPropertyName>(
"reference_temperature_name");
685 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
686 _problem->addKernel(kernel_type,
"ins_momentum_boussinesq_force", params);
689 if (getParam<bool>(
"has_coupled_force"))
691 const std::string kernel_type =
"INSADMomentumCoupledForce";
695 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
697 params.
set<
CoupledName>(
"coupled_vector_var") = getParam<CoupledName>(
"coupled_force_var");
699 params.
set<std::vector<FunctionName>>(
"vector_function") =
700 getParam<std::vector<FunctionName>>(
"coupled_force_vector_function");
702 _problem->addKernel(kernel_type,
"ins_momentum_coupled_force", params);
708 std::string kernel_type;
709 if (getParam<bool>(
"laplace"))
710 kernel_type =
"INSMomentumLaplaceForm";
712 kernel_type =
"INSMomentumTractionForm";
718 params.
set<
bool>(
"integrate_p_by_parts") = getParam<bool>(
"integrate_p_by_parts");
719 params.
set<
bool>(
"supg") = getParam<bool>(
"supg");
721 for (
unsigned int component = 0; component <
_dim; ++component)
723 params.
set<NonlinearVariableName>(
"variable") = momentums[component];
724 params.
set<
unsigned int>(
"component") = component;
725 _problem->addKernel(kernel_type, momentums[component] + std::string(
"_if"), params);
736 const std::string kernel_type =
"INSADEnergyAdvection";
740 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
741 _problem->addKernel(kernel_type,
"ins_temperature_convection", params);
744 const std::string kernel_type =
"ADHeatConduction";
747 params.
set<MaterialPropertyName>(
"thermal_conductivity") =
748 getParam<MaterialPropertyName>(
"thermal_conductivity_name");
750 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
751 _problem->addKernel(kernel_type,
"ins_temperature_conduction", params);
754 if (getParam<bool>(
"supg"))
756 const std::string kernel_type =
"INSADEnergySUPG";
760 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
762 params.
set<MaterialPropertyName>(
"tau_name") =
"tau_energy";
763 _problem->addKernel(kernel_type,
"ins_temperature_supg", params);
766 if (getParam<bool>(
"has_ambient_convection"))
768 const std::string kernel_type =
"INSADEnergyAmbientConvection";
772 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
773 params.
set<Real>(
"alpha") = getParam<Real>(
"ambient_convection_alpha");
774 params.
set<Real>(
"T_ambient") = getParam<Real>(
"ambient_temperature");
775 _problem->addKernel(kernel_type,
"ins_temperature_ambient_convection", params);
778 if (getParam<bool>(
"has_heat_source"))
780 const std::string kernel_type =
"INSADEnergySource";
784 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
786 params.
set<
CoupledName>(
"source_variable") = getParam<CoupledName>(
"heat_source_var");
788 params.
set<FunctionName>(
"source_function") =
789 getParam<FunctionName>(
"heat_source_function");
791 mooseError(
"Either the 'heat_source_var' or 'heat_source_function' param must be "
792 "set if adding the 'INSADEnergySource' through the incompressible Navier-Stokes "
794 _problem->addKernel(kernel_type,
"ins_temperature_source", params);
799 const std::string kernel_type =
"INSTemperature";
807 params.
set<MaterialPropertyName>(
"k_name") =
808 getParam<MaterialPropertyName>(
"thermal_conductivity_name");
809 params.
set<MaterialPropertyName>(
"rho_name") = getParam<MaterialPropertyName>(
"density_name");
810 params.
set<MaterialPropertyName>(
"cp_name") =
811 getParam<MaterialPropertyName>(
"specific_heat_name");
813 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
814 _problem->addKernel(kernel_type,
"ins_temperature", params);
831 params.
set<
bool>(
"set_x_comp") =
false;
834 std::stringstream ss(funcx);
836 if ((ss >> val).fail() || !ss.eof())
841 func_params.
set<Real>(
"value") = val;
842 _problem->addFunction(
"ConstantFunction", funcx, func_params);
845 params.
set<FunctionName>(
"function_x") = funcx;
853 params.
set<
bool>(
"set_y_comp") =
false;
856 std::stringstream ss(funcy);
858 if ((ss >> val).fail() || !ss.eof())
863 func_params.
set<Real>(
"value") = val;
864 _problem->addFunction(
"ConstantFunction", funcy, func_params);
867 params.
set<FunctionName>(
"function_y") = funcy;
875 params.
set<
bool>(
"set_z_comp") =
false;
878 std::stringstream ss(funcz);
880 if ((ss >> val).fail() || !ss.eof())
885 func_params.
set<Real>(
"value") = val;
886 _problem->addFunction(
"ConstantFunction", funcz, func_params);
889 params.
set<FunctionName>(
"function_z") = funcz;
900 for (
unsigned int component = 0; component <
_dim; ++component)
906 std::stringstream ss(func);
908 if ((ss >> val).fail() || !ss.eof())
911 params.
set<FunctionName>(
"function") = func;
912 params.
set<NonlinearVariableName>(
"variable") = momentums[component];
920 params.
set<Real>(
"value") = val;
921 params.
set<NonlinearVariableName>(
"variable") = momentums[component];
940 std::stringstream ss(func);
942 if ((ss >> val).fail() || !ss.eof())
945 params.
set<FunctionName>(
"function") = func;
948 _problem->addBoundaryCondition(
"FunctionDirichletBC",
956 params.
set<Real>(
"value") = val;
971 std::stringstream ss(func);
973 if ((ss >> val).fail() || !ss.eof())
976 params.
set<FunctionName>(
"function") = func;
985 params.
set<Real>(
"value") = val;
997 params.
set<Real>(
"value") = 0;
1000 _problem->addBoundaryCondition(
"DirichletBC",
"pressure_pin", params);
1008 const std::string kernel_type =
"INSADMomentumNoBCBC";
1012 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
1013 params.
set<
bool>(
"integrate_p_by_parts") = getParam<bool>(
"integrate_p_by_parts");
1015 params.
set<
MooseEnum>(
"viscous_form") = (getParam<bool>(
"laplace") ?
"laplace" :
"traction");
1016 _problem->addBoundaryCondition(kernel_type,
"ins_momentum_nobc_bc", params);
1021 std::string kernel_type;
1022 if (getParam<bool>(
"laplace"))
1023 kernel_type =
"INSMomentumNoBCBCLaplaceForm";
1025 kernel_type =
"INSMomentumNoBCBCTractionForm";
1029 for (
unsigned int component = 0; component <
_dim; ++component)
1031 params.
set<NonlinearVariableName>(
"variable") = momentums[component];
1032 _problem->addBoundaryCondition(kernel_type, momentums[component] +
"_nobc_bc", params);
1041 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
1050 params.
set<RealVectorValue>(
"gravity") = getParam<RealVectorValue>(
"gravity");
1051 params.
set<MaterialPropertyName>(
"mu_name") =
1052 getParam<MaterialPropertyName>(
"dynamic_viscosity_name");
1053 params.
set<MaterialPropertyName>(
"rho_name") = getParam<MaterialPropertyName>(
"density_name");
1054 params.
set<Real>(
"alpha") = getParam<Real>(
"alpha");
1055 params.
set<
bool>(
"laplace") = getParam<bool>(
"laplace");
1057 params.
set<
bool>(
"convective_term") = getParam<bool>(
"convective_term");
1059 params.
set<
bool>(
"transient_term") = (
_type ==
"transient");
1072 params.
set<RealVectorValue>(
"gravity") = getParam<RealVectorValue>(
"gravity");
1073 params.
set<MaterialPropertyName>(
"mu_name") =
1074 getParam<MaterialPropertyName>(
"dynamic_viscosity_name");
1075 params.
set<MaterialPropertyName>(
"rho_name") = getParam<MaterialPropertyName>(
"density_name");
1076 params.
set<
bool>(
"integrate_p_by_parts") = getParam<bool>(
"integrate_p_by_parts");
subdomain_id_type SubdomainID
void addAmbientConvectionParams(InputParameters ¶ms)
Global for adding ambient convection parameters.
registerMooseAction("NavierStokesApp", INSAction, "append_mesh_generator")
std::vector< VariableName > CoupledName
std::shared_ptr< MooseMesh > & _mesh
static InputParameters validParams()
std::shared_ptr< FEProblemBase > & _problem
const std::string & _current_task
static MooseEnum getNonlinearVariableFamilies()
static MooseEnum getNonlinearVariableOrders()
static std::string variableType(const libMesh::FEType &fe_type, const bool is_fv=false, const bool is_array=false)
InputParameters getValidParams(const std::string &name) const
This class allows us to have a section of the input file like the following which automatically adds ...
void addINSPinnedPressureBC()
std::vector< BoundaryName > _velocity_boundary
Boundaries with velocity specified.
std::set< SubdomainID > _block_ids
Subdomain IDs.
VariableName _temperature_variable_name
Temperature variable name to facilitate temperature variable added outside.
std::vector< BoundaryName > _fixed_temperature_boundary
Boundaries with temperature specified.
BoundaryName _pinned_node
The node set name of the pinned node.
bool _use_ad
Whether we use AD or not.
std::vector< FunctionName > _temperature_function
Temperature function names at fixed temperature boundaries.
void addINSTemperatureBC()
static InputParameters validParams()
unsigned int _dim
Mesh dimension.
INSAction(const InputParameters ¶meters)
libMesh::FEType _fe_type
FE type for various variables.
virtual void act() override
MooseEnum _type
Equation type, transient or steady-state.
const std::string _pressure_variable_name
pressure variable name
bool _has_pinned_node
Whether or not we need to pin pressure at a node.
std::vector< SubdomainName > _blocks
Subdomains Navier-Stokes equation is defined on.
void setNoBCCommonParams(InputParameters ¶ms)
void setKernelCommonParams(InputParameters ¶ms)
std::vector< BoundaryName > _no_bc_boundary
No-BC boundaries.
std::vector< FunctionName > _pressure_function
Pressure function names at pressure boundaries.
std::vector< BoundaryName > _pressure_boundary
Boundaries with pressure specified.
std::vector< FunctionName > _velocity_function
Velocity function names at velocity boundaries.
std::vector< std::string > getMeshGeneratorNames() const
const MeshGenerator & appendMeshGenerator(const std::string &type, const std::string &name, InputParameters params)
const InputParameters & parameters() const
const std::string & type() const
void paramError(const std::string ¶m, Args... args) const
void mooseError(Args &&... args) const
void mooseWarning(Args &&... args) const
const T & getParam(const std::string &name) const
bool isParamValid(const std::string &name) const
std::string stringify(const T &t)
static const std::string velocity_y
static const std::string temperature
static const std::string velocity_z
static const std::string velocity_x
static const std::string pressure
static const std::string velocity