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  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)
 Thermal resistances due to grout-soil exchange.
double sampleStrictPositive (ParameterLib::Parameter< double > const &param, double const t, ParameterLib::SpatialPosition const &pos, std::string_view const param_role)
std::string uTypeGeometryContext (ParameterLib::SpatialPosition const &pos, double const D, double const d0, double const distance, std::string_view const equation, std::string_view const cause)
void checkAcoshArg (double const arg, std::string_view const context)
void checkBoreholeVsPipeDiameter (double const D, double const min_diameter, ParameterLib::SpatialPosition const &pos, std::string_view const context)
double checkedGroutArea (double const borehole_area_fraction, double const pipe_outside_area, ParameterLib::SpatialPosition const &pos)
void checkEqualPipeOutsideDiameters (Pipe const &inlet, Pipe const &outlet, std::string_view const context)
void validateScalarTimeInvariantBHEParameter (ParameterLib::Parameter< double > const &param, std::string_view const role)
BoreholeGeometry createBoreholeGeometry (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters)
double coaxialPipesAnnulusDiameter (Pipe const &inner_pipe, Pipe const &outer_pipe)
RefrigerantProperties createRefrigerantProperties (BaseLib::ConfigTree const &config)
double pipeWallThermalResistance (Pipe const &pipe, double const wall_thermal_conductivity)
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, double const lambda_p_inner, Pipe const &outer_pipe, double const lambda_p_outer)
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

◆ 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 39 of file ThermalResistancesCoaxial.h.

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

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 70 of file ThermalResistancesCoaxial.h.

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

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,
double const lambda_p_inner,
Pipe const & outer_pipe,
double const lambda_p_outer )
inline

Compute pipe wall thermal resistance from pipe geometry and pre-evaluated wall thermal conductivity values.

Definition at line 61 of file ThermalResistancesCoaxial.h.

64{
65 return {pipeWallThermalResistance(inner_pipe, lambda_p_inner),
66 pipeWallThermalResistance(outer_pipe, lambda_p_outer)};
67}
double pipeWallThermalResistance(Pipe const &pipe, double const wall_thermal_conductivity)

References pipeWallThermalResistance().

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};
#define OGS_FATAL(...)
Definition Error.h:10

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()().

◆ checkAcoshArg()

void ProcessLib::HeatTransportBHE::BHE::checkAcoshArg ( double const arg,
std::string_view const context )

Validate that arg is a valid input to std::acosh, i.e. finite and > 1. The bound is strict: acosh(1) = 0 would make a thermal resistance zero and produce an infinite (1/R) assembly coefficient. On failure raises OGS_FATAL prefixed with the caller-assembled context, which is expected to carry the element id and relevant geometry.

Definition at line 53 of file BHEParameterValidation.cpp.

54{
55 if (!std::isfinite(arg) || arg <= 1.0)
56 {
57 OGS_FATAL("{:s} -> acosh argument = {:g} (must be finite and > 1).",
58 context, arg);
59 }
60}

References OGS_FATAL.

Referenced by ProcessLib::HeatTransportBHE::BHE::BHE_1U::calcThermalResistances(), and ProcessLib::HeatTransportBHE::BHE::BHE_2U::calcThermalResistances().

◆ checkBoreholeVsPipeDiameter()

void ProcessLib::HeatTransportBHE::BHE::checkBoreholeVsPipeDiameter ( double const D,
double const min_diameter,
ParameterLib::SpatialPosition const & pos,
std::string_view const context )

Validate that the borehole diameter D strictly exceeds min_diameter, the lower bound the resistance formula requires (e.g. sqrt(2)*d0 for 1U, 2*d0 for 2U) so that std::log(D/min_diameter) stays real and positive.

Definition at line 62 of file BHEParameterValidation.cpp.

66{
67 if (!(D > min_diameter) || !std::isfinite(D / min_diameter))
68 {
70 "BHE geometry invalid at {} ({:s}): borehole diameter "
71 "D={:g} must strictly exceed the minimum diameter {:g} required by "
72 "this formula.",
73 pos, context, D, min_diameter);
74 }
75}

References OGS_FATAL.

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

◆ checkedGroutArea()

double ProcessLib::HeatTransportBHE::BHE::checkedGroutArea ( double const borehole_area_fraction,
double const pipe_outside_area,
ParameterLib::SpatialPosition const & pos )

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 77 of file BHEParameterValidation.cpp.

80{
81 double const grout_area = borehole_area_fraction - pipe_outside_area;
82 if (grout_area <= 0)
83 {
85 "Non-positive grout cross-sectional area at {}. "
86 "Borehole diameter is too small for the pipe dimensions.",
87 pos);
88 }
89 return grout_area;
90}

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().

