www.mooseframework.org
PorousFlowSinkPTDefiner.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<PorousFlowSink>();
15  return params;
16 }
17 
18 PorousFlowSinkPTDefiner::PorousFlowSinkPTDefiner(const InputParameters & parameters)
19  : PorousFlowSink(parameters),
20  _pp(_involves_fluid ? &getMaterialProperty<std::vector<Real>>("PorousFlow_porepressure_nodal")
21  : nullptr),
22  _dpp_dvar(_involves_fluid
23  ? &getMaterialProperty<std::vector<std::vector<Real>>>(
24  "dPorousFlow_porepressure_nodal_dvar")
25  : nullptr),
26  _temp(!_involves_fluid ? &getMaterialProperty<Real>("PorousFlow_temperature_nodal") : nullptr),
27  _dtemp_dvar(!_involves_fluid
28  ? &getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_nodal_dvar")
29  : nullptr)
30 {
31  if (_involves_fluid && (_pp == nullptr || _dpp_dvar == nullptr))
32  mooseError("PorousFlowSink: There is no porepressure Material");
33  if (!_involves_fluid && (_temp == nullptr || _dtemp_dvar == nullptr))
34  mooseError("PorousFlowSink: There is no temperature Material");
35 }
36 
37 Real
39 {
40  if (_involves_fluid)
41  return (*_pp)[_i][_ph];
42  return (*_temp)[_i];
43 }
44 
45 Real
46 PorousFlowSinkPTDefiner::dptVar(unsigned pvar) const
47 {
48  if (_involves_fluid)
49  return (*_dpp_dvar)[_i][_ph][pvar];
50  return (*_dtemp_dvar)[_i][pvar];
51 }
const bool _involves_fluid
Whether this BC involves fluid (whether the user has supplied a fluid phase number) ...
PorousFlowSinkPTDefiner(const InputParameters &parameters)
const unsigned int _ph
The phase number.
const MaterialProperty< std::vector< Real > > *const _pp
Nodal pore pressure in each phase.
Applies a flux sink to a boundary.
const MaterialProperty< Real > *const _temp
Nodal temperature.
const MaterialProperty< std::vector< Real > > *const _dtemp_dvar
d(Nodal temperature)/d(PorousFlow variable)
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)
InputParameters validParams< PorousFlowSinkPTDefiner >()
InputParameters validParams< PorousFlowSink >()
const MaterialProperty< std::vector< std::vector< Real > > > *const _dpp_dvar
d(Nodal pore pressure in each phase)/d(PorousFlow variable)