22 params.
addParam<MooseFunctorName>(
"advected_variable", 0,
"The name of the variable");
23 params.
addRequiredParam<MooseFunctorName>(
"vel_x",
"x-component of the advecting velocity");
24 params.
addParam<MooseFunctorName>(
"vel_y",
"y-component of the advecting velocity");
25 params.
addParam<MooseFunctorName>(
"vel_z",
"z-component of the advecting velocity");
26 params.
addParam<MaterialPropertyName>(
29 "The advected material property of which to study the flow; "
30 "useful for finite element simulations");
33 "$(\\vec{J} \\cdot \\vec{n} = \\vec{v} u \\cdot \\vec{n})$.");
40 _use_normal(getParam<
MooseEnum>(
"component") ==
"normal"),
41 _component(getParam<
MooseEnum>(
"component")),
42 _advected_quantity(getFunctor<Real>(
"advected_variable")),
43 _normals(_assembly.normals()),
44 _vel_x(getFunctor<Real>(
"vel_x")),
45 _vel_y(_mesh.dimension() >= 2 ? &getFunctor<Real>(
"vel_y") : nullptr),
46 _vel_z(_mesh.dimension() == 3 ? &getFunctor<Real>(
"vel_z") : nullptr),
47 _advected_quantity_supplied(parameters.isParamSetByUser(
"advected_variable")),
48 _advected_mat_prop_supplied(parameters.isParamSetByUser(
"advected_mat_prop")),
49 _advected_material_property(getMaterialProperty<Real>(
"advected_mat_prop"))
52 paramError(
"boundary",
"A boundary must be provided if using the normal component!");
54 mooseError(
"AdvectiveFluxAux should be provided either an advected variable "
55 "or an advected material property");
57 mooseError(
"AdvectiveFluxAux is designed for use in finite element simulations.");
68 Real vel_x, vel_y, vel_z = 0;
70 vel_x = raw_value(
_vel_x(side_arg, state));
71 vel_y =
_vel_y ? raw_value((*
_vel_y)(side_arg, state)) : 0;
72 vel_z =
_vel_z ? raw_value((*
_vel_z)(side_arg, state)) : 0;
76 RealVectorValue(vel_x, vel_y, vel_z) *
_normals[
_qp]
78 RealVectorValue(vel_x, vel_y, vel_z)(
_component));
83 RealVectorValue(vel_x, vel_y, vel_z)(
_component));
86 : RealVectorValue(vel_x, vel_y, vel_z)(
_component));
registerMooseObject("MooseApp", AdvectiveFluxAux)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Auxiliary kernel responsible for computing a component of the advection flux vector.
static InputParameters validParams()
const bool _advected_quantity_supplied
Whether an advected quantity was supplied in the input.
const MaterialProperty< Real > & _advected_material_property
Material property storing the advected quantity; used for finite elements.
const bool _advected_mat_prop_supplied
Whether an advected material property was supplied in the input.
const Moose::Functor< Real > *const _vel_z
const bool _use_normal
Whether the normal component has been selected.
const int _component
Will hold 0, 1, or 2 corresponding to x, y, or z.
const Moose::Functor< Real > & _advected_quantity
Functor for the scalar field advected quantity (for a variable usually)
AdvectiveFluxAux(const InputParameters ¶meters)
const Moose::Functor< Real > & _vel_x
Velocity components.
virtual Real computeValue()
Compute and return the value of the aux variable.
const Moose::Functor< Real > *const _vel_y
const MooseArray< Point > & _normals
normals at quadrature points
bool isNodal() const
Nodal or elemental kernel?
const MooseArray< Point > & _q_point
Active quadrature points.
const Elem *const & _current_elem
Current element (valid only for elemental kernels)
const Node *const & _current_node
Current node (valid only for nodal kernels)
const unsigned int & _current_side
current side of the current element
unsigned int _qp
Quadrature point index.
MooseVariableField< Real > & _var
This is a regular kernel so we cast to a regular MooseVariable, hides base _var.
const QBase *const & _qrule
Quadrature rule being used.
static InputParameters validParams()
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
This class provides variable solution values for other classes/objects to bind to when looping over f...
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
Argument for requesting functor evaluation at quadrature point locations on an element side.