www.mooseframework.org
RichardsSeffPrimeAux.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 effective saturation of a region.
9 //
10 #include "RichardsSeffPrimeAux.h"
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>(
19  "wrtnum",
20  "This aux kernel will return d(seff)/dP_wrtnum. 0<=wrtnum<number_of_pressure_vars.");
21  params.addRequiredParam<UserObjectName>("seff_UO",
22  "Name of user object that defines effective saturation.");
23  params.addClassDescription("auxillary variable which is effective saturation");
24  return params;
25 }
26 
27 RichardsSeffPrimeAux::RichardsSeffPrimeAux(const InputParameters & parameters)
28  : AuxKernel(parameters),
29  _seff_UO(getUserObject<RichardsSeff>("seff_UO")),
30  _wrt1(getParam<int>("wrtnum"))
31 {
32  int n = coupledComponents("pressure_vars");
33  if (_wrt1 < 0 || _wrt1 >= n)
34  mooseError("Your wrtnum is ", _wrt1, " but it must obey 0 <= wrtnum < ", n, ".");
35  _pressure_vals.resize(n);
36 
37  for (int i = 0; i < n; ++i)
38  _pressure_vals[i] = &coupledValue("pressure_vars", i);
39 
40  _mat.resize(n);
41 }
42 
43 Real
45 {
47  return _mat[_wrt1];
48 }
Base class for effective saturation as a function of porepressure(s) The functions seff...
Definition: RichardsSeff.h:22
virtual void dseff(std::vector< const VariableValue * > p, unsigned int qp, std::vector< Real > &result) const =0
derivative(s) of effective saturation as a function of porepressure(s) at given quadpoint of the elem...
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...
int _wrt1
AuxKernel calculates d^2(Seff)/dP_wrt1 so wrt1 is the porepressure number to differentiate wrt to...
std::vector< Real > _mat
array of derivtives: This auxkernel returns _mat[_wrt1]
RichardsSeffPrimeAux(const InputParameters &parameters)
const RichardsSeff & _seff_UO
The user object that defines effective saturation as function of porepressure (or porepressures in th...
InputParameters validParams< RichardsSeffPrimeAux >()