www.mooseframework.org
PrimaryConvection.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #include "PrimaryConvection.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<Kernel>();
14  params.addRequiredCoupledVar("p", "Pressure");
15  RealVectorValue g(0, 0, 0);
16  params.addParam<RealVectorValue>("gravity", g, "Gravity vector (default is (0, 0, 0))");
17  params.addClassDescription("Convection of primary species");
18  return params;
19 }
20 
21 PrimaryConvection::PrimaryConvection(const InputParameters & parameters)
22  : DerivativeMaterialInterface<Kernel>(parameters),
23  _cond(getMaterialProperty<Real>("conductivity")),
24  _gravity(getParam<RealVectorValue>("gravity")),
25  _density(getDefaultMaterialProperty<Real>("density")),
26  _grad_p(coupledGradient("p")),
27  _pvar(coupled("p"))
28 
29 {
30 }
31 
32 Real
34 {
35  RealVectorValue darcy_vel = -_cond[_qp] * (_grad_p[_qp] - _density[_qp] * _gravity);
36 
37  return _test[_i][_qp] * (darcy_vel * _grad_u[_qp]);
38 }
39 
40 Real
42 {
43  RealVectorValue darcy_vel = -_cond[_qp] * (_grad_p[_qp] - _density[_qp] * _gravity);
44 
45  return _test[_i][_qp] * (darcy_vel * _grad_phi[_j][_qp]);
46 }
47 
48 Real
50 {
51  if (jvar == _pvar)
52  {
53  RealVectorValue ddarcy_vel_dp = -_cond[_qp] * _grad_phi[_j][_qp];
54  return _test[_i][_qp] * (ddarcy_vel_dp * _grad_u[_qp]);
55  }
56  else
57  return 0.0;
58 }
PrimaryConvection(const InputParameters &parameters)
InputParameters validParams< PrimaryConvection >()
virtual Real computeQpJacobian() override
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
const VariableGradient & _grad_p
Pressure gradient.
const RealVectorValue _gravity
Gravity.
virtual Real computeQpResidual() override
const MaterialProperty< Real > & _cond
Hydraulic conductivity.
const unsigned int _pvar
Pressure variable number.
const MaterialProperty< Real > & _density
Fluid density.