Giter VIP home page Giter VIP logo

excelpysim's Introduction

ExcelPySim

A reservoir simulation processing software based on the combination of Excel and Python. main banner

What

It's a reservoir simulation processing software based on Microsoft Excel, but is developed with Python language. That's, Microsoft Excel is the main work platform or main frame for reservoir simulation work, but the software is developed with Python, not the embedded VBA.

Why

Reservoir or geological engineers are born data analyst!And Python is the popular language for data analysis, machine learning and AI, refer to How popular is Python. At the same time, Microsoft Excel is the software we use frequently when we work. Why not write a reservoir simulation processing software based on Excel+Python, which will enable us to learn new python skill while working in a familiar Excel environment?

How

How to integrate Python into Excel?

Thanks XlWings, it provides the solution for us because it makes it easy to call Python from Excel and vice versa. Please install XlWings and read its documents at first before you try ExcelPySim.

How it work?

A xlsm file is open to input data which is read by and converted into a deck file for XXSim reservoir simulation software. After finishing input, a button in the xlsm file could be clicked to call the XXSim simulator to run. Please visit XXSim Github or XXSim Website for more.

Getting Started

It is started with a simple black oil case.

Tutorial 1

tutor 1 There are two files, 'tutor1.xlsm' and 'tutor1.py' which process the grid section of black oil case. By tutorial 1, it is shown that the combination of XlWings and Excel can provide a solution to a Excel-based reservoir simulation pre-processing tool. The use of xlwings is simple, just call your Python functions in your VBA macros. As follow is the python code to read and write Excel,

        # read value from excel
        nx = sheet.range('B3').options(numbers=int).value
        # write value to excel
        sheet.range('A10').value = 'Grid Size: DX'

Tutorial 2

tutor 2 Reservoir engineers need to process production data frequently, so the reading and plotting of well production data is put forward to the tutorial 2. The production data format in tutor2.xlsm is just an example, so when you use it, it is need to adjust the Excel format and edit the code according to the actual situation. Two important libs for data analysis, numpy and pandas, have been imported in Tutorial 2 to process chunks of production data, which is much more convenient and effective than VBA. Just one line code to read production data:

    df_prod = sheet.range((iRow,2),(iEndRow,7)).options(pd.DataFrame,index=False).value

Please visit pandas tutorial to learn more.

Tutorial 3

In this tutorial, PVT and SCAL data are readed and shown in graph. Also Pandas is used to read and store table data.

Joining us?

Reservoir simulation technology is important one of reservoir engineering methods and reservoir simulation tool should be one of tools at hand of a reservoir engineer. I hope it is helpful by the open source method to those that want to learn or use reservoir simulation technology and even python or machine learning. Anyone is welcome to participate.

About me

Wang Tao, Co-Founder of XXSim reservoir simulation software
Reservoir simulation engineer, C++ coder
Found more about Wang Tao check out these links:
LinkedIn | AAPG Blog | Twitter | Website

excelpysim's People

Contributors

reservoirsimulator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.