41 double const pipe_outside_area,
42 int const section_index)
44 double const grout_area = borehole_area_fraction - pipe_outside_area;
48 "Non-positive grout cross-sectional area at section {:d}. "
49 "Borehole diameter is too small for the pipe dimensions.",
62 bool const use_python_bcs_)
78 return std::visit([](
auto const& ftc) {
return ftc.is_power_bc; },
96 int const section_index)
const
98 auto const& thermal_resistances =
100 if (unknown_index < 0 ||
101 unknown_index >=
static_cast<int>(thermal_resistances.size()))
103 OGS_FATAL(
"Invalid unknown index {:d} for section {:d}.",
104 unknown_index, section_index);
106 return thermal_resistances[unknown_index];
116 template <
typename Fn>
122 for (
int i = 0; i < n; ++i)
148 int const section_index)
const
150 if (section_index < 0 ||
154 OGS_FATAL(
"Invalid section index: {:d}", section_index);
double thermalResistanceAtSection(int const unknown_index, int const section_index) const
Get thermal resistance for a specific section and unknown.
bool const use_python_bcs
RefrigerantProperties const refrigerant
void recomputeSectionalResistances(Fn &&calcForSection)
Recompute _sectional_thermal_resistances for all sections.
std::vector< double > const & getSectionBoundaries() const
Get section boundaries (cumulative distance from wellhead).
std::vector< double > _flow_velocities
GroutParameters const grout
int getNumberOfSections() const
Get number of sections in the borehole geometry.
constexpr bool isPowerBC() const
BHECommon(BoreholeGeometry const &borehole_geometry_, RefrigerantProperties const &refrigerant_, GroutParameters const &grout_, FlowAndTemperatureControl const &flowAndTemperatureControl_, bool const use_python_bcs_)
std::vector< std::vector< double > > _sectional_thermal_resistances
FlowAndTemperatureControl const flowAndTemperatureControl
std::vector< double > const & getThermalResistancesAtSection(int const section_index) const
Get the thermal resistance vector for a given section.
double getClampedFlowVelocity(int const section_index) const
Get velocity for a section, clamping to last section if index exceeds the number of velocity entries....
BoreholeGeometry const borehole_geometry
double checkedGroutArea(double const borehole_area_fraction, double const pipe_outside_area, int const section_index)
std::variant< InflowTemperature, Power, BuildingPower, BuildingPowerHotWaterActiveCooling, BuildingPowerHotWaterPassiveCooling, BuildingPowerHotWater, BuildingPowerActiveCooling, BuildingPowerPassiveCooling, ActiveCooling > FlowAndTemperatureControl