www.mooseframework.org
RichardsPiecewiseLinearSink.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 RICHARDSPIECEWISELINEARSINK
9 #define RICHARDSPIECEWISELINEARSINK
10 
11 #include "IntegratedBC.h"
12 #include "LinearInterpolation.h"
13 #include "Function.h"
14 #include "RichardsVarNames.h"
15 #include "RichardsDensity.h"
16 #include "RichardsRelPerm.h"
17 #include "RichardsSeff.h"
18 
19 // Forward Declarations
21 
22 template <>
24 
38 class RichardsPiecewiseLinearSink : public IntegratedBC
39 {
40 public:
41  RichardsPiecewiseLinearSink(const InputParameters & parameters);
42 
43 protected:
44  virtual void computeResidual();
45 
46  virtual Real computeQpResidual();
47 
48  virtual void computeJacobian();
49 
50  virtual Real computeQpJacobian();
51 
52  virtual void computeJacobianBlock(unsigned int jvar);
53 
54  virtual Real computeQpOffDiagJacobian(unsigned int jvar);
55 
58 
61 
64 
66  LinearInterpolation _sink_func;
67 
69  Function & _m_func;
70 
73 
75  unsigned int _num_p;
76 
78  unsigned int _pvar;
79 
82 
85 
88 
90  const PostprocessorValue & _area_pp;
91 
93  unsigned int _num_nodes;
94 
99  std::vector<Real> _nodal_density;
100 
105  std::vector<std::vector<Real>> _dnodal_density_dv;
106 
111  std::vector<Real> _nodal_relperm;
112 
117  std::vector<std::vector<Real>> _dnodal_relperm_dv;
118 
120  const MaterialProperty<std::vector<Real>> & _pp;
121 
123  const MaterialProperty<std::vector<std::vector<Real>>> & _dpp_dv;
124 
126  const MaterialProperty<std::vector<Real>> & _viscosity;
127 
129  const MaterialProperty<RealTensorValue> & _permeability;
130 
135  const MaterialProperty<std::vector<std::vector<Real>>> & _dseff_dv;
136 
138  const MaterialProperty<std::vector<Real>> & _rel_perm;
139 
141  const MaterialProperty<std::vector<std::vector<Real>>> & _drel_perm_dv;
142 
144  const MaterialProperty<std::vector<Real>> & _density;
145 
147  const MaterialProperty<std::vector<std::vector<Real>>> & _ddensity_dv;
148 
157  std::vector<const VariableValue *> _ps_at_nodes;
158 
160  void prepareNodalValues();
161 
163  Real jac(unsigned int wrt_num);
164 };
165 
166 #endif // RichardsPiecewiseLinearSink
const MaterialProperty< std::vector< Real > > & _rel_perm
relative permeability (only the _pvar component is used)
InputParameters validParams< RichardsPiecewiseLinearSink >()
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
LinearInterpolation _sink_func
piecewise-linear function of porepressure (this defines the strength of the sink) ...
const MaterialProperty< std::vector< Real > > & _viscosity
viscosity (only the _pvar component is used)
RichardsPiecewiseLinearSink(const InputParameters &parameters)
bool _use_relperm
whether to multiply the sink flux by relative permeability
bool _use_mobility
whether to multiply the sink flux by permeability*density/viscosity
Base class for effective saturation as a function of porepressure(s) The functions seff...
Definition: RichardsSeff.h:22
Base class for Richards relative permeability classes that provide relative permeability as a functio...
std::vector< Real > _nodal_density
nodal values of fluid density These are used if _fully_upwind = true
const MaterialProperty< std::vector< Real > > & _density
fluid density (only the _pvar component is used)
std::vector< Real > _nodal_relperm
nodal values of relative permeability These are used if _fully_upwind = true
This holds maps between pressure_var or pressure_var, sat_var used in RichardsMaterial and kernels...
std::vector< std::vector< Real > > _dnodal_density_dv
d(_nodal_density)/d(variable_ph) (variable_ph is the variable for phase=ph) These are used in the jac...
const RichardsVarNames & _richards_name_UO
holds info about the names and values of richards variable in the simulation
const RichardsSeff * _seff_UO
user object defining the effective saturation. Only used if _fully_upwind = true
const PostprocessorValue & _area_pp
area postprocessor. if given then all bare_fluxes are divided by this quantity
std::vector< const VariableValue * > _ps_at_nodes
Holds the values of pressures at all the nodes of the element Only used if _fully_upwind = true Eg: _...
const MaterialProperty< std::vector< std::vector< Real > > > & _drel_perm_dv
d(relperm_i)/d(variable_j)
virtual void computeJacobianBlock(unsigned int jvar)
unsigned int _pvar
the moose internal variable number corresponding to the porepressure of this sink flux ...
Applies a flux sink to a boundary The sink is a piecewise linear function of porepressure (the "varia...
const MaterialProperty< std::vector< std::vector< Real > > > & _dseff_dv
derivative of effective saturation wrt variables only _dseff_dv[_pvar][i] is used for i being all var...
bool _fully_upwind
whether to use full upwinding
const MaterialProperty< std::vector< Real > > & _pp
porepressure values (only the _pvar component is used)
const MaterialProperty< std::vector< std::vector< Real > > > & _dpp_dv
d(porepressure_i)/d(variable_j)
unsigned int _num_nodes
number of nodes in this element. Only used if _fully_upwind = true
const RichardsRelPerm * _relperm_UO
user object defining the relative permeability. Only used if _fully_upwind = true ...
unsigned int _num_p
number of richards variables
Base class for fluid density as a function of porepressure The functions density, ddensity and d2dens...
void prepareNodalValues()
calculates the nodal values of pressure, mobility, and derivatives thereof
std::vector< std::vector< Real > > _dnodal_relperm_dv
d(_nodal_relperm)/d(variable_ph) (variable_ph is the variable for phase=ph) These are used in the jac...
Real jac(unsigned int wrt_num)
derivative of residual wrt the wrt_num Richards variable
const MaterialProperty< RealTensorValue > & _permeability
permeability
const RichardsDensity * _density_UO
user object defining the density. Only used if _fully_upwind = true
const MaterialProperty< std::vector< std::vector< Real > > > & _ddensity_dv
d(density_i)/d(variable_j)
Function & _m_func
sink flux gets multiplied by this function