https://mooseframework.inl.gov
SpecificVolumeIC.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 "SpecificVolumeIC.h"
11 
12 registerMooseObject("ThermalHydraulicsApp", SpecificVolumeIC);
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("Sets an initial condition for the specific volume of a phase");
23  return params;
24 }
25 
27  : InitialCondition(parameters),
28  _rhoA(coupledValue("rhoA")),
29  _area(coupledValue("A")),
30  _alpha(coupledValue("alpha"))
31 {
32 }
33 
34 Real
35 SpecificVolumeIC::value(const Point & /*p*/)
36 {
37  mooseAssert(_rhoA[_qp] != 0, "Detected zero density.");
38  return _alpha[_qp] * _area[_qp] / _rhoA[_qp];
39 }
const VariableValue & _alpha
static InputParameters validParams()
registerMooseObject("ThermalHydraulicsApp", SpecificVolumeIC)
const VariableValue & _rhoA
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
virtual Real value(const Point &p)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
SpecificVolumeIC(const InputParameters &parameters)
void addClassDescription(const std::string &doc_string)
const VariableValue & _area
static InputParameters validParams()