www.mooseframework.org
RichardsSeffPrimePrimeAux.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 // This post processor returns the 2nd derive of effective saturation.
9 //
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<AuxKernel>();
17  params.addRequiredCoupledVar("pressure_vars", "List of variables that represent the pressure");
18  params.addRequiredParam<int>("wrtnum1",
19  "This aux kernel will return d^2(seff)/dP_wrtnum1 "
20  "dP_wrtnum2. 0<=wrtnum1<number_of_pressure_vars.");
21  params.addRequiredParam<int>("wrtnum2",
22  "This aux kernel will return d^2(seff)/dP_wrtnum1 "
23  "dP_wrtnum2. 0<=wrtnum2<number_of_pressure_vars.");
24  params.addRequiredParam<UserObjectName>("seff_UO",
25  "Name of user object that defines effective saturation.");
26  params.addClassDescription("auxillary variable which is 2nd derivative of effective saturation");
27  return params;
28 }
29 
30 RichardsSeffPrimePrimeAux::RichardsSeffPrimePrimeAux(const InputParameters & parameters)
31  : AuxKernel(parameters),
32  _seff_UO(getUserObject<RichardsSeff>("seff_UO")),
33  _wrt1(getParam<int>("wrtnum1")),
34  _wrt2(getParam<int>("wrtnum2"))
35 {
36  int n = coupledComponents("pressure_vars");
37  if (_wrt1 < 0 || _wrt1 >= n)
38  mooseError("Your wrtnum1 is ", _wrt1, " but it must obey 0 <= wrtnum1 < ", n, ".");
39  if (_wrt2 < 0 || _wrt2 >= n)
40  mooseError("Your wrtnum2 is ", _wrt2, " but it must obey 0 <= wrtnum2 < ", n, ".");
41  _pressure_vals.resize(n);
42 
43  for (int i = 0; i < n; ++i)
44  _pressure_vals[i] = &coupledValue("pressure_vars", i);
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];
Base class for effective saturation as a function of porepressure(s) The functions seff...
Definition: RichardsSeff.h:22
int _wrt1
AuxKernel calculates d^2(Seff)/dP_wrt1 dP_wrt2 so wrt1 is the porepressure number to differentiate wr...
RichardsSeffPrimePrimeAux(const InputParameters &parameters)
InputParameters validParams< RichardsSeffPrimePrimeAux >()
int _wrt2
AuxKernel calculates d^2(Seff)/dP_wrt1 dP_wrt2 so wrt2 is the porepressure number to differentiate wr...
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...
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...