https://mooseframework.inl.gov
THMSpecificVolumeAux.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 "THMSpecificVolumeAux.h"
11 
12 registerMooseObject("ThermalHydraulicsApp", THMSpecificVolumeAux);
13 
16 {
18  params.addRequiredCoupledVar("rhoA",
19  "Density of the phase (conserved), \alpha \rho A for 2-phase model");
20  params.addRequiredCoupledVar("A", "Cross-sectional area");
21  params.addCoupledVar("alpha", 1., "Volume fraction");
22  params.addClassDescription("Computes the specific volume for the phase.");
23 
24  return params;
25 }
26 
28  : AuxKernel(parameters),
29  _rhoA(coupledValue("rhoA")),
30  _area(coupledValue("A")),
31  _alpha(coupledValue("alpha"))
32 {
33 }
34 
35 Real
37 {
38  mooseAssert(_rhoA[_qp] != 0, "Detected zero density.");
39  Real v = _alpha[_qp] * _area[_qp] / _rhoA[_qp];
40  mooseAssert(v >= 0., "specific volume is negative.");
41  return v;
42 }
static InputParameters validParams()
const VariableValue & _rhoA
const VariableValue & _alpha
const VariableValue & _area
Computes specific volume.
THMSpecificVolumeAux(const InputParameters &parameters)
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string v
Definition: NS.h:84
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
registerMooseObject("ThermalHydraulicsApp", THMSpecificVolumeAux)