https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowHalfGaussianSink.C
Go to the documentation of this file.
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
11
13
16{
18 params.addRequiredParam<Real>("max",
19 "Maximum of the Gaussian flux multiplier. Flux out is "
20 "multiplied by max*exp((-0.5*(p - center)/sd)^2) for "
21 "p<center, and by = max for p>center. Here p is the nodal "
22 "porepressure for the fluid_phase specified (or, for heat "
23 "fluxes, it is the temperature).");
24 params.addRequiredParam<Real>("sd",
25 "Standard deviation of the Gaussian flux multiplier "
26 "(measured in Pa (or K for heat fluxes)).");
27 params.addRequiredParam<Real>(
28 "center", "Center of the Gaussian flux multiplier (measured in Pa (or K for heat fluxes)).");
29 params.addClassDescription("Applies a flux sink to a boundary. The base flux defined by "
30 "PorousFlowSink is multiplied by a Gaussian.");
31 return params;
32}
33
35 : PorousFlowSinkPTDefiner(parameters),
36 _maximum(getParam<Real>("max")),
37 _sd(getParam<Real>("sd")),
38 _center(getParam<Real>("center"))
39{
40}
41
42Real
44{
45 if (ptVar() >= _center)
48 std::exp(-0.5 * std::pow((ptVar() - _center) / _sd, 2));
49}
50
51Real
53{
54 if (ptVar() >= _center)
56 const Real str = _maximum * std::exp(-0.5 * std::pow((ptVar() - _center) / _sd, 2));
57 return PorousFlowSink::dmultiplier_dvar(pvar) * str +
58 PorousFlowSink::multiplier() * str * (_center - ptVar()) / std::pow(_sd, 2) * dptVar(pvar);
59}
registerMooseObject("PorousFlowApp", PorousFlowHalfGaussianSink)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Applies a flux sink to a boundary.
const Real _center
Center of the Gaussian sink.
const Real _maximum
Maximum of the Gaussian sink.
static InputParameters validParams()
const Real _sd
Standard deviation of the Gaussian sink.
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...
virtual Real ptVar() const
Provides the variable value (either porepressure, or temperature, depending on _involves_fluid)
static InputParameters validParams()
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)
virtual Real multiplier() const
The flux gets multiplied by this quantity.