@@ -16,7 +16,7 @@ def __init__(self, model: Model):
16
16
:return: None
17
17
"""
18
18
19
- model .logger .info (" Init " + self .__class__ .__name__ + ": " + __name__ )
19
+ model .logger .info (f' Init { self .__class__ .__name__ } : { __name__ } ' )
20
20
super ().__init__ (model ) # Initialize all the parameters in the superclass
21
21
22
22
# There are no parameters unique to this class, so we don't need to set any up here.
@@ -26,7 +26,7 @@ def __init__(self, model: Model):
26
26
self .MyClass = sclass
27
27
self .MyPath = os .path .abspath (__file__ )
28
28
29
- model .logger .info (" Complete " + self .__class__ .__name__ + ": " + __name__ )
29
+ model .logger .info (f' Complete { self .__class__ .__name__ } : { __name__ } ' )
30
30
31
31
def __str__ (self ):
32
32
return "SurfacePlantIndustrialHeat"
@@ -39,12 +39,12 @@ def read_parameters(self, model: Model) -> None:
39
39
:param model: The container class of the application, giving access to everything else, including the logger
40
40
:return: None
41
41
"""
42
- model .logger .info (" Init " + self .__class__ .__name__ + ": " + __name__ )
42
+ model .logger .info (f' Init { self .__class__ .__name__ } : { __name__ } ' )
43
43
super ().read_parameters (model ) # Read in all the parameters from the superclass
44
44
45
45
# Since there are no parameters unique to this class, we don't need to read any in here.
46
46
47
- model .logger .info (" complete " + self .__class__ .__name__ + ": " + __name__ )
47
+ model .logger .info (f' complete { self .__class__ .__name__ } : { __name__ } ' )
48
48
49
49
def Calculate (self , model : Model ) -> None :
50
50
"""
@@ -54,7 +54,7 @@ def Calculate(self, model: Model) -> None:
54
54
:type model: :class:`~geophires_x.Model.Model`
55
55
:return: Nothing, but it does make calculations and set values in the model
56
56
"""
57
- model .logger .info (" Init " + self .__class__ .__name__ + ": " + __name__ )
57
+ model .logger .info (f' Init { self .__class__ .__name__ } : { __name__ } ' )
58
58
59
59
# This is where all the calculations are made using all the values that have been set.
60
60
# If you subclass this class, you can choose to run these calculations before (or after) your calculations,
@@ -73,28 +73,23 @@ def Calculate(self, model: Model) -> None:
73
73
# useful direct-use heat provided to application [MWth]
74
74
self .HeatProduced .value = self .HeatExtracted .value * self .enduse_efficiency_factor .value
75
75
76
- # Calculate annual electricity/heat production because all end-use options have "heat extracted from reservoir" and pumping kWs
76
+ # Calculate annual electricity/heat production because all end-use options have "heat extracted from reservoir"
77
+ # and pumping kWs
77
78
self .HeatkWhExtracted .value = np .zeros (self .plant_lifetime .value )
78
79
self .PumpingkWh .value = np .zeros (self .plant_lifetime .value )
79
80
81
+ def _integrate_slice (series , _i ):
82
+ return SurfacePlant .integrate_time_series_slice (
83
+ series , _i , model .economics .timestepsperyear .value , self .utilization_factor .value
84
+ )
85
+
80
86
for i in range (0 , self .plant_lifetime .value ):
81
- # FIXME TODO WIP adjust dx for slice size
82
- self .HeatkWhExtracted .value [i ] = np .trapz (self .HeatExtracted .value [
83
- (0 + i * model .economics .timestepsperyear .value ):((
84
- i + 1 ) * model .economics .timestepsperyear .value ) + 1 ],
85
- dx = 1. / model .economics .timestepsperyear .value * 365. * 24. ) * 1000. * self .utilization_factor .value
86
- self .PumpingkWh .value [i ] = np .trapz (model .wellbores .PumpingPower .value [
87
- (0 + i * model .economics .timestepsperyear .value ):((
88
- i + 1 ) * model .economics .timestepsperyear .value ) + 1 ],
89
- dx = 1. / model .economics .timestepsperyear .value * 365. * 24. ) * 1000. * self .utilization_factor .value
87
+ self .HeatkWhExtracted .value [i ] = _integrate_slice (self .HeatExtracted .value , i )
88
+ self .PumpingkWh .value [i ] = _integrate_slice (model .wellbores .PumpingPower .value , i )
90
89
91
90
self .HeatkWhProduced .value = np .zeros (self .plant_lifetime .value )
92
91
for i in range (0 , self .plant_lifetime .value ):
93
- # FIXME TODO WIP adjust dx for slice size
94
- self .HeatkWhProduced .value [i ] = np .trapz (self .HeatProduced .value [
95
- (0 + i * model .economics .timestepsperyear .value ):((
96
- i + 1 ) * model .economics .timestepsperyear .value ) + 1 ],
97
- dx = 1. / model .economics .timestepsperyear .value * 365. * 24. ) * 1000. * self .utilization_factor .value
92
+ self .HeatkWhProduced .value [i ] = _integrate_slice (self .HeatProduced .value , i )
98
93
99
94
# calculate reservoir heat content
100
95
self .RemainingReservoirHeatContent .value = SurfacePlant .remaining_reservoir_heat_content (
0 commit comments