www.mooseframework.org
RichardsMass.C
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 // This post processor returns the mass value of a region. It is used
11 // to check that mass is conserved
12 //
13 #include "RichardsMass.h"
14 
15 registerMooseObject("RichardsApp", RichardsMass);
16 
17 template <>
18 InputParameters
20 {
21  InputParameters params = validParams<ElementIntegralVariablePostprocessor>();
22  params.addRequiredParam<UserObjectName>(
23  "richardsVarNames_UO", "The UserObject that holds the list of Richards variable names.");
24  params.addClassDescription("Returns the mass in a region.");
25  return params;
26 }
27 
28 RichardsMass::RichardsMass(const InputParameters & parameters)
29  : ElementIntegralVariablePostprocessor(parameters),
30 
31  _richards_name_UO(getUserObject<RichardsVarNames>("richardsVarNames_UO")),
32  _pvar(_richards_name_UO.richards_var_num(coupled("variable"))),
33 
34  _mass(getMaterialProperty<std::vector<Real>>("mass"))
35 {
36 }
37 
38 Real
40 {
41  return _mass[_qp][_pvar];
42 }
RichardsVarNames
This holds maps between pressure_var or pressure_var, sat_var used in RichardsMaterial and kernels,...
Definition: RichardsVarNames.h:25
RichardsMass::RichardsMass
RichardsMass(const InputParameters &parameters)
Definition: RichardsMass.C:28
RichardsMass::_pvar
unsigned int _pvar
Richards variable number that we want the mass for.
Definition: RichardsMass.h:37
registerMooseObject
registerMooseObject("RichardsApp", RichardsMass)
RichardsMass::_mass
const MaterialProperty< std::vector< Real > > & _mass
Mass, or vector of masses in multicomponent situation.
Definition: RichardsMass.h:40
RichardsMass.h
RichardsMass
This postprocessor computes the fluid mass by integrating the density over the volume.
Definition: RichardsMass.h:25
validParams< RichardsMass >
InputParameters validParams< RichardsMass >()
Definition: RichardsMass.C:19
RichardsMass::computeQpIntegral
virtual Real computeQpIntegral()
Definition: RichardsMass.C:39