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