OGS
ProcessLib::HeatTransportBHE::BHE Namespace Reference

Classes

struct  ActiveCooling
struct  AdvectiveThermalResistanceCoaxial
class  BHE_1P
class  BHE_1U
class  BHE_2U
class  BHE_CXA
class  BHE_CXC
class  BHECommon
class  BHECommonCoaxial
class  BHECommonUType
struct  BoreholeGeometry
struct  BuildingPower
struct  BuildingPowerActiveCooling
struct  BuildingPowerHotWater
struct  BuildingPowerHotWaterActiveCooling
struct  BuildingPowerHotWaterPassiveCooling
struct  BuildingPowerPassiveCooling
struct  DiameterProfile
struct  FlowAndTemperature
struct  GroutAndGroutSoilExchangeThermalResistanceCoaxial
struct  GroutParameters
struct  InflowTemperature
struct  Pipe
struct  PipeConfiguration1PType
struct  PipeConfigurationCoaxial
struct  PipeConfigurationUType
struct  PipeWallThermalResistanceCoaxial
struct  Power
struct  PowerWithCOP
struct  RefrigerantProperties
struct  ThermoMechanicalFlowProperties

Typedefs

using BHETypes = std::variant<BHE_1U, BHE_CXA, BHE_CXC, BHE_2U, BHE_1P>
using FactoryAdvancedBuildingPower
using FlowAndTemperatureControl
using CoolingVariant

Functions

std::array< double, 3 > thermalResistancesGroutSoil (double const chi, double const R_ar, double const R_g)
std::array< double, 4 > thermalResistancesGroutSoil2U (double const chi, double const R_ar_1, double const R_ar_2, double const R_g)
double checkedGroutArea (double const borehole_area_fraction, double const pipe_outside_area, int const section_index)
std::vector< double > cumulativeDistances (std::vector< MeshLib::Node * > const &sorted_nodes)
 Compute cumulative arc-length distances from the first node.
std::pair< std::vector< double >, std::vector< double > > groupSections (std::vector< double > const &distances, std::vector< double > const &diameters)
static BoreholeGeometry buildBoreholeGeometry (double borehole_length, ParameterLib::Parameter< double > const &diameter_parameter, std::vector< MeshLib::Node * > const &bhe_nodes)
BoreholeGeometry createBoreholeGeometry (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::vector< MeshLib::Node * > const &bhe_nodes)
static std::tuple< BoreholeGeometry, RefrigerantProperties, GroutParameters, FlowAndTemperatureControl, PipeConfiguration1PType, bool > parseBHE1PTypeConfig (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)
template<typename T_BHE>
T_BHE createBHE1PType (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)
template BHE_1P createBHE1PType< BHE_1P > (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)
static std::tuple< BoreholeGeometry, RefrigerantProperties, GroutParameters, FlowAndTemperatureControl, PipeConfigurationCoaxial, bool > parseBHECoaxialConfig (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)
template<typename T_BHE>
T_BHE createBHECoaxial (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)
template BHE_CXA createBHECoaxial< BHE_CXA > (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)
template BHE_CXC createBHECoaxial< BHE_CXC > (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)
static std::tuple< BoreholeGeometry, RefrigerantProperties, GroutParameters, FlowAndTemperatureControl, PipeConfigurationUType, bool > parseBHEUTypeConfig (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)
template<typename T_BHE>
T_BHE createBHEUType (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)
template BHE_1U createBHEUType< BHE_1U > (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)
template BHE_2U createBHEUType< BHE_2U > (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)
PowerWithCOP createPowerWithCOPStruct (std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
CoolingVariant createCoolingVariant (std::optional< BaseLib::ConfigTree > const &cooling_config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
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 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)
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)
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 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 > > &parameters, 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)
FlowAndTemperatureControl createFlowAndTemperatureControl (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, RefrigerantProperties const &refrigerant)
FlowAndTemperature check_power_and_flow_rate (double flow_rate, double power, double const heat_capacity, double const density, double const T_out, double const flow_rate_min, double const power_min)
GroutParameters createGroutParameters (BaseLib::ConfigTree const &config)
double prandtlNumber (double const &viscosity, double const &heat_capacity, double const &heat_conductivity)
double reynoldsNumber (double const velocity_norm, double const pipe_diameter, double const viscosity, double const density)
double nusseltNumber (double const reynolds_number, double const prandtl_number, double const pipe_diameter, double const pipe_length)
double nusseltNumberAnnulus (double const reynolds_number, double const prandtl_number, double const diameter_ratio, double const pipe_aspect_ratio)
Pipe createPipe (BaseLib::ConfigTree const &config)
double coaxialPipesAnnulusDiameter (Pipe const &inner_pipe, Pipe const &outer_pipe)
RefrigerantProperties createRefrigerantProperties (BaseLib::ConfigTree const &config)
double computeRgs (double const chi, double const R_g)
 Grout-soil thermal resistance: R_gs = (1 - chi) * R_g.
double computeRgg (double const chi, double const R_gs, double const R_ar, double const R_g)
AdvectiveThermalResistanceCoaxial calculateAdvectiveThermalResistance (Pipe const &inner_pipe, Pipe const &outer_pipe, RefrigerantProperties const &fluid, double const Nu_inner_pipe, double const Nu_annulus)
PipeWallThermalResistanceCoaxial calculatePipeWallThermalResistance (Pipe const &inner_pipe, Pipe const &outer_pipe)
GroutAndGroutSoilExchangeThermalResistanceCoaxial calculateGroutAndGroutSoilExchangeThermalResistance (Pipe const &outer_pipe, GroutParameters const &grout_parameters, double const borehole_diameter)
ThermoMechanicalFlowProperties calculateThermoMechanicalFlowPropertiesPipe (Pipe const &pipe, double const length, RefrigerantProperties const &fluid, double const flow_rate)
ThermoMechanicalFlowProperties calculateThermoMechanicalFlowPropertiesAnnulus (Pipe const &inner_pipe, Pipe const &outer_pipe, double const length, RefrigerantProperties const &fluid, double const flow_rate)

Variables

const std::map< std::tuple< bool, bool, bool >, FactoryAdvancedBuildingPoweradvancedBuildingPower

Typedef Documentation

◆ BHETypes

Definition at line 19 of file BHETypes.h.

◆ CoolingVariant

Initial value:
std::variant<PowerWithCOP,
std::reference_wrapper<ParameterLib::Parameter<double>>>

Definition at line 22 of file PowerWithCOP.h.

◆ FactoryAdvancedBuildingPower

Initial value:
std::optional<PowerWithCOP>,
std::optional<PowerWithCOP>,
std::optional<CoolingVariant>,
double const,
double const)>
std::variant< InflowTemperature, Power, BuildingPower, BuildingPowerHotWaterActiveCooling, BuildingPowerHotWaterPassiveCooling, BuildingPowerHotWater, BuildingPowerActiveCooling, BuildingPowerPassiveCooling, ActiveCooling > FlowAndTemperatureControl

Definition at line 203 of file CreateFlowAndTemperatureControl.cpp.

◆ FlowAndTemperatureControl

Function Documentation

◆ buildBoreholeGeometry()

BoreholeGeometry ProcessLib::HeatTransportBHE::BHE::buildBoreholeGeometry ( double borehole_length,
ParameterLib::Parameter< double > const & diameter_parameter,
std::vector< MeshLib::Node * > const & bhe_nodes )
static

Definition at line 18 of file BoreholeGeometry.cpp.

22{
23 auto const distances = cumulativeDistances(bhe_nodes);
24
25 // Sample diameters at each node
26 std::vector<double> diameters;
27 diameters.reserve(bhe_nodes.size());
28 for (auto const* const node : bhe_nodes)
29 {
31 pos.setNodeID(node->getID());
32 pos.setCoordinates(*node);
33 auto const diameter = diameter_parameter(0.0 /*t*/, pos)[0];
34 if (diameter <= 0)
35 {
37 "Non-positive borehole diameter {:g} at node {:d} "
38 "(x={:g}, y={:g}, z={:g}).",
39 diameter, node->getID(), (*node)[0], (*node)[1], (*node)[2]);
40 }
41 diameters.push_back(diameter);
42 }
43
44 auto [section_boundaries, section_diameters] =
45 groupSections(distances, diameters);
46
47 return {borehole_length,
48 {std::move(section_boundaries), std::move(section_diameters)},
49 &diameter_parameter};
50}
#define OGS_FATAL(...)
Definition Error.h:19
void setNodeID(std::size_t node_id)
void setCoordinates(MathLib::Point3d const &coordinates)
std::pair< std::vector< double >, std::vector< double > > groupSections(std::vector< double > const &distances, std::vector< double > const &diameters)
std::vector< double > cumulativeDistances(std::vector< MeshLib::Node * > const &sorted_nodes)
Compute cumulative arc-length distances from the first node.

