www.mooseframework.org
PorousFlowPiecewiseLinearSink.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<std::vector<Real>>(
16  "pt_vals",
17  "Tuple of pressure values (for the fluid_phase specified). Must be monotonically "
18  "increasing. For heat fluxes that don't involve fluids, these are temperature "
19  "values");
20  params.addRequiredParam<std::vector<Real>>(
21  "multipliers", "Tuple of multiplying values. The flux values are multiplied by these.");
22  params.addClassDescription("Applies a flux sink to a boundary. The base flux defined by "
23  "PorousFlowSink is multiplied by a piecewise linear function.");
24  return params;
25 }
26 
28  : PorousFlowSinkPTDefiner(parameters),
29  _sink_func(getParam<std::vector<Real>>("pt_vals"), getParam<std::vector<Real>>("multipliers"))
30 {
31 }
32 
33 Real
35 {
36  return PorousFlowSink::multiplier() * _sink_func.sample(ptVar());
37 }
38 
39 Real
41 {
42  return PorousFlowSink::dmultiplier_dvar(pvar) * _sink_func.sample(ptVar()) +
43  PorousFlowSink::multiplier() * _sink_func.sampleDerivative(ptVar()) * dptVar(pvar);
44 }
virtual Real multiplier() const override
The flux gets multiplied by this quantity.
InputParameters validParams< PorousFlowSinkPTDefiner >()
Provides either a porepressure or a temperature to derived classes, depending on _involves_fluid defi...
InputParameters validParams< PorousFlowPiecewiseLinearSink >()
PorousFlowPiecewiseLinearSink(const InputParameters &parameters)
virtual Real ptVar() const
Provides the variable value (either porepressure, or temperature, depending on _involves_fluid) ...
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 LinearInterpolation _sink_func
piecewise-linear function of porepressure that multiplies the sink flux
virtual Real multiplier() const
The flux gets multiplied by this quantity.
virtual Real dmultiplier_dvar(unsigned int pvar) const override
d(multiplier)/d(Porous flow variable pvar)