www.mooseframework.org
Q2PPiecewiseLinearSink.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 "RichardsDensity.h"
16 #include "RichardsRelPerm.h"
17 
18 // Forward Declarations
19 
33 {
34 public:
36 
38 
39 protected:
40  virtual void computeResidual() override;
41 
42  virtual Real computeQpResidual() override;
43 
44  virtual void computeJacobian() override;
45 
46  virtual Real computeQpJacobian() override;
47 
48  virtual void computeOffDiagJacobian(unsigned int jvar) override;
49 
50  virtual Real computeQpOffDiagJacobian(unsigned int jvar) override;
51 
54 
57 
60 
62  const Function & _m_func;
63 
66 
69 
72 
74  unsigned int _other_var_num;
75 
77  bool _var_is_pp;
78 
81 
84 
86  unsigned int _num_nodes;
87 
89  std::vector<Real> _pp;
90 
92  std::vector<Real> _sat;
93 
95  std::vector<Real> _nodal_density;
96 
98  std::vector<Real> _dnodal_density_dp;
99 
101  std::vector<Real> _nodal_relperm;
102 
104  std::vector<Real> _dnodal_relperm_ds;
105 
107  void prepareNodalValues();
108 
110  Real jac(unsigned int wrt_num);
111 };
virtual void computeOffDiagJacobian(unsigned int jvar) override
void prepareNodalValues()
calculates the nodal values of pressure, mobility, and derivatives thereof
virtual void computeJacobian() override
virtual void computeResidual() override
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...
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
static InputParameters validParams()
Applies a fully-upwinded flux sink to a boundary The sink is a piecewise linear function of porepress...
virtual Real computeQpResidual() override
bool _var_is_pp
whether the Variable for this BC is porepressure or not
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
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
OutputTools< Real >::VariableValue VariableValue
virtual Real computeQpJacobian() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MaterialProperty< RealTensorValue > & _permeability
permeability
bool _use_relperm
whether to multiply the sink flux by relative permeability
const InputParameters & parameters() const
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 Function & _m_func
sink flux gets multiplied by this function
const VariableValue & _other_var_nodal
the other variable in the 2-phase system (this is saturation if Variable=porepressure, and viceversa)