OGS
ProcessLib::HeatTransportBHE::BHE::BHECommon Class Reference

Detailed Description

Definition at line 55 of file BHECommon.h.

#include <BHECommon.h>

Inheritance diagram for ProcessLib::HeatTransportBHE::BHE::BHECommon:
[legend]
Collaboration diagram for ProcessLib::HeatTransportBHE::BHE::BHECommon:
[legend]

Public Member Functions

 BHECommon (BoreholeGeometry const &borehole_geometry_, RefrigerantProperties const &refrigerant_, GroutParameters const &grout_, FlowAndTemperatureControl const &flowAndTemperatureControl_, bool const use_python_bcs_)
constexpr bool isPowerBC () const
int getNumberOfSections () const
 Get number of sections in the borehole geometry.
std::vector< double > const & getSectionBoundaries () const
 Get section boundaries (cumulative distance from wellhead).
double thermalResistanceAtSection (int const unknown_index, int const section_index) const
 Get thermal resistance for a specific section and unknown.

Public Attributes

BoreholeGeometry const borehole_geometry
RefrigerantProperties const refrigerant
GroutParameters const grout
FlowAndTemperatureControl const flowAndTemperatureControl
bool const use_python_bcs

Protected Member Functions

template<typename Fn>
void recomputeSectionalResistances (Fn &&calcForSection)
 Recompute _sectional_thermal_resistances for all sections.
double getClampedFlowVelocity (int const section_index) const
 Get velocity for a section, clamping to last section if index exceeds the number of velocity entries. Returns 0 when empty.
std::vector< double > const & getThermalResistancesAtSection (int const section_index) const
 Get the thermal resistance vector for a given section.

Protected Attributes

std::vector< double > _flow_velocities
std::vector< std::vector< double > > _sectional_thermal_resistances

Constructor & Destructor Documentation

◆ BHECommon()

ProcessLib::HeatTransportBHE::BHE::BHECommon::BHECommon ( BoreholeGeometry const & borehole_geometry_,
RefrigerantProperties const & refrigerant_,
GroutParameters const & grout_,
FlowAndTemperatureControl const & flowAndTemperatureControl_,
bool const use_python_bcs_ )
inline

Member Function Documentation

◆ getClampedFlowVelocity()

double ProcessLib::HeatTransportBHE::BHE::BHECommon::getClampedFlowVelocity ( int const section_index) const
inlineprotected

Get velocity for a section, clamping to last section if index exceeds the number of velocity entries. Returns 0 when empty.

Definition at line 133 of file BHECommon.h.

134 {
135 return _flow_velocities.empty()
136 ? 0.0
137 : _flow_velocities[std::min(
138 section_index,
139 static_cast<int>(_flow_velocities.size()) - 1)];
140 }

References _flow_velocities.

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

◆ getNumberOfSections()

int ProcessLib::HeatTransportBHE::BHE::BHECommon::getNumberOfSections ( ) const
inline

Get number of sections in the borehole geometry.

Definition at line 83 of file BHECommon.h.

84 {
85 return borehole_geometry.sections.getNumberOfSections();
86 }

References borehole_geometry.

Referenced by recomputeSectionalResistances().

◆ getSectionBoundaries()

std::vector< double > const & ProcessLib::HeatTransportBHE::BHE::BHECommon::getSectionBoundaries ( ) const
inline

Get section boundaries (cumulative distance from wellhead).

Definition at line 89 of file BHECommon.h.

90 {
91 return borehole_geometry.sections.section_boundaries;
92 }

References borehole_geometry.

◆ getThermalResistancesAtSection()

std::vector< double > const & ProcessLib::HeatTransportBHE::BHE::BHECommon::getThermalResistancesAtSection ( int const section_index) const
inlineprotected

Get the thermal resistance vector for a given section.

Definition at line 147 of file BHECommon.h.

149 {
150 if (section_index < 0 ||
151 section_index >=
152 static_cast<int>(_sectional_thermal_resistances.size()))
153 {
154 OGS_FATAL("Invalid section index: {:d}", section_index);
155 }
156 return _sectional_thermal_resistances[section_index];
157 }
#define OGS_FATAL(...)
Definition Error.h:19
std::vector< std::vector< double > > _sectional_thermal_resistances
Definition BHECommon.h:144

References _sectional_thermal_resistances, and OGS_FATAL.

Referenced by thermalResistanceAtSection().

◆ isPowerBC()

bool ProcessLib::HeatTransportBHE::BHE::BHECommon::isPowerBC ( ) const
inlineconstexpr

Definition at line 76 of file BHECommon.h.