◆ checkEqualPipeOutsideDiameters()

void ProcessLib::HeatTransportBHE::BHE::checkEqualPipeOutsideDiameters ( Pipe const & inlet,
Pipe const & outlet,
std::string_view const context )

Validate that the inlet and outlet pipes of a U-type BHE share the same outside diameter. The Diersch (2011) grout and inter-grout resistance formulas (R_g, R_ar) are written for a single pipe diameter d0, so a U-type BHE must use one common outside diameter; the inlet and outlet may still differ in wall thermal conductivity. Calls OGS_FATAL on mismatch. context names the BHE type in the diagnostic message.

Definition at line 92 of file BHEParameterValidation.cpp.

94{
95 double const d_inlet = inlet.outsideDiameter();
96 double const d_outlet = outlet.outsideDiameter();
97 // The diameters are user-supplied constants, so allow for round-off but
98 // reject genuinely different pipes.
99 if (std::abs(d_inlet - d_outlet) >
100 1e-12 * std::max(std::abs(d_inlet), std::abs(d_outlet)))
101 {
102 OGS_FATAL(
103 "{:s}: inlet and outlet pipe outside diameters differ "
104 "(inlet={:g}, outlet={:g}). U-type BHE thermal resistance formulas "
105 "assume a single pipe diameter; inlet and outlet may differ only "
106 "in wall thermal conductivity.",
107 context, d_inlet, d_outlet);
108 }
109}

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

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

◆ coaxialPipesAnnulusDiameter()

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

Definition at line 52 of file Pipe.h.

54{
55 return outer_pipe.diameter - inner_pipe.outsideDiameter();
56}

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 37 of file ThermalResistanceHelpers.h.

39{
40 double const R_gg = 2.0 * R_gs * (R_ar - 2.0 * chi * R_g) /
41 (2.0 * R_gs - R_ar + 2.0 * chi * R_g);
42 if (!std::isfinite(R_gg))
43 {
45 "Error!!! Grout Thermal Resistance is an infinite number! The "
46 "simulation will be stopped!");
47 }
48 return R_gg;
49}

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 30 of file ThermalResistanceHelpers.h.

31{
32 return (1 - chi) * R_g;
33}

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 )

Definition at line 73 of file CreateBHE1PType.cpp.

79{
80 auto SinglePipeType = parseBHE1PTypeConfig(config, parameters, curves);
81 return {std::get<0>(SinglePipeType), std::get<1>(SinglePipeType),
82 std::get<2>(SinglePipeType), std::get<3>(SinglePipeType),
83 std::get<4>(SinglePipeType), std::get<5>(SinglePipeType)};
84}
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)

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 )

◆ 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 )

Definition at line 81 of file CreateBHECoaxial.cpp.

87{
88 auto coaxial = parseBHECoaxialConfig(config, parameters, curves);
89 return {std::get<0>(coaxial), std::get<1>(coaxial), std::get<2>(coaxial),
90 std::get<3>(coaxial), std::get<4>(coaxial), std::get<5>(coaxial)};
91}
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)

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 )

◆ 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 )

◆ 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 )

Definition at line 99 of file CreateBHEUType.cpp.

105{
106 auto UType = parseBHEUTypeConfig(config, parameters, curves);
107 return {std::get<0>(UType), std::get<1>(UType), std::get<2>(UType),
108 std::get<3>(UType), std::get<4>(UType), std::get<5>(UType)};
109}
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)

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 )

◆ 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 )

◆ createBoreholeGeometry()

BoreholeGeometry ProcessLib::HeatTransportBHE::BHE::createBoreholeGeometry ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters )
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 17 of file BoreholeGeometry.cpp.

20{
21 const auto borehole_length =
23 config.getConfigParameter<double>("length");
24 if (borehole_length <= 0)
25 {
26 OGS_FATAL("Borehole length must be positive, got {:g}.",
27 borehole_length);
28 }
29
30 auto const diameter_parameter_or_value =
32 config.getConfigParameter<std::string>("diameter");
33 auto const& diameter_parameter =
35 diameter_parameter_or_value, parameters, "borehole_diameter",
36 "borehole_diameter");
37
38 // Borehole diameter is physically time-invariant (fixed at drilling).
39 // Reject time-varying / mesh-node / non-scalar parameter types; warn for
40 // FunctionParameter (which may be spatial-only).
42 "borehole_diameter");
43
44 return {borehole_length, diameter_parameter};
45}
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)
void validateScalarTimeInvariantBHEParameter(ParameterLib::Parameter< double > const &param, std::string_view const role)

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

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:112
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,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > & parameters )
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 17 of file Pipe.cpp.

