OGS
ProcessLib::HeatTransportBHE::BHE::BHE_2U Class Referencefinal

Detailed Description

The BHE_2U class is the realization of 2U type of Borehole Heat Exchanger. In this class, the pipe heat capacity, pipe heat conduction, pipe advection vectors are initialized according to the geometry of 2U type of BHE. For 2U type of BHE, 8 primary unknowns are assigned on the 1D BHE elements. They are the temperature in inflow pipe T_i1 and T_i2, temperature in outflow pipe T_o1 and T_o2, temperature of the four grout zones surrounding the inflow and outflow pipe T_g1, T_g2, T_g3 and T_g4. These primary variables are solved according to heat convection and conduction equations on the pipes and also in the grout zones. The interaction of the 2U 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_2U.h.

#include <BHE_2U.h>

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

Public Member Functions

 BHE_2U (BoreholeGeometry const &borehole, RefrigerantProperties const &refrigerant, GroutParameters const &grout, FlowAndTemperatureControl const &flowAndTemperatureControl, PipeConfigurationUType const &pipes, bool const use_python_bcs)
std::array< double, number_of_flow_legsflowLegs () const
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
std::vector< double > thermalResistances (ParameterLib::SpatialPosition const &pos) const
double updateFlowRateAndTemperature (double T_out, double current_time)
 Return the inflow temperature for the boundary condition.
std::array< double, number_of_unknownscrossSectionAreas (ParameterLib::SpatialPosition const &pos) const
void updateHeatTransferCoefficients (double const flow_rate)
Public Member Functions inherited from ProcessLib::HeatTransportBHE::BHE::BHECommonUType
 BHECommonUType (BoreholeGeometry const &borehole, RefrigerantProperties const &refrigerant, GroutParameters const &grout, FlowAndTemperatureControl const &flowAndTemperatureControl, PipeConfigurationUType const &pipes, bool const use_python_bcs)
Public Member Functions inherited from ProcessLib::HeatTransportBHE::BHE::BHECommon
 BHECommon (BoreholeGeometry const &borehole_geometry_, RefrigerantProperties const &refrigerant_, GroutParameters const &grout_, FlowAndTemperatureControl const &flowAndTemperatureControl_, bool const use_python_bcs_)
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, int const in_component_id)
static std::optional< std::array< std::pair< std::size_t, int >, 2 > > getBHEBottomDirichletBCNodesAndComponents (std::size_t const bottom_node_id, int const in_component_id, int const out_component_id)

Static Public Attributes

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

Private Member Functions

std::vector< double > calcThermalResistances (double const Nu, ParameterLib::SpatialPosition const &pos) const

Private Attributes

double cached_nu_ = 0.0

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
Protected Attributes inherited from ProcessLib::HeatTransportBHE::BHE::BHECommonUType
PipeConfigurationUType const _pipes
double flow_velocity = 0.0

Constructor & Destructor Documentation

◆ BHE_2U()

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

Definition at line 20 of file BHE_2U.cpp.

