https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
12registerMooseObject("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
34Real
35SpecificVolumeIC::value(const Point & /*p*/)
36{
37 mooseAssert(_rhoA[_qp] != 0, "Detected zero density.");
38 return _alpha[_qp] * _area[_qp] / _rhoA[_qp];
39}
registerMooseObject("ThermalHydraulicsApp", SpecificVolumeIC)
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)
const VariableValue & _rhoA
virtual Real value(const Point &p)
const VariableValue & _area
const VariableValue & _alpha
SpecificVolumeIC(const InputParameters &parameters)
static InputParameters validParams()