OGS 6.2.0-244-g47b8a9a9d
ProcessLib::HeatTransportBHE::BHE::BHE_1U Class Referencefinal

Detailed Description

The BHE_1U class is the realization of 1U type of Borehole Heate Exchanger. In this class, the pipe heat capacity, pipe heat conductiion, pie advection vectors are intialized according to the geometry of 1U type of BHE. For 1U type of BHE, 4 primary unknowns are assigned on the 1D BHE elements. They are the temperature in inflow pipe T_in, temperature in outflow pipe T_out temperature of the two grout zones sorrounding the inflow and outflow pipe T_g1 and T_g2. These primary varaibles are solved according to heat convection and conduction equations on the pipes and also in the grout zones. The interaction of the 1U type of BHE and the sorrounding 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_1U.h.

#include <BHE_1U.h>

Inheritance diagram for ProcessLib::HeatTransportBHE::BHE::BHE_1U:
Collaboration diagram for ProcessLib::HeatTransportBHE::BHE::BHE_1U:

Public Member Functions

 BHE_1U (BoreholeGeometry const &borehole, RefrigerantProperties const &refrigerant, GroutParameters const &grout, FlowAndTemperatureControl const &flowAndTemperatureControl, PipeConfiguration1U const &pipes)
 
std::array< double, number_of_unknownspipeHeatCapacities () const
 
std::array< double, number_of_unknownspipeHeatConductions () const
 
std::array< Eigen::Vector3d, number_of_unknownspipeAdvectionVectors () const
 
template<int NPoints, typename SingleUnknownMatrixType , typename RMatrixType , typename RPiSMatrixType , typename RSMatrixType >
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) const
 
double updateFlowRateAndTemperature (double T_out, double current_time)
 Return the inflow temperature for the boundary condition. More...
 
double thermalResistance (int const unknown_index) const
 
std::array< double, number_of_unknownscrossSectionAreas () const
 

Static Public Attributes

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

Private Member Functions

void updateHeatTransferCoefficients (double const flow_rate)
 
std::array< double, number_of_unknownscalcThermalResistances (double const Nu)
 Nu is the Nusselt number. More...
 

Private Attributes

PipeConfiguration1U const _pipes
 
std::array< double, number_of_unknowns_thermal_resistances
 
double _flow_velocity
 Flow velocity inside the pipes. Depends on the flow_rate. More...
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ BHE_1U()

ProcessLib::HeatTransportBHE::BHE::BHE_1U::BHE_1U ( BoreholeGeometry const &  borehole,
RefrigerantProperties const &  refrigerant,
GroutParameters const &  grout,
FlowAndTemperatureControl const &  flowAndTemperatureControl,
PipeConfiguration1U const &  pipes 
)

Definition at line 25 of file BHE_1U.cpp.

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

30  : BHECommon{borehole, refrigerant, grout, flowAndTemperatureControl},
31  _pipes(pipes)
32 {
33  // Initialize thermal resistances.
34  auto values = apply_visitor(
35  [&](auto const& control) {
36  return control(refrigerant.reference_temperature,
37  0. /* initial time */);
38  },
40  updateHeatTransferCoefficients(values.flow_rate);
41 }
PipeConfiguration1U const _pipes
Definition: BHE_1U.h:140
void updateHeatTransferCoefficients(double const flow_rate)
Definition: BHE_1U.cpp:170
FlowAndTemperatureControl const flowAndTemperatureControl
Definition: BHECommon.h:44
RefrigerantProperties const refrigerant
Definition: BHECommon.h:42

Member Function Documentation

◆ assembleRMatrices()

template<int NPoints, typename SingleUnknownMatrixType , typename RMatrixType , typename RPiSMatrixType , typename RSMatrixType >
void ProcessLib::HeatTransportBHE::BHE::BHE_1U::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 
) const
inline

Definition at line 63 of file BHE_1U.h.

References OGS_FATAL, and updateFlowRateAndTemperature().

