21namespace HeatTransportBHE
30 bool const use_python_bcs)
31 :
BHECommonUType{borehole, refrigerant, grout, flowAndTemperatureControl,
32 pipes, use_python_bcs}
38 [&](
auto const& control) {
55 return {{ rho_r * specific_heat_capacity,
56 rho_r * specific_heat_capacity,
57 (1.0 - porosity_g) * rho_g * heat_cap_g,
58 (1.0 - porosity_g) * rho_g * heat_cap_g}};
78 (lambda_r + rho_r * Cp_r * alpha_L * velocity_norm),
80 (lambda_r + rho_r * Cp_r * alpha_L * velocity_norm),
82 (1.0 - porosity_g) * lambda_g,
84 (1.0 - porosity_g) * lambda_g}};
87std::array<Eigen::Vector3d, BHE_1U::number_of_unknowns>
105 return (1 - chi) * R_g;
108double compute_R_gg(
double const chi,
double const R_gs,
double const R_ar,
111 double const R_gg = 2.0 * R_gs * (R_ar - 2.0 * chi * R_g) /
112 (2.0 * R_gs - R_ar + 2.0 * chi * R_g);
113 if (!std::isfinite(R_gg))
116 "Error!!! Grout Thermal Resistance is an infinite number! The "
117 "simulation will be stopped!");
135 double new_chi = chi;
137 auto constraint = [&]()
138 {
return 1.0 / ((1.0 / R_gg) + (1.0 / (2.0 * R_gs))); };
140 std::array<double, 3>
const multiplier{chi * 2.0 / 3.0, chi * 1.0 / 3.0,
142 for (
double m_chi : multiplier)
144 if (constraint() >= 0)
149 "Warning! Correction procedure was applied due to negative thermal "
150 "resistance! Chi = {:f}.\n",
158 return {new_chi, R_gg, R_gs};
176 constexpr double pi = std::numbers::pi;
184 double const R_adv_i1 = 1.0 / (Nu * lambda_r * pi);
185 double const R_adv_o1 = 1.0 / (Nu * lambda_r * pi);
189 double const R_con_a =
191 (2.0 * pi * lambda_p);
197 double const chi = std::log(std::sqrt(D * D + 2 * d0 * d0) / 2 / d0) /
198 std::log(D / std::sqrt(2) / d0);
210 (2.0 * pi * lambda_g);
212 auto const [chi_new, R_gg, R_gs] =
216 double const R_con_b = chi_new * R_g;
218 double const R_fig = R_adv_i1 + R_con_a + R_con_b;
219 double const R_fog = R_adv_o1 + R_con_a + R_con_b;
221 return {{R_fig, R_fog, R_gg, R_gs}};
234std::array<std::pair<std::size_t ,
int >, 2>
236 std::size_t
const top_node_id,
238 int const in_component_id)
240 return {std::make_pair(top_node_id, in_component_id),
241 std::make_pair(top_node_id, in_component_id + 1)};
245 std::array<std::pair<std::size_t ,
int >, 2>>
247 std::size_t
const bottom_node_id,
248 int const in_component_id,
249 int const out_component_id)
251 return {{std::make_pair(bottom_node_id, in_component_id),
252 std::make_pair(bottom_node_id, out_component_id)}};
263 double const current_time)
266 visit([&](
auto const& control) {
return control(T_out, current_time); },
269 return values.temperature;
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
PipeConfigurationUType const _pipes
double _flow_velocity
Flow velocity inside the pipes. Depends on the flow_rate.
std::array< Eigen::Vector3d, number_of_unknowns > pipeAdvectionVectors(Eigen::Vector3d const &) const
double updateFlowRateAndTemperature(double T_out, double current_time)
Return the inflow temperature for the boundary condition.
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)
std::array< double, number_of_unknowns > calcThermalResistances(double const Nu)
Nu is the Nusselt number.
std::array< double, number_of_unknowns > pipeHeatConductions() const
std::array< double, number_of_unknowns > _thermal_resistances
std::array< double, number_of_unknowns > crossSectionAreas() const
void updateHeatTransferCoefficients(double const flow_rate)
BHE_1U(BoreholeGeometry const &borehole, RefrigerantProperties const &refrigerant, GroutParameters const &grout, FlowAndTemperatureControl const &flowAndTemperatureControl, PipeConfigurationUType const &pipes, bool const use_python_bcs)
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)
std::array< double, number_of_unknowns > pipeHeatCapacities() const
std::variant< TemperatureCurveConstantFlow, TemperatureCurveFlowCurve, FixedPowerConstantFlow, FixedPowerFlowCurve, PowerCurveConstantFlow, PowerCurveFlowCurve, BuildingPowerCurveConstantFlow > FlowAndTemperatureControl
double compute_R_gg(double const chi, double const R_gs, double const R_ar, double const R_g)
double compute_R_gs(double const chi, double const R_g)
std::array< double, 3 > thermalResistancesGroutSoil(double const chi, double const R_ar, double const R_g)
ThermoMechanicalFlowProperties calculateThermoMechanicalFlowPropertiesPipe(Pipe const &pipe, double const length, RefrigerantProperties const &fluid, double const flow_rate)
RefrigerantProperties const refrigerant
GroutParameters const grout
FlowAndTemperatureControl const flowAndTemperatureControl
BoreholeGeometry const borehole_geometry
double const longitudinal_dispersion_length
double const distance
Distance between pipes.
double outsideArea() const
Area of the pipe's outside including the wall thickness.
double outsideDiameter() const
double const wall_thermal_conductivity
double area() const
Area of the pipe's inside without the wall.
double const thermal_conductivity
double const specific_heat_capacity
double const reference_temperature