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 "SpecificTotalEnthalpyIC.h" 11 : 12 : registerMooseObject("ThermalHydraulicsApp", SpecificTotalEnthalpyIC); 13 : 14 : InputParameters 15 8918 : SpecificTotalEnthalpyIC::validParams() 16 : { 17 8918 : InputParameters params = InitialCondition::validParams(); 18 17836 : params.addRequiredCoupledVar("rhoA", "Conserved density"); 19 17836 : params.addRequiredCoupledVar("rhoEA", "Conserved total energy"); 20 17836 : params.addRequiredCoupledVar("p", "Pressure"); 21 17836 : params.addRequiredCoupledVar("A", "Cross-sectional area"); 22 17836 : params.addCoupledVar("alpha", 1., "Volume fraction"); 23 8918 : params.addClassDescription( 24 : "Sets the initial condition for the special total enthalpy of a phase"); 25 : 26 8918 : return params; 27 0 : } 28 : 29 4863 : SpecificTotalEnthalpyIC::SpecificTotalEnthalpyIC(const InputParameters & parameters) 30 : : InitialCondition(parameters), 31 4863 : _rhoA(coupledValue("rhoA")), 32 4863 : _rhoEA(coupledValue("rhoEA")), 33 4863 : _pressure(coupledValue("p")), 34 4863 : _area(coupledValue("A")), 35 9726 : _alpha(coupledValue("alpha")) 36 : { 37 4863 : } 38 : 39 : Real 40 62865 : SpecificTotalEnthalpyIC::value(const Point & /*p*/) 41 : { 42 62865 : return (_rhoEA[_qp] + _alpha[_qp] * _pressure[_qp] * _area[_qp]) / _rhoA[_qp]; 43 : }