14#include "libmesh/remote_elem.h"
15#include "metaphysicl/raw_type.h"
27 "The name of the variable on the primary side of the interface");
29 "The name of the variable on the secondary side of the interface.");
31 "diffusivity",
"The name of the diffusivity property on the primary side of the interface");
32 params.
addParam<MaterialPropertyName>(
"neighbor_diffusivity",
33 "The name of the diffusivity property on the secondary "
34 "side of the interface. By default, the "
35 "primary side material property name is used for the "
36 "secondary side. Only needed for finite volume");
37 MooseEnum interp_method(
"average harmonic",
"harmonic");
39 "coeff_interp_method",
41 "Switch that can select face interpolation method for diffusion coefficients.");
51 _grad_u(coupledGradient(
"variable")),
52 _u(coupledValue(
"variable")),
53 _u_neighbor(parameters.isParamSetByUser(
"neighbor_variable")
54 ? coupledNeighborValue(
"neighbor_variable")
55 : coupledNeighborValue(
"variable")),
57 getGenericMaterialProperty<Real, is_ad>(getParam<MaterialPropertyName>(
"diffusivity"))),
58 _diffusion_coef_neighbor(parameters.isParamSetByUser(
"neighbor_diffusivity")
59 ? getGenericNeighborMaterialProperty<Real, is_ad>(
60 getParam<MaterialPropertyName>(
"neighbor_diffusivity"))
61 : getGenericNeighborMaterialProperty<Real, is_ad>(
62 getParam<MaterialPropertyName>(
"diffusivity")))
69 mooseError(
"For the InterfaceDiffusiveFluxIntegral, variable and "
70 "neighbor_variable should be of a similar variable type.");
74 "coeff_interp_method",
75 "This parameter should not be defined for the postprocessing of finite element variables!");
77 const auto & interp_method = getParam<MooseEnum>(
"coeff_interp_method");
78 if (interp_method ==
"average")
80 else if (interp_method ==
"harmonic")
90 mooseAssert(_fi,
"This should never be null. If it is then something went wrong in execute()");
92 const auto normal = _fi->normal();
95 Point one_over_gradient_support = _fi->elemCentroid() - _fi->neighborCentroid();
96 one_over_gradient_support /= (one_over_gradient_support * one_over_gradient_support);
97 const auto gradient = (_u[_qp] - _u_neighbor[_qp]) * one_over_gradient_support;
100 interpolate(_coeff_interp_method,
registerMooseObject("MooseApp", InterfaceDiffusiveFluxIntegral)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
const MooseVariableFieldBase * getFieldVar(const std::string &var_name, unsigned int comp) const
This postprocessor computes an integral of the diffusive flux over an interface.
Moose::FV::InterpMethod _coeff_interp_method
Decides if a geometric arithmetic or harmonic average is used for the face interpolation of the diffu...
static InputParameters validParams()
InterfaceDiffusiveFluxIntegralTempl(const InputParameters ¶meters)
virtual Real computeQpIntegral() override
This postprocessor add generel capabilities to the InterfacePostprocessor to compute an integral over...
static InputParameters validParams()
bool _has_fv_vars
Whether finite volume variables are involved in the user object.
const InputParameters & parameters() const
Get the parameters of the object.
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 ...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
@ HarmonicAverage
1/(gc/elem+(1-gc)/neighbor)
@ Average
gc*elem+(1-gc)*neighbor