www.mooseframework.org
RichardsSeff1VGcut.C
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 // "cut" van-Genuchten effective saturation as a function of pressure, and its derivs wrt p
9 //
10 #include "RichardsSeff1VGcut.h"
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<RichardsSeff1VG>();
17  params.addRequiredRangeCheckedParam<Real>(
18  "p_cut",
19  "p_cut < 0",
20  "cutoff in pressure. Must be negative. If p>p_cut then use "
21  "van-Genuchten function. Otherwise use a linear relationship which is "
22  "chosen so the value and derivative match van-Genuchten at p=p_cut");
23  params.addClassDescription("cut van-Genuchten effective saturation as a function of capillary "
24  "pressure. Single-phase seff = (1 + (-al*p)^(1/(1-m)))^(-m) for "
25  "p>p_cut, otherwise user a a linear relationship that is chosen so "
26  "the value and derivative match van-Genuchten at p=p_cut.");
27  return params;
28 }
29 
30 RichardsSeff1VGcut::RichardsSeff1VGcut(const InputParameters & parameters)
31  : RichardsSeff1VG(parameters),
32  _al(getParam<Real>("al")),
33  _m(getParam<Real>("m")),
34  _p_cut(getParam<Real>("p_cut")),
35  _s_cut(0),
36  _ds_cut(0)
37 {
40 }
41 
42 void
44 {
45  _console << "cut VG Seff has p_cut=" << _p_cut << " so seff_cut=" << _s_cut
46  << " and seff=0 at p=" << -_s_cut / _ds_cut + _p_cut << std::endl;
47 }
48 
49 Real
50 RichardsSeff1VGcut::seff(std::vector<const VariableValue *> p, unsigned int qp) const
51 {
52  if ((*p[0])[qp] > _p_cut)
53  {
54  return RichardsSeff1VG::seff(p, qp);
55  }
56  else
57  {
58  Real seff_linear = _s_cut + _ds_cut * ((*p[0])[qp] - _p_cut);
59  // return (seff_linear > 0 ? seff_linear : 0); // andy isn't sure of this - might be useful to
60  // allow negative saturations
61  return seff_linear;
62  }
63 }
64 
65 void
66 RichardsSeff1VGcut::dseff(std::vector<const VariableValue *> p,
67  unsigned int qp,
68  std::vector<Real> & result) const
69 {
70  if ((*p[0])[qp] > _p_cut)
71  return RichardsSeff1VG::dseff(p, qp, result);
72  else
73  result[0] = _ds_cut;
74 }
75 
76 void
77 RichardsSeff1VGcut::d2seff(std::vector<const VariableValue *> p,
78  unsigned int qp,
79  std::vector<std::vector<Real>> & result) const
80 {
81  if ((*p[0])[qp] > _p_cut)
82  return RichardsSeff1VG::d2seff(p, qp, result);
83  else
84  result[0][0] = 0;
85 }
InputParameters validParams< RichardsSeff1VGcut >()
void dseff(std::vector< const VariableValue * > p, unsigned int qp, std::vector< Real > &result) const
derivative of effective saturation as a function of porepressure
static Real dseff(Real p, Real al, Real m)
derivative of effective saturation wrt porepressure
Real _s_cut
effective saturation at p=_p_cut
static Real seff(Real p, Real al, Real m)
effective saturation as a fcn of porepressure
void initialSetup()
just prints some (maybe) useful info to the console
void d2seff(std::vector< const VariableValue * > p, unsigned int qp, std::vector< std::vector< Real >> &result) const
second derivative of effective saturation as a function of porepressure
void d2seff(std::vector< const VariableValue * > p, unsigned int qp, std::vector< std::vector< Real >> &result) const
second derivative of effective saturation as a function of porepressure
Real seff(std::vector< const VariableValue * > p, unsigned int qp) const
effective saturation as a function of porepressure
Real seff(std::vector< const VariableValue * > p, unsigned int qp) const
effective saturation as a function of porepressure
Effective saturation as a function of porepressure using the van Genuchten formula.
Real _al
van Genuchten alpha parameter
Real _m
van Genuchten m parameter
Real _ds_cut
derivative of effective saturation wrt p at p=_p_cut
Real _p_cut
cutoff in pressure below which use a linear relationship instead of van-Genuchten expression...
void dseff(std::vector< const VariableValue * > p, unsigned int qp, std::vector< Real > &result) const
derivative of effective saturation as a function of porepressure
RichardsSeff1VGcut(const InputParameters &parameters)
InputParameters validParams< RichardsSeff1VG >()