Line data Source code
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 : 14 : InputParameters 15 8877 : SpecificVolumeIC::validParams() 16 : { 17 8877 : InputParameters params = InitialCondition::validParams(); 18 17754 : params.addRequiredCoupledVar("rhoA", 19 : "Density of the phase (conserved), \alpha \rho A for 2-phase model"); 20 17754 : params.addRequiredCoupledVar("A", "Cross-sectional area"); 21 17754 : params.addCoupledVar("alpha", 1., "Volume fraction"); 22 8877 : params.addClassDescription("Sets an initial condition for the specific volume of a phase"); 23 8877 : return params; 24 0 : } 25 : 26 4841 : SpecificVolumeIC::SpecificVolumeIC(const InputParameters & parameters) 27 : : InitialCondition(parameters), 28 4841 : _rhoA(coupledValue("rhoA")), 29 4841 : _area(coupledValue("A")), 30 9682 : _alpha(coupledValue("alpha")) 31 : { 32 4841 : } 33 : 34 : Real 35 62775 : SpecificVolumeIC::value(const Point & /*p*/) 36 : { 37 : mooseAssert(_rhoA[_qp] != 0, "Detected zero density."); 38 62775 : return _alpha[_qp] * _area[_qp] / _rhoA[_qp]; 39 : }