https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADFluxFromGradientMaterial.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11
13
16{
18
19 params.addClassDescription("Computes a flux vector material property based on the gradient of a "
20 "coupled variable and a scalar diffusivity.");
21
22 // Required name for the output flux property
23 params.addRequiredParam<MaterialPropertyName>("flux", "Name of the flux material property");
24
25 // Coupled variable whose gradient is used
26 params.addRequiredCoupledVar("u", "Variable used to compute the flux");
27
28 // Optional name for the diffusivity material property (default: 'diffusivity')
29 params.addParam<MaterialPropertyName>(
30 "diffusivity", "diffusivity", "The diffusivity material property name");
31
32 return params;
33}
34
36 : Material(parameters),
37 _grad_u(adCoupledGradient("u")),
38 _diffusivity(getADMaterialProperty<Real>("diffusivity")),
39 _flux(declareADProperty<RealVectorValue>("flux"))
40{
41}
42
43void
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