www.mooseframework.org
RichardsPiecewiseLinearSink.h
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 #pragma once
11 
12 #include "IntegratedBC.h"
13 #include "LinearInterpolation.h"
14 #include "Function.h"
15 #include "RichardsVarNames.h"
16 #include "RichardsDensity.h"
17 #include "RichardsRelPerm.h"
18 #include "RichardsSeff.h"
19 
20 // Forward Declarations
21 
36 {
37 public:
39 
41 
42 protected:
43  virtual void computeResidual() override;
44 
45  virtual Real computeQpResidual() override;
46 
47  virtual void computeJacobian() override;
48 
49  virtual Real computeQpJacobian() override;
50 
51  virtual void computeOffDiagJacobian(unsigned int jvar) override;
52 
53  virtual Real computeQpOffDiagJacobian(unsigned int jvar) override;
54 
57 
60 
63 
66 
68  const Function & _m_func;
69 
72 
74  unsigned int _num_p;
75 
77  unsigned int _pvar;
78 
81 
83  const RichardsSeff * const _seff_UO;
84 
87 
90 
92  unsigned int _num_nodes;
93 
98  std::vector<Real> _nodal_density;
99 
104  std::vector<std::vector<Real>> _dnodal_density_dv;
105 
110  std::vector<Real> _nodal_relperm;
111 
116  std::vector<std::vector<Real>> _dnodal_relperm_dv;
117 
120 
123 
126 
129 
135 
138 
141 
144 
147 
156  std::vector<const VariableValue *> _ps_at_nodes;
157 
159  void prepareNodalValues();
160 
162  Real jac(unsigned int wrt_num);
163 };
const MaterialProperty< std::vector< Real > > & _rel_perm
relative permeability (only the _pvar component is used)
virtual Real computeQpResidual() override
virtual Real computeQpJacobian() override
const RichardsDensity *const _density_UO
user object defining the density. Only used if _fully_upwind = true
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
const RichardsSeff *const _seff_UO
user object defining the effective saturation. Only used if _fully_upwind = true
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:18
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)
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
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...
const RichardsRelPerm *const _relperm_UO
user object defining the relative permeability. Only used if _fully_upwind = true ...
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 PostprocessorValue & _area_pp
area postprocessor. if given then all bare_fluxes are divided by this quantity
Real PostprocessorValue
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)
unsigned int _pvar
the moose internal variable number corresponding to the porepressure of this sink flux ...
const Function & _m_func
sink flux gets multiplied by this function
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
virtual void computeOffDiagJacobian(unsigned int jvar) override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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
static InputParameters validParams()
const InputParameters & parameters() const
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 MaterialProperty< std::vector< std::vector< Real > > > & _ddensity_dv
d(density_i)/d(variable_j)