69  {
70  switch (idx_bhe_unknowns)
71  {
72  case 0: // PHI_fig
73  R_matrix.block(0, 2 * NPoints, NPoints, NPoints) +=
74  -1.0 * matBHE_loc_R;
75  R_matrix.block(2 * NPoints, 0, NPoints, NPoints) +=
76  -1.0 * matBHE_loc_R;
77 
78  R_matrix.block(0, 0, NPoints, NPoints) +=
79  1.0 * matBHE_loc_R; // K_i1
80  R_matrix.block(2 * NPoints, 2 * NPoints, NPoints, NPoints) +=
81  1.0 * matBHE_loc_R; // K_ig
82  return;
83  case 1: // PHI_fog
84  R_matrix.block(NPoints, 3 * NPoints, NPoints, NPoints) +=
85  -1.0 * matBHE_loc_R;
86  R_matrix.block(3 * NPoints, NPoints, NPoints, NPoints) +=
87  -1.0 * matBHE_loc_R;
88 
89  R_matrix.block(NPoints, NPoints, NPoints, NPoints) +=
90  1.0 * matBHE_loc_R; // K_o1
91  R_matrix.block(3 * NPoints, 3 * NPoints, NPoints, NPoints) +=
92  1.0 * matBHE_loc_R; // K_og
93  return;
94  case 2: // PHI_gg
95  R_matrix.block(2 * NPoints, 3 * NPoints, NPoints, NPoints) +=
96  -1.0 * matBHE_loc_R;
97  R_matrix.block(3 * NPoints, 2 * NPoints, NPoints, NPoints) +=
98  -1.0 * matBHE_loc_R;
99 
100  R_matrix.block(2 * NPoints, 2 * NPoints, NPoints, NPoints) +=
101  1.0 * matBHE_loc_R; // K_ig // notice we only have
102  // 1 PHI_gg term here.
103  R_matrix.block(3 * NPoints, 3 * NPoints, NPoints, NPoints) +=
104  1.0 * matBHE_loc_R; // K_og // see Diersch 2013 FEFLOW
105  // book page 954 Table M.2
106  return;
107  case 3: // PHI_gs
108  R_s_matrix.template block<NPoints, NPoints>(0, 0).noalias() +=
109  1.0 * matBHE_loc_R;
110 
111  R_pi_s_matrix.block(2 * NPoints, 0, NPoints, NPoints) +=
112  -1.0 * matBHE_loc_R;
113  R_pi_s_matrix.block(3 * NPoints, 0, NPoints, NPoints) +=
114  -1.0 * matBHE_loc_R;
115  R_matrix.block(2 * NPoints, 2 * NPoints, NPoints, NPoints) +=
116  1.0 * matBHE_loc_R; // K_ig
117  R_matrix.block(3 * NPoints, 3 * NPoints, NPoints, NPoints) +=
118  1.0 * matBHE_loc_R; // K_og
119  return;
120  default:
121  OGS_FATAL(
122  "Error!!! In the function BHE_1U::assembleRMatrices, "
123  "the index of bhe unknowns is out of range! ");
124  }
125  }
#define OGS_FATAL(fmt,...)
Definition: Error.h:63

◆ calcThermalResistances()

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

Nu is the Nusselt number.

Definition at line 182 of file BHE_1U.cpp.

References _pipes, ProcessLib::HeatTransportBHE::BHE::BHECommon::borehole_geometry, ProcessLib::HeatTransportBHE::BHE::Pipe::diameter, ProcessLib::HeatTransportBHE::BHE::BoreholeGeometry::diameter, ProcessLib::HeatTransportBHE::BHE::PipeConfiguration1U::distance, ProcessLib::HeatTransportBHE::BHE::BHECommon::grout, ProcessLib::HeatTransportBHE::BHE::PipeConfiguration1U::inlet, ProcessLib::HeatTransportBHE::BHE::GroutParameters::lambda_g, ProcessLib::HeatTransportBHE::BHE::PipeConfiguration1U::outlet, ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant, ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::thermal_conductivity, ProcessLib::HeatTransportBHE::BHE::thermalResistancesGroutSoil(), and ProcessLib::HeatTransportBHE::BHE::Pipe::wall_thermal_conductivity.

Referenced by crossSectionAreas(), and updateHeatTransferCoefficients().

184 {
185  constexpr double pi = boost::math::constants::pi<double>();
186 
187  double const& lambda_r = refrigerant.thermal_conductivity;
188  double const& lambda_g = grout.lambda_g;
189  double const& lambda_p = _pipes.inlet.wall_thermal_conductivity;
190 
191  // thermal resistances due to advective flow of refrigerant in the _pipes
192  // Eq. 36 in Diersch_2011_CG
193  double const R_adv_i1 = 1.0 / (Nu * lambda_r * pi);
194  double const R_adv_o1 = 1.0 / (Nu * lambda_r * pi);
195 
196  // thermal resistance due to thermal conductivity of the pipe wall material
197  // Eq. 49
198  double const R_con_a =
199  std::log(_pipes.outlet.diameter / _pipes.inlet.diameter) /
200  (2.0 * pi * lambda_p);
201 
202  // the average outer diameter of the _pipes
203  double const& d0 = _pipes.outlet.diameter;
204  double const& D = borehole_geometry.diameter;
205  // Eq. 51
206  double const chi = std::log(std::sqrt(D * D + 2 * d0 * d0) / 2 / d0) /
207  std::log(D / std::sqrt(2) / d0);
208  // Eq. 52
209  // thermal resistances of the grout
210  double const R_g =
211  std::acosh((D * D + d0 * d0 - _pipes.distance * _pipes.distance) /
212  (2 * D * d0)) /
213  (2 * pi * lambda_g) * (1.601 - 0.888 * _pipes.distance / D);
214  // thermal resistance due to the grout transition.
215  double const R_con_b = chi * R_g;
216  // Eq. 29 and 30
217  double const R_fig = R_adv_i1 + R_con_a + R_con_b;
218  double const R_fog = R_adv_o1 + R_con_a + R_con_b;
219 
220  // thermal resistance due to inter-grout exchange
221  double const R_ar =
222  std::acosh((2.0 * _pipes.distance * _pipes.distance - d0 * d0) / d0 /
223  d0) /
224  (2.0 * pi * lambda_g);
225 
226  double R_gg, R_gs;
227  std::tie(R_gg, R_gs) = thermalResistancesGroutSoil(chi, R_ar, R_g);
228 
229  return {{R_fig, R_fog, R_gg, R_gs}};
230 
231  // keep the following lines------------------------------------------------
232  // when debugging the code, printing the R and phi values are needed--------
233  // std::cout << "Rfig =" << R_fig << " Rfog =" << R_fog << " Rgg =" <<
234  // R_gg << " Rgs =" << R_gs << "\n"; double phi_fig = 1.0 / (R_fig *
235  // S_i); double phi_fog = 1.0 / (R_fog * S_o); double phi_gg = 1.0 / (R_gg
236  // * S_g1); double phi_gs = 1.0 / (R_gs * S_gs); std::cout << "phi_fig ="
237  // << phi_fig << " phi_fog =" << phi_fog << " phi_gg =" << phi_gg << "
238  // phi_gs =" << phi_gs << "\n";
239  // -------------------------------------------------------------------------
240 }
PipeConfiguration1U const _pipes
Definition: BHE_1U.h:140
double const wall_thermal_conductivity
Definition: Pipe.h:30
BoreholeGeometry const borehole_geometry
Definition: BHECommon.h:41
std::pair< double, double > thermalResistancesGroutSoil(double chi, double const R_ar, double const R_g)
Definition: BHE_1U.cpp:125
RefrigerantProperties const refrigerant
Definition: BHECommon.h:42

◆ crossSectionAreas()

◆ pipeAdvectionVectors()

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

Definition at line 85 of file BHE_1U.cpp.

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

86 {
87  double const& rho_r = refrigerant.density;
88  double const& Cp_r = refrigerant.specific_heat_capacity;
89 
90  return {{// pipe i1, Eq. 19
91  {0, 0, -rho_r * Cp_r * _flow_velocity},
92  // pipe o1, Eq. 20
93  {0, 0, rho_r * Cp_r * _flow_velocity},
94  // grout g1, Eq. 21
95  {0, 0, 0},
96  // grout g2, Eq. 22
97  {0, 0, 0}}};
98 }
double _flow_velocity
Flow velocity inside the pipes. Depends on the flow_rate.
Definition: BHE_1U.h:166
RefrigerantProperties const refrigerant
Definition: BHECommon.h:42

