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 "ADFlowJunctionFlux1Phase.h" 11 : #include "ADFlowJunctionUserObject.h" 12 : 13 : registerMooseObject("ThermalHydraulicsApp", ADFlowJunctionFlux1Phase); 14 : 15 : InputParameters 16 1072 : ADFlowJunctionFlux1Phase::validParams() 17 : { 18 1072 : InputParameters params = SideIntegralPostprocessor::validParams(); 19 : 20 2144 : params.addRequiredParam<unsigned int>("connection_index", "Index of the connected flow channel"); 21 2144 : params.addRequiredParam<std::string>("junction", "Junction component name"); 22 2144 : MooseEnum equation("mass=0 momentum=1 energy=2"); 23 2144 : params.addRequiredParam<MooseEnum>( 24 : "equation", equation, "Equation for which to query flux vector"); 25 : 26 1072 : params.addClassDescription( 27 : "Retrieves an entry of a flux vector for a connection attached to a 1-phase junction"); 28 : 29 1072 : return params; 30 1072 : } 31 : 32 402 : ADFlowJunctionFlux1Phase::ADFlowJunctionFlux1Phase(const InputParameters & parameters) 33 : : SideIntegralPostprocessor(parameters), 34 : 35 402 : _connection_index(getParam<unsigned int>("connection_index")), 36 804 : _junction_name(getParam<std::string>("junction")), 37 402 : _junction_uo_name(_junction_name + ":junction_uo"), 38 402 : _junction_uo(getUserObjectByName<ADFlowJunctionUserObject>(_junction_uo_name)), 39 1206 : _equation_index(getParam<MooseEnum>("equation")) 40 : { 41 402 : } 42 : 43 : Real 44 2300 : ADFlowJunctionFlux1Phase::computeQpIntegral() 45 : { 46 2300 : const auto & flux = _junction_uo.getFlux(_connection_index); 47 2300 : return MetaPhysicL::raw_value(flux[_equation_index]); 48 : }