www.mooseframework.org
PorousFlowHalfGaussianSink.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 
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<PorousFlowSinkPTDefiner>();
15  params.addRequiredParam<Real>("max",
16  "Maximum of the Gaussian flux multiplier. Flux out is "
17  "multiplied by max*exp((-0.5*(p - center)/sd)^2) for "
18  "p<center, and by = max for p>center. Here p is the nodal "
19  "porepressure for the fluid_phase specified (or, for heat "
20  "fluxes, it is the temperature).");
21  params.addRequiredParam<Real>("sd",
22  "Standard deviation of the Gaussian flux multiplier "
23  "(measured in Pa (or K for heat fluxes)).");
24  params.addRequiredParam<Real>(
25  "center", "Center of the Gaussian flux multiplier (measured in Pa (or K for heat fluxes)).");
26  params.addClassDescription("Applies a flux sink to a boundary. The base flux defined by "
27  "PorousFlowSink is multiplied by a Gaussian.");
28  return params;
29 }
30 
31 PorousFlowHalfGaussianSink::PorousFlowHalfGaussianSink(const InputParameters & parameters)
32  : PorousFlowSinkPTDefiner(parameters),
33  _maximum(getParam<Real>("max")),
34  _sd(getParam<Real>("sd")),
35  _center(getParam<Real>("center"))
36 {
37 }
38 
39 Real
41 {
42  if (ptVar() >= _center)
45  std::exp(-0.5 * std::pow((ptVar() - _center) / _sd, 2));
46 }
47 
48 Real
50 {
51  if (ptVar() >= _center)
53  const Real str = _maximum * std::exp(-0.5 * std::pow((ptVar() - _center) / _sd, 2));
54  return PorousFlowSink::dmultiplier_dvar(pvar) * str +
55  PorousFlowSink::multiplier() * str * (_center - ptVar()) / std::pow(_sd, 2) * dptVar(pvar);
56 }
const Real _center
center of the Gaussian sink
const Real _sd
standard deviation of the Gaussian sink
InputParameters validParams< PorousFlowSinkPTDefiner >()
PorousFlowHalfGaussianSink(const InputParameters &parameters)
virtual Real dmultiplier_dvar(unsigned int pvar) const override
d(multiplier)/d(Porous flow variable pvar)
virtual Real multiplier() const override
The flux gets multiplied by this quantity.
Provides either a porepressure or a temperature to derived classes, depending on _involves_fluid defi...
InputParameters validParams< PorousFlowHalfGaussianSink >()
virtual Real ptVar() const
Provides the variable value (either porepressure, or temperature, depending on _involves_fluid) ...
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual Real dptVar(unsigned pvar) const
Provides the d(variable)/(d PorousFlow Variable pvar)
virtual Real dmultiplier_dvar(unsigned int pvar) const
d(multiplier)/d(Porous flow variable pvar)
const Real _maximum
maximum of the Gaussian sink
virtual Real multiplier() const
The flux gets multiplied by this quantity.