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 "DarcyFluxComponent.h" 11 : 12 : registerMooseObject("RichardsApp", DarcyFluxComponent); 13 : 14 : InputParameters 15 16 : DarcyFluxComponent::validParams() 16 : { 17 32 : MooseEnum component("x=0 y=1 z=2"); 18 16 : InputParameters params = AuxKernel::validParams(); 19 32 : params.addRequiredParam<RealVectorValue>( 20 : "fluid_weight", 21 : "Fluid weight (gravity*density) as a vector pointing downwards (usually " 22 : "measured in kg.m^-2.s^-2 = Pa/m). Eg '0 0 -10000'"); 23 32 : params.addRequiredParam<Real>("fluid_viscosity", 24 : "Fluid dynamic viscosity (usually measured in Pa.s)"); 25 16 : params.addClassDescription("Darcy flux (in m^3.s^-1.m^-2, or m.s^-1) -(k_ij/mu (nabla_j P - " 26 : "w_j)), where k_ij is the permeability tensor, mu is the fluid " 27 : "viscosity, P is the fluid pressure, and w_j is the fluid weight. If " 28 : "velocity_scaling is used then -(k_ij/mu (nabla_j P - " 29 : "w_j))/velocity_scaling is returned"); 30 32 : params.addParam<MooseEnum>("component", component, "The component of the Darcy flux to return"); 31 32 : params.addParam<Real>( 32 : "velocity_scaling", 33 32 : 1, 34 : "Scale the result by (1/velocity_scaling). Usually velocity_scaling = porosity."); 35 32 : params.addRequiredCoupledVar("porepressure", "The variable representing the porepressure"); 36 16 : return params; 37 16 : } 38 : 39 8 : DarcyFluxComponent::DarcyFluxComponent(const InputParameters & parameters) 40 : : AuxKernel(parameters), 41 8 : _grad_pp(coupledGradient("porepressure")), 42 16 : _fluid_weight(getParam<RealVectorValue>("fluid_weight")), 43 16 : _fluid_viscosity(getParam<Real>("fluid_viscosity")), 44 16 : _poro_recip(1.0 / getParam<Real>("velocity_scaling")), 45 8 : _permeability(getMaterialProperty<RealTensorValue>("permeability")), 46 24 : _component(getParam<MooseEnum>("component")) 47 : { 48 8 : } 49 : 50 : Real 51 2412 : DarcyFluxComponent::computeValue() 52 : { 53 2412 : return -_poro_recip * 54 2412 : (_permeability[_qp] * (_grad_pp[_qp] - _fluid_weight) / _fluid_viscosity)(_component); 55 : }