19 std::optional<BaseLib::ConfigTree>
const& config,
20 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>& parameters,
22 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
const&
27 auto const raw_power = config->getConfigParameter<std::string>(
"power");
30 raw_power, parameters,
"power",
"inline");
37 config->getConfigParameter<std::string>(
"cop_curve"),
38 "Required cop curve not found.");
44 std::optional<BaseLib::ConfigTree>
const& cooling_config,
45 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>& parameters,
47 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
const&
51 cooling_config->getConfigParameter<
bool>(
"active",
false))
56 auto const raw_power =
58 cooling_config->getConfigParameter<std::string>(
"power");
65 std::optional<PowerWithCOP>
const& heating,
66 std::optional<PowerWithCOP>
const& hot_water,
67 std::optional<CoolingVariant>
const& cooling,
70 double const flow_rate_min,
71 double const power_min)
73 if (std::holds_alternative<PowerWithCOP>(*cooling))
76 std::in_place_type<BuildingPowerHotWaterActiveCooling>,
79 std::get<PowerWithCOP>(*cooling),
88 std::in_place_type<BuildingPowerHotWaterPassiveCooling>,
91 std::get<std::reference_wrapper<ParameterLib::Parameter<double>>>(
102 std::optional<PowerWithCOP>
const& heating,
103 std::optional<PowerWithCOP>
const& ,
104 std::optional<CoolingVariant>
const& cooling,
107 double const flow_rate_min,
108 double const power_min)
110 if (std::holds_alternative<PowerWithCOP>(*cooling))
113 std::in_place_type<BuildingPowerActiveCooling>,
115 std::get<PowerWithCOP>(*cooling),
124 std::in_place_type<BuildingPowerPassiveCooling>,
126 std::get<std::reference_wrapper<ParameterLib::Parameter<double>>>(
137 std::optional<PowerWithCOP>
const& ,
138 std::optional<PowerWithCOP>
const& hot_water,
139 std::optional<CoolingVariant>
const& cooling,
142 double const flow_rate_min,
143 double const power_min)
145 if (std::holds_alternative<PowerWithCOP>(*cooling))
148 std::in_place_type<BuildingPowerActiveCooling>,
150 std::get<PowerWithCOP>(*cooling),
159 std::in_place_type<BuildingPowerPassiveCooling>,
161 std::get<std::reference_wrapper<ParameterLib::Parameter<double>>>(
172 std::optional<PowerWithCOP>
const& ,
173 std::optional<PowerWithCOP>
const& ,
174 std::optional<CoolingVariant>
const& cooling,
177 double const flow_rate_min,
178 double const power_min)
180 if (std::holds_alternative<PowerWithCOP>(*cooling))
183 std::get<PowerWithCOP>(*cooling),
192 std::in_place_type<Power>,
193 std::get<std::reference_wrapper<ParameterLib::Parameter<double>>>(
204 std::optional<PowerWithCOP>,
205 std::optional<PowerWithCOP>,
206 std::optional<CoolingVariant>,
212const std::map<std::tuple<bool, bool, bool>,
217 {{
true,
true,
false},
218 [](std::optional<PowerWithCOP>
const& heating,
219 std::optional<PowerWithCOP>
const& hot_water,
220 std::optional<CoolingVariant>
const& ,
221 auto const& flow_rate_param,
auto const& refrigerant,
222 auto const flow_rate_min,
auto const power_min)
225 std::in_place_type<BuildingPowerHotWater>,
229 refrigerant.specific_heat_capacity,
236 {{
true,
false,
false},
237 [](std::optional<PowerWithCOP>
const& heating,
238 std::optional<PowerWithCOP>
const& ,
239 std::optional<CoolingVariant>
const& ,
240 auto const& flow_rate_param,
auto const& refrigerant,
241 auto const flow_rate_min,
auto const power_min)
244 std::in_place_type<BuildingPower>,
247 refrigerant.specific_heat_capacity,
252 {{
false,
true,
false},
253 [](std::optional<PowerWithCOP>
const& ,
254 std::optional<PowerWithCOP>
const& hot_water,
255 std::optional<CoolingVariant>
const& ,
256 auto const& flow_rate_param,
auto const& refrigerant,
257 auto const flow_rate_min,
auto const power_min)
260 std::in_place_type<BuildingPower>,
263 refrigerant.specific_heat_capacity,
271 std::optional<BaseLib::ConfigTree>
const& heating_config,
272 std::optional<BaseLib::ConfigTree>
const& hot_water_config,
273 std::optional<BaseLib::ConfigTree>
const& cooling_config,
274 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>& parameters,
275 std::map<std::string,
276 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
const&
280 double const flow_rate_min,
281 double const power_min)
283 std::optional<PowerWithCOP> building_heating_curves;
284 std::optional<PowerWithCOP> building_hot_water_curves;
285 std::optional<CoolingVariant> building_cooling_curves;
287 bool heating =
false;
288 bool hot_water =
false;
289 bool cooling =
false;
293 building_heating_curves.emplace(
297 if (hot_water_config)
299 building_hot_water_curves.emplace(
305 building_cooling_curves.emplace(
309 auto key = std::make_tuple(heating, hot_water, cooling);
314 "AdvancedBuildingPower combination is not "
316 auto factory = it->second;
318 return factory(building_heating_curves,
319 building_hot_water_curves,
320 building_cooling_curves,
328 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>& parameters,
329 std::map<std::string,
330 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
const&
337 auto const flow_rate_min =
342 if (type ==
"InflowTemperature")
344 auto const raw_temperature =
348 auto const& temperature_param =
350 raw_temperature, parameters,
"temperature",
"inline");
352 auto const raw_flow_rate =
356 auto const& flow_rate_param =
358 raw_flow_rate, parameters,
"flow_rate",
"inline");
369 raw_power, parameters,
"power",
"inline");
371 auto const raw_flow_rate =
375 auto const& flow_rate_param =
377 raw_flow_rate, parameters,
"flow_rate",
"inline");
379 return Power{power_param,
387 if (type ==
"BuildingPower")
393 raw_power, parameters,
"power",
"inline");
399 "Required cop curve not found.");
401 PowerWithCOP const building_power{power_param, cop_curve};
403 auto const raw_flow_rate =
407 auto const& flow_rate_param =
409 raw_flow_rate, parameters,
"flow_rate",
"inline");
419 if (type ==
"AdvancedBuildingPower")
422 auto const& heating_config =
427 auto const& hot_water_config =
432 auto const& cooling_config =
437 auto const raw_flow_rate =
441 auto const& flow_rate_param =
443 raw_flow_rate, parameters,
"flow_rate",
"inline");
446 heating_config, hot_water_config, cooling_config, parameters,
447 curves, flow_rate_param, refrigerant, flow_rate_min, power_min);
450 "FlowAndTemperatureControl type '{:s}' is not implemented. "
451 "InflowTemperature, Power, BuildingPower, and AdvancedBuildingPower "
452 "are currently supported and require parameters as input. With the "
453 "support of parameters all former available types can be achieved.",
std::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
T getConfigParameter(std::string const ¶m) const
OGS_NO_DANGLING Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Parameter< double > & getNamedOrCreateInlineParameter(std::string const ¶meter_or_value, std::vector< std::unique_ptr< ParameterBase > > ¶meters, std::string const &property_name, std::string const &inline_suffix)
std::function< FlowAndTemperatureControl( std::optional< PowerWithCOP >, std::optional< PowerWithCOP >, std::optional< CoolingVariant >, ParameterLib::Parameter< double > const &, RefrigerantProperties const &, double const, double const)> FactoryAdvancedBuildingPower
FlowAndTemperatureControl createHotWaterCooling(std::optional< PowerWithCOP > const &, std::optional< PowerWithCOP > const &hot_water, std::optional< CoolingVariant > const &cooling, ParameterLib::Parameter< double > const &flow_rate_param, RefrigerantProperties const &refrigerant, double const flow_rate_min, double const power_min)
CoolingVariant createCoolingVariant(std::optional< BaseLib::ConfigTree > const &cooling_config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > ¶meters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
FlowAndTemperatureControl createAdvancedBuildingPower(std::optional< BaseLib::ConfigTree > const &heating_config, std::optional< BaseLib::ConfigTree > const &hot_water_config, std::optional< BaseLib::ConfigTree > const &cooling_config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > ¶meters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, ParameterLib::Parameter< double > const &flow_rate_param, RefrigerantProperties const &refrigerant, double const flow_rate_min, double const power_min)
const std::map< std::tuple< bool, bool, bool >, FactoryAdvancedBuildingPower > advancedBuildingPower
FlowAndTemperatureControl createHeatingHotWaterCooling(std::optional< PowerWithCOP > const &heating, std::optional< PowerWithCOP > const &hot_water, std::optional< CoolingVariant > const &cooling, ParameterLib::Parameter< double > const &flow_rate_param, RefrigerantProperties const &refrigerant, double const flow_rate_min, double const power_min)
FlowAndTemperatureControl createCooling(std::optional< PowerWithCOP > const &, std::optional< PowerWithCOP > const &, std::optional< CoolingVariant > const &cooling, ParameterLib::Parameter< double > const &flow_rate_param, RefrigerantProperties const &refrigerant, double const flow_rate_min, double const power_min)
FlowAndTemperatureControl createFlowAndTemperatureControl(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > ¶meters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, RefrigerantProperties const &refrigerant)
std::variant< PowerWithCOP, std::reference_wrapper< ParameterLib::Parameter< double > > > CoolingVariant
FlowAndTemperatureControl createHeatingCooling(std::optional< PowerWithCOP > const &heating, std::optional< PowerWithCOP > const &, std::optional< CoolingVariant > const &cooling, ParameterLib::Parameter< double > const &flow_rate_param, RefrigerantProperties const &refrigerant, double const flow_rate_min, double const power_min)
std::variant< InflowTemperature, Power, BuildingPower, BuildingPowerHotWaterActiveCooling, BuildingPowerHotWaterPassiveCooling, BuildingPowerHotWater, BuildingPowerActiveCooling, BuildingPowerPassiveCooling, ActiveCooling > FlowAndTemperatureControl
PowerWithCOP createPowerWithCOPStruct(std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > ¶meters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
double const specific_heat_capacity