OGS 6.2.1-76-gbb689931b
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 23 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().

28  : BHECommon{borehole, refrigerant, grout, flowAndTemperatureControl},
29  _pipes(pipes)
30 {
31  // Initialize thermal resistances.
32  auto values = visit(
33  [&](auto const& control) {
34  return control(refrigerant.reference_temperature,
35  0. /* initial time */);
36  },
38  updateHeatTransferCoefficients(values.flow_rate);
39 }
PipeConfiguration1U const _pipes
Definition: BHE_1U.h:140
void updateHeatTransferCoefficients(double const flow_rate)
Definition: BHE_1U.cpp:166
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 178 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().

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

84 {
85  double const& rho_r = refrigerant.density;
86  double const& Cp_r = refrigerant.specific_heat_capacity;
87 
88  return {{// pipe i1, Eq. 19
89  {0, 0, -rho_r * Cp_r * _flow_velocity},
90  // pipe o1, Eq. 20
91  {0, 0, rho_r * Cp_r * _flow_velocity},
92  // grout g1, Eq. 21
93  {0, 0, 0},
94  // grout g2, Eq. 22
95  {0, 0, 0}}};
96 }
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 41 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.

43 {
44  double const& rho_r = refrigerant.density;
46  double const& rho_g = grout.rho_g;
47  double const& porosity_g = grout.porosity_g;
48  double const& heat_cap_g = grout.heat_cap_g;
49 
50  return {{/*i1*/ rho_r * specific_heat_capacity,
51  /*o1*/ rho_r * specific_heat_capacity,
52  /*g1*/ (1.0 - porosity_g) * rho_g * heat_cap_g,
53  /*g2*/ (1.0 - porosity_g) * rho_g * heat_cap_g}};
54 }
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 56 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.

58 {
59  double const& lambda_r = refrigerant.thermal_conductivity;
60  double const& rho_r = refrigerant.density;
61  double const& Cp_r = refrigerant.specific_heat_capacity;
62  double const& alpha_L = _pipes.longitudinal_dispersion_length;
63  double const& porosity_g = grout.porosity_g;
64  double const& lambda_g = grout.lambda_g;
65 
66  double const velocity_norm = std::abs(_flow_velocity) * std::sqrt(2);
67 
68  // Here we calculate the laplace coefficients in the governing
69  // equations of BHE. These governing equations can be found in
70  // 1) Diersch (2013) FEFLOW book on page 952, M.120-122, or
71  // 2) Diersch (2011) Comp & Geosci 37:1122-1135, Eq. 19-22.
72  return {{// pipe i1, Eq. 19
73  (lambda_r + rho_r * Cp_r * alpha_L * velocity_norm),
74  // pipe o1, Eq. 20
75  (lambda_r + rho_r * Cp_r * alpha_L * velocity_norm),
76  // pipe g1, Eq. 21
77  (1.0 - porosity_g) * lambda_g,
78  // pipe g2, Eq. 22
79  (1.0 - porosity_g) * lambda_g}};
80 }
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 239 of file BHE_1U.cpp.

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

Referenced by assembleRMatrices().

241 {
242  auto values =
243  visit([&](auto const& control) { return control(T_out, current_time); },
245  updateHeatTransferCoefficients(values.flow_rate);
246  return values.temperature;
247 }
void updateHeatTransferCoefficients(double const flow_rate)
Definition: BHE_1U.cpp:166
FlowAndTemperatureControl const flowAndTemperatureControl
Definition: BHECommon.h:44

◆ updateHeatTransferCoefficients()

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

Definition at line 166 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().

168 {
169  auto const tm_flow_properties = calculateThermoMechanicalFlowPropertiesPipe(
171 
172  _flow_velocity = tm_flow_properties.velocity;
174  calcThermalResistances(tm_flow_properties.nusselt_number);
175 }
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:178
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.

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