77 {
78 return std::visit([](auto const& ftc) { return ftc.is_power_bc; },
80 }

References flowAndTemperatureControl.

◆ recomputeSectionalResistances()

template<typename Fn>
void ProcessLib::HeatTransportBHE::BHE::BHECommon::recomputeSectionalResistances ( Fn && calcForSection)
inlineprotected

Recompute _sectional_thermal_resistances for all sections.

Parameters
calcForSectionCallable (int section_index) -> std::vector<double> that returns the resistance vector for that section.

Definition at line 117 of file BHECommon.h.

118 {
119 int const n = getNumberOfSections();
122 for (int i = 0; i < n; ++i)
123 {
124 _sectional_thermal_resistances.push_back(calcForSection(i));
125 }
126 }
int getNumberOfSections() const
Get number of sections in the borehole geometry.
Definition BHECommon.h:83

References _sectional_thermal_resistances, and getNumberOfSections().

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

◆ thermalResistanceAtSection()

double ProcessLib::HeatTransportBHE::BHE::BHECommon::thermalResistanceAtSection ( int const unknown_index,
int const section_index ) const
inline

Get thermal resistance for a specific section and unknown.

Definition at line 95 of file BHECommon.h.

97 {
98 auto const& thermal_resistances =
99 getThermalResistancesAtSection(section_index);
100 if (unknown_index < 0 ||
101 unknown_index >= static_cast<int>(thermal_resistances.size()))
102 {
103 OGS_FATAL("Invalid unknown index {:d} for section {:d}.",
104 unknown_index, section_index);
105 }
106 return thermal_resistances[unknown_index];
107 }
std::vector< double > const & getThermalResistancesAtSection(int const section_index) const
Get the thermal resistance vector for a given section.
Definition BHECommon.h:147

References getThermalResistancesAtSection(), and OGS_FATAL.

Member Data Documentation

◆ _flow_velocities

◆ _sectional_thermal_resistances

std::vector<std::vector<double> > ProcessLib::HeatTransportBHE::BHE::BHECommon::_sectional_thermal_resistances
protected

Thermal resistances per section. Each element is a vector of resistances for that section's unknowns.

Definition at line 144 of file BHECommon.h.

Referenced by getThermalResistancesAtSection(), and recomputeSectionalResistances().

◆ borehole_geometry

◆ flowAndTemperatureControl

◆ grout

GroutParameters const ProcessLib::HeatTransportBHE::BHE::BHECommon::grout

Definition at line 73 of file BHECommon.h.

Referenced by ProcessLib::HeatTransportBHE::BHE::BHE_1P::BHE_1P(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::BHE_1U(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::BHE_2U(), ProcessLib::HeatTransportBHE::BHE::BHE_CXA::BHE_CXA(), ProcessLib::HeatTransportBHE::BHE::BHE_CXC::BHE_CXC(), BHECommon(), ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::BHECommonCoaxial(), ProcessLib::HeatTransportBHE::BHE::BHECommonUType::BHECommonUType(), 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::pipeHeatCapacities(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::pipeHeatCapacities(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::pipeHeatCapacities(), ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::pipeHeatCapacities(), ProcessLib::HeatTransportBHE::BHE::BHE_1P::pipeHeatConductions(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::pipeHeatConductions(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::pipeHeatConductions(), ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::pipeHeatConductions(), ProcessLib::HeatTransportBHE::BHE::BHE_1P::withGeometry(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::withGeometry(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::withGeometry(), ProcessLib::HeatTransportBHE::BHE::BHE_CXA::withGeometry(), and ProcessLib::HeatTransportBHE::BHE::BHE_CXC::withGeometry().

◆ refrigerant

RefrigerantProperties const ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant

Definition at line 72 of file BHECommon.h.

Referenced by ProcessLib::HeatTransportBHE::BHE::BHE_1P::BHE_1P(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::BHE_1U(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::BHE_2U(), ProcessLib::HeatTransportBHE::BHE::BHE_CXA::BHE_CXA(), ProcessLib::HeatTransportBHE::BHE::BHE_CXC::BHE_CXC(), BHECommon(), ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::BHECommonCoaxial(), ProcessLib::HeatTransportBHE::BHE::BHECommonUType::BHECommonUType(), 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::pipeAdvectionVectors(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::pipeAdvectionVectors(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::pipeAdvectionVectors(), ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::pipeAdvectionVectors(), ProcessLib::HeatTransportBHE::BHE::BHE_1P::pipeHeatCapacities(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::pipeHeatCapacities(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::pipeHeatCapacities(), ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::pipeHeatCapacities(), ProcessLib::HeatTransportBHE::BHE::BHE_1P::pipeHeatConductions(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::pipeHeatConductions(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::pipeHeatConductions(), ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::pipeHeatConductions(), ProcessLib::HeatTransportBHE::BHE::BHE_1P::updateHeatTransferCoefficients(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::updateHeatTransferCoefficients(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::updateHeatTransferCoefficients(), ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::updateHeatTransferCoefficients(), ProcessLib::HeatTransportBHE::BHE::BHE_1P::withGeometry(), ProcessLib::HeatTransportBHE::BHE::BHE_1U::withGeometry(), ProcessLib::HeatTransportBHE::BHE::BHE_2U::withGeometry(), ProcessLib::HeatTransportBHE::BHE::BHE_CXA::withGeometry(), and ProcessLib::HeatTransportBHE::BHE::BHE_CXC::withGeometry().

◆ use_python_bcs


The documentation for this class was generated from the following file: