Category: Programming

  • Von Mises Derivation and Application

    Von Mises stress envelope is a valuable tool to performing tubular stress analysis. However that pretty ellipse that you put your load calculations in has some math behind it, and understanding how it is derived helps understand why it is used.

    The Von Mises envelope equation provides the interaction between the different stresses that will equal to the yield stress of the tubular. When other stresses are 0, then clearly the remaining stress will be the same as yield. However what happens if you start pulling tension on the pipe? Does that additional stress strengthen or weaken the pipe? It actually strengthens it, and can be valuable in eking out maximum performance in your tubing and casing through design. Trying to draw a single envelope can be difficult with up to 4 variables, however this workflow illustrates how some terms can be eliminated or made in terms of one other, and identify the extremes to plot with.

    Von Mises works well for extending the ability of the pipe under tension and burst conditions, however collapse is a different story; it is an inherently unstable condition that is fine, until it isn’t. While burst will often cause some cracking and leaks as the pressure increases until total failure happens, collapse can happen extremely quickly, causing catastrophic damage before it can be reacted to. The term pancaking isn’t an exaggeration, pipe can be nice and round in one moment and flattened in the next. I remember an incident with sand screens, the field had been producing great until water influx carried particles that plugged the screen, and wells started going down one after another. The API calculations in 5C3 are the standard for determining collapse, and have a well-proven track history.

    I did a separate write up in Word to accompany code on my Github, and have copied it below (email me if you’d like a PDF of it). Head over to https://github.com/jack-charles/VonMisesCalc to check out the code itself. It’s setup out of the box to create and plot multiple VME and API curves with safety factors and derating. It can be modified easily to integrate into your own workflows for quick stress checks, without breaking out the big software packages and needing to re-input all your data.

    Next in the series – how do we calculate the tubing and casing loads, especially with buckling or torsion? And how do we know which envelope the load should be plotted against?

  • Sand Sieve Analysis Python script

    I uploaded to GitHub a Python version of the sand sieve analysis spreadsheet that I used for years. The script will generate a number of plots that help graphically determine sand control options, in a method better than the traditional Excel spreadsheets do.

    https://github.com/jack-charles/Sand-Sieve-Analysis

    It has a straightforward terminal prompt that allows for:

    • Opening a new sieve data file with multiple samples
    • Combining multiple sieve data results (plotting old core data with newer offset wells is easy!)
    • Selection of screens and proppants as options
    • Calculation of the cumulative weight percentages, uniformity coefficients, sorting coefficients, etc.
    • Plots of distributions, parameters against depth and other parameters, and screen/proppant data to determine suitability of sand control
    • Basic input error detection, but don’t stress the program if you can help it!
    • Displays to terminal or outputs to a JSON file

    On my to-do list is to incorporate logging data, such as gamma ray, sonic, and density logs to help establish other views of the formation. I would like to also add in sand retention test data from a flow cell (typically retained perm vs pressure and flow) to help make selections. I will make periodic updates to add in other calculations, including converting this to a Flask or other web framework application, and integrating to an SQL database for complete data collection.

    If you find this useful or have suggestions for improvements, please let me know. These graphs work for me, but may not be the best for users globally.

    This is a first baby step I have in mind for delivering bespoke production and well engineering calculations through an online (internet or intranet) platform. We’re all familiar with enterprise software like Landmark and trust their reliability for well integrity, but I believe there are many other critical calculations that we rely too heavily on Excel for. Even worse is when we must rely on Excel for calculations that are then put into EDM and other software. I will discuss more on my philosophy in later posts, but my own experiences and observations leads me to believe that operator and vendor data is not well managed. GIGO, unaudited calculation tools, and user laziness is a real thing that can make a database with hundreds of entries and gigs of data effectively useless.

    Interested in adding this and more to your company’s workflows? Contact me to see how we can make this happen.

  • Sharing Knowledge

    Over the years I’ve picked up quite a bit. One of the great joys of learning is to turn it around and share it. Besides sitting around a frac shack or doghouse and swapping stories, I’ve also published a number of reports, white papers, and industry papers.

    I’m also a big proponent of engineering programming, with some fairly complex VBA-backed Excel programs. Lately I have been converting much of my old code to Python, all 5000-ish lines of it, and exploring how to make the leap from the old spreadsheets to a proper web-based software platform, with assured calculations displayed in a clear and open manner.

    I will publish articles here on well engineering going forward, with a mix of theory, advice from experience, and how to practically apply it in an engineer’s procedures and calculations.

    Hopefully visitors will find it useful, and be part of the 10,000 for the day!