www.mooseframework.org
PorousFlowSink.h
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 
10 #pragma once
11 
12 #include "IntegratedBC.h"
13 #include "Function.h"
14 #include "PorousFlowDictator.h"
15 
16 class PorousFlowSink;
17 
18 template <>
19 InputParameters validParams<PorousFlowSink>();
20 
34 class PorousFlowSink : public IntegratedBC
35 {
36 public:
37  PorousFlowSink(const InputParameters & parameters);
38 
39 protected:
40  virtual Real computeQpResidual() override;
41  virtual Real computeQpJacobian() override;
42  virtual Real computeQpOffDiagJacobian(unsigned int jvar) override;
43 
46 
48  const bool _involves_fluid;
49 
51  const unsigned int _ph;
52 
54  const bool _use_mass_fraction;
55 
57  const bool _has_mass_fraction;
58 
60  const unsigned int _sp;
61 
63  const bool _use_mobility;
64 
66  const bool _has_mobility;
67 
69  const bool _use_relperm;
70 
72  const bool _has_relperm;
73 
75  const bool _use_enthalpy;
76 
78  const bool _has_enthalpy;
79 
82 
85 
88 
91 
93  const Function & _m_func;
94 
96  const MaterialProperty<RealTensorValue> * const _permeability;
97 
99  const MaterialProperty<std::vector<RealTensorValue>> * const _dpermeability_dvar;
100 
102  const MaterialProperty<std::vector<std::vector<RealTensorValue>>> * const _dpermeability_dgradvar;
103 
105  const MaterialProperty<std::vector<Real>> * const _fluid_density_node;
106 
108  const MaterialProperty<std::vector<std::vector<Real>>> * const _dfluid_density_node_dvar;
109 
111  const MaterialProperty<std::vector<Real>> * const _fluid_viscosity;
112 
114  const MaterialProperty<std::vector<std::vector<Real>>> * const _dfluid_viscosity_dvar;
115 
117  const MaterialProperty<std::vector<Real>> * const _relative_permeability;
118 
120  const MaterialProperty<std::vector<std::vector<Real>>> * const _drelative_permeability_dvar;
121 
123  const MaterialProperty<std::vector<std::vector<Real>>> * const _mass_fractions;
124 
126  const MaterialProperty<std::vector<std::vector<std::vector<Real>>>> * const _dmass_fractions_dvar;
127 
129  const MaterialProperty<std::vector<Real>> * const _enthalpy;
130 
132  const MaterialProperty<std::vector<std::vector<Real>>> * const _denthalpy_dvar;
133 
135  const MaterialProperty<std::vector<Real>> * const _internal_energy;
136 
138  const MaterialProperty<std::vector<std::vector<Real>>> * const _dinternal_energy_dvar;
139 
141  const MaterialProperty<RealTensorValue> * const _thermal_conductivity;
142 
144  const MaterialProperty<std::vector<RealTensorValue>> * const _dthermal_conductivity_dvar;
145 
147  Real jac(unsigned int jvar) const;
148 
150  virtual Real multiplier() const;
151 
153  virtual Real dmultiplier_dvar(unsigned int pvar) const;
154 
156  const bool _perm_derivs;
157 };
PorousFlowDictator.h
PorousFlowSink::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
Definition: PorousFlowSink.C:256
PorousFlowSink::_use_mass_fraction
const bool _use_mass_fraction
Whether the flux will be multiplied by the mass fraction.
Definition: PorousFlowSink.h:54
PorousFlowSink::_has_internal_energy
const bool _has_internal_energy
Whether there is an "internal_energy" Material. This is just for error checking.
Definition: PorousFlowSink.h:84
PorousFlowSink::_dpermeability_dvar
const MaterialProperty< std::vector< RealTensorValue > > *const _dpermeability_dvar
d(Permeability)/d(PorousFlow variable)
Definition: PorousFlowSink.h:99
PorousFlowSink::_dictator
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
Definition: PorousFlowSink.h:45
PorousFlowSink::_drelative_permeability_dvar
const MaterialProperty< std::vector< std::vector< Real > > > *const _drelative_permeability_dvar
d(Relative permeability of each phase)/d(PorousFlow variable)
Definition: PorousFlowSink.h:120
PorousFlowSink::_denthalpy_dvar
const MaterialProperty< std::vector< std::vector< Real > > > *const _denthalpy_dvar
d(enthalpy of each phase)/d(PorousFlow variable)
Definition: PorousFlowSink.h:132
PorousFlowSink::_dmass_fractions_dvar
const MaterialProperty< std::vector< std::vector< std::vector< Real > > > > *const _dmass_fractions_dvar
d(Mass fraction of each component in each phase)/d(PorousFlow variable)
Definition: PorousFlowSink.h:126
PorousFlowSink::PorousFlowSink
PorousFlowSink(const InputParameters &parameters)
Definition: PorousFlowSink.C:80
PorousFlowSink::_m_func
const Function & _m_func
The flux.
Definition: PorousFlowSink.h:93
PorousFlowSink::_has_mobility
const bool _has_mobility
Whether there are Materials that can form "mobility". This is just for error checking.
Definition: PorousFlowSink.h:66
PorousFlowSink::_use_relperm
const bool _use_relperm
Whether to multiply the sink flux by relative permeability.
Definition: PorousFlowSink.h:69
PorousFlowSink::_dfluid_viscosity_dvar
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_viscosity_dvar
d(Viscosity of each component in each phase)/d(PorousFlow variable)
Definition: PorousFlowSink.h:114
PorousFlowSink::_mass_fractions
const MaterialProperty< std::vector< std::vector< Real > > > *const _mass_fractions
Mass fraction of each component in each phase.
Definition: PorousFlowSink.h:123
PorousFlowSink::_has_relperm
const bool _has_relperm
Whether there is a "relperm" Material. This is just for error checking.
Definition: PorousFlowSink.h:72
PorousFlowSink::_fluid_viscosity
const MaterialProperty< std::vector< Real > > *const _fluid_viscosity
Viscosity of each component in each phase.
Definition: PorousFlowSink.h:111
PorousFlowSink::_involves_fluid
const bool _involves_fluid
Whether this BC involves fluid (whether the user has supplied a fluid phase number)
Definition: PorousFlowSink.h:48
PorousFlowSink::_has_thermal_conductivity
const bool _has_thermal_conductivity
Whether there is an "thermal_conductivity" Material. This is just for error checking.
Definition: PorousFlowSink.h:90
validParams< PorousFlowSink >
InputParameters validParams< PorousFlowSink >()
Definition: PorousFlowSink.C:22
PorousFlowDictator
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
Definition: PorousFlowDictator.h:71
PorousFlowSink::dmultiplier_dvar
virtual Real dmultiplier_dvar(unsigned int pvar) const
d(multiplier)/d(Porous flow variable pvar)
Definition: PorousFlowSink.C:344
PorousFlowSink::_use_mobility
const bool _use_mobility
Whether to multiply the sink flux by permeability*density/viscosity.
Definition: PorousFlowSink.h:63
PorousFlowSink::_perm_derivs
const bool _perm_derivs
Flag to check whether permeabiity derivatives are non-zero.
Definition: PorousFlowSink.h:156
PorousFlowSink::_dfluid_density_node_dvar
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_density_node_dvar
d(Fluid density for each phase (at the node))/d(PorousFlow variable)
Definition: PorousFlowSink.h:108
PorousFlowSink::_internal_energy
const MaterialProperty< std::vector< Real > > *const _internal_energy
Internal_Energy of each phase.
Definition: PorousFlowSink.h:135
PorousFlowSink::multiplier
virtual Real multiplier() const
The flux gets multiplied by this quantity.
Definition: PorousFlowSink.C:338
PorousFlowSink::_enthalpy
const MaterialProperty< std::vector< Real > > *const _enthalpy
Enthalpy of each phase.
Definition: PorousFlowSink.h:129
PorousFlowSink::_dthermal_conductivity_dvar
const MaterialProperty< std::vector< RealTensorValue > > *const _dthermal_conductivity_dvar
d(Thermal_Conductivity)/d(PorousFlow variable)
Definition: PorousFlowSink.h:144
PorousFlowSink::_has_mass_fraction
const bool _has_mass_fraction
Whether there is a "mass_fraction" Material. This is just for error checking.
Definition: PorousFlowSink.h:57
PorousFlowSink::_thermal_conductivity
const MaterialProperty< RealTensorValue > *const _thermal_conductivity
Thermal_Conductivity of porous material.
Definition: PorousFlowSink.h:141
PorousFlowSink::_use_enthalpy
const bool _use_enthalpy
Whether to multiply the sink flux by enthalpy.
Definition: PorousFlowSink.h:75
PorousFlowSink::computeQpJacobian
virtual Real computeQpJacobian() override
Definition: PorousFlowSink.C:250
PorousFlowSink::jac
Real jac(unsigned int jvar) const
Derivative of residual with respect to the jvar variable.
Definition: PorousFlowSink.C:262
PorousFlowSink::_fluid_density_node
const MaterialProperty< std::vector< Real > > *const _fluid_density_node
Fluid density for each phase (at the node)
Definition: PorousFlowSink.h:105
PorousFlowSink::_dpermeability_dgradvar
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > *const _dpermeability_dgradvar
d(Permeability)/d(grad(PorousFlow variable))
Definition: PorousFlowSink.h:102
PorousFlowSink::_relative_permeability
const MaterialProperty< std::vector< Real > > *const _relative_permeability
Relative permeability of each phase.
Definition: PorousFlowSink.h:117
PorousFlowSink::_sp
const unsigned int _sp
The component number (only used if _use_mass_fraction==true)
Definition: PorousFlowSink.h:60
PorousFlowSink::computeQpResidual
virtual Real computeQpResidual() override
Definition: PorousFlowSink.C:225
PorousFlowSink::_permeability
const MaterialProperty< RealTensorValue > *const _permeability
Permeability of porous material.
Definition: PorousFlowSink.h:96
PorousFlowSink::_has_enthalpy
const bool _has_enthalpy
Whether there is an "enthalpy" Material. This is just for error checking.
Definition: PorousFlowSink.h:78
PorousFlowSink::_ph
const unsigned int _ph
The phase number.
Definition: PorousFlowSink.h:51
PorousFlowSink::_use_internal_energy
const bool _use_internal_energy
Whether to multiply the sink flux by internal_energy.
Definition: PorousFlowSink.h:81
PorousFlowSink::_use_thermal_conductivity
const bool _use_thermal_conductivity
Whether to multiply the sink flux by thermal_conductivity.
Definition: PorousFlowSink.h:87
PorousFlowSink::_dinternal_energy_dvar
const MaterialProperty< std::vector< std::vector< Real > > > *const _dinternal_energy_dvar
d(internal_energy of each phase)/d(PorousFlow variable)
Definition: PorousFlowSink.h:138
PorousFlowSink
Applies a flux sink to a boundary.
Definition: PorousFlowSink.h:34