https://mooseframework.inl.gov
SpecificVolumeAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
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 #include "SpecificVolumeAux.h"
11 
12 registerMooseObject("NavierStokesApp", SpecificVolumeAux);
13 
16 {
18  params.addRequiredCoupledVar("rho", "Density of the phase");
19  params.addCoupledVar("area", 1., "Cross-sectional area (if used)");
20  params.addCoupledVar("alpha", 1., "Volume fraction (if used)");
21  params.addClassDescription("This auxkernel computes the specific volume $v$ of the fluid.");
22 
23  return params;
24 }
25 
27  : AuxKernel(parameters),
28  _rho(coupledValue("rho")),
29  _area(coupledValue("area")),
30  _alpha(coupledValue("alpha"))
31 {
32 }
33 
34 Real
36 {
37  mooseAssert(_rho[_qp] != 0, "Detected zero density.");
38  return _alpha[_qp] * _area[_qp] / _rho[_qp];
39 }
const VariableValue & _rho
static InputParameters validParams()
registerMooseObject("NavierStokesApp", SpecificVolumeAux)
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
Computes specific volume.
const VariableValue & _alpha
const VariableValue & _area
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
SpecificVolumeAux(const InputParameters &parameters)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()