27 pipes, use_python_bcs}
28{
29 checkEqualPipeOutsideDiameters(_pipes.inlet, _pipes.outlet, "BHE 2U");
30 // Initialize thermal resistances.
31 auto values = visit(
32 [&](auto const& control)
33 {
34 return control(refrigerant.reference_temperature,
35 0. /* initial time */);
36 },
38 updateHeatTransferCoefficients(values.flow_rate);
39}
BHECommonUType(BoreholeGeometry const &borehole, RefrigerantProperties const &refrigerant, GroutParameters const &grout, FlowAndTemperatureControl const &flowAndTemperatureControl, PipeConfigurationUType const &pipes, bool const use_python_bcs)
RefrigerantProperties const refrigerant
Definition BHECommon.h:51
FlowAndTemperatureControl const flowAndTemperatureControl
Definition BHECommon.h:53
void updateHeatTransferCoefficients(double const flow_rate)
Definition BHE_2U.cpp:140
void checkEqualPipeOutsideDiameters(Pipe const &inlet, Pipe const &outlet, std::string_view const context)

References ProcessLib::HeatTransportBHE::BHE::BHECommonUType::BHECommonUType(), ProcessLib::HeatTransportBHE::BHE::BHECommonUType::_pipes, ProcessLib::HeatTransportBHE::BHE::checkEqualPipeOutsideDiameters(), ProcessLib::HeatTransportBHE::BHE::BHECommon::flowAndTemperatureControl, ProcessLib::HeatTransportBHE::BHE::BHECommon::grout, ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant, updateHeatTransferCoefficients(), and ProcessLib::HeatTransportBHE::BHE::BHECommon::use_python_bcs.

Member Function Documentation

◆ assembleRMatrices()

template<int NPoints, typename SingleUnknownMatrixType, typename RMatrixType, typename RPiSMatrixType, typename RSMatrixType>
void ProcessLib::HeatTransportBHE::BHE::BHE_2U::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 80 of file BHE_2U.h.

86 {
87 switch (idx_bhe_unknowns)
88 {
89 case 0: // PHI_fig
90 R_matrix.block(0, 4 * NPoints, NPoints, NPoints) +=
91 -1.0 * matBHE_loc_R;
92 R_matrix.block(4 * NPoints, 0, NPoints, NPoints) +=
93 -1.0 * matBHE_loc_R; // R_i1
94
95 R_matrix.block(2, 5 * NPoints, NPoints, NPoints) +=
96 -1.0 * matBHE_loc_R;
97 R_matrix.block(5 * NPoints, 2, NPoints, NPoints) +=
98 -1.0 * matBHE_loc_R; // R_i2
99
100 R_matrix.block(0, 0, NPoints, NPoints) +=
101 1.0 * matBHE_loc_R; // K_i1
102 R_matrix.block(NPoints, NPoints, NPoints, NPoints) +=
103 1.0 * matBHE_loc_R; // K_i2
104 R_matrix.block(4 * NPoints, 4 * NPoints, NPoints, NPoints) +=
105 1.0 * matBHE_loc_R;
106 R_matrix.block(5 * NPoints, 5 * NPoints, NPoints, NPoints) +=
107 1.0 * matBHE_loc_R; // K_ig
108 return;
109 case 1: // PHI_fog
110 R_matrix.block(2 * NPoints, 6 * NPoints, NPoints, NPoints) +=
111 -1.0 * matBHE_loc_R;
112 R_matrix.block(6 * NPoints, 2 * NPoints, NPoints, NPoints) +=
113 -1.0 * matBHE_loc_R; // R_o1
114 R_matrix.block(3 * NPoints, 7 * NPoints, NPoints, NPoints) +=
115 -1.0 * matBHE_loc_R;
116 R_matrix.block(7 * NPoints, 3 * NPoints, NPoints, NPoints) +=
117 -1.0 * matBHE_loc_R; // R_o2
118
119 R_matrix.block(2 * NPoints, 2 * NPoints, NPoints, NPoints) +=
120 1.0 * matBHE_loc_R; // K_o1
121 R_matrix.block(3 * NPoints, 3 * NPoints, NPoints, NPoints) +=
122 1.0 * matBHE_loc_R; // K_o2
123 R_matrix.block(6 * NPoints, 6 * NPoints, NPoints, NPoints) +=
124 1.0 * matBHE_loc_R;
125 R_matrix.block(7 * NPoints, 7 * NPoints, NPoints, NPoints) +=
126 1.0 * matBHE_loc_R; // K_og
127 return;
128 case 2: // PHI_gg_1
129 R_matrix.block(4 * NPoints, 6 * NPoints, NPoints, NPoints) +=
130 -1.0 * matBHE_loc_R;
131 R_matrix.block(6 * NPoints, 4 * NPoints, NPoints, NPoints) +=
132 -1.0 * matBHE_loc_R;
133 R_matrix.block(4 * NPoints, 7 * NPoints, NPoints, NPoints) +=
134 -1.0 * matBHE_loc_R;
135 R_matrix.block(7 * NPoints, 4 * NPoints, NPoints, NPoints) +=
136 -1.0 * matBHE_loc_R;
137 R_matrix.block(5 * NPoints, 6 * NPoints, NPoints, NPoints) +=
138 -1.0 * matBHE_loc_R;
139 R_matrix.block(6 * NPoints, 5 * NPoints, NPoints, NPoints) +=
140 -1.0 * matBHE_loc_R;
141 R_matrix.block(5 * NPoints, 7 * NPoints, NPoints, NPoints) +=
142 -1.0 * matBHE_loc_R;
143 R_matrix.block(7 * NPoints, 5 * NPoints, NPoints, NPoints) +=
144 -1.0 * matBHE_loc_R; // R_g1
145
146 R_matrix.block(4 * NPoints, 4 * NPoints, NPoints, NPoints) +=
147 2.0 * matBHE_loc_R;
148 R_matrix.block(5 * NPoints, 5 * NPoints, NPoints, NPoints) +=
149 2.0 * matBHE_loc_R; // K_ig
150 R_matrix.block(6 * NPoints, 6 * NPoints, NPoints, NPoints) +=
151 2.0 * matBHE_loc_R;
152 R_matrix.block(7 * NPoints, 7 * NPoints, NPoints, NPoints) +=
153 2.0 * matBHE_loc_R; // K_og
154 return;
155 case 3: // PHI_gg_2
156 R_matrix.block(4 * NPoints, 5 * NPoints, NPoints, NPoints) +=
157 -1.0 * matBHE_loc_R;
158 R_matrix.block(5 * NPoints, 4 * NPoints, NPoints, NPoints) +=
159 -1.0 * matBHE_loc_R;
160 R_matrix.block(6 * NPoints, 7 * NPoints, NPoints, NPoints) +=
161 -1.0 * matBHE_loc_R;
162 R_matrix.block(7 * NPoints, 6 * NPoints, NPoints, NPoints) +=
163 -1.0 * matBHE_loc_R; // R_g2
164
165 R_matrix.block(4 * NPoints, 4 * NPoints, NPoints, NPoints) +=
166 1.0 * matBHE_loc_R;
167 R_matrix.block(5 * NPoints, 5 * NPoints, NPoints, NPoints) +=
168 1.0 * matBHE_loc_R; // K_ig
169 R_matrix.block(6 * NPoints, 6 * NPoints, NPoints, NPoints) +=
170 1.0 * matBHE_loc_R;
171 R_matrix.block(7 * NPoints, 7 * NPoints, NPoints, NPoints) +=
172 1.0 * matBHE_loc_R; // K_og
173 return;
174 case 4: // PHI_gs
175 R_s_matrix.template block<NPoints, NPoints>(0, 0).noalias() +=
176 1.0 * matBHE_loc_R;
177
178 R_pi_s_matrix.block(4 * NPoints, 0, NPoints, NPoints) +=
179 -1.0 * matBHE_loc_R;
180 R_pi_s_matrix.block(5 * NPoints, 0, NPoints, NPoints) +=
181 -1.0 * matBHE_loc_R;
182 R_pi_s_matrix.block(6 * NPoints, 0, NPoints, NPoints) +=
183 -1.0 * matBHE_loc_R;
184 R_pi_s_matrix.block(7 * NPoints, 0, NPoints, NPoints) +=
185 -1.0 * matBHE_loc_R;
186 R_matrix.block(4 * NPoints, 4 * NPoints, NPoints, NPoints) +=
187 1.0 * matBHE_loc_R;
188 R_matrix.block(5 * NPoints, 5 * NPoints, NPoints, NPoints) +=
189 1.0 * matBHE_loc_R; // K_ig
190 R_matrix.block(6 * NPoints, 6 * NPoints, NPoints, NPoints) +=
191 1.0 * matBHE_loc_R;
192 R_matrix.block(7 * NPoints, 7 * NPoints, NPoints, NPoints) +=
193 1.0 * matBHE_loc_R; // K_og
194 return;
195 default:
196 OGS_FATAL(
197 "BHE_2U::assembleRMatrices: unknown index {:d} "
198 "out of range.",
199 idx_bhe_unknowns);
200 }
201 }
#define OGS_FATAL(...)
Definition Error.h:10

References OGS_FATAL.

◆ calcThermalResistances()

std::vector< double > ProcessLib::HeatTransportBHE::BHE::BHE_2U::calcThermalResistances ( double const Nu,
ParameterLib::SpatialPosition const & pos ) const
private

Definition at line 155 of file BHE_2U.cpp.

157{
158 constexpr double pi = std::numbers::pi;
159
160 double const lambda_r = refrigerant.thermal_conductivity;
161 double const lambda_g = grout.lambda_g;
162 // t=0.0: borehole properties are physically time-invariant; genuinely
163 // time-varying parameter types are rejected in createPipe.
164 double const lambda_p_inlet =
165 sampleStrictPositive(_pipes.inlet.wall_thermal_conductivity, 0.0, pos,
166 "inlet wall_thermal_conductivity");
167 double const lambda_p_outlet =
168 sampleStrictPositive(_pipes.outlet.wall_thermal_conductivity, 0.0, pos,
169 "outlet wall_thermal_conductivity");
170
171 // thermal resistances due to advective flow of refrigerant in the _pipes
172 double const R_adv_i = 1.0 / (Nu * lambda_r * pi);
173 double const R_adv_o = 1.0 / (Nu * lambda_r * pi);
174
175 // thermal resistance due to thermal conductivity of the pipe wall material
176 double const R_con_a_inlet =
177 pipeWallThermalResistance(_pipes.inlet, lambda_p_inlet);
178 double const R_con_a_outlet =
179 pipeWallThermalResistance(_pipes.outlet, lambda_p_outlet);
180
181 // Single pipe outside diameter used by the resistance formulas; the U-type
182 // constructor enforces that inlet and outlet share it.
183 double const d0 = _pipes.inlet.outsideDiameter();
184 double const D = sampleStrictPositive(borehole_geometry.diameter, 0.0, pos,
185 "borehole_diameter");
186 // Context prefix shared by the acosh-argument checks below. `cause` names
187 // the physical degeneracy that drives the argument to <= 1 so the fatal
188 // message is actionable.
189 auto const geometry_context =
190 [&](std::string_view const equation, std::string_view const cause)
191 {
192 return uTypeGeometryContext(pos, D, d0, _pipes.distance, equation,
193 cause);
194 };
195 // Eq. 38: chi requires D > 2 * d0 so that log(D/(2*d0)) > 0.
196 checkBoreholeVsPipeDiameter(D, 2.0 * d0, pos,
197 "BHE 2U chi formula (Eq. 38)");
198 double const chi =
199 std::log(std::sqrt(D * D + 4 * d0 * d0) / 2 / std::sqrt(2) / d0) /
200 std::log(D / 2 / d0);
201 // Eq. 39
202 double const acosh_arg_R_g =
203 (D * D + d0 * d0 - 2 * _pipes.distance * _pipes.distance) /
204 (2 * D * d0);
206 acosh_arg_R_g,
207 geometry_context(
208 "BHE 2U R_g (Eq. 39)",
209 "The argument drops to <= 1 when a pipe reaches the borehole wall, "
210 "giving a zero grout resistance R_g and an infinite (1/R) assembly "
211 "coefficient."));
212 double const R_g = std::acosh(acosh_arg_R_g) / (2 * pi * lambda_g) *
213 (3.098 - 4.432 * std::sqrt(2) * _pipes.distance / D +
214 2.364 * 2 * _pipes.distance * _pipes.distance / D / D);
215
216 double const acosh_arg_R_ar_1 =
217 (2.0 * _pipes.distance * _pipes.distance - d0 * d0) / d0 / d0;
219 acosh_arg_R_ar_1,
220 geometry_context(
221 "BHE 2U R_ar_1",
222 "The argument drops to <= 1 when the pipes are too close, giving a "
223 "zero inter-grout resistance R_ar and an infinite (1/R) assembly "
224 "coefficient."));
225 double const R_ar_1 = std::acosh(acosh_arg_R_ar_1) / (2.0 * pi * lambda_g);
226
227 double const acosh_arg_R_ar_2 =
228 (2.0 * 2.0 * _pipes.distance * _pipes.distance - d0 * d0) / d0 / d0;
230 acosh_arg_R_ar_2,
231 geometry_context(
232 "BHE 2U R_ar_2",
233 "The argument drops to <= 1 when the pipes are too close, giving a "
234 "zero inter-grout resistance R_ar and an infinite (1/R) assembly "
235 "coefficient."));
236 double const R_ar_2 = std::acosh(acosh_arg_R_ar_2) / (2.0 * pi * lambda_g);
237
238 auto const [chi_new, R_gg_1, R_gg_2, R_gs] =
239 thermalResistancesGroutSoil2U(chi, R_ar_1, R_ar_2, R_g);
240
241 double const R_con_b = chi_new * R_g;
242
243 double const R_fig = R_adv_i + R_con_a_inlet + R_con_b;
244 double const R_fog = R_adv_o + R_con_a_outlet + R_con_b;
245
246 return {R_fig, R_fog, R_gg_1, R_gg_2, R_gs};
247}
void checkAcoshArg(double const arg, std::string_view const context)
double sampleStrictPositive(ParameterLib::Parameter< double > const &param, double const t, ParameterLib::SpatialPosition const &pos, std::string_view const param_role)
void checkBoreholeVsPipeDiameter(double const D, double const min_diameter, ParameterLib::SpatialPosition const &pos, std::string_view const context)
std::string uTypeGeometryContext(ParameterLib::SpatialPosition const &pos, double const D, double const d0, double const distance, std::string_view const equation, std::string_view const cause)
double pipeWallThermalResistance(Pipe const &pipe, double const wall_thermal_conductivity)
std::array< double, 4 > thermalResistancesGroutSoil2U(double const chi, double const R_ar_1, double const R_ar_2, double const R_g)
Thermal resistances due to grout-soil exchange.
Definition BHE_2U.cpp:106

References ProcessLib::HeatTransportBHE::BHE::BHECommonUType::_pipes, ProcessLib::HeatTransportBHE::BHE::BHECommon::borehole_geometry, ProcessLib::HeatTransportBHE::BHE::checkAcoshArg(), ProcessLib::HeatTransportBHE::BHE::checkBoreholeVsPipeDiameter(), ProcessLib::HeatTransportBHE::BHE::BHECommon::grout, ProcessLib::HeatTransportBHE::BHE::pipeWallThermalResistance(), ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant, ProcessLib::HeatTransportBHE::BHE::sampleStrictPositive(), ProcessLib::HeatTransportBHE::BHE::thermalResistancesGroutSoil2U(), and ProcessLib::HeatTransportBHE::BHE::uTypeGeometryContext().

Referenced by thermalResistances().

◆ crossSectionAreas()

std::array< double, BHE_2U::number_of_unknowns > ProcessLib::HeatTransportBHE::BHE::BHE_2U::crossSectionAreas ( ParameterLib::SpatialPosition const & pos) const

Definition at line 269 of file BHE_2U.cpp.

271{
272 double const D = sampleStrictPositive(borehole_geometry.diameter, 0.0, pos,
273 "borehole_diameter");
274 double const borehole_area = Pipe::circleArea(D);
275 double const quarter_borehole_area = borehole_area / number_of_grout_zones;
276 double const grout_area_inlet = checkedGroutArea(
277 quarter_borehole_area, _pipes.inlet.outsideArea(), pos);
278 double const grout_area_outlet = checkedGroutArea(
279 quarter_borehole_area, _pipes.outlet.outsideArea(), pos);
280
281 return {{
282 _pipes.inlet.area(), // i1
283 _pipes.inlet.area(), // i2
284 _pipes.outlet.area(), // o1
285 _pipes.outlet.area(), // o2
286 grout_area_inlet, // g1
287 grout_area_inlet, // g2
288 grout_area_outlet, // g3
289 grout_area_outlet, // g4
290 }};
291}
static constexpr int number_of_grout_zones
Definition BHE_2U.h:50
double checkedGroutArea(double const borehole_area_fraction, double const pipe_outside_area, ParameterLib::SpatialPosition const &pos)
static double circleArea(double const d)
Definition Pipe.h:46

