33 [&](
auto const& control)
46 double const specific_heat_capacity =
refrigerant.specific_heat_capacity;
47 double const rho_g =
grout.rho_g;
48 double const porosity_g =
grout.porosity_g;
49 double const heat_cap_g =
grout.heat_cap_g;
52 rho_r * specific_heat_capacity,
53 (1.0 - porosity_g) * rho_g * heat_cap_g,
60 double const lambda_r =
refrigerant.thermal_conductivity;
62 double const Cp_r =
refrigerant.specific_heat_capacity;
63 double const alpha_L =
_pipe.longitudinal_dispersion_length;
64 double const porosity_g =
grout.porosity_g;
65 double const lambda_g =
grout.lambda_g;
71 (lambda_r + rho_r * Cp_r * alpha_L * velocity_norm),
73 (1.0 - porosity_g) * lambda_g,
77std::array<Eigen::Vector3d, BHE_1P::number_of_unknowns>
81 double const& Cp_r =
refrigerant.specific_heat_capacity;
84 Eigen::Vector3d adv_vector = rho_r * Cp_r * velocity * elem_direction;
110 constexpr double pi = std::numbers::pi;
112 double const lambda_r =
refrigerant.thermal_conductivity;
113 double const lambda_g =
grout.lambda_g;
117 double const lambda_p =
119 pos,
"wall_thermal_conductivity");
122 double const R_adv_i1 = 1.0 / (Nu * lambda_r * pi);
125 double const pipe_outside_diameter =
_pipe.single_pipe.outsideDiameter();
126 double const R_con_a =
131 "borehole_diameter");
133 "BHE 1P grout resistance");
135 double const chi = std::log(std::sqrt(D * D + pipe_outside_diameter *
136 pipe_outside_diameter) /
137 std::sqrt(2) / pipe_outside_diameter) /
138 std::log(D / pipe_outside_diameter);
140 std::log(D / pipe_outside_diameter) / 2 / (pi * lambda_g);
142 double const R_con_b = chi * R_g;
147 double const R_fg = R_adv_i1 + R_con_a + R_con_b;
152std::array<std::pair<std::size_t, int>, 2>
154 std::size_t
const top_node_id,
155 std::size_t
const bottom_node_id,
156 int const in_component_id)
158 return {std::make_pair(top_node_id, in_component_id),
159 std::make_pair(bottom_node_id, in_component_id)};
162std::optional<std::array<std::pair<std::size_t, int>, 2>>
175 "borehole_diameter");
177 return {{
_pipe.single_pipe.area(),
183 double const current_time)
186 visit([&](
auto const& control) {
return control(T_out, current_time); },
189 return values.temperature;
bool const use_python_bcs
RefrigerantProperties const refrigerant
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
BoreholeGeometry const borehole_geometry
void updateHeatTransferCoefficients(double const flow_rate)
std::array< double, number_of_unknowns > pipeHeatConductions() 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 > crossSectionAreas(ParameterLib::SpatialPosition const &pos) const
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) const
std::vector< double > calcThermalResistances(double const Nu, ParameterLib::SpatialPosition const &pos) const
std::vector< double > thermalResistances(ParameterLib::SpatialPosition const &pos) 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 sampleStrictPositive(ParameterLib::Parameter< double > const ¶m, 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)
double checkedGroutArea(double const borehole_area_fraction, double const pipe_outside_area, ParameterLib::SpatialPosition const &pos)
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.
double pipeWallThermalResistance(Pipe const &pipe, double const wall_thermal_conductivity)
ThermoMechanicalFlowProperties calculateThermoMechanicalFlowPropertiesPipe(Pipe const &pipe, double const length, RefrigerantProperties const &fluid, double const flow_rate)
static double circleArea(double const d)