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