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