References ProcessLib::HeatTransportBHE::BHE::BHECommonUType::_pipes, ProcessLib::HeatTransportBHE::BHE::BHECommon::borehole_geometry, ProcessLib::HeatTransportBHE::BHE::checkedGroutArea(), ProcessLib::HeatTransportBHE::BHE::Pipe::circleArea(), number_of_grout_zones, and ProcessLib::HeatTransportBHE::BHE::sampleStrictPositive().

◆ flowLegs()

std::array< double, number_of_flow_legs > ProcessLib::HeatTransportBHE::BHE::BHE_2U::flowLegs ( ) const
inline

Signed fluid velocity per flow leg. Positive = flow along +elem_direction; negative = against it. Leg ordering matches the BHE unknowns: { i1, i2 (down), o1, o2 (up) }.

Definition at line 56 of file BHE_2U.h.

References ProcessLib::HeatTransportBHE::BHE::BHECommonUType::flow_velocity.

Referenced by pipeAdvectionVectors().

◆ getBHEBottomDirichletBCNodesAndComponents()

std::optional< std::array< std::pair< std::size_t, int >, 2 > > ProcessLib::HeatTransportBHE::BHE::BHE_2U::getBHEBottomDirichletBCNodesAndComponents ( std::size_t const bottom_node_id,
int const in_component_id,
int const out_component_id )
static

