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 "Outlet1Phase.h" 11 : #include "FlowModelSinglePhase.h" 12 : 13 : registerMooseObject("ThermalHydraulicsApp", Outlet1Phase); 14 : 15 : InputParameters 16 1708 : Outlet1Phase::validParams() 17 : { 18 1708 : InputParameters params = FlowBoundary1Phase::validParams(); 19 3416 : params.addRequiredParam<Real>("p", "Prescribed pressure [Pa]"); 20 3416 : params.declareControllable("p"); 21 1708 : params.addClassDescription( 22 : "Boundary condition with prescribed pressure for 1-phase flow channels."); 23 1708 : return params; 24 0 : } 25 : 26 853 : Outlet1Phase::Outlet1Phase(const InputParameters & params) : FlowBoundary1Phase(params) {} 27 : 28 : void 29 845 : Outlet1Phase::check() const 30 : { 31 845 : FlowBoundary1Phase::check(); 32 : 33 845 : auto fm = dynamic_cast<const FlowModelSinglePhase *>(_flow_model.get()); 34 845 : if (fm == nullptr) 35 0 : logError("Incompatible flow model. Make sure you use this component with single phase flow " 36 : "channel."); 37 845 : } 38 : 39 : void 40 811 : Outlet1Phase::addMooseObjects() 41 : { 42 811 : ExecFlagEnum userobject_execute_on(MooseUtils::getDefaultExecFlagEnum()); 43 4055 : userobject_execute_on = {EXEC_INITIAL, EXEC_LINEAR, EXEC_NONLINEAR}; 44 : 45 : // boundary flux user object 46 : { 47 811 : const std::string class_name = "ADBoundaryFlux3EqnGhostPressure"; 48 811 : InputParameters params = _factory.getValidParams(class_name); 49 1622 : params.set<Real>("p") = getParam<Real>("p"); 50 811 : params.set<Real>("normal") = _normal; 51 811 : params.set<UserObjectName>("fluid_properties") = _fp_name; 52 811 : params.set<UserObjectName>("numerical_flux") = _numerical_flux_name; 53 811 : params.set<ExecFlagEnum>("execute_on") = userobject_execute_on; 54 811 : getTHMProblem().addUserObject(class_name, _boundary_uo_name, params); 55 811 : connectObject(params, _boundary_uo_name, "p"); 56 811 : } 57 : 58 : // BCs 59 811 : addWeakBCs(); 60 1622 : }