◆ pipeHeatCapacities()

std::array< double, BHE_1U::number_of_unknowns > ProcessLib::HeatTransportBHE::BHE::BHE_1U::pipeHeatCapacities ( ) const

Definition at line 43 of file BHE_1U.cpp.

References ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::density, ProcessLib::HeatTransportBHE::BHE::BHECommon::grout, ProcessLib::HeatTransportBHE::BHE::GroutParameters::heat_cap_g, ProcessLib::HeatTransportBHE::BHE::GroutParameters::porosity_g, ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant, ProcessLib::HeatTransportBHE::BHE::GroutParameters::rho_g, ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::specific_heat_capacity, and MaterialPropertyLib::specific_heat_capacity.

45 {
46  double const& rho_r = refrigerant.density;
48  double const& rho_g = grout.rho_g;
49  double const& porosity_g = grout.porosity_g;
50  double const& heat_cap_g = grout.heat_cap_g;
51 
52  return {{/*i1*/ rho_r * specific_heat_capacity,
53  /*o1*/ rho_r * specific_heat_capacity,
54  /*g1*/ (1.0 - porosity_g) * rho_g * heat_cap_g,
55  /*g2*/ (1.0 - porosity_g) * rho_g * heat_cap_g}};
56 }
RefrigerantProperties const refrigerant
Definition: BHECommon.h:42

◆ pipeHeatConductions()

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

Definition at line 58 of file BHE_1U.cpp.

References _flow_velocity, _pipes, ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::density, ProcessLib::HeatTransportBHE::BHE::BHECommon::grout, ProcessLib::HeatTransportBHE::BHE::GroutParameters::lambda_g, ProcessLib::HeatTransportBHE::BHE::PipeConfiguration1U::longitudinal_dispersion_length, ProcessLib::HeatTransportBHE::BHE::GroutParameters::porosity_g, ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant, ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::specific_heat_capacity, and ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::thermal_conductivity.

60 {
61  double const& lambda_r = refrigerant.thermal_conductivity;
62  double const& rho_r = refrigerant.density;
63  double const& Cp_r = refrigerant.specific_heat_capacity;
64  double const& alpha_L = _pipes.longitudinal_dispersion_length;
65  double const& porosity_g = grout.porosity_g;
66  double const& lambda_g = grout.lambda_g;
67 
68  double const velocity_norm = std::abs(_flow_velocity) * std::sqrt(2);
69 
70  // Here we calculate the laplace coefficients in the governing
71  // equations of BHE. These governing equations can be found in
72  // 1) Diersch (2013) FEFLOW book on page 952, M.120-122, or
73  // 2) Diersch (2011) Comp & Geosci 37:1122-1135, Eq. 19-22.
74  return {{// pipe i1, Eq. 19
75  (lambda_r + rho_r * Cp_r * alpha_L * velocity_norm),
76  // pipe o1, Eq. 20
77  (lambda_r + rho_r * Cp_r * alpha_L * velocity_norm),
78  // pipe g1, Eq. 21
79  (1.0 - porosity_g) * lambda_g,
80  // pipe g2, Eq. 22
81  (1.0 - porosity_g) * lambda_g}};
82 }
PipeConfiguration1U const _pipes
Definition: BHE_1U.h:140
double _flow_velocity
Flow velocity inside the pipes. Depends on the flow_rate.
Definition: BHE_1U.h:166
RefrigerantProperties const refrigerant
Definition: BHECommon.h:42

◆ thermalResistance()

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

Definition at line 130 of file BHE_1U.h.

References _thermal_resistances.

131  {
132  return _thermal_resistances[unknown_index];
133  }
std::array< double, number_of_unknowns > _thermal_resistances
Definition: BHE_1U.h:163

◆ updateFlowRateAndTemperature()

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

Return the inflow temperature for the boundary condition.

