OGS
ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial Class Referenceabstract

Detailed Description

Definition at line 25 of file BHECommonCoaxial.h.

#include <BHECommonCoaxial.h>

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

Public Member Functions

 BHECommonCoaxial (BoreholeGeometry const &borehole, RefrigerantProperties const &refrigerant, GroutParameters const &grout, FlowAndTemperatureControl const &flowAndTemperatureControl, PipeConfigurationCoaxial const &pipes, bool const use_python_bcs)
 
double thermalResistance (int const unknown_index) const
 
double updateFlowRateAndTemperature (double T_out, double current_time)
 
std::array< double, number_of_unknownscalcThermalResistances (double const Nu_inner_pipe, double const Nu_annulus_pipe) 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 &) const
 
void updateHeatTransferCoefficients (double const flow_rate)
 

Static Public Member Functions

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)
 

Public Attributes

double cross_section_area_inner_pipe
 
double cross_section_area_annulus
 
double cross_section_area_grout
 
- 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
 

Static Public Attributes

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

Protected Member Functions

virtual std::array< double, 2 > velocities () const =0
 
virtual std::array< double, number_of_unknownsgetThermalResistances (double const &R_gs, double const &R_ff, double const &R_fg) const =0
 

Protected Attributes

PipeConfigurationCoaxial const _pipes
 
std::array< double, number_of_unknowns_thermal_resistances
 
double _flow_velocity_inner = std::numeric_limits<double>::quiet_NaN()
 Flow velocity inside the pipes and annulus. Depends on the flow_rate.
 
double _flow_velocity_annulus = std::numeric_limits<double>::quiet_NaN()
 

Constructor & Destructor Documentation

◆ BHECommonCoaxial()

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

Definition at line 23 of file BHECommonCoaxial.cpp.

