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