20{
21 const auto diameter =
23 config.getConfigParameter<double>("diameter");
24 const auto wall_thickness =
26 config.getConfigParameter<double>("wall_thickness");
27
28 auto const wall_thermal_conductivity_str =
30 config.getConfigParameter<std::string>("wall_thermal_conductivity");
31 auto const& wall_thermal_conductivity_param =
33 wall_thermal_conductivity_str, parameters,
34 "pipe_wall_thermal_conductivity", "pipe_wall_thermal_conductivity");
35
36 if (diameter <= 0)
37 {
38 OGS_FATAL("Pipe diameter must be positive, got {:g}.", diameter);
39 }
40 if (wall_thickness < 0)
41 {
42 OGS_FATAL("Pipe wall_thickness must be non-negative, got {:g}.",
43 wall_thickness);
44 }
45
46 // Borehole pipe wall conductivity is physically time-invariant (fixed at
47 // drilling / installation). Reject time-varying / mesh-node / non-scalar
48 // parameter types; warn for FunctionParameter (may be spatial-only).
49 validateScalarTimeInvariantBHEParameter(wall_thermal_conductivity_param,
50 "wall_thermal_conductivity");
51
52 return {diameter, wall_thickness, wall_thermal_conductivity_param};
53}

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

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().

◆ 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 )
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 20 of file CreateBHE1PType.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
32 if (bhe_if_use_python_bc_conf)
33 {
34 DBUG("BHE 1P using python boundary conditions.");
35 }
36
37 auto const borehole_geometry =
39 createBoreholeGeometry(config.getConfigSubtree("borehole"), parameters);
40
42 auto const& pipes_config = config.getConfigSubtree("pipes");
43 Pipe const inlet_pipe =
45 createPipe(pipes_config.getConfigSubtree("inlet"), parameters);
46
47 const auto pipe_longitudinal_dispersion_length =
49 pipes_config.getConfigParameter<double>(
50 "longitudinal_dispersion_length");
51 PipeConfiguration1PType const pipes{inlet_pipe,
52 pipe_longitudinal_dispersion_length};
53
55 auto const grout = createGroutParameters(config.getConfigSubtree("grout"));
56
57 auto const refrigerant =
59 createRefrigerantProperties(config.getConfigSubtree("refrigerant"));
60
61 auto const flowAndTemperatureControl = createFlowAndTemperatureControl(
63 config.getConfigSubtree("flow_and_temperature_control"),
64 parameters,
65 curves,
66 refrigerant);
67
68 return {borehole_geometry, refrigerant, grout,
69 flowAndTemperatureControl, pipes, bhe_if_use_python_bc_conf};
70}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
RefrigerantProperties createRefrigerantProperties(BaseLib::ConfigTree const &config)
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)
BoreholeGeometry createBoreholeGeometry(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters)
Pipe createPipe(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters)
Definition Pipe.cpp:17
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 )
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.

25{
26 // if the BHE is using python boundary condition
27 auto const bhe_if_use_python_bc_conf =
29 config.getConfigParameter<bool>("use_bhe_pipe_network", false);
30 DBUG("If using python boundary condition : {:s}",
31 (bhe_if_use_python_bc_conf) ? "true" : "false");
32
33 auto const borehole_geometry =
35 createBoreholeGeometry(config.getConfigSubtree("borehole"), parameters);
36
38 auto const& pipes_config = config.getConfigSubtree("pipes");
39 Pipe const outer_pipe =
41 createPipe(pipes_config.getConfigSubtree("outer"), parameters);
42 Pipe const inner_pipe =
44 createPipe(pipes_config.getConfigSubtree("inner"), parameters);
45 const auto pipe_longitudinal_dispersion_length =
47 pipes_config.getConfigParameter<double>(
48 "longitudinal_dispersion_length");
49 PipeConfigurationCoaxial const pipes{inner_pipe, outer_pipe,
50 pipe_longitudinal_dispersion_length};
51
52 double const annulus_diameter =
53 coaxialPipesAnnulusDiameter(pipes.inner_pipe, pipes.outer_pipe);
54 if (annulus_diameter <= 0)
55 {
57 "Invalid coaxial pipe geometry: outer pipe inner diameter ({:g}) "
58 "must be greater than inner pipe outside diameter ({:g}).",
59 pipes.outer_pipe.diameter, pipes.inner_pipe.outsideDiameter());
60 }
61
63 auto const grout = createGroutParameters(config.getConfigSubtree("grout"));
64
65 auto const refrigerant =
67 createRefrigerantProperties(config.getConfigSubtree("refrigerant"));
68
69 auto const flowAndTemperatureControl = createFlowAndTemperatureControl(
71 config.getConfigSubtree("flow_and_temperature_control"),
72 parameters,
73 curves,
74 refrigerant);
75
76 return {borehole_geometry, refrigerant, grout,
77 flowAndTemperatureControl, pipes, bhe_if_use_python_bc_conf};
78}

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 )
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 21 of file CreateBHEUType.cpp.

27{
28 // if the BHE is using python boundary condition
29 auto const bhe_if_use_python_bc_conf =
31 config.getConfigParameter<bool>("use_bhe_pipe_network", false);
32 DBUG("If using python boundary condition : {:s}",
33 (bhe_if_use_python_bc_conf) ? "true" : "false");
34
35 auto const borehole_geometry =
37 createBoreholeGeometry(config.getConfigSubtree("borehole"), parameters);
38
40 auto const& pipes_config = config.getConfigSubtree("pipes");
41 Pipe const inlet_pipe =
43 createPipe(pipes_config.getConfigSubtree("inlet"), parameters);
44 Pipe const outlet_pipe =
46 createPipe(pipes_config.getConfigSubtree("outlet"), parameters);
47 const auto pipe_distance =
49 pipes_config.getConfigParameter<double>("distance_between_pipes");
50 const auto pipe_longitudinal_dispersion_length =
52 pipes_config.getConfigParameter<double>(
53 "longitudinal_dispersion_length");
54 PipeConfigurationUType const pipes{inlet_pipe, outlet_pipe, pipe_distance,
55 pipe_longitudinal_dispersion_length};
56
57 if (pipe_distance <= 0)
58 {
60 "distance_between_pipes must be positive for U-type BHEs, got "
61 "{:g}.",
62 pipe_distance);
63 }
64
65 // The resistance formulas use a single pipe outside diameter; the BHE_1U /
66 // BHE_2U constructor enforces that inlet and outlet share it, so the inlet
67 // value is representative here.
68 double const d0 = pipes.inlet.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. A distance "
74 "equal to the pipe outside diameter makes the inter-grout acosh "
75 "argument exactly 1, i.e. a zero resistance and an infinite "
76 "assembly coefficient.",
77 pipe_distance, d0);
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 createBoreholeGeometry(), createFlowAndTemperatureControl(), createGroutParameters(), createPipe(), createRefrigerantProperties(), DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigSubtree(), ProcessLib::HeatTransportBHE::BHE::PipeConfigurationUType::inlet, OGS_FATAL, and ProcessLib::HeatTransportBHE::BHE::Pipe::outsideDiameter().

Referenced by createBHEUType().

◆ pipeWallThermalResistance()

double ProcessLib::HeatTransportBHE::BHE::pipeWallThermalResistance ( Pipe const & pipe,
double const wall_thermal_conductivity )
inline

