www.mooseframework.org
PrimaryConvection.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
10 #include "PrimaryConvection.h"
11 
12 registerMooseObject("ChemicalReactionsApp", PrimaryConvection);
13 
16 {
18  params.addRequiredCoupledVar("p", "Pressure");
19  RealVectorValue g(0, 0, 0);
20  params.addParam<RealVectorValue>("gravity", g, "Gravity vector (default is (0, 0, 0))");
21  params.addClassDescription("Convection of primary species");
22  return params;
23 }
24 
26  : DerivativeMaterialInterface<Kernel>(parameters),
27  _cond(getMaterialProperty<Real>("conductivity")),
28  _gravity(getParam<RealVectorValue>("gravity")),
29  _density(getDefaultMaterialProperty<Real>("density")),
30  _grad_p(coupledGradient("p")),
31  _pvar(coupled("p"))
32 
33 {
34 }
35 
36 Real
38 {
39  RealVectorValue darcy_vel = -_cond[_qp] * (_grad_p[_qp] - _density[_qp] * _gravity);
40 
41  return _test[_i][_qp] * (darcy_vel * _grad_u[_qp]);
42 }
43 
44 Real
46 {
47  RealVectorValue darcy_vel = -_cond[_qp] * (_grad_p[_qp] - _density[_qp] * _gravity);
48 
49  return _test[_i][_qp] * (darcy_vel * _grad_phi[_j][_qp]);
50 }
51 
52 Real
54 {
55  if (jvar == _pvar)
56  {
57  RealVectorValue ddarcy_vel_dp = -_cond[_qp] * _grad_phi[_j][_qp];
58  return _test[_i][_qp] * (ddarcy_vel_dp * _grad_u[_qp]);
59  }
60  else
61  return 0.0;
62 }
PrimaryConvection(const InputParameters &parameters)
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
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
registerMooseObject("ChemicalReactionsApp", PrimaryConvection)
const MaterialProperty< Real > & _cond
Hydraulic conductivity.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
Define the Kernel for a PrimaryConvection operator that looks like: cond * grad_pressure * grad_u...
const unsigned int _pvar
Pressure variable number.
const MaterialProperty< Real > & _density
Fluid density.