References cumulativeDistances(), groupSections(), OGS_FATAL, ParameterLib::SpatialPosition::setCoordinates(), and ParameterLib::SpatialPosition::setNodeID().

Referenced by createBoreholeGeometry(), and ProcessLib::HeatTransportBHE::BHE::BoreholeGeometry::rebuildForNodes().

◆ calculateAdvectiveThermalResistance()

AdvectiveThermalResistanceCoaxial ProcessLib::HeatTransportBHE::BHE::calculateAdvectiveThermalResistance ( Pipe const & inner_pipe,
Pipe const & outer_pipe,
RefrigerantProperties const & fluid,
double const Nu_inner_pipe,
double const Nu_annulus )
inline

Definition at line 37 of file ThermalResistancesCoaxial.h.

41{
42 double const hydraulic_diameter =
43 coaxialPipesAnnulusDiameter(inner_pipe, outer_pipe);
44
45 auto advective_thermal_resistance = [&](double Nu, double diameter_ratio)
46 {
47 return 1.0 / (Nu * fluid.thermal_conductivity * std::numbers::pi) *
48 diameter_ratio;
49 };
50 return {advective_thermal_resistance(Nu_inner_pipe, 1.),
51 advective_thermal_resistance(
52 Nu_annulus, hydraulic_diameter / inner_pipe.outsideDiameter()),
53 advective_thermal_resistance(
54 Nu_annulus, hydraulic_diameter / outer_pipe.diameter)};
55}
double coaxialPipesAnnulusDiameter(Pipe const &inner_pipe, Pipe const &outer_pipe)
Definition Pipe.h:50

References coaxialPipesAnnulusDiameter(), ProcessLib::HeatTransportBHE::BHE::Pipe::diameter, ProcessLib::HeatTransportBHE::BHE::Pipe::outsideDiameter(), and ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::thermal_conductivity.

Referenced by ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::calcThermalResistances().

◆ calculateGroutAndGroutSoilExchangeThermalResistance()

GroutAndGroutSoilExchangeThermalResistanceCoaxial ProcessLib::HeatTransportBHE::BHE::calculateGroutAndGroutSoilExchangeThermalResistance ( Pipe const & outer_pipe,
GroutParameters const & grout_parameters,
double const borehole_diameter )
inline

Definition at line 65 of file ThermalResistancesCoaxial.h.

68{
69 double const outer_pipe_outside_diameter = outer_pipe.outsideDiameter();
70 double const chi =
71 std::log(std::sqrt(borehole_diameter * borehole_diameter +
72 outer_pipe_outside_diameter *
73 outer_pipe_outside_diameter) /
74 std::sqrt(2) / outer_pipe_outside_diameter) /
75 std::log(borehole_diameter / outer_pipe_outside_diameter);
76 double const R_g =
77 std::log(borehole_diameter / outer_pipe_outside_diameter) / 2 /
78 (std::numbers::pi * grout_parameters.lambda_g);
79 double const conductive_b = chi * R_g;
80 double const grout_soil = (1 - chi) * R_g;
81 return {conductive_b, grout_soil};
82}

References ProcessLib::HeatTransportBHE::BHE::GroutParameters::lambda_g, and ProcessLib::HeatTransportBHE::BHE::Pipe::outsideDiameter().

Referenced by ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::calcThermalResistances().

◆ calculatePipeWallThermalResistance()

PipeWallThermalResistanceCoaxial ProcessLib::HeatTransportBHE::BHE::calculatePipeWallThermalResistance ( Pipe const & inner_pipe,
Pipe const & outer_pipe )
inline

Definition at line 57 of file ThermalResistancesCoaxial.h.

59{
60 return {inner_pipe.wallThermalResistance(),
61 outer_pipe.wallThermalResistance()};
62}

References ProcessLib::HeatTransportBHE::BHE::Pipe::wallThermalResistance().

Referenced by ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::calcThermalResistances().

◆ calculateThermoMechanicalFlowPropertiesAnnulus()

ThermoMechanicalFlowProperties ProcessLib::HeatTransportBHE::BHE::calculateThermoMechanicalFlowPropertiesAnnulus ( Pipe const & inner_pipe,
Pipe const & outer_pipe,
double const length,
RefrigerantProperties const & fluid,
double const flow_rate )
inline

Definition at line 40 of file ThermoMechanicalFlowProperties.h.

43{
44 double const Pr =
45 prandtlNumber(fluid.dynamic_viscosity, fluid.specific_heat_capacity,
46 fluid.thermal_conductivity);
47
48 double const inner_pipe_outside_diameter = inner_pipe.outsideDiameter();
49
50 // Velocity between the outer pipe and inner pipe.
51 double const velocity =
52 flow_rate / (outer_pipe.area() - inner_pipe.outsideArea());
53
54 double const Re = reynoldsNumber(
55 velocity, outer_pipe.diameter - inner_pipe_outside_diameter,
56 fluid.dynamic_viscosity, fluid.density);
57
58 double const diameter_ratio =
59 inner_pipe_outside_diameter / outer_pipe.diameter;
60 double const pipe_aspect_ratio =
61 (outer_pipe.diameter - inner_pipe_outside_diameter) / length;
62 double const nusselt_number =
63 nusseltNumberAnnulus(Re, Pr, diameter_ratio, pipe_aspect_ratio);
64 return {velocity, nusselt_number};
65}
double reynoldsNumber(double const velocity_norm, double const pipe_diameter, double const viscosity, double const density)
Definition Physics.h:21
double prandtlNumber(double const &viscosity, double const &heat_capacity, double const &heat_conductivity)
Definition Physics.h:14
double nusseltNumberAnnulus(double const reynolds_number, double const prandtl_number, double const diameter_ratio, double const pipe_aspect_ratio)
Definition Physics.h:58

References ProcessLib::HeatTransportBHE::BHE::Pipe::area(), ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::density, ProcessLib::HeatTransportBHE::BHE::Pipe::diameter, ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::dynamic_viscosity, nusseltNumberAnnulus(), ProcessLib::HeatTransportBHE::BHE::Pipe::outsideArea(), ProcessLib::HeatTransportBHE::BHE::Pipe::outsideDiameter(), prandtlNumber(), reynoldsNumber(), ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::specific_heat_capacity, and ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::thermal_conductivity.

Referenced by ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::updateHeatTransferCoefficients().

◆ calculateThermoMechanicalFlowPropertiesPipe()

ThermoMechanicalFlowProperties ProcessLib::HeatTransportBHE::BHE::calculateThermoMechanicalFlowPropertiesPipe ( Pipe const & pipe,
double const length,
RefrigerantProperties const & fluid,
double const flow_rate )
inline

Definition at line 23 of file ThermoMechanicalFlowProperties.h.

27{
28 double const Pr =
29 prandtlNumber(fluid.dynamic_viscosity, fluid.specific_heat_capacity,
30 fluid.thermal_conductivity);
31
32 double const velocity = flow_rate / pipe.area();
33 double const Re = reynoldsNumber(velocity, pipe.diameter,
34 fluid.dynamic_viscosity, fluid.density);
35 double const nusselt_number = nusseltNumber(Re, Pr, pipe.diameter, length);
36 return {velocity, nusselt_number};
37}
double nusseltNumber(double const reynolds_number, double const prandtl_number, double const pipe_diameter, double const pipe_length)
Definition Physics.h:29

References ProcessLib::HeatTransportBHE::BHE::Pipe::area(), ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::density, ProcessLib::HeatTransportBHE::BHE::Pipe::diameter, ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::dynamic_viscosity, nusseltNumber(), prandtlNumber(), reynoldsNumber(), ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::specific_heat_capacity, and ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::thermal_conductivity.