Definition at line 242 of file BHE_1U.cpp.

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

Referenced by assembleRMatrices().

244 {
245  auto values = apply_visitor(
246  [&](auto const& control) { return control(T_out, current_time); },
248  updateHeatTransferCoefficients(values.flow_rate);
249  return values.temperature;
250 }
void updateHeatTransferCoefficients(double const flow_rate)
Definition: BHE_1U.cpp:170
FlowAndTemperatureControl const flowAndTemperatureControl
Definition: BHECommon.h:44

◆ updateHeatTransferCoefficients()

void ProcessLib::HeatTransportBHE::BHE::BHE_1U::updateHeatTransferCoefficients ( double const  flow_rate)
private

Definition at line 170 of file BHE_1U.cpp.

References _flow_velocity, _pipes, _thermal_resistances, ProcessLib::HeatTransportBHE::BHE::BHECommon::borehole_geometry, calcThermalResistances(), ProcessLib::HeatTransportBHE::BHE::calculateThermoMechanicalFlowPropertiesPipe(), ProcessLib::HeatTransportBHE::BHE::PipeConfiguration1U::inlet, ProcessLib::HeatTransportBHE::BHE::BoreholeGeometry::length, and ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant.

Referenced by BHE_1U(), crossSectionAreas(), and updateFlowRateAndTemperature().

172 {
173  auto const tm_flow_properties = calculateThermoMechanicalFlowPropertiesPipe(
175 
176  _flow_velocity = tm_flow_properties.velocity;
178  calcThermalResistances(tm_flow_properties.nusselt_number);
179 }
PipeConfiguration1U const _pipes
Definition: BHE_1U.h:140
std::array< double, number_of_unknowns > calcThermalResistances(double const Nu)
Nu is the Nusselt number.
Definition: BHE_1U.cpp:182
ThermoMechanicalFlowProperties calculateThermoMechanicalFlowPropertiesPipe(Pipe const &pipe, double const length, RefrigerantProperties const &fluid, double const flow_rate)
BoreholeGeometry const borehole_geometry
Definition: BHECommon.h:41
std::array< double, number_of_unknowns > _thermal_resistances
Definition: BHE_1U.h:163
double _flow_velocity
Flow velocity inside the pipes. Depends on the flow_rate.
Definition: BHE_1U.h:166
RefrigerantProperties const refrigerant
Definition: BHECommon.h:42

Member Data Documentation

◆ _flow_velocity

double ProcessLib::HeatTransportBHE::BHE::BHE_1U::_flow_velocity
private

Flow velocity inside the pipes. Depends on the flow_rate.

Definition at line 166 of file BHE_1U.h.

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

◆ _pipes

PipeConfiguration1U const ProcessLib::HeatTransportBHE::BHE::BHE_1U::_pipes
private

◆ _thermal_resistances

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

PHI_fig, PHI_fog, PHI_gg, PHI_gs; Here we store the thermal resistances needed for computation of the heat exchange coefficients in the governing equations of BHE. These governing equations can be found in 1) Diersch (2013) FEFLOW book on page 958, M.3, or 2) Diersch (2011) Comp & Geosci 37:1122-1135, Eq. 90-97.

Definition at line 163 of file BHE_1U.h.

Referenced by thermalResistance(), and updateHeatTransferCoefficients().

◆ inflow_outflow_bc_component_ids

constexpr std::pair< int, int > ProcessLib::HeatTransportBHE::BHE::BHE_1U::inflow_outflow_bc_component_ids
static
Initial value:
= {
{0, 1}}

Definition at line 135 of file BHE_1U.h.

Referenced by ProcessLib::HeatTransportBHE::BHE::thermalResistancesGroutSoil().

◆ number_of_grout_zones

constexpr int ProcessLib::HeatTransportBHE::BHE::BHE_1U::number_of_grout_zones = 2
static

Definition at line 49 of file BHE_1U.h.

◆ number_of_unknowns

constexpr int ProcessLib::HeatTransportBHE::BHE::BHE_1U::number_of_unknowns = 4
static

Definition at line 48 of file BHE_1U.h.


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