Skip to content

Governing equations in geothermal energy ​

Fimbul currently supports pure H₂O as a single-component, two-phase fluid system. Water may be present in a liquid phase (L) and/or a vapor phase (V).

Conservation of mass ​

Mass conservation is written as

(1)∂t([1−ϕ]ρR+ϕ[ρLsL+ρVsV])+∇⋅(ρLv→L+ρVv→V)=QM,

where ϕ is porosity, ρα is density for the rock (α=R) or fluid phase (α∈{L,V}), and sα is phase saturation (the fraction of pore volume occupied by phase α, with sL+sV=1). The term QM denotes mass sources and sinks, including wells and boundary fluxes. Phase velocities are given by Darcy's law,

v→α=−kr,αμαK(∇p−ραg∇z),

where kr,α is relative permeability, μα is viscosity, K is absolute permeability, p is pressure, g is gravitational acceleration, and z is depth (positive downwards).

NOTE: In practice, the interface between liquid and vapor phases in an H₂O system may exhibit non-negligible capillary pressure effects. This is currently not modeled in Fimbul; support is planned for a future release.

Conservation of thermal energy ​

Thermal energy conservation is expressed as

(2)∂t([1−ϕ]ρRuR+ϕ[ρLsLuL+ρVsVuV])+∇⋅(ρLhLv→L+ρVhVv→V)−∇⋅(Λ∇T)=QH,

where uα is specific internal energy, hα=uα+p/ρα is specific enthalpy, T is temperature, and Λ is the effective thermal conductivity tensor of the rock–fluid mixture. The second term on the left represents advective heat transport by the flowing phases; the third term is conductive heat transport via Fourier's law,

q→c=−Λ∇T.

The term QH denotes thermal energy sources and sinks, and generally consists of an advective part (e.g., heat transported with injected fluid), and a conductive part (e.g., heat from a closed, hot wellbore).

Fluid properties ​

The fluid properties of H₂O—such as density, viscosity, enthalpy, and phase state—depend on pressure and enthalpy (or temperature) and are provided through precomputed lookup tables.

For the high-enthalpy (two-phase) regime, the steam tables are generated using the CoolProp library [] via the FimbulCoolPropExt extension. They are stored as Artifacts that are loaded automatically when using the high-enthalpy formulation. The tables can also be loaded directly using the Artifacts API. To generate your own tables, see build_steam_tables_h2o in FimbulCoolPropExt.

The figure below shows the temperature, density, and vapor saturation of H₂O as functions of pressure and specific enthalpy, covering the full range of both single-phase and two-phase states. The saturation line separates the single-phase liquid region (left), two-phase region (center), and single-phase vapor region (right). These phase diagram contours can be visualized using plot_phase_diagram_contours.

For the low-enthalpy (single-phase liquid) regime, Fimbul uses PVT tables from JutulDarcy generated using the NIST database. In this case, sV=0, so that only liquid terms in Equations (1) and (2) remain.

Wells ​

Flow in wells can be modeled in two different ways:

  • As a simple well where flow in and out of the wellbore is computed based on an explicitly computed pressure drawdown from the top to each perforated cell—see JutulDarcy's SimpleWell. In this formulation, the entire wellbore gets a single temperature, which in many cases is a poor approximation for geothermal wells.

  • As a multisegment well where each wellbore is discretized as a 1D object with its own conservation equations for mass and energy, with accompanying pressure and heat variables (either temperature or enthalpy depending on the formulation)—see JutulDarcy's MultiSegmentWell.

In geothermal energy, heat is exchanged with the formation along the entire wellbore, so a multisegment well formulation is the preferred modeling choice. For closed-loop geothermal wells (e.g., AGS, BHE and BTES), a multisegment well formulation is necessary, since temperature changes along the wellbore are crucial to model. All examples in Fimbul use the multisegment well formulation. This models conservation of mass and energy as in Equations (1) and (2), but with only void space, ϕ=1. Wellbore fluxes are computed on the segments that connect the well nodes. The primary unknown on a segment from node a to node b is the total mass flow q, which is determined by balancing the potential difference between the nodes against the frictional pressure drop along the segment,

pa−pb−ρ¯g(za−zb)=Δpf(q),Δpf=2fLDhρv|v|,v=qρA,

