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