www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Q2PPiecewiseLinearSinkFlux Class Reference

This postprocessor computes the fluid flux to a Q2PPiecewiseLinearSink. More...

#include <Q2PPiecewiseLinearSinkFlux.h>

Inheritance diagram for Q2PPiecewiseLinearSinkFlux:
[legend]

Public Member Functions

 Q2PPiecewiseLinearSinkFlux (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpIntegral ()
 

Protected Attributes

LinearInterpolation _sink_func
 the sink function, which is a piecewise linear function of porepressure values More...
 
Function & _m_func
 the multiplier function More...
 
const VariableValue & _pp
 the porepressure variable More...
 
bool _use_mobility
 whether to include density*permeability_nn/viscosity in the flux More...
 
bool _use_relperm
 whether to include relative permeability in the flux More...
 
const RichardsDensity_density
 fluid density, optional More...
 
Real _viscosity
 fluid viscosity, optional More...
 
const RichardsRelPerm_relperm
 fluid relative permeaility, optional More...
 
const VariableValue & _sat
 saturation variable, optional More...
 
const MaterialProperty< RealTensorValue > & _permeability
 medium permeability More...
 

Detailed Description

This postprocessor computes the fluid flux to a Q2PPiecewiseLinearSink.

The flux is integral_over_boundary of _sink_func*_dt (here _sink_func is a function of porepressure) and if relative permeaility and saturation are given, this integrand is multiplied by _rel_perm and if _m_func is entered, this integrand is multiplied by _m_func at the quad point and if density and viscosity are given, this integrand is multiplied by density*knn/viscosity, where knn is n.permeability.n where n is the normal to the boundary

Definition at line 35 of file Q2PPiecewiseLinearSinkFlux.h.

Constructor & Destructor Documentation

◆ Q2PPiecewiseLinearSinkFlux()

Q2PPiecewiseLinearSinkFlux::Q2PPiecewiseLinearSinkFlux ( const InputParameters &  parameters)

Definition at line 59 of file Q2PPiecewiseLinearSinkFlux.C.

60  : SideIntegralPostprocessor(parameters),
61  _sink_func(getParam<std::vector<Real>>("pressures"),
62  getParam<std::vector<Real>>("bare_fluxes")),
63  _m_func(getFunction("multiplying_fcn")),
64  _pp(coupledValue("porepressure")),
65  _use_mobility(isParamValid("fluid_density") && isParamValid("fluid_viscosity")),
66  _use_relperm(isParamValid("fluid_relperm") && isCoupled("saturation")),
67  _density(isParamValid("fluid_density") ? &getUserObject<RichardsDensity>("fluid_density")
68  : NULL),
69  _viscosity(isParamValid("fluid_viscosity") ? getParam<Real>("fluid_viscosity") : 1),
70  _relperm(isParamValid("fluid_relperm") ? &getUserObject<RichardsRelPerm>("fluid_relperm")
71  : NULL),
72  _sat(isCoupled("saturation") ? coupledValue("saturation") : _zero),
73  _permeability(getMaterialProperty<RealTensorValue>("permeability"))
74 {
75  if ((isParamValid("fluid_density") && !isParamValid("fluid_viscosity")) ||
76  (!isParamValid("fluid_density") && isParamValid("fluid_viscosity")))
77  mooseError("Q2PPiecewiseLinearSink: you must supply both of fluid_density and fluid_viscosity "
78  "if you wish to multiply by the mobility");
79  if ((isParamValid("fluid_relperm") && !isCoupled("saturation")) ||
80  (!isParamValid("fluid_relperm") && isCoupled("saturation")))
81  mooseError("Q2PPiecewiseLinearSink: you must supply both of fluid_relperm and saturation if "
82  "you wish to multiply by the relative permeaility");
83 }
Real _viscosity
fluid viscosity, optional
const VariableValue & _pp
the porepressure variable
const RichardsRelPerm * _relperm
fluid relative permeaility, optional
const MaterialProperty< RealTensorValue > & _permeability
medium permeability
const RichardsDensity * _density
fluid density, optional
bool _use_relperm
whether to include relative permeability in the flux
LinearInterpolation _sink_func
the sink function, which is a piecewise linear function of porepressure values
bool _use_mobility
whether to include density*permeability_nn/viscosity in the flux
Function & _m_func
the multiplier function
const VariableValue & _sat
saturation variable, optional

Member Function Documentation

◆ computeQpIntegral()

Real Q2PPiecewiseLinearSinkFlux::computeQpIntegral ( )
protectedvirtual

Definition at line 86 of file Q2PPiecewiseLinearSinkFlux.C.

87 {
88  Real flux = _sink_func.sample(_pp[_qp]);
89 
90  flux *= _m_func.value(_t, _q_point[_qp]);
91 
92  if (_use_mobility)
93  {
94  Real k = (_permeability[_qp] * _normals[_qp]) * _normals[_qp];
95  flux *= _density->density(_pp[_qp]) * k / _viscosity;
96  }
97  if (_use_relperm)
98  flux *= _relperm->relperm(_sat[_qp]);
99 
100  return flux * _dt;
101 }
Real _viscosity
fluid viscosity, optional
virtual Real density(Real p) const =0
fluid density as a function of porepressure This must be over-ridden in derived classes to provide an...
const VariableValue & _pp
the porepressure variable
const RichardsRelPerm * _relperm
fluid relative permeaility, optional
virtual Real relperm(Real seff) const =0
relative permeability as a function of effective saturation This must be over-ridden in your derived ...
const MaterialProperty< RealTensorValue > & _permeability
medium permeability
const RichardsDensity * _density
fluid density, optional
bool _use_relperm
whether to include relative permeability in the flux
LinearInterpolation _sink_func
the sink function, which is a piecewise linear function of porepressure values
bool _use_mobility
whether to include density*permeability_nn/viscosity in the flux
Function & _m_func
the multiplier function
const VariableValue & _sat
saturation variable, optional

Member Data Documentation

◆ _density

const RichardsDensity* Q2PPiecewiseLinearSinkFlux::_density
protected

fluid density, optional

Definition at line 59 of file Q2PPiecewiseLinearSinkFlux.h.

Referenced by computeQpIntegral().

◆ _m_func

Function& Q2PPiecewiseLinearSinkFlux::_m_func
protected

the multiplier function

Definition at line 47 of file Q2PPiecewiseLinearSinkFlux.h.

Referenced by computeQpIntegral().

◆ _permeability

const MaterialProperty<RealTensorValue>& Q2PPiecewiseLinearSinkFlux::_permeability
protected

medium permeability

Definition at line 71 of file Q2PPiecewiseLinearSinkFlux.h.

Referenced by computeQpIntegral().

◆ _pp

const VariableValue& Q2PPiecewiseLinearSinkFlux::_pp
protected

the porepressure variable

Definition at line 50 of file Q2PPiecewiseLinearSinkFlux.h.

Referenced by computeQpIntegral().

◆ _relperm

const RichardsRelPerm* Q2PPiecewiseLinearSinkFlux::_relperm
protected

fluid relative permeaility, optional

Definition at line 65 of file Q2PPiecewiseLinearSinkFlux.h.

Referenced by computeQpIntegral().

◆ _sat

const VariableValue& Q2PPiecewiseLinearSinkFlux::_sat
protected

saturation variable, optional

Definition at line 68 of file Q2PPiecewiseLinearSinkFlux.h.

Referenced by computeQpIntegral().

◆ _sink_func

LinearInterpolation Q2PPiecewiseLinearSinkFlux::_sink_func
protected

the sink function, which is a piecewise linear function of porepressure values

Definition at line 44 of file Q2PPiecewiseLinearSinkFlux.h.

Referenced by computeQpIntegral().

◆ _use_mobility

bool Q2PPiecewiseLinearSinkFlux::_use_mobility
protected

whether to include density*permeability_nn/viscosity in the flux

Definition at line 53 of file Q2PPiecewiseLinearSinkFlux.h.

Referenced by computeQpIntegral().

◆ _use_relperm

bool Q2PPiecewiseLinearSinkFlux::_use_relperm
protected

whether to include relative permeability in the flux

Definition at line 56 of file Q2PPiecewiseLinearSinkFlux.h.

Referenced by computeQpIntegral().

◆ _viscosity

Real Q2PPiecewiseLinearSinkFlux::_viscosity
protected

fluid viscosity, optional

Definition at line 62 of file Q2PPiecewiseLinearSinkFlux.h.

Referenced by computeQpIntegral().


The documentation for this class was generated from the following files: