OGS
ProcessLib::HeatTransportBHE::BHE::BHE_1P Class Referencefinal

Detailed Description

The BHE_1P class is the realization of single-pipe type of Borehole Heate Exchanger. In this class, the pipe heat capacity, pipe heat conductiion, pie advection vectors are initialized according to the geometry of the single-pipe type of BHE. For this type of BHE, 2 primary unknowns are assigned on the 1D BHE elements. They are the temperature in the pipe T_p, and temperature of the grout zone surrounding the single pipe T_g. These two primary variables are solved according to heat convection and conduction equations on the pipes and also in the grout zones. The interaction of the 1P type of BHE and the surrounding soil is regulated through the thermal resistance values, which are calculated specifically during the initialization of the class.

Definition at line 39 of file BHE_1P.h.

#include <BHE_1P.h>

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

Public Member Functions

 BHE_1P (BoreholeGeometry const &borehole, RefrigerantProperties const &refrigerant, GroutParameters const &grout, FlowAndTemperatureControl const &flowAndTemperatureControl, PipeConfiguration1PType const &pipes, bool const use_python_bcs)
 
std::array< double, number_of_unknownspipeHeatCapacities () const
 
std::array< double, number_of_unknownspipeHeatConductions () const
 
std::array< Eigen::Vector3d, number_of_unknownspipeAdvectionVectors (Eigen::Vector3d const &elem_direction) const
 
double updateFlowRateAndTemperature (double T_out, double current_time)
 Return the inflow temperature for the boundary condition.
 
double thermalResistance (int const unknown_index) const
 
std::array< double, number_of_unknownscrossSectionAreas () const
 
void updateHeatTransferCoefficients (double const flow_rate)
 
- Public Member Functions inherited from ProcessLib::HeatTransportBHE::BHE::BHECommon
constexpr bool isPowerBC () const
 

Static Public Member Functions

template<int NPoints, typename SingleUnknownMatrixType , typename RMatrixType , typename RPiSMatrixType , typename RSMatrixType >
static void assembleRMatrices (int const idx_bhe_unknowns, Eigen::MatrixBase< SingleUnknownMatrixType > const &matBHE_loc_R, Eigen::MatrixBase< RMatrixType > &R_matrix, Eigen::MatrixBase< RPiSMatrixType > &R_pi_s_matrix, Eigen::MatrixBase< RSMatrixType > &R_s_matrix)
 
static std::array< std::pair< std::size_t, int >, 2 > getBHEInflowDirichletBCNodesAndComponents (std::size_t const top_node_id, std::size_t const bottom_node_id, int const in_component_id)
 
static std::optional< std::array< std::pair< std::size_t, int >, 2 > > getBHEBottomDirichletBCNodesAndComponents (std::size_t const, int const, int const)
 

Static Public Attributes

static constexpr int number_of_unknowns = 2
 
static constexpr int number_of_grout_zones = 1
 
static constexpr std::pair< int, int > inflow_outflow_bc_component_ids []
 

Protected Attributes

PipeConfiguration1PType const _pipe
 
double _flow_velocity = std::numeric_limits<double>::quiet_NaN()
 Flow velocity inside the pipes. Depends on the flow_rate.
 

Private Member Functions

std::array< double, number_of_unknownscalcThermalResistances (double const Nu)
 

Static Private Member Functions

static double compute_R_gs (double const chi, double const R_g)
 

Private Attributes

std::array< double, number_of_unknowns_thermal_resistances
 

Additional Inherited Members

- Public Attributes inherited from ProcessLib::HeatTransportBHE::BHE::BHECommon
BoreholeGeometry const borehole_geometry
 
RefrigerantProperties const refrigerant
 
GroutParameters const grout
 
FlowAndTemperatureControl const flowAndTemperatureControl
 
bool const use_python_bcs
 

Constructor & Destructor Documentation

◆ BHE_1P()

ProcessLib::HeatTransportBHE::BHE::BHE_1P::BHE_1P ( BoreholeGeometry const & borehole,
RefrigerantProperties const & refrigerant,
GroutParameters const & grout,
FlowAndTemperatureControl const & flowAndTemperatureControl,
PipeConfiguration1PType const & pipes,
bool const use_python_bcs )

Definition at line 25 of file BHE_1P.cpp.

