https://mooseframework.inl.gov
RichardsSeffPrimePrimeAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 // This post processor returns the 2nd derive of effective saturation.
11 //
13 
15 
18 {
20  params.addRequiredCoupledVar("pressure_vars", "List of variables that represent the pressure");
21  params.addRequiredParam<int>("wrtnum1",
22  "This aux kernel will return d^2(seff)/dP_wrtnum1 "
23  "dP_wrtnum2. 0<=wrtnum1<number_of_pressure_vars.");
24  params.addRequiredParam<int>("wrtnum2",
25  "This aux kernel will return d^2(seff)/dP_wrtnum1 "
26  "dP_wrtnum2. 0<=wrtnum2<number_of_pressure_vars.");
27  params.addRequiredParam<UserObjectName>("seff_UO",
28  "Name of user object that defines effective saturation.");
29  params.addClassDescription("auxillary variable which is 2nd derivative of effective saturation");
30  return params;
31 }
32 
34  : AuxKernel(parameters),
35  _seff_UO(getUserObject<RichardsSeff>("seff_UO")),
36  _wrt1(getParam<int>("wrtnum1")),
37  _wrt2(getParam<int>("wrtnum2")),
38  _pressure_vals(coupledValues("pressure_vars"))
39 {
40  int n = coupledComponents("pressure_vars");
41  if (_wrt1 < 0 || _wrt1 >= n)
42  mooseError("Your wrtnum1 is ", _wrt1, " but it must obey 0 <= wrtnum1 < ", n, ".");
43  if (_wrt2 < 0 || _wrt2 >= n)
44  mooseError("Your wrtnum2 is ", _wrt2, " but it must obey 0 <= wrtnum2 < ", n, ".");
45 
46  _mat.resize(n);
47  for (int i = 0; i < n; ++i)
48  _mat[i].resize(n);
49 }
50 
51 Real
53 {
55  return _mat[_wrt1][_wrt2];
56 }
const RichardsSeff & _seff_UO
The user object that defines effective saturation as function of porepressure (or porepressures in th...
std::vector< std::vector< Real > > _mat
matrix of 2nd derivtives: This auxkernel returns _mat[_wrt1][_wrt2];
const std::vector< const VariableValue * > _pressure_vals
the porepressure values (this will be length N where N is the number of arguments that the _seff_UO r...
Base class for effective saturation as a function of porepressure(s) The functions seff...
Definition: RichardsSeff.h:18
Calculates derivative of effective saturation wrt specified porepressures.
int _wrt1
AuxKernel calculates d^2(Seff)/dP_wrt1 dP_wrt2 so wrt1 is the porepressure number to differentiate wr...
virtual void d2seff(std::vector< const VariableValue *> p, unsigned int qp, std::vector< std::vector< Real >> &result) const =0
second derivative(s) of effective saturation as a function of porepressure(s) at given quadpoint of t...
void addRequiredParam(const std::string &name, const std::string &doc_string)
RichardsSeffPrimePrimeAux(const InputParameters &parameters)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
unsigned int coupledComponents(const std::string &var_name) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
int _wrt2
AuxKernel calculates d^2(Seff)/dP_wrt1 dP_wrt2 so wrt2 is the porepressure number to differentiate wr...
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
registerMooseObject("RichardsApp", RichardsSeffPrimePrimeAux)
void ErrorVector unsigned int