OGS
BHE_CXC.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <Eigen/Core>
14
15#include "BHECommonCoaxial.h"
16
17namespace ProcessLib
18{
19namespace HeatTransportBHE
20{
21namespace BHE
22{
36class BHE_CXC final : public BHECommonCoaxial
37{
38public:
39 BHE_CXC(BoreholeGeometry const& borehole,
43 PipeConfigurationCoaxial const& pipes,
44 bool const use_python_bcs)
45 : BHECommonCoaxial{borehole, refrigerant,
47 pipes, use_python_bcs}
48 {
49 // Initialize thermal resistances.
50 auto values = visit(
51 [&](auto const& control) {
53 0. /* initial time */);
54 },
56 updateHeatTransferCoefficients(values.flow_rate);
57 }
58
59 template <int NPoints, typename SingleUnknownMatrixType,
60 typename RMatrixType, typename RPiSMatrixType,
61 typename RSMatrixType>
62 static void assembleRMatrices(
63 int const idx_bhe_unknowns,
64 Eigen::MatrixBase<SingleUnknownMatrixType> const& matBHE_loc_R,
65 Eigen::MatrixBase<RMatrixType>& R_matrix,
66 Eigen::MatrixBase<RPiSMatrixType>& R_pi_s_matrix,
67 Eigen::MatrixBase<RSMatrixType>& R_s_matrix)
68 {
69 switch (idx_bhe_unknowns)
70 {
71 case 0: // PHI_ff
72 R_matrix.block(0, NPoints, NPoints, NPoints) +=
73 -1.0 * matBHE_loc_R;
74 R_matrix.block(NPoints, 0, NPoints, NPoints) +=
75 -1.0 * matBHE_loc_R;
76
77 R_matrix.block(0, 0, NPoints,
78 NPoints) += 1.0 * matBHE_loc_R; // K_i
79 R_matrix.block(NPoints, NPoints, NPoints, NPoints) +=
80 1.0 * matBHE_loc_R; // K_o
81 return;
82 case 1: // PHI_fog
83 R_matrix.block(NPoints, 2 * NPoints, NPoints, NPoints) +=
84 -1.0 * matBHE_loc_R;
85 R_matrix.block(2 * NPoints, NPoints, NPoints, NPoints) +=
86 -1.0 * matBHE_loc_R;
87
88 R_matrix.block(NPoints, NPoints, NPoints, NPoints) +=
89 1.0 * matBHE_loc_R; // K_o
90 R_matrix.block(2 * NPoints,
91 2 * NPoints,
92 NPoints,
93 NPoints) += 1.0 * matBHE_loc_R; // K_og
94 return;
95 case 2: // PHI_gs
96 R_s_matrix += matBHE_loc_R;
97
98 R_pi_s_matrix.block(2 * NPoints, 0, NPoints, NPoints) +=
99 -1.0 * matBHE_loc_R;
100
101 R_matrix.block(2 * NPoints, 2 * NPoints, NPoints,
102 NPoints) += matBHE_loc_R; // K_og
103 return;
104 default:
105 OGS_FATAL(
106 "Error!!! In the function BHE_CXC::assembleRMatrices, "
107 "the index of bhe unknowns is out of range! ");
108 }
109 }
110
111 std::array<double, number_of_unknowns> crossSectionAreas() const
112 {
115 }
116
117private:
118 std::array<double, 2> velocities() const override
119 {
121 }
122
123 std::array<double, number_of_unknowns> getThermalResistances(
124 double const& R_gs, double const& R_ff,
125 double const& R_fg) const override
126 {
127 return {R_ff, R_fg, R_gs};
128 }
129};
130} // namespace BHE
131} // namespace HeatTransportBHE
132} // namespace ProcessLib
#define OGS_FATAL(...)
Definition Error.h:26
double _flow_velocity_inner
Flow velocity inside the pipes and annulus. Depends on the flow_rate.
std::array< double, number_of_unknowns > getThermalResistances(double const &R_gs, double const &R_ff, double const &R_fg) const override
Definition BHE_CXC.h:123
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)
Definition BHE_CXC.h:62
std::array< double, 2 > velocities() const override
Definition BHE_CXC.h:118
BHE_CXC(BoreholeGeometry const &borehole, RefrigerantProperties const &refrigerant, GroutParameters const &grout, FlowAndTemperatureControl const &flowAndTemperatureControl, PipeConfigurationCoaxial const &pipes, bool const use_python_bcs)
Definition BHE_CXC.h:39
std::array< double, number_of_unknowns > crossSectionAreas() const
Definition BHE_CXC.h:111
std::variant< TemperatureCurveConstantFlow, TemperatureCurveFlowCurve, FixedPowerConstantFlow, FixedPowerFlowCurve, PowerCurveConstantFlow, PowerCurveFlowCurve, BuildingPowerCurveConstantFlow > FlowAndTemperatureControl
RefrigerantProperties const refrigerant
Definition BHECommon.h:42
FlowAndTemperatureControl const flowAndTemperatureControl
Definition BHECommon.h:44