Line data Source code
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 : // 12 : #include "RichardsSeffPrimePrimeAux.h" 13 : 14 : registerMooseObject("RichardsApp", RichardsSeffPrimePrimeAux); 15 : 16 : InputParameters 17 52 : RichardsSeffPrimePrimeAux::validParams() 18 : { 19 52 : InputParameters params = AuxKernel::validParams(); 20 104 : params.addRequiredCoupledVar("pressure_vars", "List of variables that represent the pressure"); 21 104 : 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 104 : 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 104 : params.addRequiredParam<UserObjectName>("seff_UO", 28 : "Name of user object that defines effective saturation."); 29 52 : params.addClassDescription("auxillary variable which is 2nd derivative of effective saturation"); 30 52 : return params; 31 0 : } 32 : 33 18 : RichardsSeffPrimePrimeAux::RichardsSeffPrimePrimeAux(const InputParameters & parameters) 34 : : AuxKernel(parameters), 35 18 : _seff_UO(getUserObject<RichardsSeff>("seff_UO")), 36 36 : _wrt1(getParam<int>("wrtnum1")), 37 36 : _wrt2(getParam<int>("wrtnum2")), 38 54 : _pressure_vals(coupledValues("pressure_vars")) 39 : { 40 18 : int n = coupledComponents("pressure_vars"); 41 18 : if (_wrt1 < 0 || _wrt1 >= n) 42 1 : mooseError("Your wrtnum1 is ", _wrt1, " but it must obey 0 <= wrtnum1 < ", n, "."); 43 17 : if (_wrt2 < 0 || _wrt2 >= n) 44 1 : mooseError("Your wrtnum2 is ", _wrt2, " but it must obey 0 <= wrtnum2 < ", n, "."); 45 : 46 16 : _mat.resize(n); 47 40 : for (int i = 0; i < n; ++i) 48 24 : _mat[i].resize(n); 49 16 : } 50 : 51 : Real 52 4848 : RichardsSeffPrimePrimeAux::computeValue() 53 : { 54 4848 : _seff_UO.d2seff(_pressure_vals, _qp, _mat); 55 4848 : return _mat[_wrt1][_wrt2]; 56 : }