OGS
CreateBHE1PType.cpp
Go to the documentation of this file.
1
11#include "BHE_1P.h"
12#include "BaseLib/ConfigTree.h"
13#include "CreateBHEUType.h"
15
16namespace ProcessLib
17{
18namespace HeatTransportBHE
19{
20namespace BHE
21{
22static std::tuple<BoreholeGeometry,
23 RefrigerantProperties,
24 GroutParameters,
26 PipeConfiguration1PType,
27 bool>
29 BaseLib::ConfigTree const& config,
30 std::map<std::string,
31 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
32 curves)
33{
34 // if the BHE is using python boundary condition
35 auto const bhe_if_use_python_bc_conf =
37 config.getConfigParameter<bool>("use_bhe_pipe_network", false);
38
39 if (bhe_if_use_python_bc_conf)
40 {
41 DBUG("BHE 1P using python boundary conditions.");
42 }
43
44 auto const borehole_geometry =
46 createBoreholeGeometry(config.getConfigSubtree("borehole"));
47
49 auto const& pipes_config = config.getConfigSubtree("pipes");
51 Pipe const inlet_pipe = createPipe(pipes_config.getConfigSubtree("inlet"));
52
53 const auto pipe_longitudinal_dispersion_length =
55 pipes_config.getConfigParameter<double>(
56 "longitudinal_dispersion_length");
57 PipeConfiguration1PType const pipes{inlet_pipe,
58 pipe_longitudinal_dispersion_length};
59
61 auto const grout = createGroutParameters(config.getConfigSubtree("grout"));
62
63 auto const refrigerant =
65 createRefrigerantProperties(config.getConfigSubtree("refrigerant"));
66
67 auto const flowAndTemperatureControl = createFlowAndTemperatureControl(
69 config.getConfigSubtree("flow_and_temperature_control"),
70 curves,
71 refrigerant);
72
73 return {borehole_geometry, refrigerant, grout,
74 flowAndTemperatureControl, pipes, bhe_if_use_python_bc_conf};
75}
76
77template <typename T_BHE>
79 BaseLib::ConfigTree const& config,
80 std::map<std::string,
81 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
82 curves)
83{
84 auto SinglePipeType = parseBHE1PTypeConfig(config, curves);
85 return {std::get<0>(SinglePipeType), std::get<1>(SinglePipeType),
86 std::get<2>(SinglePipeType), std::get<3>(SinglePipeType),
87 std::get<4>(SinglePipeType), std::get<5>(SinglePipeType)};
88}
89
91 BaseLib::ConfigTree const& config,
92 std::map<std::string,
93 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
94 curves);
95} // namespace BHE
96} // namespace HeatTransportBHE
97} // 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)
std::variant< TemperatureCurveConstantFlow, TemperatureCurveFlowCurve, FixedPowerConstantFlow, FixedPowerFlowCurve, PowerCurveConstantFlow, PowerCurveFlowCurve, BuildingPowerCurveConstantFlow > FlowAndTemperatureControl
static std::tuple< BoreholeGeometry, RefrigerantProperties, GroutParameters, FlowAndTemperatureControl, PipeConfiguration1PType, bool > parseBHE1PTypeConfig(BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
Pipe createPipe(BaseLib::ConfigTree const &config)
Definition Pipe.cpp:21
FlowAndTemperatureControl createFlowAndTemperatureControl(BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, RefrigerantProperties const &refrigerant)
T_BHE createBHE1PType(BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
template BHE_1P createBHE1PType< BHE_1P >(BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
GroutParameters createGroutParameters(BaseLib::ConfigTree const &config)
BoreholeGeometry createBoreholeGeometry(BaseLib::ConfigTree const &config)