31 [&](
auto const& control)
44 double const specific_heat_capacity =
refrigerant.specific_heat_capacity;
45 double const rho_g =
grout.rho_g;
46 double const porosity_g =
grout.porosity_g;
47 double const heat_cap_g =
grout.heat_cap_g;
50 rho_r * specific_heat_capacity,
51 (1.0 - porosity_g) * rho_g * heat_cap_g,
56 int const section_index)
const
58 double const lambda_r =
refrigerant.thermal_conductivity;
60 double const Cp_r =
refrigerant.specific_heat_capacity;
61 double const alpha_L =
_pipe.longitudinal_dispersion_length;
62 double const porosity_g =
grout.porosity_g;
63 double const lambda_g =
grout.lambda_g;
65 double const velocity_norm =
72 (lambda_r + rho_r * Cp_r * alpha_L * velocity_norm),
74 (1.0 - porosity_g) * lambda_g,
78std::array<Eigen::Vector3d, BHE_1P::number_of_unknowns>
80 int const section_index)
const
83 double const& Cp_r =
refrigerant.specific_heat_capacity;
86 Eigen::Vector3d adv_vector = rho_r * Cp_r * velocity * elem_direction;
110 double const Nu,
int const section_index)
const
112 constexpr double pi = std::numbers::pi;
114 double const lambda_r =
refrigerant.thermal_conductivity;
115 double const lambda_g =
grout.lambda_g;
116 double const lambda_p =
_pipe.single_pipe.wall_thermal_conductivity;
119 double const R_adv_i1 = 1.0 / (Nu * lambda_r * pi);
122 double const pipe_diameter =
_pipe.single_pipe.diameter;
123 double const pipe_outside_diameter =
_pipe.single_pipe.outsideDiameter();
124 double const R_con_a =
125 std::log(pipe_outside_diameter / pipe_diameter) / (2.0 * pi * lambda_p);
131 double const chi = std::log(std::sqrt(D * D + pipe_outside_diameter *
132 pipe_outside_diameter) /
133 std::sqrt(2) / pipe_outside_diameter) /
134 std::log(D / pipe_outside_diameter);
136 std::log(D / pipe_outside_diameter) / 2 / (pi * lambda_g);
138 double const R_con_b = chi * R_g;
144 double const R_fg = R_adv_i1 + R_con_a + R_con_b;
149std::array<std::pair<std::size_t ,
int >, 2>
151 std::size_t
const top_node_id,
152 std::size_t
const bottom_node_id,
153 int const in_component_id)
155 return {std::make_pair(top_node_id, in_component_id),
156 std::make_pair(bottom_node_id, in_component_id)};
160 std::array<std::pair<std::size_t ,
int >, 2>>
170 int const section_index)
const
172 return {{
_pipe.single_pipe.area(),
175 _pipe.single_pipe.outsideArea(), section_index)}};
179 double const current_time)
182 visit([&](
auto const& control) {
return control(T_out, current_time); },
185 return values.temperature;
bool const use_python_bcs
RefrigerantProperties const refrigerant
void recomputeSectionalResistances(Fn &&calcForSection)
Recompute _sectional_thermal_resistances for all sections.
std::vector< double > _flow_velocities
GroutParameters const grout
BHECommon(BoreholeGeometry const &borehole_geometry_, RefrigerantProperties const &refrigerant_, GroutParameters const &grout_, FlowAndTemperatureControl const &flowAndTemperatureControl_, bool const use_python_bcs_)
FlowAndTemperatureControl const flowAndTemperatureControl
double getClampedFlowVelocity(int const section_index) const
Get velocity for a section, clamping to last section if index exceeds the number of velocity entries....
BoreholeGeometry const borehole_geometry
void updateHeatTransferCoefficients(double const flow_rate)
std::vector< double > calcThermalResistances(double const Nu, int const section_index=0) const
std::array< double, number_of_unknowns > crossSectionAreas(int const section_index=0) const
std::array< double, number_of_unknowns > pipeHeatConductions(int const section_index=0) const
static std::optional< std::array< std::pair< std::size_t, int >, 2 > > getBHEBottomDirichletBCNodesAndComponents(std::size_t const, int const, int const)
PipeConfiguration1PType const _pipe
std::array< double, number_of_unknowns > pipeHeatCapacities() const
BHE_1P(BoreholeGeometry const &borehole, RefrigerantProperties const &refrigerant, GroutParameters const &grout, FlowAndTemperatureControl const &flowAndTemperatureControl, PipeConfiguration1PType const &pipes, bool const use_python_bcs)
double updateFlowRateAndTemperature(double T_out, double current_time)
Return the inflow temperature for the boundary condition.
std::array< Eigen::Vector3d, number_of_unknowns > pipeAdvectionVectors(Eigen::Vector3d const &elem_direction, int const section_index=0) const
static std::array< std::pair< std::size_t, int >, 2 > getBHEInflowDirichletBCNodesAndComponents(std::size_t const top_node_id, std::size_t const bottom_node_id, int const in_component_id)
double checkedGroutArea(double const borehole_area_fraction, double const pipe_outside_area, int const section_index)
std::variant< InflowTemperature, Power, BuildingPower, BuildingPowerHotWaterActiveCooling, BuildingPowerHotWaterPassiveCooling, BuildingPowerHotWater, BuildingPowerActiveCooling, BuildingPowerPassiveCooling, ActiveCooling > FlowAndTemperatureControl
double computeRgs(double const chi, double const R_g)
Grout-soil thermal resistance: R_gs = (1 - chi) * R_g.
ThermoMechanicalFlowProperties calculateThermoMechanicalFlowPropertiesPipe(Pipe const &pipe, double const length, RefrigerantProperties const &fluid, double const flow_rate)