www.mooseframework.org
RichardsFullyUpwindFlux.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 "Kernel.h"
13 #include "RichardsVarNames.h"
14 #include "RichardsDensity.h"
15 #include "RichardsRelPerm.h"
16 #include "RichardsSeff.h"
17 #include "Material.h"
18 
19 // Forward Declarations
21 
22 template <>
23 InputParameters validParams<RichardsFullyUpwindFlux>();
24 
47 class RichardsFullyUpwindFlux : public Kernel
48 {
49 public:
50  RichardsFullyUpwindFlux(const InputParameters & parameters);
51 
52 protected:
58  virtual Real computeQpResidual() override;
59 
61  virtual void computeResidual() override;
62 
64  virtual void computeOffDiagJacobian(MooseVariableFEBase & jvar) override;
65  using Kernel::computeOffDiagJacobian;
66 
68  Real computeQpJac(unsigned int dvar);
69 
77  void upwind(bool compute_res, bool compute_jac, unsigned int jvar);
78 
80  void prepareNodalValues();
81 
87 
89  unsigned int _num_p;
90 
98  unsigned int _pvar;
99 
102 
105 
108 
110  const MaterialProperty<std::vector<Real>> & _viscosity;
111 
113  const MaterialProperty<std::vector<RealVectorValue>> & _flux_no_mob;
114 
116  const MaterialProperty<std::vector<std::vector<RealVectorValue>>> & _dflux_no_mob_dv;
117 
119  const MaterialProperty<std::vector<std::vector<RealTensorValue>>> & _dflux_no_mob_dgradv;
120 
122  unsigned int _num_nodes;
123 
128  std::vector<Real> _mobility;
129 
134  std::vector<std::vector<Real>> _dmobility_dv;
135 
142  std::vector<const VariableValue *> _ps_at_nodes;
143 };
RichardsFullyUpwindFlux::_ps_at_nodes
std::vector< const VariableValue * > _ps_at_nodes
Holds the values of pressures at all the nodes of the element Eg: _ps_at_nodes[_pvar] is a pointer to...
Definition: RichardsFullyUpwindFlux.h:142
RichardsRelPerm
Base class for Richards relative permeability classes that provide relative permeability as a functio...
Definition: RichardsRelPerm.h:23
RichardsFullyUpwindFlux::_num_p
unsigned int _num_p
number of richards variables
Definition: RichardsFullyUpwindFlux.h:89
RichardsVarNames
This holds maps between pressure_var or pressure_var, sat_var used in RichardsMaterial and kernels,...
Definition: RichardsVarNames.h:25
RichardsSeff
Base class for effective saturation as a function of porepressure(s) The functions seff,...
Definition: RichardsSeff.h:23
RichardsFullyUpwindFlux::_dmobility_dv
std::vector< std::vector< Real > > _dmobility_dv
d(_mobility)/d(variable_ph) (variable_ph is the variable for phase=ph) These are used in the jacobian...
Definition: RichardsFullyUpwindFlux.h:134
RichardsFullyUpwindFlux::computeQpResidual
virtual Real computeQpResidual() override
Note that this is not the complete residual for the quadpoint In computeResidual we sum over the quad...
Definition: RichardsFullyUpwindFlux.C:103
RichardsFullyUpwindFlux::_dflux_no_mob_dv
const MaterialProperty< std::vector< std::vector< RealVectorValue > > > & _dflux_no_mob_dv
d(_flux_no_mob)/d(variable)
Definition: RichardsFullyUpwindFlux.h:116
RichardsFullyUpwindFlux
This is a fully upwinded version of RichardsFlux.
Definition: RichardsFullyUpwindFlux.h:47
RichardsFullyUpwindFlux::computeOffDiagJacobian
virtual void computeOffDiagJacobian(MooseVariableFEBase &jvar) override
this simply calls upwind
Definition: RichardsFullyUpwindFlux.C:118
RichardsVarNames.h
RichardsSeff.h
RichardsFullyUpwindFlux::_relperm_UO
const RichardsRelPerm & _relperm_UO
user object defining the relative permeability
Definition: RichardsFullyUpwindFlux.h:107
RichardsFullyUpwindFlux::computeQpJac
Real computeQpJac(unsigned int dvar)
the derivative of the flux without the upstream mobility terms
Definition: RichardsFullyUpwindFlux.C:125
RichardsFullyUpwindFlux::_num_nodes
unsigned int _num_nodes
number of nodes in this element
Definition: RichardsFullyUpwindFlux.h:122
RichardsFullyUpwindFlux::_richards_name_UO
const RichardsVarNames & _richards_name_UO
holds info regarding the names of the Richards variables and methods for extracting values of these v...
Definition: RichardsFullyUpwindFlux.h:86
RichardsFullyUpwindFlux::_seff_UO
const RichardsSeff & _seff_UO
user object defining the effective saturation
Definition: RichardsFullyUpwindFlux.h:104
RichardsFullyUpwindFlux::_viscosity
const MaterialProperty< std::vector< Real > > & _viscosity
viscosities
Definition: RichardsFullyUpwindFlux.h:110
RichardsFullyUpwindFlux::upwind
void upwind(bool compute_res, bool compute_jac, unsigned int jvar)
Do the upwinding for both the residual and jacobian I've put both calculations in the same code to tr...
Definition: RichardsFullyUpwindFlux.C:134
RichardsFullyUpwindFlux::RichardsFullyUpwindFlux
RichardsFullyUpwindFlux(const InputParameters &parameters)
Definition: RichardsFullyUpwindFlux.C:39
RichardsDensity
Base class for fluid density as a function of porepressure The functions density, ddensity and d2dens...
Definition: RichardsDensity.h:24
RichardsFullyUpwindFlux::prepareNodalValues
void prepareNodalValues()
calculates the nodal values of mobility, and derivatives thereof
Definition: RichardsFullyUpwindFlux.C:66
RichardsFullyUpwindFlux::_pvar
unsigned int _pvar
the index of this variable in the list of Richards variables held by _richards_name_UO.
Definition: RichardsFullyUpwindFlux.h:98
RichardsRelPerm.h
RichardsFullyUpwindFlux::_flux_no_mob
const MaterialProperty< std::vector< RealVectorValue > > & _flux_no_mob
permeability*(grad(pressure) - density*gravity) (a vector of these in the multiphase case)
Definition: RichardsFullyUpwindFlux.h:113
RichardsDensity.h
validParams< RichardsFullyUpwindFlux >
InputParameters validParams< RichardsFullyUpwindFlux >()
Definition: RichardsFullyUpwindFlux.C:23
RichardsFullyUpwindFlux::computeResidual
virtual void computeResidual() override
This simply calls upwind.
Definition: RichardsFullyUpwindFlux.C:111
RichardsFullyUpwindFlux::_mobility
std::vector< Real > _mobility
nodal values of mobility = density*relperm/viscosity These are multiplied by _flux_no_mob to give the...
Definition: RichardsFullyUpwindFlux.h:128
RichardsFullyUpwindFlux::_dflux_no_mob_dgradv
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dflux_no_mob_dgradv
d(_flux_no_mob)/d(grad(variable))
Definition: RichardsFullyUpwindFlux.h:119
RichardsFullyUpwindFlux::_density_UO
const RichardsDensity & _density_UO
user object defining the density
Definition: RichardsFullyUpwindFlux.h:101