Line data Source code
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 : 10 : #include "DarcyFluxPressure.h" 11 : 12 : registerMooseObject("ChemicalReactionsApp", DarcyFluxPressure); 13 : 14 : InputParameters 15 231 : DarcyFluxPressure::validParams() 16 : { 17 231 : InputParameters params = Kernel::validParams(); 18 : RealVectorValue g(0, 0, 0); 19 462 : params.addParam<RealVectorValue>("gravity", g, "Gravity vector (default is (0, 0, 0))"); 20 231 : params.addClassDescription( 21 : "Darcy flux: - cond * (Grad P - rho * g) where cond is the hydraulic conductivity, P is " 22 : "fluid pressure, rho is fluid density and g is gravity"); 23 231 : return params; 24 0 : } 25 : 26 132 : DarcyFluxPressure::DarcyFluxPressure(const InputParameters & parameters) 27 : : DerivativeMaterialInterface<Kernel>(parameters), 28 132 : _cond(getMaterialProperty<Real>("conductivity")), 29 264 : _gravity(getParam<RealVectorValue>("gravity")), 30 264 : _density(getDefaultMaterialProperty<Real>("density")) 31 : { 32 132 : } 33 : 34 : Real 35 505120 : DarcyFluxPressure::computeQpResidual() 36 : { 37 505120 : return _grad_test[_i][_qp] * _cond[_qp] * (_grad_u[_qp] - _density[_qp] * _gravity); 38 : } 39 : 40 : Real 41 260480 : DarcyFluxPressure::computeQpJacobian() 42 : { 43 260480 : return _grad_test[_i][_qp] * _cond[_qp] * _grad_phi[_j][_qp]; 44 : }