Customizing Doublet Simulation Parameters¶
To adjust properties of the simulation, you can pass a utc_properties instance
to the calculate_doublet_performance function.
A utc_properties instance is a JClass implementation of the Java UTCProperties class.
It is generated by using the utc_properties_builder, upon which custom properties can be set,
and used to build an instance of the utc_properties.
be aware: The number of parameters is large, and the default values are set to the ThermoGIS base case. A comprehensive list of parameters is given in UTC properties.
There are two ways to set the properties of the simulation, by either:
- Using the
utc_properties_builderclass to set the properties of the simulation, and then building theutc_propertiesinstance. - Using the
instantiate_utc_properties_from_xmlfunction to parse a configuration file, which will return autc_propertiesinstance.
customizing the thermoGIS techno-economic properties
The default and custom properties in Pythermogis can be found in thetests/resources/scenarios directory.
The default properties are defined in the doublet_techno-econ_basecase.xml file, see also
UTC properties for more information on the default properties and
the ThermoGIS documentation.
🧰 Running Doublet simulations with custom simulation parameters¶
Common properties to change include:
setUseHeatPump(Boolean): if true, include a heat-pump when modellingsetUseStimulation(Boolean): if true, apply reservoir stimulation when simulating a doubletsetSurfaceTemperature(float): The temperature of the surfacesetTempGradient(float): The gradient at which temperature increases with depth, in C/kmsetDhReturnTemp(float): The goal of the direct heat return temperaturesetStimKhMax(float): The maximum transmissivity above which no stimulation will occur (if UseStimulation = True)
Here is an example, where the default utc_properties is used, but the UseHeatPump option is set to True. this is achievied by instantiating a utc_properties_builder class, running .useHeatPump(True) on that class, and then building the
utc_properties themselves, with the .build() method of the utc_properties_builder.
from pythermogis import calculate_doublet_performance, instantiate_utc_properties_builder
import xarray as xr
input_data = xr.Dataset({
"thickness": 300,
"ntg": 0.5,
"porosity": 0.5,
"depth": 2000,
"permeability": 300,
})
utc_properties = instantiate_utc_properties_builder().setUseHeatPump(True).build()
results = calculate_doublet_performance(input_data, utc_properties=utc_properties)
print(results)
🧰 Running Doublet simulations with XML configuration files¶
below is an example of how to run a doublet simulation with custom properties defined in an XML file.
If you have a valid configuration file, you can parse a utc_properties class using the method: instantiate_utc_properties_from_xml.
Examples of valid configuration files are found in tests/resources/test_input/scenarios.
The vast majority of the parameters in the xml are not used by this python API; but are required by the ThermoGIS java code,
unfortunately they are still needed in the xml file to enable parsing.
from src.pythermogis import calculate_doublet_performance_stochastic, instantiate_utc_properties_from_xml
import xarray as xr
input_data = xr.Dataset({
"thickness_mean": 300,
"thickness_sd": 50,
"ntg": 0.5,
"porosity": 0.5,
"depth": 5000,
"ln_permeability_mean": 5,
"ln_permeability_sd": 0.5,
})
utc_properties = instantiate_utc_properties_from_xml("path/to/valid/xml/file")
results = calculate_doublet_performance_stochastic(input_data, utc_properties=utc_properties)
print(results)