BasinmodlR follows a geothermal heat project from what is known about the subsurface to its value for the company that would build it. The chain has six steps, each a function that returns a plain table:
project_reservoir(): aquifer properties at the
site;project_doublet(): flow, temperature and power of a
doublet in each aquifer;project_demand(): the heat users;project_network(): the transport pipeline and the heat
network;project_costs(): heat sold, investment and running
costs;project_value(): cash flow, net present value, debt
cover and break-even heat price.geothermal_project() runs all six. What differs between
countries and companies is kept apart in one object,
project_setup(), so the chain itself never changes.
A burial and thermal history model gives, for every unit, its present
depth and thickness, the porosity it kept from its deepest burial
(compaction is irreversible) and its temperature.
project_reservoir() turns the units into aquifers;
permeability follows from porosity with a lithology relation
(lithology_table()) or a relation fitted on well data
(fit_poroperm()).
model <- run_basin_model(brabant)
aquifers <- project_reservoir(model, site = c(0, 0), lithology = c("layer 4" = "sandstone", "layer 2" = "sandstone"))
aquifers[, c("id", "top_depth", "thickness", "porosity", "permeability_md", "gradient_c_km", "porosity_basis")]
#> id top_depth thickness porosity permeability_md gradient_c_km
#> 1 layer 5 500 50 0.09375919 22.597395 28.75006
#> 2 layer 4 550 750 0.08161826 14.515085 27.70415
#> 3 Rebecq Gp. (unit 5) 1300 50 0.06785225 8.095194 27.17645
#> 4 layer 2 1350 2000 0.04179939 1.791022 26.78599
#> 5 Jodoigne-Mousty Fms. (unit 2) 3350 2750 0.05440858 4.056012 22.39929
#> porosity_basis
#> 1 max burial
#> 2 max burial
#> 3 max burial
#> 4 max burial
#> 5 max burialThe Brabant Massif units are old and deeply buried: porosity and permeability are far too low for a doublet. That is the answer for this basin, and the chain carries it through. For the rest of this vignette we use a layer table, the second common starting point.
Only depth and thickness are required; lithology, porosity,
permeability, temperature and uplift are used when they are given and
estimated when they are not. The column perm_basis says
where each value came from.
layers <- data.frame(id = c("upper sand", "lower sand"), top_depth = c(1800, 2400),
thickness = c(80, 120), lithology = "sandstone", perm_md = c(250, NA),
uplift_m = c(0, 300), temp_c = c(70, 88))
res <- project_reservoir(layers, site = c(0, 0))
res[, c("id", "porosity", "permeability_md", "perm_basis", "porosity_basis")]
#> id porosity permeability_md perm_basis porosity_basis
#> 1 upper sand 0.2981584 250.0000 given max burial
#> 2 lower sand 0.2325835 481.0368 lithology + porosity max burialOther inputs feed the same step: prospect_site() for one
well-known site, prospects_from_boreholes() and
prospects_from_grid() for borehole data and maps,
read_thermogis_aquifer() for the Dutch ThermoGIS grids, and
sonic_to_porosity(), fit_poroperm() and
calibrate_prospects() for well logs.
nl <- project_setup("NL")
nl
#> Project set-up 'NL' (EUR)
#> Netherlands: PBL SDE++ 2026 reference costs, SDE++ 2026 (provisional correction amount), project finance (70 % debt), ThermoGIS doublet design
#> cost basis : PBL SDE++ 2026 reference, deep geothermal < 12 MWth; fixed O&M 117/kW/yr, electricity 80/MWh, plant 150000/MW, pipeline 1000/m
#> investor : project_finance (decides on equity NPV), debt 70 % at 5.75 % over 10 yr, tax 25.8 %
#> subsidy : SDE++, 15 years
#> well design : skin -1 / -1, well distance 1500 m, pump pressure rule: thermogisThe Dutch preset uses the reference installation of PBL’s SDE++ 2026 advice, the SDE++ 2026 subsidy and PBL’s project-finance terms. A greenhouse grower in the same country has its own financing and tax position:
For a country without a preset everything is given. The values below are only an illustration; use local quotes for wells, plant and networks, the national tax rate and the subsidy that applies.
other <- project_setup("custom",
economics = project_economics(well_cost_coef = c(0.25, 800, 3e5), elec_price = 150, fixed_om_per_kw = 90),
investor = "utility", investor_args = list(tax_rate = 0.30),
subsidy = list(subsidy_investment(0.4, cap = 1e7), subsidy_production(eur_mwh = 15, years = 10)),
description = "illustrative utility in a country with an investment grant and a production premium")
other
#> Project set-up 'custom' (EUR)
#> illustrative utility in a country with an investment grant and a production premium
#> cost basis : given; fixed O&M 90/kW/yr, electricity 150/MWh, plant 150000/MW, pipeline 1000/m
#> investor : utility (decides on project NPV), debt 50 % at 5.75 % over 10 yr, tax 30.0 %
#> subsidy : investment grant, 40 % of the investment (cap 1e+07)
#> subsidy : production premium, 10 years
#> well design : skin -1 / -1, well distance 1500 m, pump pressure rule: thermogisA set-up can be registered under a name for the rest of the session
(register_project_setup()) and saved with
saveRDS() to share it within a company.
dbl <- project_doublet(res, nl, t_return = 35)
dbl[, c("id", "pump_bar", "production_temp", "q_m3h", "power_mw", "cop", "status")]
#> id pump_bar production_temp q_m3h power_mw cop status
#> 1 upper sand 58.48330 68.90938 196.8149 6.639451 12.45937 ok
#> 2 lower sand 78.18962 87.19890 468.2057 24.972918 14.73456 okThe pump pressure follows the ThermoGIS rule (30 percent of the
hydrostatic pressure at mid-aquifer) unless the set-up says otherwise.
engine = "screen" gives the closed-form screen, fast enough
for national grids.
users <- project_demand(data.frame(id = c("greenhouses", "hospital", "district"),
x = c(1500, 1800, 2100), y = c(200, -300, 400),
annual_MWh = c(40000, 25000, 30000)),
hours = 5000, min_temp_c = 60, return_temp_c = 35, price_eur_gj = 14)
users
#> id group x y annual_MWh hours peak_mw min_temp_c return_temp_c price_eur_gj
#> 1 greenhouses clients 1500 200 40000 5000 8 60 35 14
#> 2 hospital clients 1800 -300 25000 5000 5 60 35 14
#> 3 district clients 2100 400 30000 5000 6 60 35 14
net <- project_network(users, site = c(0, 0))
net$pipe_m
#> [1] 1773.309Without street data the network is estimated from straight distances.
With streets (for example from OpenStreetMap,
read_osm_streets()), the network is routed along them and
every pipe is sized:
streets <- list()
for (k in 0:5) {
streets[[length(streets) + 1]] <- data.frame(osm_id = k + 1, seq = 1:2, x = c(0, 2400), y = c(-800, -800) + k * 400)
streets[[length(streets) + 1]] <- data.frame(osm_id = k + 11, seq = 1:2, x = c(0, 0) + k * 480, y = c(-800, 1200))
}
streets <- do.call(rbind, streets)
routed <- project_network(users, site = c(0, 0), streets = streets, setup = nl)
routed$network
#> <gd_network>
#> clients routed : 3 of 3
#> trench length : 6.20 km of main + 0.30 km of service
#> diversity factor : 0.82 at the plant, 1.00 on single-client branches
#> peak load at plant : 15515 kW
#> diameters : DN200 to DN250
#> network cost : 9.92 million (1579 per m of trench)p <- geothermal_project(res, users, nl, site = c(0, 0))
p
#> Geothermal project (set-up 'NL', investor project_finance)
#> 2 aquifer(s) from layer table; 3 client(s), 95.0 GWh/yr; transport pipeline 1773 m
#> aquifer depth_m T_C flow_m3h MW sold_GWh capex_M npv_M dscr breakeven status
#> upper sand 1800 68.9 197 8.01 56.2 10.2 13.9 3.5 2.2 ok
#> lower sand 2400 87.2 468 29.33 95.0 16.8 9.5 2.3 9.3 ok
#> best: upper sand, 8.0 MW, 56 GWh/yr sold, investment 10.2 MEUR, decision NPV 13.9 MEUR -> feasibleThe same chain for the grower and for the other set-up:
for (s in list(grower, other)) {
b <- geothermal_project(res, users, s, site = c(0, 0))$best
cat(sprintf("%-8s best %s: NPV %.1f M, break-even %.1f per GJ, feasible %s\n",
s$investor$type, b$id, b$npv / 1e6, b$breakeven_eur_gj, b$feasible))
}
#> grower best upper sand: NPV 7.4 M, break-even 9.6 per GJ, feasible TRUE
#> utility best upper sand: NPV 15.9 M, break-even 6.6 per GJ, feasible TRUEEvery intermediate number is in the result, for example the cost items and the cash flow of the chosen aquifer:
p$best[, c("capex_wells", "capex_plant_pump", "capex_pipeline", "capex_distribution", "capex_connections",
"opex_fixed", "opex_pumping", "heat_sold_mwh", "coverage")]
#> capex_wells capex_plant_pump capex_pipeline capex_distribution capex_connections opex_fixed
#> 1 5316288 1701297 1773309 568172.5 800864.7 937011.7
#> opex_pumping heat_sold_mwh coverage
#> 1 299326.7 56231.34 0.5919089
head(project_cashflow(p))
#> year revenue sde opex ebitda interest debt_service depreciation eia tax
#> 1 1 2834060 2527529 1236338 4125250 408937.2 954873.9 677328.8 0 784057.9
#> 2 2 2890741 2527529 1261065 4157205 377545.9 954873.9 677328.8 0 800401.1
#> 3 3 2948556 2527529 1286286 4189798 344349.5 954873.9 677328.8 0 817374.9
#> 4 4 3007527 2527529 1312012 4223044 309244.4 954873.9 677328.8 0 835009.4
#> 5 5 3067677 2527529 1338252 4256954 272120.7 954873.9 677328.8 0 853336.1
#> 6 6 3129031 2527529 1365017 4291542 232862.4 954873.9 677328.8 0 872388.6
#> cash_to_equity project_cash
#> 1 2386318 3235687
#> 2 2401930 3259397
#> 3 2417549 3283581
#> 4 2433160 3308249
#> 5 2448744 3333411
#> 6 2464280 3359075For a region or a country the same ingredients are used on a grid:
subsurface_potential() samples every aquifer of a ThermoGIS
download (or your own grids) and couple_potential() tries
every allowed cell within pipeline reach of every cluster of clients,
with the same costs and investor profiles.
model_audit_report() writes an HTML report with every step
behind the result. These need the packages ‘sf’ and ‘terra’:
pot <- subsurface_potential("D:/geothermal/thermogis_webmaps_TNO_RD_new", spacing_m = 1000)
groups <- list(client_layer("greenhouses.gpkg", 240, "kWh_m2", sector = "greenhouse"),
client_layer("industry.gpkg", "GJ", "GJ", group = "industry", hours = 6000, min_temp_c = 90))
zones <- list(constraint_layer("natura2000.shp", "natura2000"))
x <- couple_potential(pot, groups, zones, investor = nl$investor, sde = sde_scheme())
model_audit_report(pot, groups, zones, file = "audit.html")The doublet engine on its own (after DoubletCalc) is described in the
help of doublet_spec(), doublet_simulate() and
doublet_monte_carlo(); worked case studies are in
system.file("scripts", package = "BasinmodlR").