https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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
34Real
36{
37 mooseAssert(_rho[_qp] != 0, "Detected zero density.");
38 return _alpha[_qp] * _area[_qp] / _rho[_qp];
39}
registerMooseObject("NavierStokesApp", SpecificVolumeAux)
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
Computes specific volume.
static InputParameters validParams()
const VariableValue & _rho
const VariableValue & _alpha
SpecificVolumeAux(const InputParameters &parameters)
const VariableValue & _area