OGS
CreateBHEUType.cpp
Go to the documentation of this file.
1
11#include "CreateBHEUType.h"
12
13#include "BHE_1P.h"
14#include "BHE_1U.h"
15#include "BHE_2U.h"
16#include "BaseLib/ConfigTree.h"
18namespace ProcessLib
19{
20namespace HeatTransportBHE
21{
22namespace BHE
23{
24static std::tuple<BoreholeGeometry,
25 RefrigerantProperties,
26 GroutParameters,
28 PipeConfigurationUType,
29 bool>
31 BaseLib::ConfigTree const& config,
32 std::map<std::string,
33 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
34 curves)
35{
36 // if the BHE is using python boundary condition
37 auto const bhe_if_use_python_bc_conf =
39 config.getConfigParameter<bool>("use_bhe_pipe_network", false);
40 DBUG("If using python boundary condition : {:s}",
41 (bhe_if_use_python_bc_conf) ? "true" : "false");
42
43 auto const borehole_geometry =
45 createBoreholeGeometry(config.getConfigSubtree("borehole"));
46
48 auto const& pipes_config = config.getConfigSubtree("pipes");
50 Pipe const inlet_pipe = createPipe(pipes_config.getConfigSubtree("inlet"));
51 Pipe const outlet_pipe =
53 createPipe(pipes_config.getConfigSubtree("outlet"));
54 const auto pipe_distance =
56 pipes_config.getConfigParameter<double>("distance_between_pipes");
57 const auto pipe_longitudinal_dispersion_length =
59 pipes_config.getConfigParameter<double>(
60 "longitudinal_dispersion_length");
61 PipeConfigurationUType const pipes{inlet_pipe, outlet_pipe, pipe_distance,
62 pipe_longitudinal_dispersion_length};
63
65 auto const grout = createGroutParameters(config.getConfigSubtree("grout"));
66
67 auto const refrigerant =
69 createRefrigerantProperties(config.getConfigSubtree("refrigerant"));
70
71 auto const flowAndTemperatureControl = createFlowAndTemperatureControl(
73 config.getConfigSubtree("flow_and_temperature_control"),
74 curves,
75 refrigerant);
76
77 return {borehole_geometry, refrigerant, grout,
78 flowAndTemperatureControl, pipes, bhe_if_use_python_bc_conf};
79}
80
81template <typename T_BHE>
83 BaseLib::ConfigTree const& config,
84 std::map<std::string,
85 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
86 curves)
87{
88 auto UType = parseBHEUTypeConfig(config, curves);
89 return {std::get<0>(UType), std::get<1>(UType), std::get<2>(UType),
90 std::get<3>(UType), std::get<4>(UType), std::get<5>(UType)};
91}
92
94 BaseLib::ConfigTree const& config,
95 std::map<std::string,
96 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
97 curves);
98
100 BaseLib::ConfigTree const& config,
101 std::map<std::string,
102 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
103 curves);
104} // namespace BHE
105} // namespace HeatTransportBHE
106} // namespace ProcessLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
T getConfigParameter(std::string const &param) const
ConfigTree getConfigSubtree(std::string const &root) const
RefrigerantProperties createRefrigerantProperties(BaseLib::ConfigTree const &config)
template BHE_1U createBHEUType< BHE_1U >(BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::variant< TemperatureCurveConstantFlow, TemperatureCurveFlowCurve, FixedPowerConstantFlow, FixedPowerFlowCurve, PowerCurveConstantFlow, PowerCurveFlowCurve, BuildingPowerCurveConstantFlow > FlowAndTemperatureControl
Pipe createPipe(BaseLib::ConfigTree const &config)
Definition Pipe.cpp:21
template BHE_2U createBHEUType< BHE_2U >(BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
FlowAndTemperatureControl createFlowAndTemperatureControl(BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, RefrigerantProperties const &refrigerant)
GroutParameters createGroutParameters(BaseLib::ConfigTree const &config)
BoreholeGeometry createBoreholeGeometry(BaseLib::ConfigTree const &config)
T_BHE createBHEUType(BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
static std::tuple< BoreholeGeometry, RefrigerantProperties, GroutParameters, FlowAndTemperatureControl, PipeConfigurationUType, bool > parseBHEUTypeConfig(BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)