diff --git a/docs/manual/simulation_configuration.md b/docs/manual/simulation_configuration.md index 9263fc7f6a7f046e07477474285a469af76af7b1..f3cc2ccc9ae3bd8632599a00b7d64cf6e8509763 100644 --- a/docs/manual/simulation_configuration.md +++ b/docs/manual/simulation_configuration.md @@ -146,7 +146,7 @@ The main input JSON file includes the following parameters: | optimize_keys_bounds | Bounds for optimized parameters | — | nested_list | `[[lower, upper]]` matching optimize_keys | | loadprofile | Path to configuration file of the heat load profile | — | string | Optional | | flow_data | Path to configuration file of the flow rate profile | - | string | Optional | -| Q | Power demand | W | scalar | Used if `run_type` is POWER and no `loadprofile` defined | +| Q | Power demand | W | scalar | Used if `run_type` is POWER and no `loadprofile` defined; positive for heat production, negative for cold production | | Tin | Inlet temperature | °C | scalar | Used if `run_type` is TIN | | variables_config | Path to stochastic simulation configuration file | — | string | Used for stochastic runs (RunMain module) | | save_Tfield_res | Flag to save results of 3D temperature field in a numarical simulation | — | boolean | Only used if model_type is FINVOL | @@ -271,29 +271,29 @@ describes its structure. For stochastic simulations, the first dimension of the parameters in the *results* subset is always the number of samples. -| Parameter | Description | Unit | Dimensions | Remark | -|-----------|-------------------------------------------------------|-------|--------------------|---------------------------------------------| -| Q_b | Heat load | W | time | Only calculated for run_type TIN | -| Re_in | Reynolds nr. in the inlet pipe(s) | | time | | -| Re_out | Reynolds nr. in the outlet pipe(s) | | time | | -| T_b | Borehole wall temperature | C | time; zseg | | -| T_bave | Depth-average borehole wall temperature | C | time | | -| T_f | Fluid temperature | C | time; z; nPipes | | -| T_fi | Inlet temperature | C | time | Only calculated for run_type POWER | -| T_fo | Outlet temperature | C | time | | -| Tg | (Sub)surface temperature | C | time or time; zseg | | -| dploop | Pumping pressure | bar | time | | -| flowrate | Flowrate | kg/s | time | Total flow rate | -| hours | Simulation timesteps | hours | time | | -| k_g | Grout thermal conductivity | W/mK | time or time; zseg | | -| k_s | Subsurface thermal conductivity | W/mK | time or time; zseg | | -| qloop | Consumed power by the fluid circulation pump | W | time | | -| qsign | Sign of heat flow | | time | Sign indicates heat extraction or injection | -| qzb | Subsurface heat flow | W/m | time; zseg | | -| nPipes | Number of pipes | | | Coördinates for the nPipes dimension | -| time | Simulation timesteps | hours | | Coördinates for the time dimension | -| z | Depth for top and bottom of simulation depth segments | m | | Coördinates for the depth dimension | -| zseg | Depth for middle of simulation depth segments | m | | Coördinates for the depth-segment dimension | +| Parameter | Description | Unit | Dimensions | Remark | +|-----------|-------------------------------------------------------|-------|--------------------|-------------------------------------------------------------------| +| Q_b | Heat load | W | time | Only calculated for run_type TIN | +| Re_in | Reynolds nr. in the inlet pipe(s) | | time | | +| Re_out | Reynolds nr. in the outlet pipe(s) | | time | | +| T_b | Borehole wall temperature | C | time; zseg | | +| T_bave | Depth-average borehole wall temperature | C | time | | +| T_f | Fluid temperature | C | time; z; nPipes | | +| T_fi | Inlet temperature | C | time | Only calculated for run_type POWER | +| T_fo | Outlet temperature | C | time | | +| Tg | (Sub)surface temperature | C | time or time; zseg | | +| dploop | Pumping pressure | bar | time | | +| flowrate | Flowrate | kg/s | time | Total flow rate | +| hours | Simulation timesteps | hours | time | | +| k_g | Grout thermal conductivity | W/mK | time or time; zseg | | +| k_s | Subsurface thermal conductivity | W/mK | time or time; zseg | | +| qloop | Consumed power by the fluid circulation pump | W | time | | +| qsign | Sign of heat flow | | time | Sign indicates heat extraction (positive) or injection (negative) | +| qzb | Subsurface heat flow | W | time; zseg | | +| nPipes | Number of pipes | | | Coördinates for the nPipes dimension | +| time | Simulation timesteps | hours | | Coördinates for the time dimension | +| z | Depth for top and bottom of simulation depth segments | m | | Coördinates for the depth dimension | +| zseg | Depth for middle of simulation depth segments | m | | Coördinates for the depth-segment dimension | In addition to the database file, a plot is generated from a cross-section of the borehole design. Both are stored according to the following convention: diff --git a/pyproject.toml b/pyproject.toml index 02d786483544c24c0715d9e09e70e229caacb7f0..aeaba3b2659325920700ed6db110bc11b9f7cdc4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "geoloop" -version = "1.0.4" +version = "1.0.5" description = "This is a Python package for simulation of (deep) vertical Borehole Heat Exchanger (BHE) systems" authors = [ { name = "Zanne Korevaar", email = "zanne.korevaar@tno.nl" }, diff --git a/src/geoloop/bin/SingleRunSim.py b/src/geoloop/bin/SingleRunSim.py index a2303879c844fc2e535e7c10058c37beee95d24f..0be7569db8b72f05084dc39323fef42d0d0f3dab 100644 --- a/src/geoloop/bin/SingleRunSim.py +++ b/src/geoloop/bin/SingleRunSim.py @@ -221,7 +221,7 @@ class SingleRunResult: flowrate : np.ndarray Mass flow rate over time [kg/s]. qsign : np.ndarray - Sign of power production (-1 = extraction, +1 = injection). + Sign of power production (1 = heat extraction, -1 = heat injection). T_fi : np.ndarray Inlet fluid temperature over time [°C]. T_fo : np.ndarray @@ -243,7 +243,7 @@ class SingleRunResult: Fluid temperature as function of time, depth and pipe index [°C]. Shape: (n_time, n_depth_nodes, nPipes) qzb : np.ndarray - Distributed heat flux at borehole wall [W/m]. + Distributed heat flux at borehole wall [W]. Shape: (n_time, n_depth_segments) Re_in : np.ndarray Reynolds number in inlet pipes over time [-]. @@ -566,7 +566,7 @@ class SingleRun: - T_f : ndarray of shape (nt, npipes, nz) Fluid temperature in pipes [°C]. - qzb : ndarray of shape (nt, nseg) - Heat flux along the borehole wall [W/m]. + Heat flux along the borehole wall [W]. - k_s : ndarray of shape (nseg,) Soil conductivity interpolated over segments. - k_g : ndarray of shape (nseg,) diff --git a/src/geoloop/constants.py b/src/geoloop/constants.py index e3f775258acaf1060334ef7308b9a5d2deaefe23..c33539f759bc70ae922204211db7e24a31820c45 100644 --- a/src/geoloop/constants.py +++ b/src/geoloop/constants.py @@ -10,7 +10,7 @@ units_dict = { "z": "m", "T_b": "\u00b0C", "T_f": "\u00b0C", - "qzb": "W/m", + "qzb": "W", "k_g": "W/mK", "k_p": "W/mK", "m_flow": "kg/s", diff --git a/src/geoloop/geoloopcore/b2g.py b/src/geoloop/geoloopcore/b2g.py index 1d549b9846e7f2959a9297799a220cf0ec13f535..b59165676adf2452245cef47092caa11c2656699 100644 --- a/src/geoloop/geoloopcore/b2g.py +++ b/src/geoloop/geoloopcore/b2g.py @@ -111,7 +111,7 @@ class B2G: T_f : ndarray Pipe fluid temperature field [°C]. qzb : ndarray - Vertical heat flux along borehole [W/m]. + Vertical heat flux along borehole [W]. h_fpipes : ndarray Convective film coefficients for each pipe. result : ndarray diff --git a/src/geoloop/geoloopcore/b2g_ana.py b/src/geoloop/geoloopcore/b2g_ana.py index c48be36975945e2019e912d2b2f86e38c3e76285..eae77166540ae588aa19421b277b33e67a108f03 100644 --- a/src/geoloop/geoloopcore/b2g_ana.py +++ b/src/geoloop/geoloopcore/b2g_ana.py @@ -264,7 +264,7 @@ class B2G_ana: T_ftimes[i] = T_f # stored index time, depth, pipe T_b[i] = Tb qbzseg[i] = qbz - qsign[i] = np.sign(max(qbz) * min(qbz)) + qsign[i] = np.sign(np.sum(qbz)) imax = i hours = time / 3600.0 @@ -494,7 +494,7 @@ class B2G_ana: T_b[i] = Tb # qbz is calculated at the depth division in segments (zseg) qbzseg[i] = qbz - qsign[i] = np.sign(max(qbz) * min(qbz)) + qsign[i] = np.sign(np.sum(qbz)) imax = i hours = time / 3600.0 diff --git a/src/geoloop/plotting/create_plots.py b/src/geoloop/plotting/create_plots.py index d6d4cee879f1920c66b9a20e7de9ee951627eaea..937132cafd8dbaa28032304e89545638868c46de 100644 --- a/src/geoloop/plotting/create_plots.py +++ b/src/geoloop/plotting/create_plots.py @@ -616,7 +616,7 @@ class PlotResults: dz = zp[1] - zp[0] if model_type in ["ANALYTICAL"]: - qbzm = qzb / dz + qbzm = qzb / abs(dz) ax2.plot( qbzm, zseg, @@ -624,7 +624,7 @@ class PlotResults: color=next(color_iter_ax2), ) elif model_type in ["FINVOL"]: - qbzm = qzb / dz + qbzm = qzb / abs(dz) qbzm[0] *= 2 qbzm[-1] *= 2 ax2.plot( @@ -639,6 +639,9 @@ class PlotResults: q_plot = qbzm * np.ones(len(zp)) # because of UBWT condition the heat flow is not linear # ax2.plot(q_plot, zp, label=f'{file_name}: Heat Flow', color=next(color_iter_ax2)) + # remove label of x-axis + ax2.set_xlabel("") + ax2.set_xticklabels("") else: print(f"Unrecognized model type: {model_type}") @@ -685,8 +688,12 @@ class PlotResults: # combine the legends from the second plot primary and secondary axis handles2, labels2 = ax2.get_legend_handles_labels() handles3, labels3 = ax2twin.get_legend_handles_labels() - all_handles = handles2 + handles3 - all_labels = labels2 + labels3 + if model_type in ["PYG", "PYGFIELD"]: + all_handles = handles2 + all_labels = labels2 + else: + all_handles = handles2 + handles3 + all_labels = labels2 + labels3 # Create a single combined legend and define legend location if len(params_ds) > 1: legend_loc = ((1.8 - (len(params_ds) * 0.4)), 1)