21 params.
addParam<MaterialPropertyName>(
23 "Velocity vector as a material property. Should be provided when we want the velocity value "
24 "to be determined implicitly (e.g. we don't have a Dirichlet condition)");
25 params.
addParam<FunctionName>(
"velocity_function",
26 "Function describing the values of velocity on the boundary.");
28 "Boundary condition for advection when it is integrated by parts. Supports Dirichlet "
29 "(inlet-like) and implicit (outlet-like) conditions.");
30 params.
addParam<MaterialPropertyName>(
"advected_quantity",
31 "An optional material property to be advected. If not "
32 "supplied, then the variable will be used.");
33 params.
addParam<FunctionName>(
"primal_dirichlet_value",
34 "The value of the primal variable on the boundary.");
35 params.
addParam<MaterialPropertyName>(
38 "If a primal Dirichlet value is supplied, then a coefficient may be optionally multiplied "
39 "that multiples the Dirichlet value");
53 _velocity_mat_prop(isParamValid(
"velocity_mat_prop")
54 ? &this->template getGenericMaterialProperty<RealVectorValue, is_ad>(
57 _velocity_function(isParamValid(
"velocity_function") ? &getFunction(
"velocity_function")
59 _user_supplied_adv_quant(isParamValid(
"advected_quantity")),
61 _user_supplied_adv_quant
62 ? this->template getGenericMaterialProperty<Real, is_ad>(
"advected_quantity").get()
65 isParamValid(
"primal_dirichlet_value") ? &getFunction(
"primal_dirichlet_value") : nullptr),
66 _primal_coeff(this->template getGenericMaterialProperty<Real, is_ad>(
"primal_coefficient"))
70 "This parameter should only be provided when 'primal_dirichlet_value' is provided");
72 mooseError(
"Only one of 'primal_dirichlet_value' or 'advected_quantity' should be provided");
74 mooseError(
"Exactly one of 'velocity_mat_prop' or 'velocity_function' should be provided");
88 ? (*_velocity_mat_prop)[_qp]
92 if (_primal_dirichlet)
93 return _test[_i][_qp] * vdotn * _primal_dirichlet->
value(_t, _q_point[_qp]) *
96 return _test[_i][_qp] * vdotn * _adv_quant[_qp];
105 ? (*_velocity_mat_prop)[
_qp]
registerMooseObject("MooseApp", ConservativeAdvectionBC)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Moose::GenericType< Real, is_ad > GenericReal
Moose::GenericType< RealVectorValue, is_ad > GenericRealVectorValue
A boundary condition for when the advection term is integrated by parts.
const bool _user_supplied_adv_quant
Flag to check if user has supplied an advective quantity or not.
const Function *const _primal_dirichlet
Dirichlet value for the primal variable.
virtual GenericReal< is_ad > computeQpResidual() override
Method for computing the residual at quadrature points.
const Function *const _velocity_function
The velocity as a function.
const GenericMaterialProperty< RealVectorValue, is_ad > *const _velocity_mat_prop
The velocity as a material property.
ConservativeAdvectionBCTempl(const InputParameters ¶meters)
static InputParameters validParams()
ConservativeAdvectionBC(const InputParameters ¶meters)
static InputParameters validParams()
virtual Real computeQpJacobian() override
Method for computing the diagonal Jacobian at quadrature points.
virtual RealVectorValue vectorValue(Real t, const Point &p) const
Override this to evaluate the vector function at a point (t,x,y,z), by default this returns a zero ve...
static InputParameters validParams()
unsigned int _qp
quadrature point index
unsigned int _i
i-th, j-th index for enumerating test and shape functions
const MooseArray< Point > & _q_point
active quadrature points
const VariablePhiValue & _phi
shape function values (in QPs)
const MooseArray< Point > & _normals
normals at quadrature points
const VariableTestValue & _test
test function values (in QPs)
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 isParamSetByUser(const std::string &name) const
Test if the supplied parameter is set by a user, as opposed to not set or set to default.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
virtual const OutputTools< T >::VariableValue & value()
The value of the variable this object is operating on.