Definition at line 260 of file BHE_2U.cpp.

264{
265 return {{std::make_pair(bottom_node_id, in_component_id),
266 std::make_pair(bottom_node_id, out_component_id)}};
267}

◆ getBHEInflowDirichletBCNodesAndComponents()

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

Definition at line 250 of file BHE_2U.cpp.

254{
255 return {std::make_pair(top_node_id, in_component_id),
256 std::make_pair(top_node_id, in_component_id + 2)};
257}

◆ pipeAdvectionVectors()

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

Definition at line 86 of file BHE_2U.cpp.

87{
88 double const rho_r = refrigerant.density;
89 double const Cp_r = refrigerant.specific_heat_capacity;
90
91 auto const legs = flowLegs();
92 auto leg_adv = [&](double const v_signed) -> Eigen::Vector3d
93 { return rho_r * Cp_r * v_signed * elem_direction; };
94
95 return {{leg_adv(legs[0]), // i1
96 leg_adv(legs[1]), // i2
97 leg_adv(legs[2]), // o1
98 leg_adv(legs[3]), // o2
99 {0, 0, 0}, // g1
100 {0, 0, 0}, // g2
101 {0, 0, 0}, // g3
102 {0, 0, 0}}}; // g4
103}
std::array< double, number_of_flow_legs > flowLegs() const
Definition BHE_2U.h:56

