Python Presets

Part 12, Part 12: The Rock Physics Lab

Learning objectives

  • Reproduce five of the course's models in real, runnable Python
  • Copy Gassmann, soft-sand, Backus, fluid-and-Vs, and inclusion-model programs 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 five self-contained Python programs, actual runnable code in numpy, not pseudocode, that reproduce the models you have been driving with sliders. Open one in the Python Playground with a click, download it, or copy it into your own environment; then run it and change it. Each depends only on numpy and matplotlib, prints a small table that reproduces a course anchor exactly, so you can trust it the moment it runs, and closes with its model's natural figure.

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.

Five Programs, Five 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 K_dry=6K\_{dry} = 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 K_sat=12.348K\_{sat} = 12.348 GPa, and the inverse recovers K_dry=6.000K\_{dry} = 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 phi_c=0.36\\phi\_c = 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 fourth is BATZLE-WANG FLUIDS AND VS PREDICTION, the Part 3 and Part 7 backbones in one program: brine, gas, and oil at reservoir temperature and pressure, then the Greenberg-Castagna brine lines. Its anchors are the 100,000 ppm brine at 50 degrees and 25 MPa printing K=3.03K = 3.03 GPa, the gas that collapses from 0.061 to 0.008 GPa on the lift to 5 MPa, and the Vs trio at V_p=3.5V\_p = 3.5 km/s: mudrock 1.845, sandstone 1.959, limestone 1.853. The fifth is INCLUSION MODELS, the Part 6 machinery end to end: Berryman spheroids, DEM embedding pores a pinch at a time, Gassmann, and Xu-White. It prints the DEM ladder for aspect-0.15 pores in calcite, 54.0 down to 10.9 GPa, the pore-type spread V_p=5.81V\_p = 5.81, 4.92, and 2.72 km/s at fifteen percent porosity, and the Xu-White clay anchors 3.40, 2.75, and 2.33, then draws the pore-type fan those numbers sit on.

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 five programs are the on-ramp, small enough to read in minutes 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.