Skip to content

High-enthalpy example case - #60

Merged
strene merged 33 commits into
mainfrom
ht-example-case
Oct 17, 2026
Merged

strene merged 33 commits into
mainfrom
ht-example-case

Conversation

@strene

@strene strene commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces a new "magmatic intrusion" geothermal case, improves the handling and documentation of pure-water steam tables, and makes several refinements to well modeling and documentation. The most significant changes are the addition of a high-enthalpy geothermal system example, updates to the steam tables artifact and generation scripts, and improved handling of closed-loop wells.

New magmatic intrusion geothermal system:

  • Added a new example magmatic_intrusion_demo.jl that demonstrates simulation of a high-enthalpy geothermal reservoir heated by a magmatic intrusion, including both natural-state evolution and production scenarios with and without reinjection. (examples/production/magmatic_intrusion_demo.jl)
  • Exposed the magmatic_intrusion case in the public API and included it in the list of available cases and documentation. (src/Fimbul.jl, docs/src/man/cases/cases.md, src/cases/cases.jl) [1] [2] [3]

Steam tables and artifacts:

  • Updated the SteamTablesH2O artifact to a new version with improved phase labeling for supercritical states, ensuring continuity across the critical pressure and avoiding spurious two-phase regions. (Artifacts.toml, ext/FimbulCoolPropExt/steam_tables.jl) [1] [2]
  • Added a new script to build the steam tables using CoolProp and save them in the required format, with checks for correct phase labeling. (examples/pvt/build_steam_tables.jl)

Closed-loop well handling:

  • Ensured that closed-loop well systems (e.g., BTES, AGS, coaxial BHE) cannot be shut, as shutting one end would create a dead end in the hydraulic circuit. This is enforced in the respective case setup functions. (src/cases/btes.jl, src/cases/ags.jl, src/cases/coaxial_bhe.jl) [1] [2] [3]

Documentation and utility improvements:

  • Added a recent reference on magmatic heat sources to the bibliography. (docs/src/refs.bib)
  • Excluded utility scripts (such as PVT table builders) from documentation examples and clarified their usage. (docs/make.jl)
  • Minor plotting and code cleanups in the coaxial BHE example, such as removing fixed xticks. (examples/production/coaxial_bhe_demo.jl) [1] [2]
  • Minor fix to pressure and enthalpy grid handling in steam tables generation. (ext/FimbulCoolPropExt/steam_tables.jl)

strene and others added 30 commits October 14, 2026 19:32
Zero fluid volume in the grout cells made the well CNV criterion
(normalized by pore volume) sensitive to round-off in the well
solve, causing many extra Newton iterations with JutulDarcy 0.4.
Use 1e-3 of the grout volume, consistent with the U1 closed-loop well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JutulDarcy 0.4 takes the number of components in the compositional flux
from the equation of state, which H2OSystem does not have. Overload
component_mass_fluxes! for GeothermalModel until this is handled upstream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Only add wells that are active in the schedule, since fluid can flow
  along the wellbore of a shut well. A natural-state case (num_years = 0)
  has no wells, and the new initial_state keyword allows restarting a
  production case from the natural state.
- Use a tensor grid with uniform fine cells around the intrusion and
  geometric grading towards the boundaries, retaining the number of cells
  given by dims. The cap rock gets its own uniform cell layers (cap_cells).
- Demo: simulate the natural state without wells, restart the production
  scenarios with wells and yearly report steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Refine the mesh vertically from the base of the cap rock to the bottom of
  the intrusion, with zero refinement margin by default.
- Choose the number of cap-rock layers automatically, such that cap-rock
  cells are approximately as large as the refined cells.
- Place the injector just above the intrusion by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a dh_max_abs keyword to set_reservoir_variable_defaults! for geothermal
(H2OSystem) models, which limits the absolute change in enthalpy per Newton
iteration. It is not limited by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JutulDarcy main changed the signature of compositional_fluxes! and moved
diffusion to a separate term. Pure H2O has a single component, so no
diffusive flux is added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The update to Jutul 0.5 and JutulDarcy 0.4 reintroduced 1.11 lower
bounds for LazyArtifacts, LinearAlgebra and Statistics, which are not
compatible with the julia = "1.10" bound from #59.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
strene and others added 3 commits October 16, 2026 17:19
The steam tables script in examples/pvt requires CoolProp and is not
meant to be built as a documentation page. Update its usage notes after
it was moved from scripts/, which also removed its Project.toml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A junction point between two well sections can lie exactly on a cell
face, since the mesh is built from the trajectory points. Since Jutul
0.5.3, find_enclosing_cells only returns cells where the trajectory has
positive length, so the connected sections may not share a cell at the
junction. Fall back to the cell of the other section with centroid
closest to the junction point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nolebase/vitepress-plugin-enhanced-readabilities and @nolebase/ui
2.21 require VitePress 2, which broke npm install in the docs build.
Pin both to 2.18.2, as in JutulDarcy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@strene
strene merged commit df3f413 into main Oct 17, 2026
3 checks passed
@strene
strene deleted the ht-example-case branch October 17, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant