geoloop 1.0.0b1__py3-none-any.whl → 1.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
geoloop/configuration.py CHANGED
@@ -19,6 +19,8 @@ class LithologyConfig(BaseModel):
19
19
  Path to the JSON configuration file that created this object.
20
20
  out_dir_lithology : str or Path
21
21
  Directory where lithology outputs will be written.
22
+ lithology_properties_path: str or Path
23
+ Path to the Excel table with lithology properties.
22
24
  borehole_lithology_path : str or Path
23
25
  Path to the Excel or CSV file containing lithology data.
24
26
  borehole_lithology_sheetname : str
@@ -48,6 +50,7 @@ class LithologyConfig(BaseModel):
48
50
  config_file_path: str | Path
49
51
  out_dir_lithology: str | Path
50
52
  input_dir_lithology: str | Path
53
+ lithology_properties_path: str |Path | None = None
51
54
  borehole_lithology_path: str | Path
52
55
  borehole_lithology_sheetname: str
53
56
  out_table: str
@@ -89,6 +92,23 @@ class LithologyConfig(BaseModel):
89
92
  if not isinstance(self.out_dir_lithology, Path):
90
93
  self.out_dir_lithology = base_dir_lithology / Path(self.out_dir_lithology)
91
94
 
95
+ # Lithology properties table
96
+ # Resolve user-supplied path
97
+ if self.lithology_properties_path is not None:
98
+ if not isinstance(self.lithology_properties_path, Path):
99
+ self.lithology_properties_path = Path(self.lithology_properties_path)
100
+
101
+ if not self.lithology_properties_path.is_absolute():
102
+ self.lithology_properties_path = (
103
+ base_dir_lithology / self.lithology_properties_path
104
+ ).resolve()
105
+
106
+ if not self.lithology_properties_path.exists():
107
+ raise FileNotFoundError(
108
+ f"Lithology properties file not found: "
109
+ f"{self.lithology_properties_path}"
110
+ )
111
+
92
112
  return self
93
113
 
94
114
 
@@ -399,7 +419,7 @@ class SingleRunConfig(BaseModel, extra="allow"):
399
419
  fluid_percent : float or int
400
420
  Mixture percentage for the fluid dissolved in water.
401
421
  m_flow : float
402
- Mass flow rate per pipe [kg/s].
422
+ Mass flow rate [kg/s].
403
423
  epsilon : float
404
424
  Pipe roughness [m].
405
425
  r_in : list of float, optional
geoloop/constants.py CHANGED
@@ -1,20 +1,3 @@
1
- from pathlib import Path
2
-
3
- repo_path = Path(__file__).parent.parent.parent
4
-
5
- # Test directories
6
- test_dir = repo_path / "test"
7
- tests_input_path = test_dir / "input"
8
- test_output_path = test_dir / "output"
9
-
10
- # Resources directory
11
- resources_path = repo_path / "resources"
12
-
13
- # Lithology resources directory
14
- lithology_properties_xlsx = (
15
- resources_path / "lithology_properties" / "lithology_properties.xlsx"
16
- )
17
-
18
1
  # Dictionary of units for various parameters in the model.
19
2
  units_dict = {
20
3
  "Q_b": "W",
@@ -110,28 +110,9 @@ class B2G_ana:
110
110
  for k in range(nsegments):
111
111
  la = gt.load_aggregation.ClaessonJaved(sim_params.dt, sim_params.tmax)
112
112
  LoadAgg.append(la)
113
- # TODO: JD: the workaround below was not reuired anymore?
113
+
114
114
  # The field contains only one borehole
115
- # boreField = [gt.boreholes.Borehole(custom_pipe.b.H, custom_pipe.b.D, custom_pipe.b.r_b, x=0., y=0.)]
116
- # The field contains only one borehole, but needs one extra at very large distance to be correct, ie. gfunc plateaus at 6.7)
117
- boreField = [
118
- gt.boreholes.Borehole(
119
- custom_pipe.b.H,
120
- custom_pipe.b.D,
121
- custom_pipe.b.r_b,
122
- x=0.0,
123
- y=0.0,
124
- tilt=np.radians(0.1),
125
- ),
126
- gt.boreholes.Borehole(
127
- custom_pipe.b.H,
128
- custom_pipe.b.D,
129
- custom_pipe.b.r_b,
130
- x=1000.0,
131
- y=0.0,
132
- tilt=np.radians(0.1),
133
- ),
134
- ]
115
+ boreField = [gt.boreholes.Borehole(custom_pipe.b.H, custom_pipe.b.D, custom_pipe.b.r_b, x=0., y=0.)]
135
116
 
136
117
  # Get time values needed for g-function evaluation
137
118
  time_req = LoadAgg[0].get_times_for_simulation()
@@ -1,16 +1,14 @@
1
1
  import math
2
2
  from pathlib import Path
3
+ from importlib.resources import files
3
4
 
4
5
  import numpy as np
5
6
  import pandas as pd
6
7
  import xarray as xr
7
8
 
8
9
  from geoloop.configuration import LithologyConfig
9
- from geoloop.constants import lithology_properties_xlsx
10
10
  from geoloop.geoloopcore.strat_interpolator import TgInterpolator
11
11
 
12
- # TODO: save the config paramters (error and scaling factors) in the thermcon h5 file that now only stores the results
13
-
14
12
 
15
13
  class ThermalConductivityCalculator:
16
14
  """
@@ -259,6 +257,7 @@ class ProcessLithologyToThermalConductivity:
259
257
 
260
258
  def __init__(
261
259
  self,
260
+ lithology_properties_df: pd.DataFrame,
262
261
  borehole_df: pd.DataFrame,
263
262
  Tg: float,
264
263
  Tgrad: float,
@@ -272,8 +271,7 @@ class ProcessLithologyToThermalConductivity:
272
271
  out_table: str,
273
272
  read_from_table: bool,
274
273
  ) -> None:
275
- # Read lithology properties reference table (Excel)
276
- self.lithology_props_df = pd.read_excel(lithology_properties_xlsx)
274
+ self.lithology_props_df = lithology_properties_df
277
275
 
278
276
  self.borehole_df = borehole_df
279
277
  self.lithology_props_dict = self.create_lithology_props_dict()
@@ -387,12 +385,22 @@ class ProcessLithologyToThermalConductivity:
387
385
  Initialized instance.
388
386
  """
389
387
 
390
- borehole_path = config.borehole_lithology_path
388
+ # Read borehole lithology table (Excel)
391
389
  borehole_df = pd.read_excel(
392
- borehole_path, sheet_name=config.borehole_lithology_sheetname
390
+ config.borehole_lithology_path, sheet_name=config.borehole_lithology_sheetname
393
391
  )
392
+ # Read lithology properties reference table (Excel)
393
+ if config.lithology_properties_path is not None:
394
+ lithology_properties_df = pd.read_excel(
395
+ config.lithology_properties_path
396
+ )
397
+ else:
398
+ lithology_properties_df = pd.read_excel(
399
+ files("geoloop.lithology.resources").joinpath("lithology_properties.xlsx")
400
+ )
394
401
 
395
402
  return cls(
403
+ lithology_properties_df=lithology_properties_df,
396
404
  borehole_df=borehole_df,
397
405
  Tg=config.Tg,
398
406
  Tgrad=config.Tgrad,
File without changes
@@ -199,7 +199,7 @@ class PlotResults:
199
199
  -------
200
200
  None
201
201
  """
202
- out_path_prefix = out_path.with_name(out_path.name + "timeplot")
202
+ out_path_prefix = out_path.with_name(out_path.name + "_timeplot")
203
203
 
204
204
  # Ensure results_dfs is a list of dataframes
205
205
  if isinstance(results_dfs, pd.DataFrame):
@@ -237,12 +237,7 @@ class PlotResults:
237
237
  and "Q_b" in df.columns
238
238
  and "qloop" in df.columns
239
239
  ):
240
- mean_Q = df["Q_b"].mean()
241
- mean_q = df["qloop"].mean()
242
- mean_COP = mean_Q / mean_q
243
- df["COP"] = mean_COP # abs(df['Q_b'] / df['qloop'])
244
- # df['COP'] = abs(df['Q_b']) / df['qloop']
245
- # print(df["COP"].min())
240
+ df['COP'] = abs(df['Q_b']) / df['qloop']
246
241
  if (
247
242
  "Delta_T" in plot_parameters
248
243
  and "T_fi" in df.columns
@@ -253,7 +248,7 @@ class PlotResults:
253
248
  plots = [
254
249
  ("Q_b", "Heat Load [W]", "Q_b", None, None),
255
250
  ("flowrate", "Flowrate [kg/s]", "flowrate", None, None),
256
- ("COP", "Coefficient of Performance", "COP", None, None),
251
+ ("COP", "Coefficient of Performance", "COP", None, None)
257
252
  ]
258
253
 
259
254
  plotted_params = []
@@ -281,11 +276,12 @@ class PlotResults:
281
276
 
282
277
  ax.legend(loc=(-0.07, -0.35))
283
278
 
284
- ax_twin = ax.twinx()
285
- ax_twin.set_ylabel("Pump Power [W]")
286
-
287
279
  for idx, df in enumerate(results_dfs):
288
280
  if "qloop" in plot_parameters and "qloop" in df.columns:
281
+
282
+ ax_twin = ax.twinx()
283
+ ax_twin.set_ylabel("Pump Power [W]")
284
+
289
285
  color = next(color_iter)
290
286
 
291
287
  # Plot the line
@@ -319,7 +315,7 @@ class PlotResults:
319
315
  ax_twin.grid(axis="both")
320
316
 
321
317
  file_name = out_path.with_name(
322
- out_path.name + f"timeplot_{'_'.join(sorted(set(plotted_params)))}.png"
318
+ out_path.name + f"_timeplot_{'_'.join(sorted(set(plotted_params)))}.png"
323
319
  )
324
320
 
325
321
  fig.tight_layout()
@@ -440,7 +436,7 @@ class PlotResults:
440
436
 
441
437
  file_name = out_path.with_name(
442
438
  out_path.name
443
- + "timeplot_"
439
+ + "_timeplot_"
444
440
  + "_".join(sorted(set(plotted_params)))
445
441
  + ".png"
446
442
  )
@@ -473,6 +469,15 @@ class PlotResults:
473
469
  label=labels[idx][param],
474
470
  color=next(color_iter),
475
471
  )
472
+ if param=="COP":
473
+ if param == "COP":
474
+ ax.text(
475
+ 0.7, 0.9, # 2% from left and bottom of the axes
476
+ f"mean COP: {df['COP'].mean():.2f}",
477
+ transform=ax.transAxes,
478
+ bbox=dict(boxstyle="round,pad=0.3", facecolor="white", alpha=0.7),
479
+ fontsize=12
480
+ )
476
481
 
477
482
  ax.legend(loc=(-0.07, -0.17 - (0.08 * len(results_dfs))))
478
483
  ax.grid()
@@ -984,7 +989,7 @@ class PlotResults:
984
989
  bbox_to_anchor=(0, -0.1), loc="upper left"
985
990
  ) # Adjust legend position if needed
986
991
 
987
- save_path = outpath.with_name(outpath.name + f"Sensitivity_{y_variable}")
992
+ save_path = outpath.with_name(outpath.name + f"_sensitivity_{y_variable}")
988
993
  plt.savefig(save_path, bbox_inches="tight")
989
994
  plt.close()
990
995
  else:
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geoloop
3
- Version: 1.0.0b1
4
- Summary: This is a Python package for simulation of (deep) Borehole Heat Exchanger (BHE) systems
3
+ Version: 1.0.2
4
+ Summary: This is a Python package for simulation of (deep) vertical Borehole Heat Exchanger (BHE) systems
5
5
  Author-email: Zanne Korevaar <zanne.korevaar@tno.nl>, Jan-Diederik van Wees <jan_diederik.vanwees@tno.nl>
6
- License: Apache 2.0
6
+ License-Expression: Apache-2.0
7
7
  Keywords: borehole heat exchanger,BHE,geothermal,ground-source heat pump,deep borehole heat exchanger
8
8
  Requires-Python: <3.14,>=3.12
9
9
  Description-Content-Type: text/markdown
@@ -33,20 +33,22 @@ Dynamic: license-file
33
33
 
34
34
  ## What is **Geoloop**?
35
35
 
36
- **Geoloop** is a Python package for simulating borehole heat exchanger (BHE) systems,
37
- with a focus on optimal implementation of subsurface thermal properties and their impact on system performance.
36
+ **Geoloop** is a Python package for simulating vertical borehole heat exchanger (BHE) systems,
37
+ with a focus on the impact of depth-dependent thermal properties and geothermal gradient and their impact on system performance.
38
38
 
39
39
  **Geoloop** incorporates (uncertainty in) depth-variations in subsurface thermal conductivity, subsurface temperature,
40
40
  BHE design and diverse operational boundary conditions such as seasonal load variations or
41
- minimum fluid temperatures, in a tool for deterministic or stochastic performance analyses with the opportunity
42
- for optimization of the system design and operation. This makes Geoloop ideal for scenario analyses and sensitivity
41
+ minimum fluid temperatures. It allows for deterministic or stochastic performance analyses with the opportunity
42
+ for optimization of the system design and operation. This makes Geoloop well suited for scenario analyses and sensitivity
43
43
  studies in both research and practical applications.
44
44
 
45
- **Geoloop** uses thermal response factors (*g*-functions) calculated using the analytical Finite Line Source model from
46
- the *pygfunction* package. This setup is extended into a stacked approach for depth-dependent thermal response calculations.
47
- A detailed description and benchmark of this depth-dependent semi-analytical method is provided in Korevaar & Van Wees (in prep.).
48
- **Geoloop's** generic framework allows for easy switching between simulation methods, including the innovative depth-dependent
49
- semi-analytical approach, the depth-uniform implementation of g-functions as implemented in *pygfunction* and a numerical
45
+ **Geoloop** provides a novel depth-dependent approach for thermal response calculations.
46
+ A detailed description and benchmark of this depth-dependent semi-analytical method is provided in Korevaar et al. (2026).
47
+ **Geoloop** uses the *pygfunction* package, developed by Cimmino & Cook (2022), including its implementation
48
+ of *g*-functions, time aggregation schemes for varying loads, borehole and fluid thermal properties, and various visualization capabilities
49
+
50
+ **Geoloop's** generic framework allows for easy switching between simulation methods, including the
51
+ depth-dependent model, the depth-uniform implementation of g-functions as implemented in *pygfunction* and a numerical
50
52
  finite volume approach.
51
53
 
52
54
  ---
@@ -66,7 +68,7 @@ see the [Installation Guide](https://geoloop-8f7a36.ci.tno.nl/installation/insta
66
68
 
67
69
  ## Requirements
68
70
 
69
- Geoloop requires **Python 3.12 or higher**.
71
+ Geoloop requires **Python version >=3.12,<3.14**.
70
72
 
71
73
  Core dependencies include:
72
74
  - pygfunction
@@ -105,8 +107,14 @@ See the [LICENSE.md](LICENSE.md) file for details.
105
107
 
106
108
  ## Acknowledgments
107
109
 
108
- Developed with the support of the Dutch funding agency **RVO**, in a consortium project with grant nr. MOOI322009.
110
+ Developed with the support of the **Netherlands Enterprise Agency (RVO)**, in a consortium project with grant nr. MOOI322009.
109
111
 
110
112
  ---
111
113
 
112
114
 
115
+ ## References
116
+
117
+ - Cimmino, M. and Cook, J.: pygfunction 2.2: New features and improvements in accuracy and computational efficiency,
118
+ in: Proceedings of the IGSHPA Research Track 2022, International Ground Source Heat Pump Association,
119
+ https://doi.org/10.22488/okstate.22.000015, 2022.
120
+ - Korevaar, Z., Brett, H., Lourens, A. and Van Wees, J.D.: Geoloop (v1.0) – a stochastic, depth-dependent borehole heat exchanger model, Geoscientific Model Development (in prep), 2026
@@ -1,6 +1,6 @@
1
1
  geoloop/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- geoloop/configuration.py,sha256=RuouQFQGbElpD382KI1JZviK0TfTJSHQP3IZimW3C7g,33140
3
- geoloop/constants.py,sha256=F2fsh3e35Fp8AqNguPba6W96jaIAfsWazk1d6uzKi6I,2698
2
+ geoloop/configuration.py,sha256=dhiqW326YYxZLT9-hdiKG5_UqVUIhCETnNOyjxl-xb4,34052
3
+ geoloop/constants.py,sha256=v_U88LpjxQCBq-7wv8XCprNqa4XTpsNFW7XLKFC2cuw,2276
4
4
  geoloop/axisym/AxisymetricEL.py,sha256=uGERxWzt9PIixzyYqK_v2kBuOEye6ZhqqXVBBEbrRig,28218
5
5
  geoloop/axisym/__init__.py,sha256=s3Suw3X0GzuQKGvR1ia6RCYGa43Az8g4gtRgedkf2b0,84
6
6
  geoloop/bin/Flowdatamain.py,sha256=vwVn7y9jPH-6RU2_eH2tWLvcsbFFHDxi8APoQ5ug1J0,2566
@@ -18,7 +18,7 @@ geoloop/geoloopcore/CoaxialPipe.py,sha256=QDoelo4LmIy99Wf6_w8ECZOQbNQ7hTRMrvY6Rg
18
18
  geoloop/geoloopcore/CustomPipe.py,sha256=2sRUj0dhqtqbi0h2ydj_uDvpxYpqi1yowXvhlpOoRYA,23885
19
19
  geoloop/geoloopcore/__init__.py,sha256=-KGPB9JKniMxRslEodzCwcrRPrdz_JgWion7uDbfF9I,104
20
20
  geoloop/geoloopcore/b2g.py,sha256=U7Hw6M1v4ckY78K9IYzyqk_NtVTU5ibwUlTsGNbEeiY,29098
21
- geoloop/geoloopcore/b2g_ana.py,sha256=_jcSudb6qZX4XiERtEH1Mv193jRqLtGr2gGWz4BsE78,19193
21
+ geoloop/geoloopcore/b2g_ana.py,sha256=3gFY3Q8DdXGnMmerf2crmgBnC__oBLhyiaFen1jG1Og,18469
22
22
  geoloop/geoloopcore/boreholedesign.py,sha256=k9TlSHrnRFCnw9TtDoZ8rURIWMksHncS0Uz0qp7fY8E,23574
23
23
  geoloop/geoloopcore/getloaddata.py,sha256=Lj5q8dx6JQms0TIpkhA2GzQ-BGrgJEp4agFq-i3d15Y,4135
24
24
  geoloop/geoloopcore/pyg_ana.py,sha256=b66IoR4UwvB9n_bFUBqjYvq34e49MeBcXMwKVwyLy3k,9756
@@ -28,19 +28,20 @@ geoloop/geoloopcore/soilproperties.py,sha256=vpH5Iq7Uuf1AX2wEqWEAv9J8w9nQqh-CfEA
28
28
  geoloop/geoloopcore/strat_interpolator.py,sha256=BB-xMA5Py3QOOoAdZMZBnxsuGpEug9xCfvuE7ZL6Ysk,6071
29
29
  geoloop/lithology/__init__.py,sha256=Nwcc5G-DCpBQjTIn2VK0Rvm2HDs3cc8gjXUAjRg7DmU,158
30
30
  geoloop/lithology/plot_lithology.py,sha256=SyOYH6hEAhMz8f4qk9XlofEVG7cEpOtBxOwgh6uEeQ0,9477
31
- geoloop/lithology/process_lithology.py,sha256=ukAExhO-41NnS6FI1Lp2FoKB2yjWztHSSkEZIYImctA,26449
31
+ geoloop/lithology/process_lithology.py,sha256=F4Z7gTJRzU_P46EFUW7tsdBGfY1wI13vxvvUH3ntAHo,26765
32
+ geoloop/lithology/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
33
  geoloop/loadflowdata/__init__.py,sha256=5LO-5fjkWkw50gOuLwDIY2oZHojguTdKJrOtuHHVFPo,138
33
34
  geoloop/loadflowdata/flow_data.py,sha256=FM9QZ-oK0zSrMTfTTOjjifP4G5F5sAiWHhnSpRVGaaw,5395
34
35
  geoloop/loadflowdata/loadprofile.py,sha256=a0sMkNfqs-YDMwuLreX1Oy3L_yF4aciziHBthsnEvMM,9746
35
36
  geoloop/plotting/__init__.py,sha256=cUvbg7WZIuEAYLgQrhhUyS0MFzkwhWaktVV9TwmncuU,125
36
- geoloop/plotting/create_plots.py,sha256=b6ggMpn2UgDzZKZnD0_p6rp7fLTpAN-cIG0LTSqdCe0,45269
37
+ geoloop/plotting/create_plots.py,sha256=KJbqH3UN25C3NttQBJUGQ8zhQhWosGjFlCc3XBG5LaE,45549
37
38
  geoloop/plotting/load_data.py,sha256=7-HGOLV4e-_D8PShTljMSbehRrX10vok6aTjenrfOYM,18184
38
39
  geoloop/utils/RunManager.py,sha256=_teQvHJ5ET5STjTv1YZbYUD4I9lC6xPpACL5zer7nas,5861
39
40
  geoloop/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
41
  geoloop/utils/helpers.py,sha256=Xrowd6t1nUUsU642y2bD3haKtNs0Zi8cCR8PtIFqAug,32139
41
- geoloop-1.0.0b1.dist-info/licenses/LICENSE.md,sha256=0MhY1_Mi2BnmfY4sG2hMfaIQBsGbCR-_jPNOQ2wjnaI,582
42
- geoloop-1.0.0b1.dist-info/METADATA,sha256=F2WiBAsKe6nSpTGtuA1NpOYBkiGmnongTMbI2nvM_LI,3680
43
- geoloop-1.0.0b1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
44
- geoloop-1.0.0b1.dist-info/entry_points.txt,sha256=MK2kD_B90zZfZN-kUVrfQyJZqorcgg1WYLe7CSgvfHc,56
45
- geoloop-1.0.0b1.dist-info/top_level.txt,sha256=V20v-HNxFxZn9Tguuo4KZFG3c9Kn4D4w06tL1tlRbwE,8
46
- geoloop-1.0.0b1.dist-info/RECORD,,
42
+ geoloop-1.0.2.dist-info/licenses/LICENSE.md,sha256=0MhY1_Mi2BnmfY4sG2hMfaIQBsGbCR-_jPNOQ2wjnaI,582
43
+ geoloop-1.0.2.dist-info/METADATA,sha256=iniZ8EQ_-5rm7qvJ6Zqlg7eA2DqIPOfvw1I_WhECR5w,4302
44
+ geoloop-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
+ geoloop-1.0.2.dist-info/entry_points.txt,sha256=MK2kD_B90zZfZN-kUVrfQyJZqorcgg1WYLe7CSgvfHc,56
46
+ geoloop-1.0.2.dist-info/top_level.txt,sha256=V20v-HNxFxZn9Tguuo4KZFG3c9Kn4D4w06tL1tlRbwE,8
47
+ geoloop-1.0.2.dist-info/RECORD,,