Finite-aquifer history replay and discrete Bayesian uncertainty
This workflow extends the frozen-EOS measured-history tank.
Keep the original sample and independently laboratory-tuned EOS in CalibratedPvtModel.
Reservoir matching changes volume/support assumptions; it does not retune that EOS.
Physical aquifer and units
FetkovichAquifer accepts initial water volume $W_i$ in reservoir m3, total water/rock
compressibility $c_t$ in 1/bar, productivity $J$ in reservoir m3/(s bar), and initial
average aquifer pressure $p_{ai}$ in bara. Its rate and storage equations are
Positive $W_e$ means water entering the reservoir. No surface-volume conversion or
extra multiplication by Bw is applied. The water-volume basis is fixed; the
slightly-compressible, constant-property assumptions need engineering justification.
The model follows the rate-plus-material-balance structure of
Fetkovich (1971), SPE 2603.
The OPM AQUFETP reference
documents corresponding physical parameters. OPM deck water volumes/productivity
use a surface-volume basis with PVTW; convert that basis before reusing them here.
initialState() returns an immutable zero-influx checkpoint.
advance(state, durationSeconds, pressureStartBara, pressureEndBara) integrates the
linear pressure path exactly. For $x=J\Delta t/C$, $L=1-e^{-x}$ and
$R=1-L/x$, the finite-storage interval increment is
The implementation uses series expansions and expm1 near zero exposure.
Zero productivity gives no exchange. Zero storage gives no volumetric support.
Explicitly infinite water volume with positive compressibility gives fixed aquifer
pressure. Signed exchange permits recharge; finite-water exhaustion, including an
interior pressure-ramp extremum, is rejected. This lumped storage law is distinct
from radial transient diffusion in VanEverdingenHurstAquifer; only common storage
limits are compared, not claimed transient equivalence.
The radial class provides infinite-acting mathematical diffusion and a prepared
FiniteRadialAquiferInfluence for sealed annuli with outer/inner radius ratios
2 through 10. The finite scalar radius option uses the unqualified legacy
maximum policy. For independent radial comparisons, select the prepared API and
preserve separate Carter–Tracy approximation and timestep evidence. See the
annulus model and example.
For physical radial inputs, use the inner reservoir radius, compressibility in
1/Pa for dimensionlessTime and in 1/bar for aquiferConstant (multiply the
former by 1e5). The converters validate physical domains and distinguish zero
support/time from an unrepresentable positive result; neither a failed
conversion nor invalid input may be used as a zero-support uncertainty scenario.
Small-exposure numerical qualification
FetkovichAquiferPrecisionTest compares 1,444 synthetic prescribed-pressure cases
against an independent 60-digit Decimal ODE solution, repeated at 75 digits.
The matrices include both arithmetic boundaries, signed exchange and interior
extrema, zero productivity/storage and explicit infinite storage. Whole intervals
and 16 subintervals provide 11,552 comparisons. Frozen tolerances are 1e-9 bara
for pressure and 1e-8 m3 + 2e-12 times the larger of one m3 and the absolute
reference exchange for water volumes. Both reference files reproduce byte-for-byte
at the two precisions.
The existing fourth-order coefficient series is used below dimensionless exposure 1e-3 to avoid cancellation at 1e-4; its first omitted coefficient terms are below 1.4e-18. This arithmetic change preserves physical storage/exhaustion checks. The complete reference, native outputs and timing diagnostic record the failing baseline and passing correction. This qualification concerns a prescribed linear pressure path. Coupled nonlinear history replay still requires interval refinement and independent engineering validation.
Coupling to the existing EOS tank
CompositionalReservoirHistory.replay(initialVolumeM3, aquifer) solves the reservoir
end pressure implicitly with the aquifer interval response. The existing
SimpleReservoir TV flash closes the tracked EOS fluid volume to
Aquifer water stays segregated and immiscible. It occupies pore space, but does not enter the tracked component inventory. The measured component schedule therefore cannot produce this segregated water. Initial EOS water and measured component injection remain part of the tracked fluid; they are separate from aquifer support. Water mixing, dissolution, salinity, water chemistry, rock expansion and thermal balances are not added by this approximation. Use a different qualified model when those effects matter.
For opt-in phase-selective withdrawals, the aquifer is coupled on each explicit extraction substep. Only tracked EOS aqueous fluid can be selected for production; segregated support water remains separate.
Each accepted result retains initial/end reservoir pressures, average aquifer
pressures, cumulative aquifer volume, times and tracked component amounts.
Reject a nonpositive remaining fluid volume, unavailable components, negative
cumulative segregated support, failed TV-flash volume closure or a failed coupled
root. Root probes outside physical storage bounds never become predictions. Minimum/maximum interval influx
are checked as well as endpoints, so recharge cannot conceal temporarily negative
segregated water or exhausted pore space.
SimpleReservoir.advanceComponentAmounts has an overload accepting the complete
cumulative external water volume; later ordinary component steps retain the last
accepted external volume. Rejected steps leave state, time and calculation identity
unchanged.
fitVolume(minimumVolumeM3, maximumVolumeM3, aquifer) holds aquifer parameters fixed
while estimating initial pore volume against the supplied pressure sigmas. Report
bound-limited solutions and rejected trials. Refine the measurement/flow intervals:
exact integration of a prescribed linear pressure path does not make the unknown
coupled nonlinear pressure trajectory exact.
Independent coupled finite-EOS benchmark
The optional coupled SRK/aquifer matrix
compares native replay against an independently coded SRK pressure equation and
continuous water-support ODE. Sixteen synthetic cases at four interval meshes
cover finite/infinite storage and zero-storage/productivity limits. It retains
all 1,920 endpoints, named methane inventory, aquifer storage, final pore closure,
checkpoint immutability, runtime and fixed convergence bounds. Run the benchmark’s
run.py with the selected Python interpreter in a source checkout; its audit.py
checks the full outputs. This optional matrix adds no ordinary simulation overhead.
The acceptance audit independently inspects every endpoint and reconstructs its pressure/water errors from the pinned reference. It rejects non-finite values, missing rows, wrong matrix identities and inconsistent reported diagnostics, including when Python assertions are disabled. Component, storage and explicit SRK pressure closure are checked from the retained row fields. Final native phase volume is not present in those fields, so the final pore-volume residual remains a separately bounded native diagnostic. This integrity repair leaves the original model, reference data and numerical acceptance tolerances unchanged.
The reference uses fixed synthetic EOS inputs with identical original/tuned checkpoints and prescribed methane withdrawals. It does not establish measured laboratory calibration, produced-phase/GOR accuracy, radial aquifer equivalence, parameter identifiability or Bayesian acceptance. The benchmark scope and all remaining issue criteria remain explicit in its README and #4740 ledger.
Joint Bayesian scenarios
ReservoirHistoryEnsemble.Candidate combines one frozen history, pore volume,
optional physical aquifer, positive prior probability mass and provenance.
Use initial gas/oil/aqueous fractions in each history to encode geological gas-cap
assumptions. Different independently accepted laboratory models and measured
component-amount realizations can represent PVT and production-history uncertainty.
These uncertainties are propagated only when explicitly supplied; the utility does
not infer missing distributions or repair a miscalibrated EOS.
All candidates must share named component order, initial temperature/pressure, observation/forecast times, pressure observations, sigmas and holdout selection. For independent Gaussian pressure errors, evaluation uses
\[w_i=\frac{\pi_i\exp(-\chi_i^2/2)}{\sum_j\pi_j\exp(-\chi_j^2/2)}.\]Here $\pi_i$ is a complete joint prior mass, not a density at a grid point. A nonuniform grid needs cell-integrated masses. Logarithmic normalization prevents likelihood underflow. Correlated pressure errors require another likelihood; production realizations and laboratory uncertainty should not count the same measurement uncertainty twice.
| Returned evidence | Interpretation |
|---|---|
| Normalized prior/posterior masses | Discrete joint hypotheses, including EOS/history assumptions |
| Best likelihood index | Minimum calibration chi-square, separately from prior preference |
| Rejected candidates and prior mass fraction | Infeasible hypotheses retain explicit diagnostic weight |
| Posterior means and parameter correlations | Volume, initial gas/aqueous fractions, aquifer capacity and productivity; constant/non-finite dimensions report NaN |
| Prior standardized shifts | Posterior-minus-prior mean in prior standard deviations; a conflict diagnostic, not a significance test |
| Effective scenario count | Inverse sum of squared weights; concentration of this ensemble, not MCMC sample size |
| Log evidence without Gaussian constant | Relative normalizer only; not absolute data-density evidence |
pressureQuantiles(q) |
Lower-tail model-pressure quantiles over all history/forecast times |
parameterQuantiles(q) |
Marginal lower-tail initial-volume, phase-fraction, aquifer-capacity and productivity quantiles, in getParameterNames() order |
Held-out pressures never enter the posterior likelihood. Prediction-only intervals use NaN pressure/sigma pairs and remain available for forecast quantiles. Quantile 0.1 is the lower tenth percentile, not the petroleum exceedance convention. Quantiles exclude future measurement noise. Only the product $C=c_tW_i$ enters pressure/storage response; pressure history cannot distinguish $c_t$ from $W_i$ separately. Include observations around the response timescale $C/J$ and independent geological bounds. Refine the joint hypothesis grid and check sensitivity to prior/support assumptions before interpreting intervals.
Parameter quantiles use the generalized inverse of the discrete posterior CDF:
the first positive-mass support value whose cumulative mass is at least q.
Values q=0 and q=1 return its minimum and maximum support. Zero posterior
mass, including rejected or numerically underflowed scenarios, contributes no
support. Explicit infinite aquifer capacity can therefore produce an infinite
capacity quantile while its mean/correlation remains undefined. These are
marginal quantiles: combining separately returned parameter quantiles does
not construct a joint scenario or credible region. Initial pore-volume quantiles
are in-place assumptions, not recoverable reserves. q=0.1 is a lower-tail
tenth percentile, not a petroleum exceedance P10.
Independent finite-scenario benchmark
The optional discrete-posterior benchmark
retains complete synthetic methane SRK/PR trajectories and posterior outputs.
Its independent Decimal cubic-EOS/linear-pressure aquifer solver supplies the
specified discrete forward model; separate probability sums check joint masses,
means, volume/support correlations, prior shifts, effective counts and all
parameter/pressure quantiles. It compares 3x3, 5x5 and 9x9 volume/productivity
grids, changed priors and capacities, joint capacity scenarios, explicitly supplied
EOS/withdrawal realizations, infeasible inventory and changed holdout pressure.
Run its run.py from a source checkout with the selected Python interpreter.
Each EOS hypothesis has immutable identical original/tuned checkpoints; these alternatives were explicitly supplied, not laboratory calibrated or reservoir retuned. Methane component withdrawals are prescribed inputs. The benchmark checks the finite-scenario and discrete forward-model contract; continuous-time accuracy is covered separately by the coupled ODE matrix above. Prior density cell integration is an explicit fixture choice, not an inferred distribution. Grid refinement diagnostics do not demonstrate convergence to a continuous posterior, and scenario sensitivities do not establish measured coverage or held-out field GOR/composition accuracy. Read the retained scope, bounds and complete outputs before interpreting its uncertainty diagnostics.
The tests check independent Bayes odds, heldout exclusion, sigma weighting, underflow-resistant normalization, rejected prior mass, volume/aquifer confounding, production-realization uncertainty, serialization and quantile ordering. Aquifer tests compare analytical storage limits and an independent RK4 integration; coupled tests check separate inventories, pore-volume closure, known-volume recovery and interval refinement. These are analytical/synthetic software qualifications. They are not a matched public laboratory-to-field validation or recoverable-reserves estimate.
Remaining qualification
Issue #4740 also requires independent laboratory/field qualification, broader phase-path coverage and independently predicted produced-phase validation. Multi-tank transmissibility follows qualified single-tank matching. ES-MDA/external ensemble integration and the 2025 rescaled-CVD research method are separate gated extensions. None is implied by this finite scenario integrator.