30 : BHECommon{borehole, refrigerant, grout, flowAndTemperatureControl,
32 _pipes(pipes)
33{
39
40 _thermal_resistances.fill(std::numeric_limits<double>::quiet_NaN());
41}
std::array< double, number_of_unknowns > _thermal_resistances
RefrigerantProperties const refrigerant
Definition BHECommon.h:42
FlowAndTemperatureControl const flowAndTemperatureControl
Definition BHECommon.h:44
double outsideArea() const
Area of the pipe's outside including the wall thickness.
Definition Pipe.h:35
double area() const
Area of the pipe's inside without the wall.
Definition Pipe.h:32

References _pipes, _thermal_resistances, ProcessLib::HeatTransportBHE::BHE::BoreholeGeometry::area(), ProcessLib::HeatTransportBHE::BHE::Pipe::area(), ProcessLib::HeatTransportBHE::BHE::BHECommon::borehole_geometry, cross_section_area_annulus, cross_section_area_grout, cross_section_area_inner_pipe, ProcessLib::HeatTransportBHE::BHE::PipeConfigurationCoaxial::inner_pipe, ProcessLib::HeatTransportBHE::BHE::PipeConfigurationCoaxial::outer_pipe, and ProcessLib::HeatTransportBHE::BHE::Pipe::outsideArea().

Member Function Documentation

◆ calcThermalResistances()

std::array< double, BHECommonCoaxial::number_of_unknowns > ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::calcThermalResistances ( double const Nu_inner_pipe,
double const Nu_annulus_pipe ) const

Definition at line 106 of file BHECommonCoaxial.cpp.

108{
109 // thermal resistances due to advective flow of refrigerant in the pipes
110 auto const R_advective = calculateAdvectiveThermalResistance(
112 Nu_annulus_pipe);
113
114 // thermal resistance due to thermal conductivity of the pipe wall material
115 auto const R_conductive = calculatePipeWallThermalResistance(
117
118 // thermal resistance due to the grout transition and grout-soil exchange.
121
122 // thermal resistance due to grout-soil exchange
123 double const R_gs = R.grout_soil;
124
125 // Eq. 56 and 57
126 double const R_ff = R_advective.inner_pipe_coaxial + R_advective.a_annulus +
127 R_conductive.inner_pipe_coaxial;
128 double const R_fg =
129 R_advective.b_annulus + R_conductive.annulus + R.conductive_b;
130
131 return getThermalResistances(R_gs, R_ff, R_fg);
132}
virtual std::array< double, number_of_unknowns > getThermalResistances(double const &R_gs, double const &R_ff, double const &R_fg) const =0
PipeWallThermalResistanceCoaxial calculatePipeWallThermalResistance(Pipe const &inner_pipe, Pipe const &outer_pipe)
AdvectiveThermalResistanceCoaxial calculateAdvectiveThermalResistance(Pipe const &inner_pipe, Pipe const &outer_pipe, RefrigerantProperties const &fluid, double const Nu_inner_pipe, double const Nu_annulus)
GroutAndGroutSoilExchangeThermalResistanceCoaxial calculateGroutAndGroutSoilExchangeThermalResistance(Pipe const &outer_pipe, GroutParameters const &grout_parameters, double const borehole_diameter)

References _pipes, ProcessLib::HeatTransportBHE::BHE::BHECommon::borehole_geometry, ProcessLib::HeatTransportBHE::BHE::calculateAdvectiveThermalResistance(), ProcessLib::HeatTransportBHE::BHE::calculateGroutAndGroutSoilExchangeThermalResistance(), ProcessLib::HeatTransportBHE::BHE::calculatePipeWallThermalResistance(), ProcessLib::HeatTransportBHE::BHE::BoreholeGeometry::diameter, getThermalResistances(), ProcessLib::HeatTransportBHE::BHE::BHECommon::grout, ProcessLib::HeatTransportBHE::BHE::PipeConfigurationCoaxial::inner_pipe, ProcessLib::HeatTransportBHE::BHE::PipeConfigurationCoaxial::outer_pipe, and ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant.

Referenced by updateHeatTransferCoefficients().

◆ getBHEBottomDirichletBCNodesAndComponents()

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

Definition at line 146 of file BHECommonCoaxial.cpp.

149{
150 return {{std::make_pair(bottom_node_id, in_component_id),
151 std::make_pair(bottom_node_id, out_component_id)}};
152}

◆ getBHEInflowDirichletBCNodesAndComponents()

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

Definition at line 135 of file BHECommonCoaxial.cpp.

139{
140 return {std::make_pair(top_node_id, in_component_id),
141 std::make_pair(top_node_id, in_component_id + 1)};
142}

◆ getThermalResistances()

virtual std::array< double, number_of_unknowns > ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::getThermalResistances ( double const & R_gs,
double const & R_ff,
double const & R_fg ) const
protectedpure virtual

◆ pipeAdvectionVectors()

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

Definition at line 90 of file BHECommonCoaxial.cpp.

92{
93 double const rho_r = refrigerant.density;
94 double const Cp_r = refrigerant.specific_heat_capacity;
95 auto const v = velocities();
96
97 return {// pipe i, Eq. 26 and Eq. 23
98 rho_r * Cp_r * std::abs(v[0]) * elem_direction,
99 // pipe o, Eq. 27 and Eq. 24
100 -rho_r * Cp_r * std::abs(v[1]) * elem_direction,
101 // grout g, Eq. 28 and Eq. 25
102 {0, 0, 0}};
103}
virtual std::array< double, 2 > velocities() const =0

References ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::density, ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant, ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::specific_heat_capacity, and velocities().

◆ pipeHeatCapacities()

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

◆ pipeHeatConductions()

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

Definition at line 67 of file BHECommonCoaxial.cpp.

68{
69 double const lambda_r = refrigerant.thermal_conductivity;
70 double const rho_r = refrigerant.density;
71 double const Cp_r = refrigerant.specific_heat_capacity;
72 double const alpha_L = _pipes.longitudinal_dispersion_length;
73 double const porosity_g = grout.porosity_g;
74 double const lambda_g = grout.lambda_g;
75
76 auto v = velocities();
77 // Here we calculate the laplace coefficients in the governing
78 // equations of BHE. These governing equations can be found in
79 // 1) Diersch (2013) FEFLOW book on page 952, M.120-122, or
80 // 2) Diersch (2011) Comp & Geosci 37:1122-1135, Eq. 26-28, 23-25
81 return {{// pipe i, Eq. 26 and Eq. 23
82 (lambda_r + rho_r * Cp_r * alpha_L * std::abs(v[0])),
83 // pipe o, Eq. 27 and Eq. 24
84 (lambda_r + rho_r * Cp_r * alpha_L * std::abs(v[1])),
85 // pipe g, Eq. 28 and Eq. 25
86 (1.0 - porosity_g) * lambda_g}};
87}

References _pipes, ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::density, ProcessLib::HeatTransportBHE::BHE::BHECommon::grout, ProcessLib::HeatTransportBHE::BHE::GroutParameters::lambda_g, ProcessLib::HeatTransportBHE::BHE::PipeConfigurationCoaxial::longitudinal_dispersion_length, ProcessLib::HeatTransportBHE::BHE::GroutParameters::porosity_g, ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant, ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::specific_heat_capacity, ProcessLib::HeatTransportBHE::BHE::RefrigerantProperties::thermal_conductivity, and velocities().

◆ thermalResistance()

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

Definition at line 38 of file BHECommonCoaxial.h.

39 {
40 return _thermal_resistances[unknown_index];
41 }

References _thermal_resistances.

◆ updateFlowRateAndTemperature()

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

Definition at line 57 of file BHECommonCoaxial.cpp.

59{
60 auto values =
61 visit([&](auto const& control) { return control(T_out, current_time); },
63 updateHeatTransferCoefficients(values.flow_rate);
64 return values.temperature;
65}

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

◆ updateHeatTransferCoefficients()

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

Definition at line 154 of file BHECommonCoaxial.cpp.

155{
156 auto const tm_flow_properties_annulus =
161 flow_rate);
162
163 _flow_velocity_annulus = tm_flow_properties_annulus.velocity;
164
165 auto const tm_flow_properties = calculateThermoMechanicalFlowPropertiesPipe(
167
168 _flow_velocity_inner = tm_flow_properties.velocity;
169
171 calcThermalResistances(tm_flow_properties.nusselt_number,
172 tm_flow_properties_annulus.nusselt_number);
173}
std::array< double, number_of_unknowns > calcThermalResistances(double const Nu_inner_pipe, double const Nu_annulus_pipe) const
double _flow_velocity_inner
Flow velocity inside the pipes and annulus. Depends on the flow_rate.
ThermoMechanicalFlowProperties calculateThermoMechanicalFlowPropertiesAnnulus(Pipe const &inner_pipe, Pipe const &outer_pipe, double const length, RefrigerantProperties const &fluid, double const flow_rate)
ThermoMechanicalFlowProperties calculateThermoMechanicalFlowPropertiesPipe(Pipe const &pipe, double const length, RefrigerantProperties const &fluid, double const flow_rate)

References _flow_velocity_annulus, _flow_velocity_inner, _pipes, _thermal_resistances, ProcessLib::HeatTransportBHE::BHE::BHECommon::borehole_geometry, calcThermalResistances(), ProcessLib::HeatTransportBHE::BHE::calculateThermoMechanicalFlowPropertiesAnnulus(), ProcessLib::HeatTransportBHE::BHE::calculateThermoMechanicalFlowPropertiesPipe(), ProcessLib::HeatTransportBHE::BHE::PipeConfigurationCoaxial::inner_pipe, ProcessLib::HeatTransportBHE::BHE::BoreholeGeometry::length, ProcessLib::HeatTransportBHE::BHE::PipeConfigurationCoaxial::outer_pipe, and ProcessLib::HeatTransportBHE::BHE::BHECommon::refrigerant.

Referenced by ProcessLib::HeatTransportBHE::BHE::BHE_CXA::BHE_CXA(), ProcessLib::HeatTransportBHE::BHE::BHE_CXC::BHE_CXC(), and updateFlowRateAndTemperature().

◆ velocities()

virtual std::array< double, 2 > ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::velocities ( ) const
protectedpure virtual

Member Data Documentation

◆ _flow_velocity_annulus

double ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::_flow_velocity_annulus = std::numeric_limits<double>::quiet_NaN()
protected

◆ _flow_velocity_inner

double ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::_flow_velocity_inner = std::numeric_limits<double>::quiet_NaN()
protected

Flow velocity inside the pipes and annulus. Depends on the flow_rate.

Definition at line 91 of file BHECommonCoaxial.h.

Referenced by updateHeatTransferCoefficients(), ProcessLib::HeatTransportBHE::BHE::BHE_CXA::velocities(), and ProcessLib::HeatTransportBHE::BHE::BHE_CXC::velocities().

◆ _pipes

PipeConfigurationCoaxial const ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::_pipes
protected

◆ _thermal_resistances

std::array<double, number_of_unknowns> ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::_thermal_resistances
protected

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 88 of file BHECommonCoaxial.h.

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

◆ cross_section_area_annulus

double ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::cross_section_area_annulus

◆ cross_section_area_grout

double ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::cross_section_area_grout

◆ cross_section_area_inner_pipe

double ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::cross_section_area_inner_pipe

◆ inflow_outflow_bc_component_ids

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

Definition at line 50 of file BHECommonCoaxial.h.

50 {
51 {0, 1}};

◆ number_of_grout_zones

constexpr int ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::number_of_grout_zones = 1
staticconstexpr

Definition at line 36 of file BHECommonCoaxial.h.

◆ number_of_unknowns

constexpr int ProcessLib::HeatTransportBHE::BHE::BHECommonCoaxial::number_of_unknowns = 3
staticconstexpr

Definition at line 35 of file BHECommonCoaxial.h.


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