References flowLegs(), and ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant.

◆ pipeHeatCapacities()

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

Definition at line 41 of file BHE_2U.cpp.

43{
44 double const rho_r = refrigerant.density;
45 double const specific_heat_capacity = refrigerant.specific_heat_capacity;
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 /*i2*/ rho_r * specific_heat_capacity,
52 /*o1*/ rho_r * specific_heat_capacity,
53 /*o2*/ 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 /*g3*/ (1.0 - porosity_g) * rho_g * heat_cap_g,
57 /*g4*/ (1.0 - porosity_g) * rho_g * heat_cap_g}};
58}

References ProcessLib::HeatTransportBHE::BHE::BHECommon::grout, and ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant.

◆ pipeHeatConductions()

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

Definition at line 60 of file BHE_2U.cpp.

62{
63 double const lambda_r = refrigerant.thermal_conductivity;
64 double const rho_r = refrigerant.density;
65 double const Cp_r = refrigerant.specific_heat_capacity;
66 double const alpha_L = _pipes.longitudinal_dispersion_length;
67 double const porosity_g = grout.porosity_g;
68 double const lambda_g = grout.lambda_g;
69
70 double const velocity_norm = std::abs(flow_velocity);
71
72 auto const pipe_conduction =
73 lambda_r + rho_r * Cp_r * alpha_L * velocity_norm;
74 auto const grout_conduction = (1.0 - porosity_g) * lambda_g;
75 return {{pipe_conduction, // i1
76 pipe_conduction, // i2
77 pipe_conduction, // o1
78 pipe_conduction, // o2
79 grout_conduction, // g1
80 grout_conduction, // g2
81 grout_conduction, // g3
82 grout_conduction}}; // g4
83}

