www.mooseframework.org
Q2PPiecewiseLinearSink.h
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 
8 #ifndef Q2PPIECEWISELINEARSINK
9 #define Q2PPIECEWISELINEARSINK
10 
11 #include "IntegratedBC.h"
12 #include "LinearInterpolation.h"
13 #include "Function.h"
14 #include "RichardsDensity.h"
15 #include "RichardsRelPerm.h"
16 
17 // Forward Declarations
19 
20 template <>
21 InputParameters validParams<Q2PPiecewiseLinearSink>();
22 
35 class Q2PPiecewiseLinearSink : public IntegratedBC
36 {
37 public:
38  Q2PPiecewiseLinearSink(const InputParameters & parameters);
39 
40 protected:
41  virtual void computeResidual();
42 
43  virtual Real computeQpResidual();
44 
45  virtual void computeJacobian();
46 
47  virtual Real computeQpJacobian();
48 
49  virtual void computeJacobianBlock(unsigned int jvar);
50 
51  virtual Real computeQpOffDiagJacobian(unsigned int jvar);
52 
55 
58 
60  LinearInterpolation _sink_func;
61 
63  Function & _m_func;
64 
67 
70 
72  const VariableValue & _other_var_nodal;
73 
75  unsigned int _other_var_num;
76 
78  bool _var_is_pp;
79 
81  Real _viscosity;
82 
84  const MaterialProperty<RealTensorValue> & _permeability;
85 
87  unsigned int _num_nodes;
88 
90  std::vector<Real> _pp;
91 
93  std::vector<Real> _sat;
94 
96  std::vector<Real> _nodal_density;
97 
99  std::vector<Real> _dnodal_density_dp;
100 
102  std::vector<Real> _nodal_relperm;
103 
105  std::vector<Real> _dnodal_relperm_ds;
106 
108  void prepareNodalValues();
109 
111  Real jac(unsigned int wrt_num);
112 };
113 
114 #endif // Q2PPIECEWISELINEARSINK
void prepareNodalValues()
calculates the nodal values of pressure, mobility, and derivatives thereof
Function & _m_func
sink flux gets multiplied by this function
std::vector< Real > _nodal_density
nodal values of fluid density
LinearInterpolation _sink_func
piecewise-linear function of porepressure (this defines the strength of the sink) ...
bool _use_mobility
whether to multiply the sink flux by permeability*density/viscosity
Q2PPiecewiseLinearSink(const InputParameters &parameters)
Base class for Richards relative permeability classes that provide relative permeability as a functio...
virtual void computeJacobianBlock(unsigned int jvar)
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Real jac(unsigned int wrt_num)
derivative of residual wrt the wrt_num variable
unsigned int _other_var_num
the variable number of the other variable
Applies a fully-upwinded flux sink to a boundary The sink is a piecewise linear function of porepress...
bool _var_is_pp
whether the Variable for this BC is porepressure or not
InputParameters validParams< Q2PPiecewiseLinearSink >()
std::vector< Real > _dnodal_density_dp
d(_nodal_density)/d(porepressure)
std::vector< Real > _pp
nodal values of porepressure
const RichardsRelPerm & _relperm
fluid relative permeability
const MaterialProperty< RealTensorValue > & _permeability
permeability
bool _use_relperm
whether to multiply the sink flux by relative permeability
std::vector< Real > _dnodal_relperm_ds
d(_nodal_relperm)/d(saturation)
Base class for fluid density as a function of porepressure The functions density, ddensity and d2dens...
unsigned int _num_nodes
number of nodes in this element.
std::vector< Real > _nodal_relperm
nodal values of relative permeability
std::vector< Real > _sat
nodal values of saturation
const RichardsDensity & _density
fluid density
const VariableValue & _other_var_nodal
the other variable in the 2-phase system (this is saturation if Variable=porepressure, and viceversa)