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 "ProductionWell.h" 11 : 12 : registerTHMActionComponentTasks("ThermalHydraulicsApp", ProductionWell); 13 : registerActionComponent("ThermalHydraulicsApp", ProductionWell); 14 : 15 : InputParameters 16 9 : ProductionWell::validParams() 17 : { 18 9 : InputParameters params = WellBase::validParams(); 19 : 20 18 : params.addRequiredParam<FunctionName>("outlet_pressure", "Outlet pressure function [Pa]"); 21 : 22 9 : params.addClassDescription("Adds the components and controls for a production well."); 23 : 24 9 : return params; 25 0 : } 26 : 27 9 : ProductionWell::ProductionWell(const InputParameters & params) : WellBase(params) {} 28 : 29 : void 30 9 : ProductionWell::addTHMComponents() 31 : { 32 9 : addWellBaseComponents(true); 33 9 : addOutlet(); 34 9 : } 35 : 36 : void 37 9 : ProductionWell::addControlLogic() 38 : { 39 9 : const std::string get_fn_name = name() + "_get_outlet_p_ctrl"; 40 : { 41 9 : const std::string class_name = "GetFunctionValueControl"; 42 9 : auto params = _factory.getValidParams(class_name); 43 27 : params.set<FunctionName>("function") = getParam<FunctionName>("outlet_pressure"); 44 9 : params.set<Point>("point") = _surface_point; 45 9 : addControlLogicObject(class_name, get_fn_name, params); 46 9 : } 47 : { 48 9 : const std::string class_name = "SetComponentRealValueControl"; 49 9 : auto params = _factory.getValidParams(class_name); 50 18 : params.set<std::string>("component") = outletName(); 51 9 : params.set<std::string>("parameter") = "p"; 52 18 : params.set<std::string>("value") = get_fn_name + ":value"; 53 9 : addControlLogicObject(class_name, name() + "_set_outlet_p_ctrl", params); 54 9 : } 55 9 : } 56 : 57 : void 58 9 : ProductionWell::addOutlet() 59 : { 60 9 : const std::string class_name = "Outlet1Phase"; 61 9 : auto params = _factory.getValidParams(class_name); 62 27 : params.set<BoundaryName>("input") = flowChannelName(0) + ":out"; 63 9 : params.set<Real>("p") = 1e5; // arbitrary placeholder value; this gets controlled 64 9 : addTHMComponent(class_name, outletName(), params); 65 18 : } 66 : 67 : std::string 68 18 : ProductionWell::outletName() const 69 : { 70 18 : return name() + "_outlet"; 71 : }