References ProcessLib::HeatTransportBHE::BHE::BHECommonUType::_pipes, ProcessLib::HeatTransportBHE::BHE::BHECommonUType::flow_velocity, ProcessLib::HeatTransportBHE::BHE::BHECommon::grout, and ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant.

◆ thermalResistances()

std::vector< double > ProcessLib::HeatTransportBHE::BHE::BHE_2U::thermalResistances ( ParameterLib::SpatialPosition const & pos) const

Return the full vector of thermal resistances for the element at pos, computed once using the cached Nusselt number. Intended to be called once per element by the assembler so that the resistance computation is not repeated per unknown and per integration point.

Definition at line 149 of file BHE_2U.cpp.

151{
153}
std::vector< double > calcThermalResistances(double const Nu, ParameterLib::SpatialPosition const &pos) const
Definition BHE_2U.cpp:155

References cached_nu_, and calcThermalResistances().

◆ updateFlowRateAndTemperature()

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

Return the inflow temperature for the boundary condition.

Definition at line 293 of file BHE_2U.cpp.

295{
296 auto values =
297 visit([&](auto const& control) { return control(T_out, current_time); },
299 updateHeatTransferCoefficients(values.flow_rate);
300 return values.temperature;
301}

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

◆ updateHeatTransferCoefficients()

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

Definition at line 140 of file BHE_2U.cpp.

141{
143 _pipes.inlet, borehole_geometry.length, refrigerant, flow_rate);
144
145 flow_velocity = tm_flow.velocity;
146 cached_nu_ = tm_flow.nusselt_number;
147}
ThermoMechanicalFlowProperties calculateThermoMechanicalFlowPropertiesPipe(Pipe const &pipe, double const length, RefrigerantProperties const &fluid, double const flow_rate)

References ProcessLib::HeatTransportBHE::BHE::BHECommonUType::_pipes, ProcessLib::HeatTransportBHE::BHE::BHECommon::borehole_geometry, cached_nu_, ProcessLib::HeatTransportBHE::BHE::calculateThermoMechanicalFlowPropertiesPipe(), ProcessLib::HeatTransportBHE::BHE::BHECommonUType::flow_velocity, and ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant.

Referenced by BHE_2U(), and updateFlowRateAndTemperature().

Member Data Documentation

◆ cached_nu_

double ProcessLib::HeatTransportBHE::BHE::BHE_2U::cached_nu_ = 0.0
private

Definition at line 228 of file BHE_2U.h.

Referenced by thermalResistances(), and updateHeatTransferCoefficients().

◆ inflow_outflow_bc_component_ids

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

Definition at line 206 of file BHE_2U.h.

206 {
207 {0, 2}, {1, 3}};

◆ number_of_flow_legs

int ProcessLib::HeatTransportBHE::BHE::BHE_2U::number_of_flow_legs = 4
staticconstexpr

Definition at line 51 of file BHE_2U.h.

◆ number_of_grout_zones

int ProcessLib::HeatTransportBHE::BHE::BHE_2U::number_of_grout_zones = 4
staticconstexpr

Definition at line 50 of file BHE_2U.h.

Referenced by crossSectionAreas().

◆ number_of_unknowns

int ProcessLib::HeatTransportBHE::BHE::BHE_2U::number_of_unknowns = 8
staticconstexpr

Definition at line 49 of file BHE_2U.h.


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