19 "add_interpolation_method_physics");
25 params.
addClassDescription(
"Define the Navier Stokes weakly-compressible scalar field transport "
26 "equation(s) using the linear finite volume discretization");
27 params.
set<
MooseEnum>(
"passive_scalar_advection_interpolation") =
29 params.
addParam<InterpolationMethodName>(
30 "passive_scalar_advection_interpolation_method_name",
31 "Name of an externally defined FVInterpolationMethod to use for passive scalar advection. "
32 "When provided, this overrides 'passive_scalar_advection_interpolation'.");
33 params.
addParam<
bool>(
"use_nonorthogonal_correction",
35 "If the nonorthogonal correction should be used when computing the normal "
36 "gradient, notably in the diffusion term.");
55 "Porous media scalar advection is currently unimplemented");
83 "MooseLinearVariableFVReal");
89 params.set<std::vector<Real>>(
"scaling") = {
90 getParam<std::vector<Real>>(
"passive_scalar_scaling")[name_i]};
99 std::string kernel_type =
"LinearFVTimeDerivative";
105 params.
set<LinearVariableName>(
"variable") = vname;
114 const auto method_name =
115 isParamValid(
"passive_scalar_advection_interpolation_method_name")
116 ? getParam<InterpolationMethodName>(
"passive_scalar_advection_interpolation_method_name")
117 : InterpolationMethodName(
118 std::string(getParam<MooseEnum>(
"passive_scalar_advection_interpolation")));
120 const std::string kernel_type =
"LinearFVScalarAdvection";
125 params.
set<InterpolationMethodName>(
"advected_interp_method_name") = method_name;
130 params.
set<LinearVariableName>(
"variable") = vname;
139 const auto passive_scalar_diffusivities =
140 getParam<std::vector<MooseFunctorName>>(
"passive_scalar_diffusivity");
142 if (passive_scalar_diffusivities.size())
144 const std::string kernel_type =
"LinearFVDiffusion";
147 params.
set<
bool>(
"use_nonorthogonal_correction") =
148 getParam<bool>(
"use_nonorthogonal_correction");
152 params.
set<MooseFunctorName>(
"diffusion_coeff") =
163 const std::string kernel_type =
"LinearFVSource";
182 params.
set<MooseFunctorName>(
"source_density") =
187 params.
set<std::vector<SubdomainName>>(
"block") =
192 "_coupled_source_" + std::to_string(i),
202 if (inlet_boundaries.empty())
210 "passive_scalar_inlet_types",
212 ") is not equal to the number of inlet boundaries (" +
213 std::to_string(inlet_boundaries.size()) +
") times the number of passive scalars (" +
217 "The number of groups of inlet functors (" +
219 ") is not equal to the number of passive scalars (" +
226 "The number of inlet boundary functors for scalar '" +
228 "' does not match the number of inlet boundaries (" +
231 unsigned int num_inlets = inlet_boundaries.size();
232 for (
unsigned int bc_ind = 0; bc_ind < num_inlets; ++bc_ind)
236 const std::string bc_type =
"LinearFVAdvectionDiffusionFunctorDirichletBC";
240 params.
set<std::vector<BoundaryName>>(
"boundary") = {inlet_boundaries[bc_ind]};
248 mooseError(
"Flux boundary conditions not supported at this time using the linear finite "
249 "volume discretization");
265 if (outlet_boundaries.empty())
268 for (
const auto & outlet_bdy : outlet_boundaries)
270 const std::string bc_type =
"LinearFVAdvectionDiffusionOutflowBC";
272 params.
set<std::vector<BoundaryName>>(
"boundary") = {outlet_bdy};
273 params.
set<
bool>(
"use_two_term_expansion") =
274 getParam<bool>(
"passive_scalar_two_term_bc_expansion");
registerMooseAction("NavierStokesApp", WCNSLinearFVScalarTransportPhysics, "add_interpolation_method_physics")
registerNavierStokesPhysicsBaseTasks("NavierStokesApp", WCNSLinearFVScalarTransportPhysics)
registerWCNSFVScalarTransportBaseTasks("NavierStokesApp", WCNSLinearFVScalarTransportPhysics)
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
InputParameters getValidParams(const std::string &name) const
void paramError(const std::string ¶m, Args... args) const
void mooseError(Args &&... args) const
bool isParamValid(const std::string &name) const
unsigned int size() const
void addFVAdvectedInterpolationMethod(const MooseEnum &interpolation_method)
Add the FVInterpolationMethod object for an advected interpolation method if absent.
virtual FEProblemBase & getProblem()
bool shouldCreateTimeDerivative(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_already_defined) const
void assignBlocks(InputParameters ¶ms, const std::vector< SubdomainName > &blocks) const
void reportPotentiallyMissedParameters(const std::vector< std::string > ¶m_names, const std::string &object_type, const std::string &object_name="") const
std::string prefix() const
const SolverSystemName & getSolverSystem(unsigned int variable_index) const
bool shouldCreateVariable(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_aux)
std::vector< SubdomainName > _blocks
void addRequiredPhysicsTask(const std::string &task)
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
bool _has_turbulence_model
Because of the Modules/navierStokesFV syntax, a turbulence physics often exists without a model we sa...
const bool _porous_medium_treatment
Switch to show if porous medium treatment is requested or not.
const UserObjectName & rhieChowUOName() const
Return the name of the Rhie Chow user object.
const std::vector< BoundaryName > & getOutletBoundaries() const
Get the outlet boundaries.
const std::vector< BoundaryName > & getInletBoundaries() const
Get the inlet boundaries.
Creates all the objects needed to solve the Navier Stokes scalar transport equations.
const bool _has_scalar_equation
A boolean to help compatibility with the old Modules/NavierStokesFV syntax or to deliberately skip ad...
std::vector< MooseFunctorName > _passive_scalar_sources
Functors for the passive scalar sources. Indexing is scalar variable index.
std::vector< std::vector< MooseFunctorName > > _passive_scalar_coupled_sources
Functors for the passive scalar (coupled) sources. Outer indexing is scalar variable index.
MultiMooseEnum _passive_scalar_inlet_types
Passive scalar inlet boundary types.
std::vector< std::vector< std::vector< SubdomainName > > > _passive_scalar_coupled_sources_blocks
Subdomains for the sources. Outer indexing is scalar index, intermediate is source index,...
std::vector< std::vector< Real > > _passive_scalar_coupled_sources_coef
Coefficients for multiplying for the passive scalar sources. Outer indexing is scalar variable index.
virtual void setSlipVelocityParams(InputParameters &) const
std::vector< NonlinearVariableName > _passive_scalar_names
Names of the passive scalar variables.
static InputParameters validParams()
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 linear...
virtual void addSolverVariables() override
virtual unsigned short getNumberAlgebraicGhostingLayersNeeded() const override
Return the number of ghosting layers needed.
virtual void addScalarTimeKernels() override
Functions adding kernels for the incompressible / weakly-compressible scalar transport equation If th...
virtual void addScalarAdvectionKernels() override
virtual void addScalarInletBC() override
Functions adding boundary conditions for the incompressible simulation.
virtual void addScalarOutletBC() override
virtual void addScalarDiffusionKernels() override
static InputParameters validParams()
virtual void addFVInterpolationMethods() override
WCNSLinearFVScalarTransportPhysics(const InputParameters ¶meters)
virtual void addScalarSourceKernels() override
Equivalent of NSFVAction addScalarCoupledSourceKernels.
MooseEnum fvAdvectedInterpolationMethods()
Enum of the advected interpolation methods supported by FVInterpolationMethod objects.