Reservoir Geometry: Riemannian Manifolds in Oil and Gas
Beneath the surface of every oil and gas field lies a porous rock formation, and inside that rock, fluid moves. The simplest model for that motion, Darcy's law, was measured empirically by Henry Darcy in 1856 from sand filtration experiments on the Dijon fountain supply. He found that volumetric flow rate through a porous column is proportional to the pressure drop and inversely proportional to the column length. This linear constitutive relation has a proportionality constant, the permeability, that characterises the rock. For more than a century reservoir engineers treated permeability as a scalar (a single number per rock sample) and built analytic solutions for pressure propagation on that assumption.
Real reservoirs are three-dimensional and anisotropic. Sedimentary layering, fracture networks and depositional fabrics all impose directional preferences on fluid flow: the rock is more permeable along bedding planes than across them, more permeable along open fractures than perpendicular to them, more permeable horizontally than vertically by factors routinely exceeding one hundred. A scalar permeability misrepresents all of this. The correct object is a permeability tensor: a symmetric positive definite contravariant tensor of type whose coordinate matrix in a given chart is a symmetric positive definite array assigning a different conductance to flow in each direction.
That tensor is the entry point for Riemannian geometry. The reservoir is a Riemannian manifold:
The inverse of the permeability tensor is a Riemannian metric. It turns the reservoir into a metric space where the distance between two points is the hydraulic effort required for fluid to traverse them. High-permeability sandstone is "short"; tight shale is "long." Geodesics of this metric are the paths of least hydraulic resistance and the rays along which a pressure front travels. Darcy streamlines are the integral curves of the Riemannian gradient of pressure and coincide with geodesics for uniform flow and for flow from a point source in a homogeneous formation. Spatial gradients in permeability produce Christoffel symbols and curvature. Permeability heterogeneity thus curves the geodesics. For constant permeability the pressure equation is a heat equation on this manifold governed by the Laplace-Beltrami operator. For heterogeneous permeability it differs from that equation by a first-order term (§4.2). Permeability contrasts at formation boundaries are refractive index discontinuities that bend geodesics by an exact analogue of Snell's law. Every equation in this post follows from reading the permeability tensor as a metric.
Structure. Section §2 separates the permeability tensor from its coordinate matrix and introduces index notation, the Levi-Civita connection and the fibre bundle of material property fields. Section §3 constructs the permeability metric and its diffusion ellipsoid and shows that Darcy flux is a Riemannian gradient. Section §4 derives the Laplace-Beltrami heat equation, the spherical pressure kernel and the spherical-to-radial flow transition. Section §5 computes the Christoffel symbols for a diagonal tensor and derives the Darcy-Snell refraction law and the Jacobi field equation. Section §6 proves the scalar curvature formula and shows that the Weyl curvature vanishes in 3D. Section §7 solves the spectral problem on a rectangular parallelepiped. Section §8 treats the space of permeability coordinate matrices as the manifold and derives geodesic interpolation. Section §9 extends the framework to a deforming reservoir with Biot poroelasticity and a Kozeny-Carman conformal metric flow. Section §10 runs the geometry in no_std Rust on a microcontroller with the cartan library. Section §11 surveys applications in well-test interpretation, formation evaluation, reservoir simulation, compaction monitoring and embedded well-site instrumentation.
1. Darcy's Law and the 3D Permeability Tensor
1.1. Empirical Law
Darcy's original experiment measured the steady-state volumetric flow rate through a vertical sand column of cross-sectional area and length , subject to a pressure head difference :
where is the hydraulic conductivity of the sand. Dividing both sides by and taking the continuum limit gives the volumetric flux (volume rate per unit area), the Darcy velocity or specific discharge:
where is the fluid pressure, is the dynamic viscosity, and is the intrinsic permeability. This isotropic form holds only when the rock has no preferred flow direction. Clean well-sorted sandstone satisfies this condition and almost nothing else does.
Reservoir permeability spans roughly eight orders of magnitude. Conventional sandstone reservoirs typically exhibit . Tight gas formations lie in the range . Shale matrix permeability falls below , with hydraulic fractures providing the dominant conductive pathways. In laminated reservoirs the horizontal-to-vertical permeability ratio commonly ranges from 5 to 100, and values exceeding 1000 are regularly encountered in thinly laminated fluvial sequences. This anisotropy drives all 3D geometry in what follows.
1.2. Full 3D Permeability Tensor
In an anisotropic three-dimensional formation, the Darcy velocity in each direction depends on the pressure gradient in all three directions. The constitutive law is:
where is the permeability tensor. Symmetry () follows from the Onsager reciprocal relations: the cross-coupling between a pressure gradient in direction and the resulting flux in direction must equal the coupling in the reverse direction. This follows from microscopic reversibility. Positive definiteness is a physical requirement: the viscous dissipation rate per unit volume, , must be positive for any non-zero pressure gradient.
In the Einstein summation convention, Darcy's law reads
where repeated indices are summed from 1 to 3. The index placement has geometric meaning: upper indices on and denote contravariant components, which transform like coordinate differentials under a change of chart; lower indices on denote covariant components, which transform like the coordinate basis vectors . The array is the coordinate matrix of the permeability tensor in the current chart. It is a representation, not the tensor itself: rotating or rescaling the coordinate axes changes while leaving the underlying physical permeability of the rock unchanged. Section §2 develops this distinction before the Riemannian geometry is built on it.
The positive definiteness conditions for the tensor are:
These are the three Sylvester conditions (leading principal minors all positive), which characterise symmetric positive definite matrices.
1.3. Transverse Isotropy in the Standard Reservoir Model
The dominant anisotropy type in clastic and carbonate reservoirs is transverse isotropy (TI), in which the rock has equal permeability in all horizontal directions but a different permeability vertically. With as the vertical axis:
where is the horizontal permeability and is the vertical permeability. All off-diagonal entries vanish when the coordinate axes are aligned with the bedding plane. The TI model reduces the full six-parameter tensor to two independent parameters. That suffices for the dominant flow behaviour in most conventional reservoirs.
The dimensionless anisotropy ratio
governs the shape of the 3D pressure diffusion front. For the front is a sphere; for it is an oblate ellipsoid (wider horizontally than vertically). In practice, ranges from 2 in well-sorted sandstones to well above 100 in laminated formations. The vertical permeability is rarely measured directly in field tests and is typically inferred from the early-time spherical flow regime in a well test.
1.4. Continuity and the 3D Pressure Equation
Combining Darcy's law with conservation of mass for a slightly compressible fluid (constant total compressibility ) in a porous medium with porosity :
Substituting [eq:darcy-tensor] into [eq:continuity] gives the 3D pressure diffusion equation:
For constant this is a constant-coefficient parabolic PDE. For heterogeneous , it is a variable-coefficient elliptic-parabolic operator whose structure is governed by the Riemannian geometry of the tensor field.
2. Permeability Tensors and Coordinate Representations
2.1. Permeability Tensor as a Coordinate-Free Object
The word "tensor" is often used interchangeably with "matrix" in engineering literature. In what follows that identification is wrong: it produces incorrect equations on a deforming manifold. The distinction comes before any geometry.
A tensor field of type on a smooth manifold assigns to each point a multilinear map
where is the tangent space at and is the cotangent space. The tensor itself is this map. A matrix is the array of numbers obtained by evaluating the map on a chosen basis. A different basis changes the matrix and leaves the tensor unchanged.
The permeability tensor is a symmetric contravariant tensor of type : at each it is a symmetric bilinear map . Given a coordinate chart on with coordinate basis for and dual basis for , the components of in that chart are
The array is the permeability matrix in the chart . Darcy's law in this chart is
where are the contravariant components of the Darcy velocity vector and are the covariant components of the pressure gradient covector. The repeated index is summed from 1 to 3 (Einstein convention). Throughout, upper indices denote contravariant components and lower indices denote covariant components.
2.2. Transformation Law and the Primacy of the Tensor
Under a coordinate change with Jacobian , the components of a tensor transform as
Each index transforms with one factor of . The tensor is unchanged: it is the same physical object, described by different numbers in the new chart. A rotation from geographic coordinates (north, east, down) to borehole coordinates (along-hole, cross-hole, vertical) multiplies the matrix by two factors of the rotation matrix, but the permeability of the rock at that point is unaltered.
The permeability tensor is symmetric positive definite as a tensor if
Symmetry and positive definiteness are coordinate-invariant conditions on the tensor; they hold in every chart simultaneously if they hold in one. The Sylvester conditions on the matrix are statements about the matrix representation in a particular chart. The individual minors change with the chart. The conditions hold in one chart exactly when the tensor is SPD, and then they hold in every chart.
The form of the Sylvester conditions changes with the chart although positive definiteness is preserved. Consider a 2D tensor with principal values aligned at to the coordinate axes. Its matrix in that coordinate frame is , and the Sylvester conditions hold. In a frame aligned with the principal axes the matrix is diagonal and the conditions are trivially , . The invariant test is the tensor condition for all nonzero covectors .
2.3. Metric as a Covariant Tensor
The Riemannian metric derived from is a covariant symmetric tensor: at each it is a symmetric positive definite bilinear map . Its components in a chart are
The relationship means that the matrix is the matrix inverse of . More invariantly, the contraction holds in every chart, where is the Kronecker delta. Indices are raised and lowered by and :
The Darcy velocity has contravariant components (a vector along the flow direction); the pressure gradient has covariant components (a covector along the direction of steepest pressure increase). The permeability tensor converts covectors to vectors: it maps the pressure gradient covector to the flux vector.
2.4. Levi-Civita Connection
A connection on is a rule for differentiating tensor fields that is consistent with the manifold structure. The Levi-Civita connection is the unique connection that is (i) metric-compatible, , and (ii) torsion-free, . Its Christoffel symbols in a coordinate chart are
The symbols transform inhomogeneously under coordinate changes and form no tensor. They correct for the curvature of the coordinate grid and vanish at the centre of a geodesic normal chart. The covariant derivative of a vector field is
and its covariant divergence is
The last equality follows from the identity and is the form used in the Laplace-Beltrami operator of §4.
The notation uses three indices but the symbol does not obey the tensor transformation law. Under a coordinate change, the Christoffel symbols pick up an inhomogeneous second-derivative term involving . Parallel transport on a curved manifold cannot be encoded by a tensor. The curvature tensor , defined as the commutator of covariant derivatives, is a tensor. The inhomogeneous terms in the transformation of the Christoffel symbols cancel in . The Riemann and Ricci curvature tensors computed in §6 are proper tensors; the Christoffel symbols appearing in their definitions are not.
2.5. Tensor-Matrix Distinction on a Deforming Manifold
On the static reservoir of §3–§8 the tensor/matrix distinction does not change the form of the equations: the domain is fixed and a single coordinate chart suffices. On a deforming reservoir (§9), the solid skeleton displaces with a smooth map from the reference configuration to the current configuration . The deformation gradient is
where are material (Lagrangian) coordinates and are spatial (Eulerian) coordinates. Under this map, the coordinate chart on in which the permeability matrix is measured changes at every time step.
The permeability tensor is a material property of the rock: it does not change when coordinates are relabelled. Its Eulerian matrix representation does change, because the coordinate axes at a point are not the same objects as the axes at the corresponding material point . The object to transport forward in time is the push-forward of the tensor:
where are the components of the permeability tensor in the reference configuration. This is the contravariant transformation law applied to the deformation map. Confusing the matrix with the tensor on a deforming domain omits the Jacobian and gives an error of order in the permeability. That error is of the size of the strain and is sometimes large in compaction reservoirs. Section §9 develops this in full.
3. 3D Reservoir as a Riemannian Manifold
3.1. Permeability Metric
A symmetric positive definite permeability tensor defines a Riemannian metric on by declaring : the components of the covariant metric tensor in any chart are , the entries of the matrix inverse of . The following theorem shows that this choice is canonical.
Let be the reservoir domain equipped with the Riemannian metric . The Darcy velocity is equal to , the Riemannian gradient of the pressure field.
Proof. The Riemannian gradient is defined as the unique vector field satisfying
for all tangent vectors . In coordinates, . The condition reads , i.e., for all . Multiplying both sides by and summing over gives , i.e., . Therefore
The proof uses no properties specific to ; it holds in any dimension.
The metric measures resistance to flow, not permeability. In high-permeability rock ( large, small), the Riemannian distance between two nearby points is small: fluid traverses this distance easily, and the geometry contracts the region. In low-permeability rock ( small, large), the Riemannian distance is large. Geodesic distance measures hydraulic effort. Two points that are close in Euclidean space but separated by a tight shale barrier are far apart in the Riemannian metric of the reservoir.
The reservoir is a space where the "distance" between two points is the work the fluid must do to travel from one to the other. A 100 mD sandstone 10 metres thick is "closer" in this metric than a 0.01 mD shale 1 metre thick. Every equation in this post follows from this reinterpretation. The permeability tensor gives the shape of the metric at each point and the rest is calculus on that shape. The Darcy equation, the pressure diffusion equation and the streamline equations are the standard equations of Riemannian geometry applied to the metric . The task of the reservoir engineer is to measure the metric.
3.2. Transverse Isotropy and the Diffusion Ellipsoid
For the transversely isotropic tensor , the metric is
The Riemannian unit ball is the ellipsoid
with horizontal semi-axis and vertical semi-axis . This is the diffusion ellipsoid: it describes the shape of the region reached by a unit-energy pressure pulse in unit Riemannian time. Since in most reservoirs the ellipsoid is oblate (flattened vertically) because horizontal flow is easier.
In a pressure transient test, the radius of investigation at time is approximately the set of points at Riemannian distance from the well. With the horizontal and vertical diffusivities and , for a TI reservoir this is the ellipsoid
In the early-time spherical flow regime (before the diffusion front contacts the formation top and bottom) the ellipsoid is entirely within the reservoir, and the pressure derivative behaves as on a log-log scale, distinct from the flat derivative of radial flow. This spherical flow regime is the primary diagnostic for measuring from a pressure transient test.
Take a reservoir with and . The metric components are and . A vertical displacement of one metre has Riemannian arc length and a horizontal displacement of one metre has . Moving one metre upward is thus ten times "farther" than moving one metre sideways. The ellipsoid is the set of points at equal Riemannian distance from the well and is oblate because vertical distance is longer. This restates Darcy's law in geometric language. A vertical permeability two orders of magnitude lower becomes a vertical distance one order of magnitude longer.
3.3. Volume Form and Riemannian Divergence
The Riemannian volume form on is
Here is the determinant of the matrix of covariant metric components, which equals since is the matrix inverse of . For the TI tensor, , so . High-permeability regions have a smaller Riemannian volume element: they are geometrically compressed. The Riemannian divergence of a vector field is
In well-test interpretation this flux law underlies the pressure diffusion equation solved at the wellbore; see §11.1.
4. Pressure Diffusion as the 3D Laplace–Beltrami Equation
4.1. 3D Laplace–Beltrami Operator
For a Riemannian manifold with metric and inverse metric , the Laplace–Beltrami operator acting on a smooth function is
With the permeability metric (so , the contravariant metric components equal the permeability tensor components in the current chart, and ), this becomes
4.2. Constant vs. Heterogeneous Permeability
If is spatially constant, then
and the 3D pressure equation [eq:pressure-eq] is the Laplace–Beltrami heat equation on :
Proof. When is constant, all derivatives of and vanish and [eq:lb-explicit] reduces to . The pressure equation then takes the form [eq:heat-beltrami].
When varies with position, expansion of [eq:lb-explicit] gives
The correction term, proportional to the gradient of , is non-zero whenever the permeability varies in space. It vanishes when is constant and then recovers [eq:lb-equals-darcy]. This formula holds in any dimension. For the TI tensor, , and the correction involves gradients of both and . The Darcy divergence is the physically correct operator for heterogeneous reservoirs. Discretising the Laplace–Beltrami form introduces a systematic error proportional to and is largest near facies boundaries.
In three dimensions a conformal rescaling removes the correction. For one has and . Hence and for every heterogeneous . In two dimensions is unchanged by , and no rescaling helps unless is constant.
4.3. Heat Kernels in 2D and 3D
The fundamental solution to the heat equation depends on the spatial dimension. For isotropic permeability and diffusivity , the heat kernels in two and three dimensions are:
where . The 2D kernel applies to an infinite vertical well producing from a formation of uniform thickness (the pressure diffusion is planar, independent of the -coordinate). The 3D kernel applies to a point source in a three-dimensional infinite medium.
For a point source (perforation cluster) at the origin in a constant isotropic 3D reservoir and producing at volumetric rate , the pressure drawdown is
where is the complementary error function. This satisfies the 3D heat equation with , and the appropriate point-source boundary condition at the origin.
Proof. Superposing the 3D heat kernel over the production history gives . The substitution gives , and gives [eq:3d-drawdown]. Consider the two limits: as , since the argument goes to infinity and hence (no drawdown before production). As , and the limit is the steady-state Newtonian potential . This potential satisfies the time-independent Laplace equation at . Hence the solution converges to steady state.
The 2D and 3D kernels produce different pressure signatures. In two dimensions the Green's function for the Laplacian is logarithmic: the steady-state pressure from a line source grows as , which diverges as . There is no true steady state in an infinite 2D reservoir. In three dimensions, the Green's function is , which decays to zero at infinity. A point source in a 3D infinite reservoir reaches a true steady state.
In well testing a well completed over a short interval of a thick formation of height behaves as a 3D spherical source at early time (before the pressure transient contacts the top and bottom of the formation) and transitions to a 2D cylindrical (Theis) source at late time. The transition occurs near , where is the vertical diffusivity. The log-log pressure derivative shows a slope of during spherical flow and a flat plateau during radial flow. Identifying and measuring both regimes is the standard well-test method for determining independently of .
4.4. Spherical-to-Radial Flow Transition
The transition between 3D spherical and 2D radial flow is a Riemannian geometry result: the dimension of the heat kernel changes as the pressure diffusion ellipsoid transitions from three-dimensional to quasi-two-dimensional.
Consider a well producing at rate from a short perforated interval centred at the origin in a TI formation of thickness with permeabilities , and diffusivities , . The pressure response satisfies:
(i) For (early time), the pressure drawdown approximates a 3D spherical kernel centred on the perforated interval:
where is the horizontal distance, , and is the effective Riemannian distance from the well in the TI metric.
(ii) For (late time), the vertical mode has equilibrated and the pressure drawdown approaches the 2D Theis form:
where is the exponential integral.
Proof.
Key Lemma. For any smooth function of alone,
Proof of Lemma. Since and , the chain rule gives
Adding the -component and multiplying by :
For the vertical term, and , so
Summing both contributions and substituting : the coefficient is , and the coefficient is . This proves the Key Lemma.
Source coefficient (part i). The pressure equation with a point source at the origin is
Set for a constant . The Key Lemma reduces the spatial operator to , the radial 3D Laplacian in scaled by . The function satisfies the 3D radial heat equation away from the origin (verifiable by direct differentiation). To fix , introduce the rescaled coordinate , under which and the TI operator becomes . Therefore, in the distributional sense,
where the Jacobian of the change contributes the factor . The source condition gives . This establishes [eq:spherical-regime].
Late-time limit (part ii). When , the vertical diffusion length greatly exceeds the formation thickness, and the vertical pressure gradient has equilibrated across the formation. The problem reduces to a two-dimensional source-diffusion system in the horizontal plane with effective line-source strength . Applying the two-dimensional Theis solution (the 2D analogue of the heat kernel used above):
which is positive since for . This establishes [eq:radial-regime].
5. 3D Geodesics and Streamlines
5.1. Christoffel Symbols for Diagonal 3D K
For a diagonal permeability tensor in three dimensions (with coordinates ), the metric is (no sum). The Levi-Civita Christoffel symbols are
where the outer index does not participate in a sum (since is diagonal, ).
For with spatially varying entries, the non-vanishing Christoffel symbols are:
All components with three distinct indices vanish. If is spatially constant, all , and the geodesics of are straight lines.
Proof. Compute each case from [eq:christoffel] using and .
For :
For , , :
For , , :
For constant , all partial derivatives of vanish and so all Christoffel symbols are zero. The geodesic equation reduces to and the solutions are straight lines.
As noted in §2.4, the symbols have three indices but are not tensor components: they transform inhomogeneously under coordinate changes with an added second-derivative term involving . The Christoffel symbols derived above are valid in the coordinate chart aligned with the principal axes of . In a rotated chart the formulas change (because the matrix is no longer diagonal), even though the underlying connection and hence the geodesics are unchanged.
5.2. 3D Rescaled Coordinate Transformation
For a constant diagonal tensor , the coordinate change
(no summation) transforms the metric to the standard Euclidean form in three dimensions:
For a constant-permeability reservoir with , geodesics are straight lines in the rescaled coordinate system . Darcy streamlines are the gradient lines of in these coordinates and are straight for uniform flow and for flow from a point source. In the plane, a line making angle with the -axis in the rescaled system makes angle in the original system where .
For the TI reservoir with , , the rescaled domain is . The vertical dimension is stretched by the factor . A reservoir that is geometrically thin vertically may then be isotropic in the rescaled coordinates when is large enough.
5.3. Darcy–Snell Law at Permeability Interfaces
When a geodesic crosses a planar boundary between two isotropic regions with permeabilities and , it does not continue in the same direction. The angle of incidence and the angle of refraction are related by an exact analogue of Snell's law from optics.
Consider a planar permeability interface at , with isotropic permeability for and for . A geodesic arriving at the interface at angle measured from the interface normal refracts to angle according to
For and , no refracted geodesic exists and the geodesic undergoes total reflection at the interface.
Proof. By Fermat's principle applied to the Riemannian metric, geodesics minimise the arc-length functional . This is formally identical to optical path minimisation with refractive index : Snell's law states , which translates to [eq:darcy-snell]. More directly: since depends only on , the Lagrangian is independent of the tangential coordinates . The Euler–Lagrange equations give the conserved quantities and . Writing the tangential speed and the Riemannian arc-length speed (a constant for arc-length parametrisation), the conserved tangential co-momentum is . Setting this equal across the interface gives [eq:darcy-snell]. Total reflection occurs when no real satisfies [eq:darcy-snell], i.e., when . This requires .
The Darcy–Snell law governs geodesics, the rays of the pressure front. At a low-permeability fault (shale smear or cemented zone, with ) it gives . Geodesics entering the fault therefore bend towards the normal and cross it by the shortest route. Total reflection happens in the opposite direction: a geodesic leaving tight rock for a layer with stays in the tight rock. For a contrast suffices.
Darcy streamlines obey a different law at the same interface. Continuity of the normal flux and of the tangential pressure gradient give the tangent law , and every streamline crosses an interface of finite permeability. A fault of finite permeability therefore reduces the flow through it without reflecting it, and the transmissibility multiplier describes that reduction.
In this framework a propped fracture is a thin region where the permeability jumps from the matrix value (perhaps in a tight shale) to the fracture conductivity (perhaps or more). In the Riemannian picture, the metric component across the fracture drops by a factor of . Points on opposite sides of the fracture that are physically millimetres apart become close in the Riemannian sense. The fracture is a geometric shortcut through otherwise "distant" rock.
In this language the stimulated reservoir volume (SRV) of a multi-stage hydraulic fracture completion is the geodesic neighbourhood of the fracture network. The SRV boundary is approximately the set of points whose Riemannian distance to the nearest fracture face equals the drainage radius during the production time. Rock that is Euclidean-close to the wellbore but Riemannian-far from any fracture (because no high-permeability path connects it) remains undrained. Fracture spacing matters because the inter-fracture matrix is "far" in the metric unless the fractures are close enough that their geodesic neighbourhoods overlap.
The Darcy-Snell law at the fracture face controls how streamlines enter the fracture. For a fracture with , the critical angle for total reflection of a geodesic leaving the matrix is : geodesics that enter the fracture arrive within a fraction of a degree of the normal and then run nearly parallel to the fracture wall. Under the tangent law for Darcy streamlines, matrix flow meets the fracture face within a fraction of a degree of the normal for any direction of flow inside the fracture short of exactly parallel. This is the geometric content of the "linear flow regime" (half-slope on the pressure derivative) observed in tight-rock completions: the fracture surface acts as a planar sink with matrix flow arriving normal to the face.
5.4. Jacobi Fields and Streamline Spreading
In three dimensions the transverse neighbourhood of a geodesic is two-dimensional. The Jacobi equation governs how nearby geodesics spread apart:
where is the covariant derivative along the geodesic , is a Jacobi field (transverse deviation vector, ), and is the Riemann curvature tensor. In 3D there are two independent transverse directions and two independent Jacobi fields govern the spreading of the flow tube cross-section.
Let be the cross-sectional area of a flow tube at arc-length along the central geodesic. To leading order in curvature,
where is the Ricci curvature in the flow direction. If , the flow tube area decreases (streamlines focus) and the formation is a converging lens for fluid. If , the area increases (streamlines defocus) and the formation is a diverging lens. For the isotropic conformal metric the sign of is set by the second derivatives of as well as its gradient. A profile with gives at the permeability minimum for along , and an exponential trend gives along the trend.
The Jacobi field equation describes in 3D what practitioners call flow channelling: preferential flow through high-permeability streaks or fractures with early breakthrough in secondary recovery. The curvature of the permeability field determines whether and how rapidly channelling develops along a given flow path.
Geodesic refraction at faults follows this geodesic equation. The arrival-time surface it generates is the observable used in well-test permeability inversion. See §11.1.
6. Curvature of the 3D Permeability Field
6.1. 3D Conformal Isotropic Metric
For an isotropic but spatially variable permeability , the permeability tensor is and the metric is
This is a conformally flat metric in : it is related to the Euclidean metric by the scalar conformal factor . In index notation, and , where is the Euclidean metric tensor (components: 1 on the diagonal, 0 off it, in every orthonormal chart). Writing , the conformal factor is and hence .
The general formula for the scalar curvature of a conformally flat metric on is
where and are the ordinary Euclidean operators. For this gives the Liouville formula . For the formula acquires a second term.
6.2. 3D Scalar Curvature Formula
For the conformally flat isotropic metric in three dimensions, the scalar curvature is
where and are the Euclidean Laplacian and gradient. In particular whenever is constant.
For comparison, in two dimensions the same metric yields
The 3D formula has a larger coefficient in front of . Sharp permeability gradients produce stronger curvature effects in 3D than in 2D.
Proof. Set and compute the ingredients:
For the Euclidean Laplacian of :
Substituting into [eq:conformal-curvature] with (so , ) and :
Substituting [eq:phi-gradient] and [eq:phi-laplacian]:
Collecting terms:
For constant both and and hence . Here is the Laplacian on the flat Euclidean background (acting on the scalar field ) and differs from the Laplace-Beltrami on the curved manifold . The 2D formula [eq:scalar-curvature-2d] follows from the same calculation with (the term vanishes in [eq:conformal-curvature] for ).
6.3. Vanishing Weyl Tensor in 3D
In any dimension the Riemann curvature tensor decomposes into a trace-free part (the Weyl tensor ) and a part determined by the Ricci tensor. In three dimensions the Weyl tensor has no independent components and vanishes identically.
In three dimensions, the Weyl curvature tensor vanishes identically for every Riemannian metric. The full Riemann curvature tensor is determined entirely by the Ricci tensor and the scalar curvature via
Proof. In dimension , the Weyl tensor is defined as the totally trace-free part of the Riemann tensor. A dimension count shows that in 3D the Riemann tensor has 6 independent components, and the Ricci tensor also has 6 independent components (as a symmetric matrix). The Weyl tensor therefore has zero independent components, and the Riemann tensor is fully determined by the Ricci tensor via the identity [eq:riemann-3d]. For a conformally flat metric the Weyl tensor vanishes in any dimension, since it is conformally invariant and vanishes for the flat metric. In 3D this is an empty condition (the Cotton tensor is the conformal invariant in 3D).
The vanishing of the Weyl tensor in 3D means the Riemann curvature tensor is entirely determined by the Ricci tensor and the scalar curvature through [eq:riemann-3d]. Any local gravitational-like tidal stretching of streamlines (the Jacobi field equation [eq:jacobi-eq] for the convergence or divergence of nearby flow paths) is driven entirely by local Ricci curvature. There are no independent long-range curvature degrees of freedom: in 4D general relativity the Weyl tensor contains gravitational wave modes that propagate through vacuum and in 3D no such modes exist. For the reservoir, the curvature at a point is fixed by the permeability and its first two derivatives at that point. The Ricci tensor is computable from the permeability field and its first two derivatives and contains the complete curvature content of the manifold.
6.4. Curvature and Pressure Transient Anomalies
The scalar curvature in [eq:scalar-curvature-3d] has a direct well-test interpretation. Since , large signals one of two conditions: large absolute variation in permeability ( large, i.e., concave or convex permeability profiles), or large relative gradients ( large, i.e., sharp layering boundaries or fracture edges). Both conditions produce departures from the Theis/spherical pressure signatures. The pressure satisfies , which differs from the Laplace–Beltrami heat equation by the first-order term of [eq:lb-correction] in . That term and both vanish for constant permeability and both grow with sharp gradients. A high-curvature zone reached by the pressure diffusion front at time is expected to produce an anomaly in the second derivative of pressure with respect to . This post does not derive its amplitude.
7. Boundary-Dominated Flow and 3D Spectral Theory
7.1. 3D Eigenvalue Problem
At late times in a bounded reservoir with a constant-pressure outer boundary, the pressure disturbance relaxes to a boundary-dominated regime in which every point decays at the same exponential rate. Its profile is the first eigenfunction of the Laplace–Beltrami operator. (For a closed no-flow boundary under constant-rate production the late-time regime is pseudosteady state, in which the pressure declines linearly in time at every point.)
For a bounded reservoir with Dirichlet outer boundary condition , the pressure modes satisfy
where is the Laplace–Beltrami operator for the metric . The eigenvalues are real, positive, and discrete.
The eigenvalues are scalars: they do not depend on the coordinate chart used to describe the reservoir. The eigenvalue equation is written in terms of the Laplace-Beltrami operator . That operator is intrinsic to the Riemannian manifold . The explicit formula for on the rectangular parallelepiped uses a specific coordinate chart aligned with the box axes, but the values are the same in every chart.
7.2. Rectangular Parallelepiped with TI Anisotropy
For a rectangular parallelepiped reservoir with transversely isotropic permeability tensor and horizontal diffusivity , the decay rates of the Dirichlet modes (the eigenvalues of divided by ) are
where is the anisotropy ratio. The fundamental (smallest) eigenvalue is and the corresponding late-time decay constant is
Proof. In the rescaled coordinates , , , the metric is Euclidean (Corollary [geodesic-streamline-3d]) and the domain transforms to with , , . The Laplace–Beltrami operator in rescaled coordinates is the standard Euclidean Laplacian , and the Dirichlet problem on a rectangular parallelepiped has eigenfunctions
with eigenvalues
Dividing by to convert eigenvalues into decay rates and factoring out gives [eq:pss-eigenvalues-3d]. The time constant follows by inverting .
The anisotropy ratio enters only the -indexed (vertical) modes. Large lowers the vertical contributions , and a small thickness raises them. The first non-trivial vertical overtone has . The ratio gives the time scale separation between vertical and horizontal equilibration. The vertical pressure variation equilibrates faster than the horizontal variation when , the usual case in a thin reservoir. Strong layering (large ) slows the vertical equilibration.
The full 3D spectral decomposition is
where the coefficients are determined by the initial condition. For , only the fundamental mode remains: , the three-dimensional boundary-dominated regime. The fundamental decay rate is directly measurable as the slope of against during that period.
The eigenvalues are decay rates of diffusive modes. They are not oscillation frequencies. Acoustic logging with tube waves (Stoneley waves) senses permeability within centimetres of the borehole wall through wave attenuation and slowness and does not excite these reservoir-scale modes. The reservoir-scale spectrum is read from late-time pressure decline.
A shift in the fundamental decay rate between two time-lapse surveys means the metric has changed, whether from compaction, waterflood sweep or fracture closure. The anisotropy ratio appears in the eigenvalue formula as a scaling of the vertical mode index. A formation with high vertical anisotropy therefore has a characteristic spectral signature: the vertical overtones () decay slowly relative to a formation of the same thickness with . In principle this spectral fingerprint is invertible for the anisotropy ratio without a separate vertical permeability measurement. Wellbore storage, skin and noise complicate the inversion. The clean spectral structure described here is the idealised limit that the field measurement approximates.
8. SPD(3) Manifold of Permeability Tensors
8.1. Permeability Space as a Manifold
Two distinct Riemannian manifolds appear in reservoir geometry. The first is the physical reservoir domain, the open region occupied by the formation. That region has no intrinsic Riemannian structure of its own: it is an open subset of Euclidean three-space. The Riemannian metric is a property of the material inside the domain. The reservoir domain is the base space; the geometry lives in the fibre.
The second manifold is the space of pointwise material properties. At every spatial location , the rock possesses a permeability tensor . The values that can take form a manifold: the set of all symmetric positive definite matrices, denoted . The permeability field is therefore a smooth section of a fibre bundle over : the base manifold is the physical domain , the fibre at each is a copy of , and is a section of that bundle. More precisely, the fibre is the space of coordinate matrices of the permeability tensor in a chosen chart. A change of chart at acts on the fibre by the congruence (from the transformation law [eq:K-transform]). The fibre bundle is therefore associated to the frame bundle of , with structure group acting by congruence. The affine-invariant metric on is invariant under this action and is the natural choice for reservoir applications.
As a topological space, sits inside the tensor product space : a matrix is a rank-2 tensor, and its nine components embed it in . Imposing symmetry cuts this to the 6-dimensional subspace , and imposing positive definiteness selects the open cone . The fibre lives in this tensor power. This distinction carries forward when collections of tensors of different ranks are associated to a point: a scalar permeability, a full permeability tensor, and an elasticity tensor of rank 4 (living in ) are all fibres over the same base point and together form a multi-rank vector bundle of material properties.
With this structure in place the geodesic interpolation of permeability tensors is a question about geodesics in the fibre manifold . Given two measurements and at distinct base points, or two rock samples whose blended properties must be estimated, the geodesic in connecting them is the physically correct interpolant.
The set of symmetric positive definite matrices,
is a smooth Riemannian manifold of dimension (six independent entries) with the affine-invariant (Fisher–Rao) metric
where are symmetric matrices (tangent vectors at ). The elements of are symmetric positive definite matrices: the coordinate matrix representations of permeability tensors in a fixed chart. The identification of a tensor with a point of is therefore chart-dependent: the geodesic distance between two permeability states is computed between their matrix representations, and is consistent only if both matrices are expressed in the same coordinate chart.
The affine-invariant metric is the natural choice for permeability tensors: it is invariant under congruence transformations for any invertible and corresponds to invariance under change of coordinate frame in the reservoir. No particular drilling orientation or bed-dip coordinate system is preferred by the geometry.
8.2. Geodesic Interpolation of 3D Permeability
The unique minimising geodesic from (the coordinate matrix of the permeability tensor at formation point ) to (the coordinate matrix at point , both expressed in the same chart) is
and the geodesic distance between the two tensors is
where are the generalised eigenvalues of relative to and is the Frobenius norm.
The naive arithmetic mean is not a geodesic on and violates the physical symmetry of the problem: the arithmetic midpoint of and is not the inverse of the arithmetic midpoint of and . Arithmetic interpolation of permeabilities is inconsistent with arithmetic interpolation of resistivities. The geodesic interpolation [eq:spd-geodesic] satisfies this consistency property: the geodesic midpoint of and is exactly the inverse of the geodesic midpoint of and .
For the 3D TI tensor, arithmetic averaging of and independently is equivalent to arithmetic interpolation of the diagonal entries, and it overestimates the effective vertical permeability of a layered zone, which is the harmonic mean of the layer values. Geodesic interpolation in accounts for the coupling between horizontal and vertical components when the principal axes of the two formation tensors are not aligned (e.g., when the bedding dip changes between the two measurement points).
8.3. Tensor Rotation and Coordinate Invariance
Under a rotation , the permeability tensor transforms as . The invariants under this transformation are:
They determine the three elementary symmetric functions of the eigenvalues of (, , ) and are coordinate-invariant properties of the tensor.
Proof. since . by cyclic invariance. by the same argument.
The geometric mean permeability , the arithmetic mean , and the quadratic mean are all coordinate-invariant measures of the permeability tensor. For the TI tensor, these evaluate to , , and , each representing a different averaging convention.
Straight-line interpolation of coordinate-matrix entries can exit and yield an unphysical negative-permeability region; geodesic interpolation avoids this. See §11.2.
9. Deforming Reservoir with Biot Poroelasticity and Evolving Geometry
9.1. Static Assumption
Sections §3–§8 treat the Riemannian manifold as static: the domain is fixed, the permeability tensor field is time-independent, and the metric does not evolve. The pressure equation is a heat equation on a frozen geometry.
The static model is appropriate for stiff formations where pore pressure depletion does not change the pore geometry appreciably. Many reservoirs are compliant. In chalk reservoirs (Ekofisk, Valhall in the North Sea) the rock matrix is highly compressible; Ekofisk exhibited several metres of seabed subsidence during production, driven by compaction of the chalk formation at depth [14, 15]. In tight sandstones and shales effective stress changes alter pore throat geometry and hence permeability by factors of two to five over a production lifetime. In these settings the solid skeleton deforms as fluid is produced, porosity decreases, permeability changes, and the metric evolves. The manifold is deforming.
Coupled solid deformation and fluid flow in porous media are described by Biot poroelasticity, developed by Maurice Biot in a series of papers beginning in 1941. It extends Terzaghi's 1923 one-dimensional consolidation theory to three dimensions and provides the coupled PDE system from which the deforming metric emerges.
9.2. Kinematics of the Deforming Solid
Let denote the reference (undeformed) configuration of the reservoir at time , with material points labelled by Lagrangian coordinates (). At time , the solid skeleton occupies the current configuration , with Eulerian coordinates . The motion is described by a smooth diffeomorphism
The deformation gradient is the mixed tensor
with Jacobian . The solid displacement field in the linearised (small-strain) regime has Eulerian components with .
The linearised strain tensor is the symmetric covariant tensor
where are the covariant components of the displacement in Cartesian coordinates. Strain, stress and equilibrium are measured with the Euclidean metric of physical space, which is distinct from the permeability metric . The volumetric dilatation is the scalar trace
9.3. Biot Constitutive Relations
Linear Biot poroelasticity couples the solid stress to the fluid pressure through two constitutive equations. The first relates the total stress tensor (a contravariant tensor) to the strain and the pressure:
Here is the drained elastic stiffness tensor, a tensor satisfying the major and minor symmetries . For an isotropic solid it reduces to two Lamé parameters: . The scalar is the Biot-Willis coefficient, the ratio of pore volume change to total volume change at constant fluid pressure; for an incompressible solid grain.
The second constitutive relation defines the increment of fluid content (volume of fluid added per unit reference volume of porous medium):
where is the Biot modulus, the inverse of the combined compressibility of the fluid and the pore space at constant volumetric strain.
For consolidated sandstones, and . Chalk has and because the matrix is highly compressible. Granites have (Westerly granite 0.47 in Rice–Cleary [11]) and a large . The undrained bulk modulus is , where is the drained modulus.
9.4. Governing Equations in Abstract Index Form
The three governing equations of quasistatic Biot poroelasticity are:
Solid equilibrium (inertia neglected on reservoir timescales):
Fluid mass conservation:
where is a volumetric source/sink term (positive for injection, negative for production) and are the contravariant components of the Darcy flux vector.
Darcy transport with time-dependent permeability:
Here are the contravariant components of the permeability tensor in the current configuration, and is the Riemannian gradient of with respect to the time-dependent metric . The identification of the Darcy flux as a Riemannian gradient holds at every time by the same argument as in §3, applied to the instantaneous metric.
Substituting [eq:biot-zeta] and [eq:darcy-time] into [eq:fluid-mass] gives the coupled fluid equation:
The left side is the rate of change of fluid content; the right side is the Euclidean divergence of the Darcy flux plus sources. Equations [eq:solid-eq] and [eq:biot-fluid] are coupled: the pressure drives the solid through the term in [eq:solid-eq], and the solid deformation drives the fluid through the term in [eq:biot-fluid].
9.5. Porosity Evolution and Kozeny-Carman Permeability
From the Biot constitutive relation [eq:biot-zeta], the porosity evolves as
where is the initial porosity. The change in porosity is driven jointly by solid compaction (the term) and by direct pore compressibility (the term).
The Kozeny-Carman relation connects porosity to permeability through the pore geometry. For a medium with tortuous pore channels of characteristic grain size , the scalar permeability scales as
first derived by Kozeny (1927) [16] and Carman (1937) [13]. The dependence on is steep: a 10% reduction in porosity reduces permeability by roughly 25–40% according to the current porosity value. For the full 3D anisotropic tensor the Kozeny-Carman structure is preserved if the anisotropy arises solely from pore-channel orientation and the pore geometry at each scale does not change. In that case
where are the reference permeability tensor components, and the scalar Kozeny-Carman factor is
Here (the reference state is recovered) and (permeability increases with porosity). Equation [eq:KC-tensor] preserves the tensor structure of : the anisotropy ratio, the orientation of the principal axes, and the eigenvector directions are all unchanged by compaction. Only the overall magnitude scales. This assumes that the pore network remains geometrically similar under compression. The assumption is good for matrix compaction in intergranular porosity and poor for fracture closure (where individual fracture sets may close while others remain open).
Taking the time derivative of [eq:KC-tensor] and using from [eq:porosity-evol]:
9.6. Evolving Riemannian Metric
The Riemannian metric is . Under the Kozeny-Carman update [eq:KC-tensor], the metric scales as
where is the reference metric. This is a conformal deformation of the reference metric: the metric at time is the reference metric rescaled by a single scalar field , the square of the conformal factor. Since when porosity has increased (dilation), we have and the metric contracts (greater permeability). Since when porosity has decreased (compaction), and the metric expands (lower permeability and greater hydraulic resistance).
Taking the time derivative of [eq:metric-evolution]:
Equation [eq:dg-dt] is the metric evolution equation. The metric undergoes a uniform conformal rescaling at a rate determined by the rate of change of porosity and the Kozeny-Carman sensitivity . The evolution is a scalar multiple of (no mixing of tensor indices): the off-diagonal components of maintain the same ratio to the diagonal components as at .
Two metrics and on a manifold are conformal if for a smooth positive scalar function . Under the Kozeny-Carman permeability model, for all and the metric therefore remains in the conformal class for all time. A consequence is that the angle between any two vectors is preserved by the metric evolution. The evolution changes distances and volumes. Geodesics change too unless is uniform in space. For a given pressure gradient the Darcy velocity keeps its direction and only its speed changes.
9.7. Biot-Darcy Theorem on the Deforming Riemannian Manifold
Let be the time-parametrised Riemannian manifold with metric , where is the reference permeability tensor field, is the reference porosity, and is the Kozeny-Carman factor [eq:KC-factor]. Under linear Biot poroelasticity with quasistatic solid equilibrium, the coupled system governing and is:
in Cartesian coordinates, where and the right-hand side of (III) is a scalar multiple of . By [eq:lb-correction] the right side of (I) equals plus the drift term , which vanishes where is uniform.
Proof.
Fluid equation (part I).
The Darcy flux in index notation is . Since (the contravariant metric components equal the permeability tensor components in the current metric, by definition of ), we have
Mass conservation measures volume with the Euclidean metric and the flux enters through its Euclidean divergence
The Laplace–Beltrami operator of weights this divergence by and differs from it by the drift term of [eq:lb-correction]. Substituting [eq:div-q] into the fluid mass conservation equation [eq:fluid-mass] with gives equation (I).
Solid equation (part II).
Expanding with the Biot stress [eq:biot-stress]:
Since is constant, the pressure term simplifies: . Rearranging gives equation (II).
Metric evolution (part III).
The permeability tensor components satisfy by the Kozeny-Carman assumption [eq:KC-tensor]. Differentiating with respect to time and applying the chain rule:
Substituting from [eq:porosity-evol] gives equation (III).
9.8. Conformal Metric Flow and Instantaneous Curvature
Under the hypotheses of Theorem [biot-darcy-theorem], the metric satisfies with conformal factor . For the isotropic case with scalar permeability , the scalar curvature of at any instant is
where all differential operators are with respect to the flat Euclidean background, and is the scalar permeability field at time .
Proof. Since with and , the instantaneous metric is . This is the isotropic conformally flat metric with scalar permeability . The curvature formula from §6 applies directly with .
A compacting reservoir in which the factor is uniform in space scales , and by and hence scales by . The sign pattern of the curvature is preserved. A reservoir with spatially heterogeneous compaction (fault blocks compacting at different rates, for instance) develops spatial gradients in over time that were absent from the reference state, and hence non-zero curvature in regions that were previously flat.
9.9. Remarks on Scope and Extensions
Equation (II) of Theorem [biot-darcy-theorem] omits the inertial term , justified when the solid acceleration is negligible compared to the divergence of the stress tensor. On production timescales (days to decades), pressure diffusion is orders of magnitude slower than elastic wave propagation, and the solid skeleton equilibrates instantaneously relative to the fluid pressure. The quasistatic assumption fails on seismic timescales (milliseconds), where the full Biot dynamic equations govern P-wave and S-wave propagation with two compressional modes: a fast wave (in-phase solid and fluid motion) and a slow Biot wave (out-of-phase, highly attenuated). The slow Biot wave is the acoustic analogue of the diffusion mode studied in §4 at seismic frequencies.
The conformal evolution follows from the assumption that compaction scales all permeability tensor components identically. This holds for intergranular matrix porosity but not for fracture networks. In a naturally fractured reservoir, individual fracture sets have different normal stiffnesses and close at different rates under increasing effective stress. If the set aligned with the minimum horizontal stress closes while the set aligned with the maximum horizontal stress remains open, the anisotropy ratio changes, and the evolution of is no longer conformal: the metric deforms differently in different directions and mixes the principal axes. The full permeability update then requires a time-dependent path in the fibre (§8) that is not a scalar scaling of the initial point and in general is not a geodesic.
Equation [eq:bdt-metric] resembles Ricci flow, , in that both describe a PDE governing the metric tensor. Ricci flow is an intrinsic geometric evolution: the right-hand side is determined entirely by the Ricci curvature of the current metric. The Biot metric evolution [eq:bdt-metric] is externally driven: the right-hand side is a scalar multiplied by , and is set by the fluid pressure and solid displacement. The evolution is a one-parameter conformal rescaling driven by a coupled PDE system. The relevant structure is a parametrised family of metrics indexed by the solution of the Biot system.
The conformal structure of the metric evolution reduces the compaction inverse problem to a scalar field; see §11.4 for the subsidence-monitoring application.
10. Embedded Reservoir Monitoring with cartan
10.1. Manifold Theory on Microcontrollers
The geometric framework developed above is implementable on the low-power microcontrollers deployed in downhole monitoring systems, surface well-head sensors and field data acquisition units. Well-site instrumentation has historically been separated from reservoir modelling by a large computational gap: sensors record pressures and temperatures, and that raw data is shipped to centralised compute infrastructure for analysis. The gap is closing. Modern commodity ARM Cortex-M4 and Cortex-M33 chips have hardware floating-point units capable of executing the geodesic computations above in real time on battery power. Those units are single-precision and the f64 code below runs in software emulation there. The Cortex-M7 in the STM32H7 has a double-precision unit.
The cartan library implements the manifold structures of this post with explicit no_std support. The cartan-core crate defines the Manifold, Connection and Curvature traits; cartan-manifolds provides an Spd<N> struct for with the affine-invariant metric; and cartan-geo provides Geodesic<M> for parameterised geodesic sampling. All three crates declare
#![cfg_attr(not(feature = "std"), no_std)]and build on nalgebra (linear algebra, also no_std) and libm (elementary functions without the OS floating-point runtime) when compiled without the std feature. The crate attribute covers less than it suggests. In cartan-manifolds 0.10 the Spd<N> struct sits behind the std feature because its eigendecomposition does. The no_std build provides Euclidean, Sphere, SpecialOrthogonal and SpecialEuclidean and omits . A bare-metal geodesic is short enough to write directly against nalgebra, as §10.3 does.
10.2. Spd<3> Struct in cartan-manifolds
The Spd<N> struct represents the manifold . For reservoir applications, . A point on the manifold is an SMatrix<f64, 3, 3> (a fixed-size symmetric positive definite matrix from nalgebra), and a tangent vector is also an SMatrix<f64, 3, 3> (a symmetric matrix in ).
The exponential map at in direction is
and the logarithmic map is
Both are implemented via eigendecomposition of the symmetrised argument using the nalgebra symmetric eigensolver and is no_std compatible. The matrix square roots and matrix logarithm are computed through the eigendecomposition: for a symmetric matrix , one has and .
10.3. Geodesic Interpolation on a Microcontroller
A pressure-while-drilling tool records the 3D formation permeability tensor at discrete depths as the bit advances through heterogeneous rock. The onboard microcontroller must interpolate between consecutive tensor measurements to produce a continuous permeability model for real-time pore pressure prediction. Arithmetic interpolation of the tensor components produces physically inconsistent estimates near facies boundaries, as noted in §8.2. Geodesic interpolation on produces the geometrically correct result.
The following code evaluates the geodesic [eq:spd-geodesic] in a no_std crate with no allocator. It compiles for thumbv7em-none-eabihf (Cortex-M4F and M7) as a static library with no #[global_allocator]:
// Cargo.toml (embedded target):
// [dependencies]
// nalgebra = { version = "0.35", default-features = false, features = ["libm"] }
// libm = { version = "0.2", default-features = false }
#![no_std]
use nalgebra::{SMatrix, SymmetricEigen};
type K3 = SMatrix<f64, 3, 3>;
/// Apply f to the eigenvalues of a symmetric matrix: Q f(Λ) Qᵀ.
fn spectral(a: K3, f: impl Fn(f64) -> f64) -> K3 {
let eig = SymmetricEigen::new(a);
let q = eig.eigenvectors;
q * K3::from_diagonal(&eig.eigenvalues.map(f)) * q.transpose()
}
/// Permeability tensor at fractional depth t in [0, 1] on the SPD(3) geodesic
/// from K0 to K1: K0^{1/2} (K0^{-1/2} K1 K0^{-1/2})^t K0^{1/2}.
pub fn interpolate_permeability(k0: K3, k1: K3, t: f64) -> K3 {
let half = spectral(k0, libm::sqrt);
let inv_half = spectral(k0, |x| 1.0 / libm::sqrt(x));
let m = inv_half * k1 * inv_half;
let m = (m + m.transpose()) * 0.5;
half * spectral(m, |x| libm::pow(x, t)) * half
}Every matrix is a fixed-size SMatrix on the stack, and nalgebra's symmetric eigensolver for static sizes needs no heap. On a hosted build the result agrees with cartan's Geodesic::from_two_points(&Spd::<3>, k0, &k1).unwrap().eval(t) to a relative error below , and the midpoint satisfies . Each call performs three symmetric eigendecompositions and a handful of products.
10.4. Real-Time Curvature Monitoring
Beyond interpolation, the cartan-geo crate provides CurvatureQuery<M> for computing sectional, Ricci, and scalar curvature at a point. For the manifold, the sectional curvature of the plane spanned by symmetric matrices is
where and is the matrix commutator. The curvature is non-positive everywhere on , and the manifold is complete and simply connected. It is therefore Cartan-Hadamard: the geodesic between any two permeability tensors is unique and globally defined, and there is no cut locus. This non-positive curvature is the geometric counterpart of the physical fact that the space of valid permeability tensors has no "wrapping" topology: every permeability state is unambiguously interpolable from any other.
with the affine-invariant metric is a homogeneous space. Its scalar curvature is the same at every point. Summing [eq:spd-sectional] over an orthonormal basis of gives . For the constant is , and it says nothing about the formation. A formation curvature alarm on a field data acquisition board instead evaluates the scalar curvature of the reservoir metric, from §6, on a stencil of permeability estimates. If exceeds a threshold the board flags rapid permeability variation and that the pore pressure model should fall back from the Theis approximation to a full numerical solve.
/// Scalar curvature R = 2 lap(k) - (5/2)|grad k|^2 / k of the metric g = delta/k
/// on a seven-point stencil: k[0] at the centre, then the +x, -x, +y, -y, +z, -z
/// neighbours at spacing h.
fn formation_curvature_alarm(k: [f64; 7], h: f64, threshold: f64) -> bool {
let lap = (k[1] + k[2] + k[3] + k[4] + k[5] + k[6] - 6.0 * k[0]) / (h * h);
let gx = (k[1] - k[2]) / (2.0 * h);
let gy = (k[3] - k[4]) / (2.0 * h);
let gz = (k[5] - k[6]) / (2.0 * h);
let r = 2.0 * lap - 2.5 * (gx * gx + gy * gy + gz * gz) / k[0];
r > threshold || r < -threshold
}The function uses only core floating-point arithmetic and runs in no_std mode.
10.5. Role of no_std in Oil and Gas
Downhole tools operate under severe constraints. Temperatures reach to in deep wells. Vibration from the drill string imposes shock loads of or more. Battery-operated logging tools typically have 50 to 200 milliwatts available. Operating systems cannot be run reliably at these temperatures and power levels; the hardware runs bare-metal firmware on radiation-hardened or automotive-grade microcontrollers.
The no_std constraint is a deployment requirement. A geometry library that depends on a heap allocator, a thread scheduler, or OS-level floating-point runtime cannot be used downhole. The code in §10.3 and §10.4 meets that requirement: it uses fixed-size matrices on the stack and libm, and it links with no global allocator.
3D Riemannian reservoir geometry need not sit in a remote compute cluster. The same geodesic computations, curvature evaluations and tensor interpolations described in this post can run in real time at the drill bit in the environment that generated the data. This closes the loop between measurement and model.
The same no_std path runs on wellhead microcontrollers for real-time permeability estimation; see §11.5.
11. Practical Applications
11.1. Well-Test Interpretation
Pressure transient analysis on anisotropic formations translates directly into the Riemannian framework. The apparent diffusivity observed at the wellbore is controlled by the Laplace–Beltrami operator developed in §4. Geodesics (pressure-front rays) refract at faults and stratigraphic contacts according to the geodesic equation of §5, in exact analogy with Snell's law at an optical interface. The principal axes and eigenvalue ratio of can be recovered from multi-well arrival-time inversion.
The permeability metric converts geodesic travel time directly into a permeability-anisotropy estimate. In a homogeneous anisotropic layer, the pressure front is an ellipsoid whose semi-axes ratio equals , where are the principal values of .
11.2. Formation Evaluation and Geomodelling
Petrophysical logs sample pointwise at the wellbore. Filling the inter-well volume requires interpolation that must respect the SPD constraint: a permeability field that exits anywhere is unphysical. Straight-line interpolation of coordinate-matrix entries can violate positive definiteness in regions of high anisotropy contrast. The geodesic interpolation of §8 guarantees a physically admissible field at every point.
At the midpoint of the geodesic between two SPD matrices and , the determinant is . Along the whole geodesic the determinant interpolates geometrically as and stays between the endpoint values.
11.3. Reservoir Simulation
Finite-volume reservoir simulators discretise the Darcy divergence of [eq:pressure-eq] with Euclidean cell volumes and face areas. The Riemannian divergence of §3.3 differs from it by the drift term of [eq:lb-correction]. A scheme built on the Laplace–Beltrami form must remove that term to reproduce the physical flux.
For an isotropic formation whose permeability varies by two orders of magnitude, varies by a factor of , and is large across facies boundaries. A Laplace–Beltrami discretisation that keeps the drift term then misstates the flux across cell faces near those boundaries.
11.4. Compaction and Subsidence Monitoring
During reservoir depletion, pore-pressure drawdown compacts the solid frame. The Biot coupling of §9 links surface deformation observables (InSAR range-change maps, tiltmeter records) to the subsurface permeability evolution via the Kozeny-Carman update . Inverting surface displacements for then gives a time-lapse permeability map without requiring new well data.
The conformal metric evolution with proved in §9 means the permeability update is encoded in a single scalar field . The inverse problem for the full tensor therefore has the dimension of the scalar compaction problem. History matching then searches over one scalar field.
11.5. Embedded Well-Site Monitoring
The no_std Rust implementation of §10 targets microcontrollers deployed at the wellhead. It evaluates geodesic interpolation and Kozeny-Carman permeability updates on downhole sensor streams in f64 arithmetic on fixed-size matrices, without heap allocation.
One geodesic step performs three symmetric eigendecompositions and a few products with no allocation. On a Cortex-M4F that work runs in software double precision. A Cortex-M7 with a double-precision FPU, such as the one in the STM32H7, executes it in hardware.
12. Conclusion
Darcy's law and Riemannian geometry date from the same years. Riemann presented his habilitation lecture in 1854; Darcy published his filtration experiments two years later in 1856. The two bodies of mathematics developed independently for over a century before reservoir engineers and applied mathematicians began to recognise their connection. In three dimensions the identification is complete: the permeability tensor is a Riemannian metric, Darcy flux is the Riemannian gradient, pressure diffusion in a homogeneous formation is the Laplace–Beltrami heat equation, pressure fronts travel along geodesics, and permeability interfaces refract geodesics according to a Darcy–Snell law exact in form and derivation. The scalar curvature of the isotropic permeability metric is . Its gradient coefficient exceeds that of the 2D formula. Sharp gradients therefore weigh more in three-dimensional flow. The Weyl curvature vanishes identically in 3D. The full geometry is therefore locally determined by and the Ricci tensor alone.
Each of these results is a theorem with a practical well-test or simulation consequence. The Darcy–Snell law predicts how pressure-front rays bend at faults and stratigraphic contacts. The spherical-to-radial flow transition distinguishes from in a pressure build-up test. The 3D eigenvalue formula [eq:pss-eigenvalues-3d] gives the late-time decay constant of a layered compartment as a function of all three reservoir dimensions and the anisotropy ratio. Geodesic interpolation on provides consistent formation modelling across facies boundaries where arithmetic tensor averaging fails.
The cartan library implements these computations in Rust, and the geodesic and the formation curvature alarm of §10 compile as no_std code for bare-metal ARM microcontrollers. Well-site monitoring boards can execute the same manifold arithmetic at the formation. The gap between reservoir theory and field instrumentation is a software and architecture problem that the Rust ownership model and the no_std ecosystem are positioned to close.
The extension to deforming reservoirs (§9) shows that the static geometry is the special case of a richer structure. Biot poroelasticity couples the fluid pressure equation to the solid skeleton deformation, and under the Kozeny-Carman permeability model the Riemannian metric evolves conformally: with . The curvature formulae and spectral theory of §6–§7 apply at each instant to the current metric. What was a fixed geometric stage becomes a parametrised family of geometries driven by the coupled PDE system: a deforming manifold whose shape is determined by the rock's mechanical response to fluid extraction.
References
- H. Darcy. Les Fontaines Publiques de la Ville de Dijon. Victor Dalmont, Paris, 1856.
- M. Muskat. The Flow of Homogeneous Fluids through Porous Media. McGraw-Hill, New York, 1937.
- C. V. Theis. "The relation between the lowering of the piezometric surface and the rate and duration of discharge of a well using ground-water storage." Transactions of the American Geophysical Union, 16(2):519–524, 1935.
- G. de Marsily. Quantitative Hydrogeology. Academic Press, Orlando, 1986.
- M. P. do Carmo. Riemannian Geometry. Birkhäuser, Boston, 1992.
- P.-A. Absil, R. Mahony, R. Sepulchre. Optimization Algorithms on Matrix Manifolds. Princeton University Press, 2008.
- R. Bhatia. Positive Definite Matrices. Princeton University Press, 2007.
- L. Onsager. "Reciprocal Relations in Irreversible Processes." Physical Review, 37(4):405–426, 1931.
- M. A. Biot. "General theory of three-dimensional consolidation." Journal of Applied Physics, 12(2):155–164, 1941.
- K. Terzaghi. Theoretical Soil Mechanics. Wiley, New York, 1943.
- J. R. Rice, M. P. Cleary. "Some basic stress diffusion solutions for fluid-saturated elastic porous media with compressible constituents." Reviews of Geophysics and Space Physics, 14(2):227–241, 1976.
- O. Coussy. Poromechanics. Wiley, Chichester, 2004.
- P. C. Carman. "Fluid flow through granular beds." Transactions of the Institution of Chemical Engineers, 15:150–166, 1937.
- R. M. Sulak and J. Danielsen. "Reservoir aspects of Ekofisk subsidence." Journal of Petroleum Technology, 41(7):709–716, 1989. SPE-17834-PA.
- J. Geertsma. "Land subsidence above compacting oil and gas reservoirs." Journal of Petroleum Technology, 25(6):734–744, 1973. SPE-3730-PA.
- J. Kozeny. "Über kapillare Leitung des Wassers im Boden." Sitzungsberichte der Akademie der Wissenschaften Wien, Mathematisch-Naturwissenschaftliche Klasse, Abteilung IIa, 136:271–306, 1927.