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 
18 {
21  "p_cut",
22  "p_cut < 0",
23  "cutoff in pressure. Must be negative. If p>p_cut then use "
24  "van-Genuchten function. Otherwise use a linear relationship which is "
25  "chosen so the value and derivative match van-Genuchten at p=p_cut");
26  params.addClassDescription("cut van-Genuchten effective saturation as a function of capillary "
27  "pressure. Single-phase seff = (1 + (-al*p)^(1/(1-m)))^(-m) for "
28  "p>p_cut, otherwise user a a linear relationship that is chosen so "
29  "the value and derivative match van-Genuchten at p=p_cut.");
30  return params;
31 }
32 
34  : RichardsSeff1VG(parameters),
35  _al(getParam<Real>("al")),
36  _m(getParam<Real>("m")),
37  _p_cut(getParam<Real>("p_cut")),
38  _s_cut(0),
39  _ds_cut(0)
40 {
43 }
44 
45 void
47 {
48  _console << "cut VG Seff has p_cut=" << _p_cut << " so seff_cut=" << _s_cut
49  << " and seff=0 at p=" << -_s_cut / _ds_cut + _p_cut << std::endl;
50 }
51 
52 Real
53 RichardsSeff1VGcut::seff(std::vector<const VariableValue *> p, unsigned int qp) const
54 {
55  if ((*p[0])[qp] > _p_cut)
56  {
57  return RichardsSeff1VG::seff(p, qp);
58  }
59  else
60  {
61  Real seff_linear = _s_cut + _ds_cut * ((*p[0])[qp] - _p_cut);
62  // return (seff_linear > 0 ? seff_linear : 0); // andy isn't sure of this - might be useful to
63  // allow negative saturations
64  return seff_linear;
65  }
66 }
67 
68 void
69 RichardsSeff1VGcut::dseff(std::vector<const VariableValue *> p,
70  unsigned int qp,
71  std::vector<Real> & result) const
72 {
73  if ((*p[0])[qp] > _p_cut)
74  return RichardsSeff1VG::dseff(p, qp, result);
75  else
76  result[0] = _ds_cut;
77 }
78 
79 void
80 RichardsSeff1VGcut::d2seff(std::vector<const VariableValue *> p,
81  unsigned int qp,
82  std::vector<std::vector<Real>> & result) const
83 {
84  if ((*p[0])[qp] > _p_cut)
85  return RichardsSeff1VG::d2seff(p, qp, result);
86  else
87  result[0][0] = 0;
88 }
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
Real seff(std::vector< const VariableValue *> p, unsigned int qp) const
effective saturation as a function of porepressure
static InputParameters validParams()
void dseff(std::vector< const VariableValue *> p, unsigned int qp, std::vector< Real > &result) const
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
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
static Real dseff(Real p, Real al, Real m)
derivative of effective saturation wrt porepressure
Real _s_cut
effective saturation at p=_p_cut
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 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
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
Effective saturation as a function of porepressure using the van Genuchten formula, but when p<p_cut use a linear instead, seff = a + b*p, which matches value and derivative at p=p_cut This is so seff=0 at a finite value of p rather than p=-infinity.
Real _ds_cut
derivative of effective saturation wrt p at p=_p_cut
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("RichardsApp", RichardsSeff1VGcut)
Real _p_cut
cutoff in pressure below which use a linear relationship instead of van-Genuchten expression...
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
RichardsSeff1VGcut(const InputParameters &parameters)
const ConsoleStream _console