www.mooseframework.org
RichardsHalfGaussianSinkFlux.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 mass due to a half-gaussian sink flux from the boundary of a
9 // volume.
10 //
12 #include "Function.h"
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<SideIntegralVariablePostprocessor>();
19  params.addRequiredParam<Real>("max",
20  "Maximum of the flux (measured in kg.m^-2.s^-1). Flux out "
21  "= max*exp((-0.5*(p - centre)/sd)^2) for p<centre, and Flux "
22  "out = max for p>centre. Note, to make this a source "
23  "rather than a sink, let max<0");
24  params.addRequiredParam<Real>("sd",
25  "Standard deviation of the Gaussian (measured in Pa). Flux "
26  "out = max*exp((-0.5*(p - centre)/sd)^2) for p<centre, and "
27  "Flux out = max for p>centre.");
28  params.addRequiredParam<Real>("centre",
29  "Centre of the Gaussian (measured in Pa). Flux out = "
30  "max*exp((-0.5*(p - centre)/sd)^2) for p<centre, and "
31  "Flux out = max for p>centre.");
32  params.addParam<FunctionName>(
33  "multiplying_fcn",
34  1.0,
35  "The flux will be multiplied by this spatially-and-temporally varying function.");
36  params.addRequiredParam<UserObjectName>(
37  "richardsVarNames_UO", "The UserObject that holds the list of Richards variable names.");
38  return params;
39 }
40 
42  : SideIntegralVariablePostprocessor(parameters),
43  _feproblem(dynamic_cast<FEProblemBase &>(_subproblem)),
44  _maximum(getParam<Real>("max")),
45  _sd(getParam<Real>("sd")),
46  _centre(getParam<Real>("centre")),
47  _richards_name_UO(getUserObject<RichardsVarNames>("richardsVarNames_UO")),
48  _pvar(_richards_name_UO.richards_var_num(coupled("variable"))),
49  _m_func(getFunction("multiplying_fcn")),
50  _pp(getMaterialProperty<std::vector<Real>>("porepressure"))
51 {
52 }
53 
54 Real
56 {
57  if (_pp[_qp][_pvar] >= _centre)
58  return _maximum * _dt * _m_func.value(_t, _q_point[_qp]);
59  else
60  return _maximum * exp(-0.5 * std::pow((_pp[_qp][_pvar] - _centre) / _sd, 2)) * _dt *
61  _m_func.value(_t, _q_point[_qp]);
62 }
This holds maps between pressure_var or pressure_var, sat_var used in RichardsMaterial and kernels...
InputParameters validParams< RichardsHalfGaussianSinkFlux >()
Real _maximum
flux out = max*exp((-0.5*(p - centre)/sd)^2) for p<centre, and flux out = max otherwise ...
RichardsHalfGaussianSinkFlux(const InputParameters &parameters)
const MaterialProperty< std::vector< Real > > & _pp
porepressure (or porepressure vector for multiphase problems)
Real _centre
flux out = max*exp((-0.5*(p - centre)/sd)^2) for p<centre, and flux out = max otherwise ...
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
unsigned int _pvar
the index of this variable in the list of Richards variables held by _richards_name_UO.
Function & _m_func
the multiplier function
Real _sd
flux out = max*exp((-0.5*(p - centre)/sd)^2) for p<centre, and flux out = max otherwise ...