www.mooseframework.org
NSSpecificVolumeAux.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 
8 // Navier-Stokes includes
9 #include "NSSpecificVolumeAux.h"
10 #include "NS.h"
11 
12 // MOOSE includes
13 #include "MooseMesh.h"
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<AuxKernel>();
20 
21  params.addClassDescription(
22  "Auxiliary kernel for computing the specific volume (1/rho) of the fluid.");
23  params.addRequiredCoupledVar(NS::density, "density");
24 
25  return params;
26 }
27 
28 NSSpecificVolumeAux::NSSpecificVolumeAux(const InputParameters & parameters)
29  : AuxKernel(parameters), _rho(coupledValue(NS::density))
30 {
31 }
32 
33 Real
35 {
36  // Return a "big" value rather than dividing by zero.
37  if (_rho[_qp] == 0.)
38  return 1.e10;
39 
40  return 1. / _rho[_qp];
41 }
Definition: NS.h:13
InputParameters validParams< NSSpecificVolumeAux >()
const std::string density
Definition: NS.h:15
const VariableValue & _rho
virtual Real computeValue()
NSSpecificVolumeAux(const InputParameters &parameters)