Conductive thermal resistance of a pipe wall: R = ln(d_outside / d_inside) / (2 * pi * lambda_wall). The wall thermal conductivity is passed in (pre-sampled at the element's SpatialPosition) because it may be a spatially varying parameter.

Definition at line 22 of file ThermalResistanceHelpers.h.

24{
25 return std::log(pipe.outsideDiameter() / pipe.diameter) /
26 (2.0 * std::numbers::pi * wall_thermal_conductivity);
27}

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

Referenced by ProcessLib::HeatTransportBHE::BHE::BHE_1P::calcThermalResistances(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::calcThermalResistances(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::calcThermalResistances(), and calculatePipeWallThermalResistance().

◆ 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().

◆ sampleStrictPositive()

double ProcessLib::HeatTransportBHE::BHE::sampleStrictPositive ( ParameterLib::Parameter< double > const & param,
double const t,
ParameterLib::SpatialPosition const & pos,
std::string_view const param_role )

Sample a scalar BHE parameter and reject non-finite or non-positive values. Plain v <= 0 does NOT reject NaN (NaN comparisons are always false) nor Inf (Inf <= 0 is false), so both slip through into std::log / std::acosh and produce silent NaN in assembly. Use this helper at every BHE parameter evaluation site.

Definition at line 24 of file BHEParameterValidation.cpp.

28{
29 double const v = param(t, pos)[0];
30 if (!std::isfinite(v) || v <= 0.0)
31 {
33 "BHE {:s} ('{}') is non-finite or non-positive (value={:g}) at "
34 "{}.",
35 param_role, param.name, v, pos);
36 }
37 return v;
38}

References ParameterLib::ParameterBase::name, and OGS_FATAL.

Referenced by ProcessLib::HeatTransportBHE::BHE::BHE_1P::calcThermalResistances(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::calcThermalResistances(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::calcThermalResistances(), ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::calcThermalResistances(), 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().

◆ 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 102 of file BHE_1U.cpp.

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

Definition at line 106 of file BHE_2U.cpp.

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

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

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

◆ uTypeGeometryContext()

std::string ProcessLib::HeatTransportBHE::BHE::uTypeGeometryContext ( ParameterLib::SpatialPosition const & pos,
double const D,
double const d0,
double const distance,
std::string_view const equation,
std::string_view const cause )

Assemble the shared "BHE geometry invalid" diagnostic prefix used by the acosh-argument checks in the U-type resistance formulas. equation names the formula, cause the physical degeneracy driving the argument to <= 1. Kept in one place so the D/d0/distance message stays consistent across BHE types.

Definition at line 40 of file BHEParameterValidation.cpp.

46{
47 return fmt::format(
48 "BHE geometry invalid at {} ({:s}): D={:g}, d0={:g}, distance={:g}. "
49 "{:s}",
50 pos, equation, D, d0, distance, cause);
51}

Referenced by ProcessLib::HeatTransportBHE::BHE::BHE_1U::calcThermalResistances(), and ProcessLib::HeatTransportBHE::BHE::BHE_2U::calcThermalResistances().

◆ validateScalarTimeInvariantBHEParameter()

void ProcessLib::HeatTransportBHE::BHE::validateScalarTimeInvariantBHEParameter ( ParameterLib::Parameter< double > const & param,
std::string_view const role )

Validate a scalar, time-invariant BHE parameter (borehole diameter, pipe wall thermal conductivity, ...) at config time. Rejects genuinely time-varying parameter types (and warns for FunctionParameter, which is only usable when spatial-only), rejects MeshNodeParameter, and requires a single global component. Calls OGS_FATAL on violation. role names the parameter in the diagnostic messages.

Definition at line 111 of file BHEParameterValidation.cpp.

113{
114 // Borehole geometry properties are sampled once at t=0 and are physically
115 // time-invariant, so reject parameter types that genuinely vary in time.
116 // Parameter::isTimeDependent() is too conservative to use as the sole
117 // criterion here: a FunctionParameter reports true even for a purely
118 // spatial expression. We therefore deny-list only the parameter types that
119 // are always genuinely time-varying, and merely warn (below) for anything
120 // else that reports time-dependence.
121 if (dynamic_cast<ParameterLib::CurveScaledParameter<double> const*>(
122 &param) != nullptr ||
124 &param) != nullptr)
125 {
126 OGS_FATAL(
127 "BHE {:s} '{}' uses a time-varying parameter type, but borehole "
128 "geometry properties are sampled once at t=0 and are physically "
129 "time-invariant. Use ConstantParameter, MeshElementParameter, or "
130 "a spatial-only FunctionParameter.",
131 role, param.name);
132 }
133 if (param.isTimeDependent())
134 {
135 WARN(
136 "BHE {:s} '{}' reports time-dependence. This is expected for a "
137 "FunctionParameter, whose time-dependence flag is set even for a "
138 "purely spatial expression, so a spatial-only expression is fine. "
139 "Only the value at t=0 is used; ensure the expression does not "
140 "actually depend on time.",
141 role, param.name);
142 }
143
144 if (dynamic_cast<ParameterLib::MeshNodeParameter<double> const*>(&param))
145 {
146 OGS_FATAL(
147 "BHE parameter '{}' must not be a MeshNodeParameter. "
148 "Use MeshElementParameter for spatially varying BHE properties.",
149 param.name);
150 }
151
152 if (param.getNumberOfGlobalComponents() != 1)
153 {
154 OGS_FATAL(
155 "BHE {:s} '{}' must be scalar (1 component), got {:d} components.",
156 role, param.name, param.getNumberOfGlobalComponents());
157 }
158}
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:34
A parameter represented by a mesh property vector.
virtual bool isTimeDependent() const =0
virtual int getNumberOfGlobalComponents() const =0

References ParameterLib::Parameter< T >::getNumberOfGlobalComponents(), ParameterLib::ParameterBase::isTimeDependent(), ParameterLib::ParameterBase::name, OGS_FATAL, and WARN().

Referenced by createBoreholeGeometry(), and createPipe().

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().