31 : BHECommon{borehole, refrigerant, grout, flowAndTemperatureControl,
33 _pipe(pipes)
34{
35 _thermal_resistances.fill(std::numeric_limits<double>::quiet_NaN());
36
37 // Initialize thermal resistances.
38 auto values = visit(
39 [&](auto const& control) {
41 0. /* initial time */);
42 },
44 updateHeatTransferCoefficients(values.flow_rate);
45}
void updateHeatTransferCoefficients(double const flow_rate)
Definition BHE_1P.cpp:100
std::array< double, number_of_unknowns > _thermal_resistances
Definition BHE_1P.h:147
PipeConfiguration1PType const _pipe
Definition BHE_1P.h:132
RefrigerantProperties const refrigerant
Definition BHECommon.h:42
FlowAndTemperatureControl const flowAndTemperatureControl
Definition BHECommon.h:44

References _thermal_resistances, ProcessLib::HeatTransportBHE::BHE::BHECommon::flowAndTemperatureControl, ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::reference_temperature, ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant, and updateHeatTransferCoefficients().

Member Function Documentation

◆ assembleRMatrices()

template<int NPoints, typename SingleUnknownMatrixType , typename RMatrixType , typename RPiSMatrixType , typename RSMatrixType >
static void ProcessLib::HeatTransportBHE::BHE::BHE_1P::assembleRMatrices ( int const idx_bhe_unknowns,
Eigen::MatrixBase< SingleUnknownMatrixType > const & matBHE_loc_R,
Eigen::MatrixBase< RMatrixType > & R_matrix,
Eigen::MatrixBase< RPiSMatrixType > & R_pi_s_matrix,
Eigen::MatrixBase< RSMatrixType > & R_s_matrix )
inlinestatic

Definition at line 64 of file BHE_1P.h.

70 {
71 // Here we are looping over two resistance terms
72 // First PHI_fg is the resistance between pipe and grout
73 // Second PHI_gs is the resistance between grout and soil
74 switch (idx_bhe_unknowns)
75 {
76 case 0: // PHI_fg
77 R_matrix.block(0, NPoints, NPoints, NPoints) +=
78 -1.0 * matBHE_loc_R;
79 R_matrix.block(NPoints, 0, NPoints, NPoints) +=
80 -1.0 * matBHE_loc_R;
81
82 R_matrix.block(0, 0, NPoints, NPoints) +=
83 matBHE_loc_R; // K_i/o
84 R_matrix.block(NPoints, NPoints, NPoints, NPoints) +=
85 matBHE_loc_R; // K_fg
86 return;
87 case 1: // PHI_gs
88 R_s_matrix += matBHE_loc_R;
89
90 R_pi_s_matrix.block(NPoints, 0, NPoints, NPoints) +=
91 -1.0 * matBHE_loc_R;
92
93 R_matrix.block(NPoints, NPoints, NPoints, NPoints) +=
94 matBHE_loc_R; // K_fg
95 return;
96 default:
98 "Error!!! In the function BHE_1P::assembleRMatrices, "
99 "the index of bhe resistance term is out of range! ");
100 }
101 }
#define OGS_FATAL(...)
Definition Error.h:26

References OGS_FATAL.

◆ calcThermalResistances()

std::array< double, BHE_1P::number_of_unknowns > ProcessLib::HeatTransportBHE::BHE::BHE_1P::calcThermalResistances ( double const Nu)
private

Definition at line 112 of file BHE_1P.cpp.