Referenced by ProcessLib::HeatTransportBHE::BHE::BHE_1P::updateHeatTransferCoefficients(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::updateHeatTransferCoefficients(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::updateHeatTransferCoefficients(), and ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::updateHeatTransferCoefficients().

◆ check_power_and_flow_rate()

FlowAndTemperature ProcessLib::HeatTransportBHE::BHE::check_power_and_flow_rate ( double flow_rate,
double power,
double const heat_capacity,
double const density,
double const T_out,
double const flow_rate_min,
double const power_min )
inline

Definition at line 24 of file FlowAndTemperatureControl.h.

31{
32 flow_rate = (std::abs(flow_rate) < flow_rate_min) ? 0.0 : flow_rate;
33
34 if (std::abs(power) < power_min)
35 {
36 return {flow_rate, T_out};
37 }
38
39 if (flow_rate == 0)
40 {
42 "BHE power {:0.2f} W with flow rate of 0 m3/s requested, "
43 "calculation not possible!",
44 power);
45 }
46 return {flow_rate, power / flow_rate / heat_capacity / density + T_out};
47};

References OGS_FATAL.

Referenced by ProcessLib::HeatTransportBHE::BHE::ActiveCooling::operator()(), ProcessLib::HeatTransportBHE::BHE::BuildingPower::operator()(), ProcessLib::HeatTransportBHE::BHE::BuildingPowerActiveCooling::operator()(), ProcessLib::HeatTransportBHE::BHE::BuildingPowerHotWater::operator()(), ProcessLib::HeatTransportBHE::BHE::BuildingPowerHotWaterActiveCooling::operator()(), ProcessLib::HeatTransportBHE::BHE::BuildingPowerHotWaterPassiveCooling::operator()(), ProcessLib::HeatTransportBHE::BHE::BuildingPowerPassiveCooling::operator()(), and ProcessLib::HeatTransportBHE::BHE::Power::operator()().

◆ checkedGroutArea()

double ProcessLib::HeatTransportBHE::BHE::checkedGroutArea ( double const borehole_area_fraction,
double const pipe_outside_area,
int const section_index )
inline

Validate that a grout cross-sectional area (borehole area fraction minus pipe outside area) is positive. Returns the area on success, calls OGS_FATAL on failure.

Definition at line 40 of file BHECommon.h.

43{
44 double const grout_area = borehole_area_fraction - pipe_outside_area;
45 if (grout_area <= 0)
46 {
48 "Non-positive grout cross-sectional area at section {:d}. "
49 "Borehole diameter is too small for the pipe dimensions.",
50 section_index);
51 }
52 return grout_area;
53}

References OGS_FATAL.

Referenced by ProcessLib::HeatTransportBHE::BHE::BHE_1P::crossSectionAreas(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::crossSectionAreas(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::crossSectionAreas(), ProcessLib::HeatTransportBHE::BHE::BHE_CXA::crossSectionAreas(), and ProcessLib::HeatTransportBHE::BHE::BHE_CXC::crossSectionAreas().

◆ coaxialPipesAnnulusDiameter()

double ProcessLib::HeatTransportBHE::BHE::coaxialPipesAnnulusDiameter ( Pipe const & inner_pipe,
Pipe const & outer_pipe )
inline

Definition at line 50 of file Pipe.h.

52{
53 return outer_pipe.diameter - inner_pipe.outsideDiameter();
54}

References ProcessLib::HeatTransportBHE::BHE::Pipe::diameter, and ProcessLib::HeatTransportBHE::BHE::Pipe::outsideDiameter().

Referenced by calculateAdvectiveThermalResistance(), and parseBHECoaxialConfig().

◆ computeRgg()

double ProcessLib::HeatTransportBHE::BHE::computeRgg ( double const chi,
double const R_gs,
double const R_ar,
double const R_g )
inline

Inter-grout thermal resistance. Eq. (in Diersch_2011_CG).

Definition at line 24 of file ThermalResistanceHelpers.h.

26{
27 double const R_gg = 2.0 * R_gs * (R_ar - 2.0 * chi * R_g) /
28 (2.0 * R_gs - R_ar + 2.0 * chi * R_g);
29 if (!std::isfinite(R_gg))
30 {
32 "Error!!! Grout Thermal Resistance is an infinite number! The "
33 "simulation will be stopped!");
34 }
35 return R_gg;
36}

References OGS_FATAL.

Referenced by thermalResistancesGroutSoil(), and thermalResistancesGroutSoil2U().

◆ computeRgs()

double ProcessLib::HeatTransportBHE::BHE::computeRgs ( double const chi,
double const R_g )
inline

Grout-soil thermal resistance: R_gs = (1 - chi) * R_g.

Definition at line 17 of file ThermalResistanceHelpers.h.

18{
19 return (1 - chi) * R_g;
20}

Referenced by ProcessLib::HeatTransportBHE::BHE::BHE_1P::calcThermalResistances(), thermalResistancesGroutSoil(), and thermalResistancesGroutSoil2U().

◆ createAdvancedBuildingPower()

FlowAndTemperatureControl ProcessLib::HeatTransportBHE::BHE::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 > > & parameters,
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 )

Definition at line 270 of file CreateFlowAndTemperatureControl.cpp.

282{
283 std::optional<PowerWithCOP> building_heating_curves;
284 std::optional<PowerWithCOP> building_hot_water_curves;
285 std::optional<CoolingVariant> building_cooling_curves;
286
287 bool heating = false;
288 bool hot_water = false;
289 bool cooling = false;
290
291 if (heating_config)
292 {
293 building_heating_curves.emplace(
294 createPowerWithCOPStruct(heating_config, parameters, curves));
295 heating = true;
296 }
297 if (hot_water_config)
298 {
299 building_hot_water_curves.emplace(
300 createPowerWithCOPStruct(hot_water_config, parameters, curves));
301 hot_water = true;
302 }
303 if (cooling_config)
304 {
305 building_cooling_curves.emplace(
306 createCoolingVariant(cooling_config, parameters, curves));
307 cooling = true;
308 }
309 auto key = std::make_tuple(heating, hot_water, cooling);
310
311 auto it = advancedBuildingPower.find(key);
312 if (it == advancedBuildingPower.end())
313 OGS_FATAL(
314 "AdvancedBuildingPower combination is not "
315 "implemented.");
316 auto factory = it->second;
317
318 return factory(building_heating_curves,
319 building_hot_water_curves,
320 building_cooling_curves,
321 flow_rate_param,
322 refrigerant,
323 flow_rate_min,
324 power_min);
325}
CoolingVariant createCoolingVariant(std::optional< BaseLib::ConfigTree > const &cooling_config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
const std::map< std::tuple< bool, bool, bool >, FactoryAdvancedBuildingPower > advancedBuildingPower
PowerWithCOP createPowerWithCOPStruct(std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)

References advancedBuildingPower, createCoolingVariant(), createPowerWithCOPStruct(), and OGS_FATAL.

Referenced by createFlowAndTemperatureControl().

◆ createBHE1PType()

template<typename T_BHE>
T_BHE ProcessLib::HeatTransportBHE::BHE::createBHE1PType ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
std::vector< MeshLib::Node * > const & bhe_nodes )

Definition at line 70 of file CreateBHE1PType.cpp.

77{
78 auto SinglePipeType =
79 parseBHE1PTypeConfig(config, parameters, curves, bhe_nodes);
80 return {std::get<0>(SinglePipeType), std::get<1>(SinglePipeType),
81 std::get<2>(SinglePipeType), std::get<3>(SinglePipeType),
82 std::get<4>(SinglePipeType), std::get<5>(SinglePipeType)};
83}
static std::tuple< BoreholeGeometry, RefrigerantProperties, GroutParameters, FlowAndTemperatureControl, PipeConfiguration1PType, bool > parseBHE1PTypeConfig(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)

References parseBHE1PTypeConfig().

◆ createBHE1PType< BHE_1P >()

template BHE_1P ProcessLib::HeatTransportBHE::BHE::createBHE1PType< BHE_1P > ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
std::vector< MeshLib::Node * > const & bhe_nodes )

◆ createBHECoaxial()

template<typename T_BHE>
T_BHE ProcessLib::HeatTransportBHE::BHE::createBHECoaxial ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
std::vector< MeshLib::Node * > const & bhe_nodes )

Definition at line 99 of file CreateBHECoaxial.cpp.

106{
107 auto coaxial = parseBHECoaxialConfig(config, parameters, curves, bhe_nodes);
108 return {std::get<0>(coaxial), std::get<1>(coaxial), std::get<2>(coaxial),
109 std::get<3>(coaxial), std::get<4>(coaxial), std::get<5>(coaxial)};
110}
static std::tuple< BoreholeGeometry, RefrigerantProperties, GroutParameters, FlowAndTemperatureControl, PipeConfigurationCoaxial, bool > parseBHECoaxialConfig(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)

References parseBHECoaxialConfig().

◆ createBHECoaxial< BHE_CXA >()

template BHE_CXA ProcessLib::HeatTransportBHE::BHE::createBHECoaxial< BHE_CXA > ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
std::vector< MeshLib::Node * > const & bhe_nodes )

◆ createBHECoaxial< BHE_CXC >()

template BHE_CXC ProcessLib::HeatTransportBHE::BHE::createBHECoaxial< BHE_CXC > ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
std::vector< MeshLib::Node * > const & bhe_nodes )

◆ createBHEUType()

template<typename T_BHE>
T_BHE ProcessLib::HeatTransportBHE::BHE::createBHEUType ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
std::vector< MeshLib::Node * > const & bhe_nodes )

Definition at line 122 of file CreateBHEUType.cpp.

129{
130 auto UType = parseBHEUTypeConfig(config, parameters, curves, bhe_nodes);
131 return {std::get<0>(UType), std::get<1>(UType), std::get<2>(UType),
132 std::get<3>(UType), std::get<4>(UType), std::get<5>(UType)};
133}
static std::tuple< BoreholeGeometry, RefrigerantProperties, GroutParameters, FlowAndTemperatureControl, PipeConfigurationUType, bool > parseBHEUTypeConfig(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::vector< MeshLib::Node * > const &bhe_nodes)

References parseBHEUTypeConfig().

◆ createBHEUType< BHE_1U >()

template BHE_1U ProcessLib::HeatTransportBHE::BHE::createBHEUType< BHE_1U > ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
std::vector< MeshLib::Node * > const & bhe_nodes )

◆ createBHEUType< BHE_2U >()

template BHE_2U ProcessLib::HeatTransportBHE::BHE::createBHEUType< BHE_2U > ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
std::vector< MeshLib::Node * > const & bhe_nodes )

◆ createBoreholeGeometry()

BoreholeGeometry ProcessLib::HeatTransportBHE::BHE::createBoreholeGeometry ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::vector< MeshLib::Node * > const & bhe_nodes )
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__borehole__length
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__borehole__diameter

Definition at line 64 of file BoreholeGeometry.cpp.

68{
69 const auto borehole_length =
71 config.getConfigParameter<double>("length");
72 if (borehole_length <= 0)
73 {
74 OGS_FATAL("Borehole length must be positive, got {:g}.",
75 borehole_length);
76 }
77
78 auto const diameter_parameter_or_value =
80 config.getConfigParameter<std::string>("diameter");
81 auto const& diameter_parameter =
83 diameter_parameter_or_value, parameters, "borehole_diameter",
84 "borehole_diameter");
85
86 return buildBoreholeGeometry(borehole_length, diameter_parameter,
87 bhe_nodes);
88}
Parameter< double > & getNamedOrCreateInlineParameter(std::string const &parameter_or_value, std::vector< std::unique_ptr< ParameterBase > > &parameters, std::string const &property_name, std::string const &inline_suffix)
static BoreholeGeometry buildBoreholeGeometry(double borehole_length, ParameterLib::Parameter< double > const &diameter_parameter, std::vector< MeshLib::Node * > const &bhe_nodes)

References buildBoreholeGeometry(), BaseLib::ConfigTree::getConfigParameter(), ParameterLib::getNamedOrCreateInlineParameter(), and OGS_FATAL.

Referenced by parseBHE1PTypeConfig(), parseBHECoaxialConfig(), and parseBHEUTypeConfig().

◆ createCooling()

FlowAndTemperatureControl ProcessLib::HeatTransportBHE::BHE::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 )

Definition at line 171 of file CreateFlowAndTemperatureControl.cpp.

179{
180 if (std::holds_alternative<PowerWithCOP>(*cooling))
181 {
182 return FlowAndTemperatureControl{std::in_place_type<ActiveCooling>,
183 std::get<PowerWithCOP>(*cooling),
184 flow_rate_param,
185 refrigerant.specific_heat_capacity,
186 refrigerant.density,
187 flow_rate_min,
188 power_min};
189 }
190
192 std::in_place_type<Power>,
193 std::get<std::reference_wrapper<ParameterLib::Parameter<double>>>(
194 *cooling)
195 .get(),
196 flow_rate_param,
197 refrigerant.specific_heat_capacity,
198 refrigerant.density,
199 flow_rate_min,
200 power_min};
201}

References ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::density, and ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::specific_heat_capacity.

◆ createCoolingVariant()

CoolingVariant ProcessLib::HeatTransportBHE::BHE::createCoolingVariant ( std::optional< BaseLib::ConfigTree > const & cooling_config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves )

◆ createFlowAndTemperatureControl()

FlowAndTemperatureControl ProcessLib::HeatTransportBHE::BHE::createFlowAndTemperatureControl ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
RefrigerantProperties const & refrigerant )
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__type
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__flow_rate_min
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__power_min
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__InflowTemperature__temperature
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__InflowTemperature__flow_rate
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__Power__power
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__Power__flow_rate
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__BuildingPower__power
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__BuildingPower__cop_curve
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__BuildingPower__flow_rate
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__AdvancedBuildingPower__heating
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__AdvancedBuildingPower__hot_water
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__AdvancedBuildingPower__cooling
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__AdvancedBuildingPower__flow_rate

Definition at line 326 of file CreateFlowAndTemperatureControl.cpp.

333{
335 auto const type = config.getConfigParameter<std::string>("type");
336
337 auto const flow_rate_min =
339 config.getConfigParameter<double>("flow_rate_min", 1e-6);
341 auto const power_min = config.getConfigParameter<double>("power_min", 1e-3);
342 if (type == "InflowTemperature")
343 {
344 auto const raw_temperature =
346 config.getConfigParameter<std::string>("temperature");
347
348 auto const& temperature_param =
350 raw_temperature, parameters, "temperature", "inline");
351
352 auto const raw_flow_rate =
354 config.getConfigParameter<std::string>("flow_rate");
355
356 auto const& flow_rate_param =
358 raw_flow_rate, parameters, "flow_rate", "inline");
359
360 return InflowTemperature{temperature_param, flow_rate_param,
361 flow_rate_min};
362 }
363 if (type == "Power")
364 {
366 auto const raw_power = config.getConfigParameter<std::string>("power");
367
368 auto const& power_param = ParameterLib::getNamedOrCreateInlineParameter(
369 raw_power, parameters, "power", "inline");
370
371 auto const raw_flow_rate =
373 config.getConfigParameter<std::string>("flow_rate");
374
375 auto const& flow_rate_param =
377 raw_flow_rate, parameters, "flow_rate", "inline");
378
379 return Power{power_param,
380 flow_rate_param,
381 refrigerant.specific_heat_capacity,
382 refrigerant.density,
383 flow_rate_min,
384 power_min};
385 }
386
387 if (type == "BuildingPower")
388 {
390 auto const raw_power = config.getConfigParameter<std::string>("power");
391
392 auto const& power_param = ParameterLib::getNamedOrCreateInlineParameter(
393 raw_power, parameters, "power", "inline");
394
395 auto const& cop_curve = *BaseLib::getOrError(
396 curves,
398 config.getConfigParameter<std::string>("cop_curve"),
399 "Required cop curve not found.");
400
401 PowerWithCOP const building_power{power_param, cop_curve};
402
403 auto const raw_flow_rate =
405 config.getConfigParameter<std::string>("flow_rate");
406
407 auto const& flow_rate_param =
409 raw_flow_rate, parameters, "flow_rate", "inline");
410
411 return BuildingPower{building_power,
412 flow_rate_param,
413 refrigerant.specific_heat_capacity,
414 refrigerant.density,
415 flow_rate_min,
416 power_min};
417 }
418
419 if (type == "AdvancedBuildingPower")
420 {
421 // add a heating, hot water and cooling config as optional to handle
422 auto const& heating_config =
424 config.getConfigSubtreeOptional(
425 "heating"); // Optional, take care if it is not present
426
427 auto const& hot_water_config =
429 config.getConfigSubtreeOptional(
430 "hot_water"); // Optional, take care if it is not present
431
432 auto const& cooling_config =
434 config.getConfigSubtreeOptional(
435 "cooling"); // Optional, take care if it is not present
436
437 auto const raw_flow_rate =
439 config.getConfigParameter<std::string>("flow_rate");
440
441 auto const& flow_rate_param =
443 raw_flow_rate, parameters, "flow_rate", "inline");
444
446 heating_config, hot_water_config, cooling_config, parameters,
447 curves, flow_rate_param, refrigerant, flow_rate_min, power_min);
448 }
449 OGS_FATAL(
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.",
454 type);
455}
OGS_NO_DANGLING Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition Algorithm.h:111
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 > > &parameters, 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)

References createAdvancedBuildingPower(), ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::density, BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigSubtreeOptional(), ParameterLib::getNamedOrCreateInlineParameter(), BaseLib::getOrError(), OGS_FATAL, and ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::specific_heat_capacity.

Referenced by parseBHE1PTypeConfig(), parseBHECoaxialConfig(), and parseBHEUTypeConfig().

◆ createGroutParameters()

GroutParameters ProcessLib::HeatTransportBHE::BHE::createGroutParameters ( BaseLib::ConfigTree const & config)
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout__density
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout__porosity
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout__specific_heat_capacity
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout__thermal_conductivity

Definition at line 14 of file GroutParameters.cpp.

15{
16 const auto grout_density =
18 config.getConfigParameter<double>("density");
19 const auto grout_porosity =
21 config.getConfigParameter<double>("porosity");
22 const auto grout_heat_capacity =
24 config.getConfigParameter<double>("specific_heat_capacity");
25 const auto grout_thermal_conductivity =
27 config.getConfigParameter<double>("thermal_conductivity");
28 return {grout_density, grout_porosity, grout_heat_capacity,
29 grout_thermal_conductivity};
30}

References BaseLib::ConfigTree::getConfigParameter().

Referenced by parseBHE1PTypeConfig(), parseBHECoaxialConfig(), and parseBHEUTypeConfig().

◆ createHeatingCooling()

FlowAndTemperatureControl ProcessLib::HeatTransportBHE::BHE::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 )

Definition at line 101 of file CreateFlowAndTemperatureControl.cpp.

109{
110 if (std::holds_alternative<PowerWithCOP>(*cooling))
111 {
113 std::in_place_type<BuildingPowerActiveCooling>,
114 *heating,
115 std::get<PowerWithCOP>(*cooling),
116 flow_rate_param,
117 refrigerant.specific_heat_capacity,
118 refrigerant.density,
119 flow_rate_min,
120 power_min};
121 }
122
124 std::in_place_type<BuildingPowerPassiveCooling>,
125 *heating,
126 std::get<std::reference_wrapper<ParameterLib::Parameter<double>>>(
127 *cooling)
128 .get(),
129 flow_rate_param,
130 refrigerant.specific_heat_capacity,
131 refrigerant.density,
132 flow_rate_min,
133 power_min};
134}

References ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::density, and ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::specific_heat_capacity.

◆ createHeatingHotWaterCooling()

FlowAndTemperatureControl ProcessLib::HeatTransportBHE::BHE::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 )

Definition at line 64 of file CreateFlowAndTemperatureControl.cpp.

72{
73 if (std::holds_alternative<PowerWithCOP>(*cooling))
74 {
76 std::in_place_type<BuildingPowerHotWaterActiveCooling>,
77 *heating,
78 *hot_water,
79 std::get<PowerWithCOP>(*cooling),
80 flow_rate_param,
81 refrigerant.specific_heat_capacity,
82 refrigerant.density,
83 flow_rate_min,
84 power_min};
85 }
86
88 std::in_place_type<BuildingPowerHotWaterPassiveCooling>,
89 *heating,
90 *hot_water,
91 std::get<std::reference_wrapper<ParameterLib::Parameter<double>>>(
92 *cooling)
93 .get(),
94 flow_rate_param,
95 refrigerant.specific_heat_capacity,
96 refrigerant.density,
97 flow_rate_min,
98 power_min};
99}

References ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::density, and ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::specific_heat_capacity.

◆ createHotWaterCooling()

FlowAndTemperatureControl ProcessLib::HeatTransportBHE::BHE::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 )

Definition at line 136 of file CreateFlowAndTemperatureControl.cpp.

144{
145 if (std::holds_alternative<PowerWithCOP>(*cooling))
146 {
148 std::in_place_type<BuildingPowerActiveCooling>,
149 *hot_water,
150 std::get<PowerWithCOP>(*cooling),
151 flow_rate_param,
152 refrigerant.specific_heat_capacity,
153 refrigerant.density,
154 flow_rate_min,
155 power_min};
156 }
157
159 std::in_place_type<BuildingPowerPassiveCooling>,
160 *hot_water,
161 std::get<std::reference_wrapper<ParameterLib::Parameter<double>>>(
162 *cooling)
163 .get(),
164 flow_rate_param,
165 refrigerant.specific_heat_capacity,
166 refrigerant.density,
167 flow_rate_min,
168 power_min};
169}

References ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::density, and ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::specific_heat_capacity.

◆ createPipe()

Pipe ProcessLib::HeatTransportBHE::BHE::createPipe ( BaseLib::ConfigTree const & config)
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inlet__diameter
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inlet__wall_thickness
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inlet__wall_thermal_conductivity

Definition at line 15 of file Pipe.cpp.

16{
17 const auto diameter =
19 config.getConfigParameter<double>("diameter");
20 const auto wall_thickness =
22 config.getConfigParameter<double>("wall_thickness");
23 const auto wall_thermal_conductivity =
25 config.getConfigParameter<double>("wall_thermal_conductivity");
26
27 if (diameter <= 0)
28 {
29 OGS_FATAL("Pipe diameter must be positive, got {:g}.", diameter);
30 }
31 if (wall_thickness < 0)
32 {
33 OGS_FATAL("Pipe wall_thickness must be non-negative, got {:g}.",
34 wall_thickness);
35 }
36 if (wall_thermal_conductivity <= 0)
37 {
38 OGS_FATAL("Pipe wall_thermal_conductivity must be positive, got {:g}.",
39 wall_thermal_conductivity);
40 }
41
42 return {diameter, wall_thickness, wall_thermal_conductivity};
43}

References BaseLib::ConfigTree::getConfigParameter(), and OGS_FATAL.

Referenced by parseBHE1PTypeConfig(), parseBHECoaxialConfig(), and parseBHEUTypeConfig().

◆ createPowerWithCOPStruct()

PowerWithCOP ProcessLib::HeatTransportBHE::BHE::createPowerWithCOPStruct ( std::optional< BaseLib::ConfigTree > const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves )
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__AdvancedBuildingPower__hot_water__power
Input File Parameter
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__AdvancedBuildingPower__heating__power
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__AdvancedBuildingPower__cooling__cop_curve
Input File Parameter
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__AdvancedBuildingPower__hot_water__cop_curve
Input File Parameter
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control__AdvancedBuildingPower__heating__cop_curve

Definition at line 18 of file CreateFlowAndTemperatureControl.cpp.

24{
27 auto const raw_power = config->getConfigParameter<std::string>("power");
28
29 auto const& power_param = ParameterLib::getNamedOrCreateInlineParameter(
30 raw_power, parameters, "power", "inline");
31
32 auto const& cop_curve = *BaseLib::getOrError(
33 curves,
37 config->getConfigParameter<std::string>("cop_curve"),
38 "Required cop curve not found.");
39
40 return PowerWithCOP{power_param, cop_curve};
41}

References ParameterLib::getNamedOrCreateInlineParameter(), and BaseLib::getOrError().

