A Tale of Python and PVT

A Tale of Python and PVT

In an earlier post, I’d shared how I challenge myself to undertake a project over each festive season holiday period. Well this year, it was to teach myself how to code in Python.

Why Python? While I've no desire to enter into a heated debate of which code is 'best', I think many would agree that Python is a common language that people are using for machine learning. Indeed, as measured by how often language tutorials are searched on Google, it's both the most popular AND the fastest growing.

So armed with enthusiasm, many glasses of wine, a desktop shortcut to stackoverflow and a newly purchased Udemy course, I set off to learn the arcane arts of Python programming. It actually turned out to be quite easy to pick up the basics - so easy in fact that I quickly found myself hunting out problems to apply this new tool to. It was intoxicating!

What could I apply it to next?

Mentally sifting through upcoming project challenges, I realized that it's likely that I’ll soon be involved with two upcoming projects in which PVT and EOS characterization is both important and non-trivial..... This was an area that I was.... *ahem*... rusty in, having not needed it in many a year, and I'm a firm believer in the 7P's.

Pulling down my dog-eared Monograph 20 reference book on Phase Behaviour by Curtis Whitson and Michael Brule, I resolved to work through all the examples in Python Jupyter Notebooks, both to refresh my understanding, as well as to serve as a future reference for myself and others.

Monograph 20 is an excellent reference, and I heartily recommend purchasing it if interested in the topic. It does, however, have quite a few minor, and a couple of major typos which only really become clear when you do all the math yourself - I've highlighted the more important ones in the Notebooks.

If you'd like to follow along, I've just made publicly available all 22 of the worked problems from Appendix B on a GitHub site - spanning the gamut from simple property calculations, to multiphase flash calculations and Michelson stability tests..... . To properly follow along though, you'll need a copy of Monograph 20.

Some quick shout-outs for people who have inspired me in this venture, in no particular order: Curtis Whitson for the excellent compiled resource that Monograph 20 is, Michael Pyrcz (or GeostatsGuy - search for him on GitHub & YouTube) for his excellent freely available library of Geostats related code and training aids, and Juan Cottier - a geologist whose commitment to creating new and interesting LinkedIn content that's not simply regurgitated leadership quotes I admire.

If you've read this far - many thanks - and I hope you get some use out of these worked examples. For those with far more programming experience (and I’m sure there are many), please be gentle…. I’m only two months in and I’m sure there are many more ‘Pythonic’ ways to structure some of the code. Constructive suggestions - particularly on more robust flash solving methods etc - will be gratefully accepted. If there's enough interest, I'll let you know when I've finished the larger EOS matching exercise in Appendix C.

Get them here

Warm regards, Mark Burgoyne

Ankaj Kumar Sinha

Senior Manager - PE Sarawak Oil at PETRONAS Carigali Sdn Bhd

4y

Very insightful article.

Nilesh Gorde

Completion Engineer at Reliance (Deepwater HPHT Field)

5y

Very interesting article sir..

David Robertson

Community Engagement Team at Calgary Drop In & Rehab Centre Society

5y

Very interesting article, Mark. How long would you say it took you to become proficient enough in Python to start addressing your PVT interests?

Like
Reply
Ade Melynda RACHMAN

Jr. Petroleum Engineer at Pertamina Hulu Kalimantan Timur (PHKT)

6y

Hello Sir, I have read the article too at TWA. And It's s so interesting

Huy Dong

Production Engineer at AppSmiths® Technology

6y
Like
Reply

To view or add a comment, sign in

More articles by Mark Burgoyne

Insights from the community

Others also viewed

Explore topics