114{
115 constexpr double pi = std::numbers::pi;
116
117 double const lambda_r = refrigerant.thermal_conductivity;
118 double const lambda_g = grout.lambda_g;
119 double const lambda_p = _pipe.single_pipe.wall_thermal_conductivity;
120
121 // thermal resistances due to advective flow of refrigerant in the pipe
122 double const R_adv_i1 = 1.0 / (Nu * lambda_r * pi);
123
124 // thermal resistance due to thermal conductivity of the pipe wall material
125 double const R_con_a = std::log(_pipe.single_pipe.outsideDiameter() /
127 (2.0 * pi * lambda_p);
128
129 // thermal resistances of the grout
130 double const D = borehole_geometry.diameter;
131 double const pipe_outside_diameter = _pipe.single_pipe.outsideDiameter();
132
133 double const chi = std::log(std::sqrt(D * D + pipe_outside_diameter *
134 pipe_outside_diameter) /
135 std::sqrt(2) / pipe_outside_diameter) /
136 std::log(D / pipe_outside_diameter);
137 double const R_g =
138 std::log(D / pipe_outside_diameter) / 2 / (pi * lambda_g);
139
140 double const R_con_b = chi * R_g;
141
142 // thermal resistances due to grout-soil exchange
143 double const R_gs = compute_R_gs(chi, R_g);
144
145 // Eq. 29 and 30
146 double const R_fg = R_adv_i1 + R_con_a + R_con_b;
147
148 return {{R_fg, R_gs}};
149}
static double compute_R_gs(double const chi, double const R_g)
Definition BHE_1P.cpp:95

References _pipe, ProcessLib::HeatTransportBHE::BHE::BHECommon::borehole_geometry, compute_R_gs(), ProcessLib::HeatTransportBHE::BHE::BoreholeGeometry::diameter, ProcessLib::HeatTransportBHE::BHE::Pipe::diameter, ProcessLib::HeatTransportBHE::BHE::BHECommon::grout, ProcessLib::HeatTransportBHE::BHE::GroutParameters::lambda_g, ProcessLib::HeatTransportBHE::BHE::Pipe::outsideDiameter(), ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant, ProcessLib::HeatTransportBHE::BHE::PipeConfiguration1PType::single_pipe, ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::thermal_conductivity, and ProcessLib::HeatTransportBHE::BHE::Pipe::wall_thermal_conductivity.

Referenced by updateHeatTransferCoefficients().

◆ compute_R_gs()

double ProcessLib::HeatTransportBHE::BHE::BHE_1P::compute_R_gs ( double const chi,
double const R_g )
staticprivate

Definition at line 95 of file BHE_1P.cpp.

96{
97 return (1 - chi) * R_g;
98}

Referenced by calcThermalResistances().

◆ crossSectionAreas()

◆ getBHEBottomDirichletBCNodesAndComponents()

std::optional< std::array< std::pair< std::size_t, int >, 2 > > ProcessLib::HeatTransportBHE::BHE::BHE_1P::getBHEBottomDirichletBCNodesAndComponents ( std::size_t const ,
int const ,
int const  )
static

Definition at line 163 of file BHE_1P.cpp.

167{
168 return {};
169}

◆ getBHEInflowDirichletBCNodesAndComponents()

std::array< std::pair< std::size_t, int >, 2 > ProcessLib::HeatTransportBHE::BHE::BHE_1P::getBHEInflowDirichletBCNodesAndComponents ( std::size_t const top_node_id,
std::size_t const bottom_node_id,
int const in_component_id )
static

Definition at line 152 of file BHE_1P.cpp.

156{
157 return {std::make_pair(top_node_id, in_component_id),
158 std::make_pair(bottom_node_id, in_component_id)};
159}

◆ pipeAdvectionVectors()

std::array< Eigen::Vector3d, BHE_1P::number_of_unknowns > ProcessLib::HeatTransportBHE::BHE::BHE_1P::pipeAdvectionVectors ( Eigen::Vector3d const & elem_direction) const

Definition at line 83 of file BHE_1P.cpp.

84{
85 double const& rho_r = refrigerant.density;
86 double const& Cp_r = refrigerant.specific_heat_capacity;
87 Eigen::Vector3d adv_vector = rho_r * Cp_r * _flow_velocity * elem_direction;
88
89 return {// pipe, Eq. 19
90 adv_vector,
91 // grout, Eq. 21
92 {0, 0, 0}};
93}
double _flow_velocity
Flow velocity inside the pipes. Depends on the flow_rate.
Definition BHE_1P.h:135

References _flow_velocity, ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::density, ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant, and ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::specific_heat_capacity.

◆ pipeHeatCapacities()

◆ pipeHeatConductions()

std::array< double, BHE_1P::number_of_unknowns > ProcessLib::HeatTransportBHE::BHE::BHE_1P::pipeHeatConductions ( ) const

◆ thermalResistance()

double ProcessLib::HeatTransportBHE::BHE::BHE_1P::thermalResistance ( int const unknown_index) const
inline

Definition at line 106 of file BHE_1P.h.

107 {
108 return _thermal_resistances[unknown_index];
109 }

References _thermal_resistances.

◆ updateFlowRateAndTemperature()

double ProcessLib::HeatTransportBHE::BHE::BHE_1P::updateFlowRateAndTemperature ( double T_out,
double current_time )

Return the inflow temperature for the boundary condition.

Definition at line 177 of file BHE_1P.cpp.

179{
180 auto values =
181 visit([&](auto const& control) { return control(T_out, current_time); },
183 updateHeatTransferCoefficients(values.flow_rate);
184 return values.temperature;
185}

References ProcessLib::HeatTransportBHE::BHE::BHECommon::flowAndTemperatureControl, and updateHeatTransferCoefficients().

◆ updateHeatTransferCoefficients()

void ProcessLib::HeatTransportBHE::BHE::BHE_1P::updateHeatTransferCoefficients ( double const flow_rate)

Member Data Documentation

◆ _flow_velocity

double ProcessLib::HeatTransportBHE::BHE::BHE_1P::_flow_velocity = std::numeric_limits<double>::quiet_NaN()
protected

Flow velocity inside the pipes. Depends on the flow_rate.

Definition at line 135 of file BHE_1P.h.

Referenced by pipeAdvectionVectors(), pipeHeatConductions(), and updateHeatTransferCoefficients().

◆ _pipe

PipeConfiguration1PType const ProcessLib::HeatTransportBHE::BHE::BHE_1P::_pipe
protected

◆ _thermal_resistances

std::array<double, number_of_unknowns> ProcessLib::HeatTransportBHE::BHE::BHE_1P::_thermal_resistances
private

PHI_fg, PHI_gs; Here we store the thermal resistances needed for computation of the heat exchange coefficients in the governing equations of BHE.

Definition at line 147 of file BHE_1P.h.

Referenced by BHE_1P(), thermalResistance(), and updateHeatTransferCoefficients().

◆ inflow_outflow_bc_component_ids

std::pair<int, int> ProcessLib::HeatTransportBHE::BHE::BHE_1P::inflow_outflow_bc_component_ids[]
staticconstexpr
Initial value:
= {
{0, 1}}

Definition at line 111 of file BHE_1P.h.

111 {
112 {0, 1}};

◆ number_of_grout_zones

int ProcessLib::HeatTransportBHE::BHE::BHE_1P::number_of_grout_zones = 1
staticconstexpr

Definition at line 50 of file BHE_1P.h.

◆ number_of_unknowns

int ProcessLib::HeatTransportBHE::BHE::BHE_1P::number_of_unknowns = 2
staticconstexpr

Definition at line 49 of file BHE_1P.h.


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