Referenced by createAdvancedBuildingPower(), and createCoolingVariant().

◆ createRefrigerantProperties()

RefrigerantProperties ProcessLib::HeatTransportBHE::BHE::createRefrigerantProperties ( BaseLib::ConfigTree const & config)
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__density
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__viscosity
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__specific_heat_capacity
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__thermal_conductivity
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant__reference_temperature

Definition at line 14 of file RefrigerantProperties.cpp.

16{
17 auto const refrigerant_density =
19 config.getConfigParameter<double>("density");
20 auto const refrigerant_viscosity =
22 config.getConfigParameter<double>("viscosity");
23 auto const refrigerant_heat_capacity =
25 config.getConfigParameter<double>("specific_heat_capacity");
26 auto const refrigerant_thermal_conductivity =
28 config.getConfigParameter<double>("thermal_conductivity");
29 auto const refrigerant_reference_temperature =
31 config.getConfigParameter<double>("reference_temperature");
32 return {refrigerant_viscosity, refrigerant_density,
33 refrigerant_thermal_conductivity, refrigerant_heat_capacity,
34 refrigerant_reference_temperature};
35}

References BaseLib::ConfigTree::getConfigParameter().

Referenced by parseBHE1PTypeConfig(), parseBHECoaxialConfig(), and parseBHEUTypeConfig().

◆ cumulativeDistances()

std::vector< double > ProcessLib::HeatTransportBHE::BHE::cumulativeDistances ( std::vector< MeshLib::Node * > const & sorted_nodes)
inline

Compute cumulative arc-length distances from the first node.

Definition at line 21 of file BHESectionUtils.h.

23{
24 std::vector<double> distances;
25 distances.reserve(sorted_nodes.size());
26 distances.push_back(0.0);
27
28 double cumulative_distance = 0.0;
29 for (std::size_t i = 1; i < sorted_nodes.size(); ++i)
30 {
31 cumulative_distance +=
32 std::sqrt(MathLib::sqrDist(*sorted_nodes[i - 1], *sorted_nodes[i]));
33 distances.push_back(cumulative_distance);
34 }
35
36 return distances;
37}
double sqrDist(MathLib::Point3d const &p0, MathLib::Point3d const &p1)
Definition Point3d.cpp:19

References MathLib::sqrDist().

Referenced by buildBoreholeGeometry().

◆ groupSections()

std::pair< std::vector< double >, std::vector< double > > ProcessLib::HeatTransportBHE::BHE::groupSections ( std::vector< double > const & distances,
std::vector< double > const & diameters )
inline

Group consecutive sections with the same diameter value into one section. Returns {section_boundaries, section_diameters}. Uses absolute tolerance for floating-point comparison.

Definition at line 42 of file BHESectionUtils.h.

44{
45 if (distances.empty() || diameters.empty() ||
46 distances.size() != diameters.size())
47 {
49 "Invalid sampled diameter profile. Distances and diameters "
50 "must be non-empty and have the same size.");
51 }
52
53 if (std::any_of(diameters.begin(), diameters.end(),
54 [](double d) { return d <= 0.0; }))
55 {
56 OGS_FATAL("All borehole diameters must be positive.");
57 }
58
59 std::vector<double> section_boundaries;
60 std::vector<double> section_diameters;
61 section_boundaries.push_back(distances[0]);
62 section_diameters.push_back(diameters[0]);
63
64 for (std::size_t i = 1; i < diameters.size(); ++i)
65 {
66 constexpr double grouping_tolerance = 1e-12;
67 if (std::abs(diameters[i] - section_diameters.back()) >
68 grouping_tolerance)
69 {
70 section_boundaries.push_back(distances[i]);
71 section_diameters.push_back(diameters[i]);
72 }
73 }
74
75 return {section_boundaries, section_diameters};
76}

References OGS_FATAL.

Referenced by buildBoreholeGeometry().

◆ nusseltNumber()

double ProcessLib::HeatTransportBHE::BHE::nusseltNumber ( double const reynolds_number,
double const prandtl_number,
double const pipe_diameter,
double const pipe_length )
inline

Definition at line 29 of file Physics.h.

33{
34 if (reynolds_number < 2300.0)
35 {
36 return 4.364;
37 }
38 if (reynolds_number < 10000.0)
39 {
40 double const gamma = (reynolds_number - 2300) / (10000 - 2300);
41
42 return (1.0 - gamma) * 4.364 +
43 gamma *
44 ((0.0308 / 8.0 * 1.0e4 * prandtl_number) /
45 (1.0 + 12.7 * std::sqrt(0.0308 / 8.0) *
46 (std::pow(prandtl_number, 2.0 / 3.0) - 1.0)) *
47 (1.0 + std::pow(pipe_diameter / pipe_length, 2.0 / 3.0)));
48 }
49
50 double const xi = std::pow(1.8 * std::log10(reynolds_number) - 1.5, -2.0);
51 return (xi / 8.0 * reynolds_number * prandtl_number) /
52 (1.0 + 12.7 * std::sqrt(xi / 8.0) *
53 (std::pow(prandtl_number, 2.0 / 3.0) - 1.0)) *
54 (1.0 + std::pow(pipe_diameter / pipe_length, 2.0 / 3.0));
55}

Referenced by calculateThermoMechanicalFlowPropertiesPipe().

◆ nusseltNumberAnnulus()

double ProcessLib::HeatTransportBHE::BHE::nusseltNumberAnnulus ( double const reynolds_number,
double const prandtl_number,
double const diameter_ratio,
double const pipe_aspect_ratio )
inline

Definition at line 58 of file Physics.h.

62{
63 if (reynolds_number < 2300.0)
64 {
65 return 3.66 + (4.0 - 0.102 / (diameter_ratio + 0.02)) *
66 std::pow(diameter_ratio, 0.04);
67 }
68 if (reynolds_number < 10000.0)
69 {
70 double const gamma = (reynolds_number - 2300) / (10000 - 2300);
71
72 return (1.0 - gamma) *
73 (3.66 + (4.0 - 0.102 / (diameter_ratio + 0.02))) *
74 std::pow(diameter_ratio, 0.04) +
75 gamma *
76 ((0.0308 / 8.0 * 1.0e4 * prandtl_number) /
77 (1.0 + 12.7 * std::sqrt(0.0308 / 8.0) *
78 (std::pow(prandtl_number, 2.0 / 3.0) - 1.0)) *
79 (1.0 + std::pow(pipe_aspect_ratio, 2.0 / 3.0)) *
80 ((0.86 * std::pow(diameter_ratio, 0.84) + 1.0 -
81 0.14 * std::pow(diameter_ratio, 0.6)) /
82 (1.0 + diameter_ratio)));
83 }
84 double const xi = std::pow(1.8 * std::log10(reynolds_number) - 1.5, -2.0);
85 return (xi / 8.0 * reynolds_number * prandtl_number) /
86 (1.0 + 12.7 * std::sqrt(xi / 8.0) *
87 (std::pow(prandtl_number, 2.0 / 3.0) - 1.0)) *
88 (1.0 + std::pow(pipe_aspect_ratio, 2.0 / 3.0)) *
89 ((0.86 * std::pow(diameter_ratio, 0.84) + 1.0 -
90 0.14 * std::pow(diameter_ratio, 0.6)) /
91 (1.0 + diameter_ratio));
92}

Referenced by calculateThermoMechanicalFlowPropertiesAnnulus().

◆ parseBHE1PTypeConfig()

std::tuple< BoreholeGeometry, RefrigerantProperties, GroutParameters, FlowAndTemperatureControl, PipeConfiguration1PType, bool > ProcessLib::HeatTransportBHE::BHE::parseBHE1PTypeConfig ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
std::vector< MeshLib::Node * > const & bhe_nodes )
static
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__use_bhe_pipe_network
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__borehole
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inlet
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__longitudinal_dispersion_length
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control

Definition at line 16 of file CreateBHE1PType.cpp.