where ρ¯ is the average of the mixture densities in the two nodes, L is the segment length, A=π(ro2−ri2) is the cross-sectional area of the flow path, and Dh=2(ro−ri) is its hydraulic diameter, with ro and ri the outer and inner radius (ri=0 for a pipe, ri>0 for an annulus). The mixture density ρ and viscosity μ are saturation-weighted averages over the phases, taken from the upstream node. The Fanning friction factor f depends on the Reynolds number Re=ρ|v|Dh/μ,

f={16/Re,Re≤2000(laminar),[−3.6log10⁡(6.9Re+(ε3.7Do)10/9)]−2,Re≥4000(turbulent),

where ε is the pipe roughness and Do=2ro (Haaland's correlation). In between, f is interpolated linearly in Re between the laminar and turbulent values. The mass flow from node a to node b is q, and the corresponding heat flow is

qH=q∑αxαhα+Gab(Ta−Tb),

where xα=ραsα/∑βρβsβ is the mass fraction of phase α and the phase enthalpies hα are taken from the upstream node. The last term is heat conduction between the nodes, with Gab the thermal conductance of the segment. It is zero by default, but closed-loop wells use it for the thermal resistances between pipe and grout nodes, which are connected by segments without flow (q=0), with Gab=L/Rab—see Closed-loop wells.

Perforations of both simple and multisegment wells compute mass and conductive heat flow using Peaceman-type well indices, with the exception of U-tube and coaxial closed-loop wells (see below). The well index WI is computed with Peaceman's formula—see compute_peaceman_index and the JutulDarcy documentation on wells. For a perforation connecting well node w to reservoir cell c, the mass flow of phase α from the well into the reservoir (positive for injection) is

qα=WImα(pw−pc−ρ¯αg(zw−zc)),

where ρ¯α is the average of the phase densities in the well node and the reservoir cell. The mass mobility mα is ραkr,α/μα of the reservoir cell for production. For injection, it is ραsα of the well node times the total mobility ∑βkr,β/μβ of the reservoir cell. The heat flow from the well into the reservoir is the sum of advective and conductive heat flow,

qH=∑αhαqα+WIth(Tw−Tc),

where the phase enthalpy hα is taken from the well for injection and from the reservoir cell for production.

Thermal well index ​

The thermal well index WIth accounts for conduction through the well casing, the grout surrounding the casing, and the rock. These are treated as thermal resistances in series,

WIth=2πLRc+Rg+Rr,

where the casing, grout and rock terms are

Rc=ln⁡(rw/rc)λc,Rg=ln⁡(rg/rw)λg,Rr=ln⁡(reth/rg)Λe.

Here, rc=rw−tc is the inner radius of a casing of thickness tc, rg=rw+tg is the outer radius of a grout layer of thickness tg, and λc and λg are the casing and grout thermal conductivities. A term is omitted if the corresponding thickness is zero. The rock term uses Peaceman's formula with thermal conductivity in place of permeability: Λe=Λ1Λ2 is computed from the effective rock–fluid conductivity Λ=ϕΛf+(1−ϕ)ΛR, and reth is the Peaceman equivalent radius computed with Λ in place of K and the Peaceman constant doubled (0.56 instead of 0.28). Both indices can also be set directly when setting up the well (WI and WIth in setup_well).

Closed-loop wells ​

Closed-loop wells (see setup_closed_loop_well) do not exchange mass with the reservoir, so WI=0, and heat is exchanged by conduction only. Fimbul represents the cross-section of the borehole as a network of nodes (pipes and grout) connected by thermal resistances, following the thermal resistance and capacity model described in []. The heat flow between two connected nodes a and b (or between a grout node and the reservoir) is

qH=LRab(Ta−Tb),

where Rab is the thermal resistance per unit length. In the expressions below, dg=2rg is the borehole diameter, λg is the grout thermal conductivity, and subscripts i and o denote the inner and outer radius of a pipe wall. The convective (fluid-to-pipe-wall) resistances inside the pipes are currently neglected.

Generic closed-loop well (ClosedLoopGenericWell): the pipe exchanges heat directly with the reservoir through WIth, as computed above with the pipe wall as casing and the surrounding grout.

Single U-tube (ClosedLoop1UWell): two pipes with outer diameter dp=2rp,o and pipe wall thermal conductivity λp, each connected to its own grout node. With w the shank spacing (the center-to-center distance between the two pipes) and

x=ln⁡(dg2+2dp2/(2dp))ln⁡(dg/(2dp)),Rg=(1.601−0.888wdg)cosh−1⁡(dg2+dp2−w22dgdp)2πλg,

the resistances are

Rpg=ln⁡(rp,o/rp,i)2πλp+xRg(pipe to grout),Rgr=(1−x)Rg(grout to reservoir),Rgg=2Rgr(Rar−2xRg)2Rgr−Rar+2xRg(grout to grout),

where Rar=cosh−1⁡((2w2−dp2)/dp2)/(2πλg).

Coaxial (ClosedLoopCoaxialWell): an inner pipe inside an outer pipe (the annulus), surrounded by grout. The subscripts ip and op denote the inner and outer pipe, with pipe wall thermal conductivities λip and λop. With dp=2rop,o the outer diameter of the outer pipe and

x=ln⁡(dg2+dp2)/(2dp2)ln⁡(dg/dp),Rg=ln⁡(dg/dp)2πλg,

the resistances are

Rpp=ln⁡(rip,o/rip,i)2πλip(inner pipe to annulus),Rpg=ln⁡(rop,o/rop,i)2πλop+xRg(annulus to grout),Rgr=(1−x)Rg(grout to reservoir).

For the U-tube and coaxial wells, the grout-to-reservoir index L/Rgr is used as the thermal well index WIth of the perforation, and all indices can be overridden when setting up the well.

NOTE: For the U-tube and coaxial wells, WIth only accounts for the thermal resistance inside the borehole. Unlike the Peaceman-type index above (used by the generic closed-loop well), it contains no term for conduction from the borehole wall to the center of the reservoir cell, i.e., the temperature of the perforated cell is assumed to approximate the borehole wall temperature. This is the same assumption as in [], and requires the reservoir grid to be refined around the well.

Fracture flow ​

In many geothermal systems, flow is dominated by fractures. In enhanced geothermal systems (EGS), hydraulically stimulated fractures provide the flow paths between injection and production wells in otherwise low-permeability rock. In fracture thermal energy storage (FTES), heat is stored by circulating hot water through fractures in crystalline rock. Such fractures are much thinner than the grid cells but far more permeable than the surrounding rock, and they are therefore poorly represented by the matrix permeability alone.

To model fractured systems, Fimbul can be combined with the discrete fracture modeling (DFM) framework in JutulDarcy—see the EGS and FTES setup functions. In DFM, the fractures are represented as a separate, lower-dimensional mesh made up of faces of the matrix mesh, and we model conservation of mass and energy in the fractures just as in the matrix using Equations (1) and (2). A fracture cell has volume Afa, where Af is the area of the cell and a is the fracture aperture, and the fracture permeability is by default given by the cubic law, Kf=ah2/12, with ah the hydraulic aperture (by default equal to a).

Matrix–fracture exchange. Each fracture cell lies on a face of the matrix mesh and is connected to the two matrix cells on either side of that face. The direct connection between the two matrix cells is removed, so that all flow across the face passes through the fracture, and half of the fracture volume is subtracted from each of the two matrix cells. The mass flow of phase α from fracture cell f into matrix cell m is

qα=ραkr,αμαΘfm(pf−pm−ρ¯αg(zf−zm)),

where Θfm is the fracture–matrix transmissibility, ρ¯α is the average of the phase densities in the two cells, and the mass mobility ραkr,α/μα is taken from the upstream cell. The heat flow from the fracture cell into the matrix cell is the sum of advective and conductive heat flow,

qH=∑αhαqα+Λfm(Tf−Tm),

where the phase enthalpy hα is taken from the upstream cell, and Λfm is the fracture–matrix thermal conductance of the rock and the fluid.

Well–fracture exchange. Multisegment wells that cross a fracture are connected directly to the fracture cells they intersect: each crossing gets an additional well node that perforates the fracture cell. Mass and heat exchange through these perforations is computed as for the matrix (see Wells), with Peaceman-type well indices computed from the fracture permeability and thermal conductivity. Simple wells do not currently support crossing fractures: they are only connected to the matrix cells they perforate.