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")
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]
const VariableTestValue & _test
test function values (in QPs)
Moose::GenericType< Real, is_ad > GenericReal
const bool _user_supplied_adv_quant
Flag to check if user has supplied an advective quantity or not.
const MooseArray< Point > & _normals
normals at quadrature points
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 ...
ConservativeAdvectionBCTempl(const InputParameters ¶meters)
static InputParameters validParams()
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
static InputParameters validParams()
static InputParameters validParams()
unsigned int _i
i-th, j-th index for enumerating test and shape functions
const VariablePhiValue & _phi
shape function values (in QPs)
registerMooseObject("MooseApp", ConservativeAdvectionBC)
unsigned int _qp
quadrature point index
const MooseArray< Point > & _q_point
active quadrature points
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 Function *const _primal_dirichlet
Dirichlet value for the primal variable.
Moose::GenericType< RealVectorValue, is_ad > GenericRealVectorValue
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
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...
ConservativeAdvectionBC(const InputParameters ¶meters)
const GenericMaterialProperty< RealVectorValue, is_ad > *const _velocity_mat_prop
The velocity as a material property.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
virtual Real computeQpJacobian() override
Method for computing the diagonal Jacobian at quadrature points.
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.
A boundary condition for when the advection term is integrated by parts.