23{
24 // if the BHE is using python boundary condition
25 auto const bhe_if_use_python_bc_conf =
27 config.getConfigParameter<bool>("use_bhe_pipe_network", false);
28
29 if (bhe_if_use_python_bc_conf)
30 {
31 DBUG("BHE 1P using python boundary conditions.");
32 }
33
34 auto const borehole_geometry =
36 createBoreholeGeometry(config.getConfigSubtree("borehole"), parameters,
37 bhe_nodes);
38
40 auto const& pipes_config = config.getConfigSubtree("pipes");
42 Pipe const inlet_pipe = createPipe(pipes_config.getConfigSubtree("inlet"));
43
44 const auto pipe_longitudinal_dispersion_length =
46 pipes_config.getConfigParameter<double>(
47 "longitudinal_dispersion_length");
48 PipeConfiguration1PType const pipes{inlet_pipe,
49 pipe_longitudinal_dispersion_length};
50
52 auto const grout = createGroutParameters(config.getConfigSubtree("grout"));
53
54 auto const refrigerant =
56 createRefrigerantProperties(config.getConfigSubtree("refrigerant"));
57
58 auto const flowAndTemperatureControl = createFlowAndTemperatureControl(
60 config.getConfigSubtree("flow_and_temperature_control"),
61 parameters,
62 curves,
63 refrigerant);
64
65 return {borehole_geometry, refrigerant, grout,
66 flowAndTemperatureControl, pipes, bhe_if_use_python_bc_conf};
67}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
RefrigerantProperties createRefrigerantProperties(BaseLib::ConfigTree const &config)
BoreholeGeometry createBoreholeGeometry(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::vector< MeshLib::Node * > const &bhe_nodes)
Pipe createPipe(BaseLib::ConfigTree const &config)
Definition Pipe.cpp:15
FlowAndTemperatureControl createFlowAndTemperatureControl(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, RefrigerantProperties const &refrigerant)
GroutParameters createGroutParameters(BaseLib::ConfigTree const &config)

References createBoreholeGeometry(), createFlowAndTemperatureControl(), createGroutParameters(), createPipe(), createRefrigerantProperties(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), and BaseLib::ConfigTree::getConfigSubtree().

Referenced by createBHE1PType().

◆ parseBHECoaxialConfig()

std::tuple< BoreholeGeometry, RefrigerantProperties, GroutParameters, FlowAndTemperatureControl, PipeConfigurationCoaxial, bool > ProcessLib::HeatTransportBHE::BHE::parseBHECoaxialConfig ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
std::vector< MeshLib::Node * > const & bhe_nodes )
static
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__use_bhe_pipe_network
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__borehole
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__outer
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inner
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__longitudinal_dispersion_length
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control

Definition at line 19 of file CreateBHECoaxial.cpp.

26{
27 // if the BHE is using python boundary condition
28 auto const bhe_if_use_python_bc_conf =
30 config.getConfigParameter<bool>("use_bhe_pipe_network", false);
31 DBUG("If using python boundary condition : {:s}",
32 (bhe_if_use_python_bc_conf) ? "true" : "false");
33
34 auto const borehole_geometry =
36 createBoreholeGeometry(config.getConfigSubtree("borehole"), parameters,
37 bhe_nodes);
38
40 auto const& pipes_config = config.getConfigSubtree("pipes");
42 Pipe const outer_pipe = createPipe(pipes_config.getConfigSubtree("outer"));
43 Pipe const inner_pipe =
45 createPipe(pipes_config.getConfigSubtree("inner"));
46 const auto pipe_longitudinal_dispersion_length =
48 pipes_config.getConfigParameter<double>(
49 "longitudinal_dispersion_length");
50 PipeConfigurationCoaxial const pipes{inner_pipe, outer_pipe,
51 pipe_longitudinal_dispersion_length};
52
53 double const annulus_diameter =
54 coaxialPipesAnnulusDiameter(pipes.inner_pipe, pipes.outer_pipe);
55 if (annulus_diameter <= 0)
56 {
58 "Invalid coaxial pipe geometry: outer pipe inner diameter ({:g}) "
59 "must be greater than inner pipe outside diameter ({:g}).",
60 pipes.outer_pipe.diameter, pipes.inner_pipe.outsideDiameter());
61 }
62
63 double const outer_pipe_outside_diameter =
64 pipes.outer_pipe.outsideDiameter();
65 for (int section_index = 0;
66 section_index < borehole_geometry.sections.getNumberOfSections();
67 ++section_index)
68 {
69 double const D =
70 borehole_geometry.sections.diameterAtSection(section_index);
71 if (D <= outer_pipe_outside_diameter)
72 {
74 "Invalid coaxial geometry at section {:d}: borehole diameter "
75 "{:g} must be greater than outer pipe outside diameter {:g}.",
76 section_index, D, outer_pipe_outside_diameter);
77 }
78 }
79
81 auto const grout = createGroutParameters(config.getConfigSubtree("grout"));
82
83 auto const refrigerant =
85 createRefrigerantProperties(config.getConfigSubtree("refrigerant"));
86
87 auto const flowAndTemperatureControl = createFlowAndTemperatureControl(
89 config.getConfigSubtree("flow_and_temperature_control"),
90 parameters,
91 curves,
92 refrigerant);
93
94 return {borehole_geometry, refrigerant, grout,
95 flowAndTemperatureControl, pipes, bhe_if_use_python_bc_conf};
96}

References coaxialPipesAnnulusDiameter(), createBoreholeGeometry(), createFlowAndTemperatureControl(), createGroutParameters(), createPipe(), createRefrigerantProperties(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigSubtree(), and OGS_FATAL.

Referenced by createBHECoaxial().

◆ parseBHEUTypeConfig()

std::tuple< BoreholeGeometry, RefrigerantProperties, GroutParameters, FlowAndTemperatureControl, PipeConfigurationUType, bool > ProcessLib::HeatTransportBHE::BHE::parseBHEUTypeConfig ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const & curves,
std::vector< MeshLib::Node * > const & bhe_nodes )
static
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__use_bhe_pipe_network
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__borehole
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__inlet
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__outlet
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__distance_between_pipes
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__pipes__longitudinal_dispersion_length
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__grout
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__refrigerant
Input File Parameter
prj__processes__process__HEAT_TRANSPORT_BHE__borehole_heat_exchangers__borehole_heat_exchanger__flow_and_temperature_control

Definition at line 22 of file CreateBHEUType.cpp.

29{
30 // if the BHE is using python boundary condition
31 auto const bhe_if_use_python_bc_conf =
33 config.getConfigParameter<bool>("use_bhe_pipe_network", false);
34 DBUG("If using python boundary condition : {:s}",
35 (bhe_if_use_python_bc_conf) ? "true" : "false");
36
37 auto const borehole_geometry =
39 createBoreholeGeometry(config.getConfigSubtree("borehole"), parameters,
40 bhe_nodes);
41
43 auto const& pipes_config = config.getConfigSubtree("pipes");
45 Pipe const inlet_pipe = createPipe(pipes_config.getConfigSubtree("inlet"));
46 Pipe const outlet_pipe =
48 createPipe(pipes_config.getConfigSubtree("outlet"));
49 const auto pipe_distance =
51 pipes_config.getConfigParameter<double>("distance_between_pipes");
52 const auto pipe_longitudinal_dispersion_length =
54 pipes_config.getConfigParameter<double>(
55 "longitudinal_dispersion_length");
56 PipeConfigurationUType const pipes{inlet_pipe, outlet_pipe, pipe_distance,
57 pipe_longitudinal_dispersion_length};
58
59 if (pipe_distance <= 0)
60 {
62 "distance_between_pipes must be positive for U-type BHEs, got "
63 "{:g}.",
64 pipe_distance);
65 }
66
67 double const d0 =
68 std::max(pipes.inlet.outsideDiameter(), pipes.outlet.outsideDiameter());
69 if (pipe_distance < d0)
70 {
72 "distance_between_pipes ({:g}) must be >= pipe outside diameter "
73 "({:g}) for valid U-type thermal resistance formulas.",
74 pipe_distance, d0);
75 }
76
77 for (int section_index = 0;
78 section_index < borehole_geometry.sections.getNumberOfSections();
79 ++section_index)
80 {
81 double const D =
82 borehole_geometry.sections.diameterAtSection(section_index);
83 if (D <= 2.0 * d0)
84 {
86 "Invalid U-type geometry at section {:d}: borehole diameter "
87 "{:g} must be greater than 2*pipe outside diameter {:g}.",
88 section_index, D, 2.0 * d0);
89 }
90
91 double const acosh_argument =
92 (D * D + d0 * d0 - pipe_distance * pipe_distance) / (2.0 * D * d0);
93 if (!std::isfinite(acosh_argument) || acosh_argument < 1.0)
94 {
96 "Invalid U-type geometry at section {:d}: acosh argument "
97 "for grout resistance is {:g}, must be >= 1. "
98 "(D={:g}, d0={:g}, distance_between_pipes={:g})",
99 section_index, acosh_argument, D, d0, pipe_distance);
100 }
101 }
102
104 auto const grout = createGroutParameters(config.getConfigSubtree("grout"));
105
106 auto const refrigerant =
108 createRefrigerantProperties(config.getConfigSubtree("refrigerant"));
109
110 auto const flowAndTemperatureControl = createFlowAndTemperatureControl(
112 config.getConfigSubtree("flow_and_temperature_control"),
113 parameters,
114 curves,
115 refrigerant);
116
117 return {borehole_geometry, refrigerant, grout,
118 flowAndTemperatureControl, pipes, bhe_if_use_python_bc_conf};
119}

References createBoreholeGeometry(), createFlowAndTemperatureControl(), createGroutParameters(), createPipe(), createRefrigerantProperties(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigSubtree(), and OGS_FATAL.

Referenced by createBHEUType().

◆ prandtlNumber()

double ProcessLib::HeatTransportBHE::BHE::prandtlNumber ( double const & viscosity,
double const & heat_capacity,
double const & heat_conductivity )
inline

Definition at line 14 of file Physics.h.

17{
18 return viscosity * heat_capacity / heat_conductivity;
19}

Referenced by calculateThermoMechanicalFlowPropertiesAnnulus(), and calculateThermoMechanicalFlowPropertiesPipe().

◆ reynoldsNumber()

double ProcessLib::HeatTransportBHE::BHE::reynoldsNumber ( double const velocity_norm,
double const pipe_diameter,
double const viscosity,
double const density )
inline

Definition at line 21 of file Physics.h.

25{
26 return velocity_norm * pipe_diameter / (viscosity / density);
27}

Referenced by calculateThermoMechanicalFlowPropertiesAnnulus(), and calculateThermoMechanicalFlowPropertiesPipe().

◆ thermalResistancesGroutSoil()

std::array< double, 3 > ProcessLib::HeatTransportBHE::BHE::thermalResistancesGroutSoil ( double const chi,
double const R_ar,
double const R_g )

Thermal resistances due to grout-soil exchange.

Check if constraints regarding negative thermal resistances are violated apply correction procedure. Section (1.5.5) in FEFLOW White Papers Vol V.

Definition at line 101 of file BHE_1U.cpp.

104{
105 double R_gs = computeRgs(chi, R_g);
106 double R_gg = computeRgg(chi, R_gs, R_ar, R_g);
107 double new_chi = chi;
108
109 auto constraint = [&]()
110 { return 1.0 / ((1.0 / R_gg) + (1.0 / (2.0 * R_gs))); };
111
112 std::array<double, 3> const multiplier{chi * 2.0 / 3.0, chi * 1.0 / 3.0,
113 0.0};
114 for (double m_chi : multiplier)
115 {
116 if (constraint() >= 0)
117 {
118 break;
119 }
120 DBUG(
121 "Warning! Correction procedure was applied due to negative thermal "
122 "resistance! Chi = {:f}.\n",
123 m_chi);
124
125 R_gs = computeRgs(m_chi, R_g);
126 R_gg = computeRgg(m_chi, R_gs, R_ar, R_g);
127 new_chi = m_chi;
128 }
129
130 return {new_chi, R_gg, R_gs};
131}
double computeRgg(double const chi, double const R_gs, double const R_ar, double const R_g)
double computeRgs(double const chi, double const R_g)
Grout-soil thermal resistance: R_gs = (1 - chi) * R_g.

References computeRgg(), computeRgs(), and DBUG().

Referenced by ProcessLib::HeatTransportBHE::BHE::BHE_1U::calcThermalResistances().

◆ thermalResistancesGroutSoil2U()

std::array< double, 4 > ProcessLib::HeatTransportBHE::BHE::thermalResistancesGroutSoil2U ( double const chi,
double const R_ar_1,
double const R_ar_2,
double const R_g )

Thermal resistances due to grout-soil exchange.

Check if constraints regarding negative thermal resistances are violated apply correction procedure. Section (1.5.5) in FEFLOW White Papers Vol V.

Definition at line 113 of file BHE_2U.cpp.

117{
118 double R_gs = computeRgs(chi, R_g);
119 double R_gg_1 = computeRgg(chi, R_gs, R_ar_1, R_g);
120 double R_gg_2 = computeRgg(chi, R_gs, R_ar_2, R_g);
121 double chi_new = chi;
122
123 auto constraint = [&]()
124 { return 1.0 / ((1.0 / R_gg_1) + (1.0 / (2.0 * R_gs))); };
125
126 std::array<double, 3> const multiplier{chi * 2.0 / 3.0, chi * 1.0 / 3.0,
127 0.0};
128 for (double m_chi : multiplier)
129 {
130 if (constraint() >= 0)
131 {
132 break;
133 }
134 DBUG(
135 "Warning! Correction procedure was applied due to negative thermal "
136 "resistance! Chi = {:f}.\n",
137 m_chi);
138 R_gs = computeRgs(m_chi, R_g);
139 R_gg_1 = computeRgg(m_chi, R_gs, R_ar_1, R_g);
140 R_gg_2 = computeRgg(m_chi, R_gs, R_ar_2, R_g);
141 chi_new = m_chi;
142 }
143
144 return {chi_new, R_gg_1, R_gg_2, R_gs};
145}

References computeRgg(), computeRgs(), and DBUG().

Referenced by ProcessLib::HeatTransportBHE::BHE::BHE_2U::calcThermalResistances().

Variable Documentation

◆ advancedBuildingPower

const std::map<std::tuple<bool, bool, bool>, FactoryAdvancedBuildingPower> ProcessLib::HeatTransportBHE::BHE::advancedBuildingPower

Definition at line 215 of file CreateFlowAndTemperatureControl.cpp.

215 {
216 {{true, true, true}, &createHeatingHotWaterCooling},
217 {{true, true, false},
218 [](std::optional<PowerWithCOP> const& heating,
219 std::optional<PowerWithCOP> const& hot_water,
220 std::optional<CoolingVariant> const& /*cooling*/,
221 auto const& flow_rate_param, auto const& refrigerant,
222 auto const flow_rate_min, auto const power_min)
223 {
225 std::in_place_type<BuildingPowerHotWater>,
226 *heating,
227 *hot_water,
228 flow_rate_param,
229 refrigerant.specific_heat_capacity,
230 refrigerant.density,
231 flow_rate_min,
232 power_min};
233 }},
234 {{true, false, true}, &createHeatingCooling},
235 {{false, true, true}, &createHotWaterCooling},
236 {{true, false, false},
237 [](std::optional<PowerWithCOP> const& heating,
238 std::optional<PowerWithCOP> const& /*hot_water*/,
239 std::optional<CoolingVariant> const& /*cooling*/,
240 auto const& flow_rate_param, auto const& refrigerant,
241 auto const flow_rate_min, auto const power_min)
242 {
244 std::in_place_type<BuildingPower>,
245 *heating,
246 flow_rate_param,
247 refrigerant.specific_heat_capacity,
248 refrigerant.density,
249 flow_rate_min,
250 power_min};
251 }},
252 {{false, true, false},
253 [](std::optional<PowerWithCOP> const& /*heating*/,
254 std::optional<PowerWithCOP> const& hot_water,
255 std::optional<CoolingVariant> const& /*cooling*/,
256 auto const& flow_rate_param, auto const& refrigerant,
257 auto const flow_rate_min, auto const power_min)
258 {
260 std::in_place_type<BuildingPower>,
261 *hot_water,
262 flow_rate_param,
263 refrigerant.specific_heat_capacity,
264 refrigerant.density,
265 flow_rate_min,
266 power_min};
267 }},
268 {{false, false, true}, &createCooling}};
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)
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 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)

Referenced by createAdvancedBuildingPower().