Python Presets

Part 12, Part 12: The Rock Physics Lab

Learning objectives

  • Reproduce three of the course's models in real, runnable Python
  • Copy a Gassmann, a soft-sand, and a Backus program that print the course anchors
  • Confirm each program reproduces a number you already trust
  • Leave the browser for a numerical runtime when a slider is no longer enough

The Same Physics, in Real Code

The Lab runs the kernels in the browser for instant feedback. This section closes the gap to a real numerical runtime by giving you three self-contained Python programs, actual runnable code in numpy, not pseudocode, that reproduce the models you have been driving with sliders. Copy one into the Python Playground under Tools, or into your own environment, run it, and change it. Each is about thirty to forty lines, depends only on numpy, and prints a small table that reproduces a course anchor exactly, so you can trust it the moment it runs.

Python presetsgassmann.pyfluid substitutionKsat brine 12.348softsand.pyHertz-Mindlin lineK 3.054 at phi 0.30backus.pyBackus + Thomseneps 0.033 at 50/50Three runnable numpy programs, each reproducing a course anchor exactly.

Three Programs, Three Anchors

The first is GASSMANN FLUID SUBSTITUTION, the Part 4.2 workflow forward and backward. It takes the soft sand of Part 4, a dry frame of Kdry=6K_{dry} = 6dry=6 GPa at porosity phi=0.28\phi = 0.28 with quartz grains, saturates it with brine, oil, and gas in turn, and then runs the inverse to prove the round trip is exact. Its anchor is the brine case: forward Gassmann prints Ksat=12.348K_{sat} = 12.348sat=12.348 GPa, and the inverse recovers Kdry=6.000K_{dry} = 6.000dry=6.000 GPa to the digit. The second is the SOFT-SAND LINE, the Part 5.2 and 5.3 model: Hertz-Mindlin sets the dry pack at the critical porosity and the modified Hashin-Shtrikman lower bound carries it up in porosity. For quartz at phic=0.36\phi_c = 0.36c=0.36, C=9C = 9, and 20 MPa it prints the pack modulus K=2.051K = 2.051 GPa at the critical porosity and K=3.054K = 3.054 GPa at phi=0.30\phi = 0.30, the same soft-sand line you read off the plot in Part 5. The third is BACKUS AVERAGE AND THOMSEN, the Part 9.2 workflow: it laminates a stiff sand with the Ogbon-1 shale and averages them the exact long-wavelength way into one anisotropic medium. At a fifty-fifty mix it prints Thomsen epsilon=0.0331\epsilon = 0.0331, gamma=0.1040\gamma = 0.1040, and delta=0.0419\delta = -0.0419, the anchor from the layered-earth section.

The point of printing anchors is trust. When a program you copied reproduces a number you already worked out in an earlier part, you know the code is faithful, and only then is it safe to change. Move a porosity, add a fluid, laminate three lithologies instead of two, and the program keeps computing correctly because its kernel is the course's kernel.

When the Slider Runs Out

A browser slider is bounded on purpose: it explores a few parameters fast. Real work outgrows it, a hundred wells to substitute, a Monte Carlo over aspect ratios, a whole log to Backus-average bed by bed, and that is when you carry the physics into Python where a loop can run a thousand times. Nothing changes but the scale; the equations are the ones on this page. These three programs are the on-ramp, small enough to read in a minute and correct enough to build on. The next section looks up from the code to the horizon: what the skills you now hold let you do, and where in research and in the wider platform they lead.

References

  • Mavko, G., Mukerji, T., & Dvorkin, J. (2009). The Rock Physics Handbook (2nd ed.). Cambridge University Press.
  • Avseth, P., Mukerji, T., & Mavko, G. (2005). Quantitative Seismic Interpretation. Cambridge University Press.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.