https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADFluxFromGradientMaterial.C
Go to the documentation of this file.
2
4
7{
9
10 params.addClassDescription("Computes a flux vector material property based on the gradient of a "
11 "coupled variable and a scalar diffusivity.");
12
13 // Required name for the output flux property
14 params.addRequiredParam<MaterialPropertyName>("flux", "Name of the flux material property");
15
16 // Coupled variable whose gradient is used
17 params.addRequiredCoupledVar("u", "Variable used to compute the flux");
18
19 // Optional name for the diffusivity material property (default: 'diffusivity')
20 params.addParam<MaterialPropertyName>(
21 "diffusivity", "diffusivity", "The diffusivity material property name");
22
23 return params;
24}
25
27 : Material(parameters),
28 _grad_u(adCoupledGradient("u")),
29 _diffusivity(getADMaterialProperty<Real>("diffusivity")),
30 _flux(declareADProperty<RealVectorValue>("flux"))
31{
32}
33
34void
registerMooseObject("MooseApp", ADFluxFromGradientMaterial)
Material computing a diffusive flux from the gradient of a coupled variable.
virtual void computeQpProperties() override
Users must override this method.
ADMaterialProperty< RealVectorValue > & _flux
Material property storing the flux vector.
ADFluxFromGradientMaterial(const InputParameters &parameters)
static InputParameters validParams()
const ADMaterialProperty< Real > & _diffusivity
Diffusivity.
const ADVariableGradient & _grad_u
Gradient of the coupled variable.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
unsigned int _qp
Materials compute MaterialProperties.
Definition Material.h:36
static InputParameters validParams()
Definition Material.C:14