Coder Social home page Coder Social logo

sgmomodeling / pywfm Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 3.0 16.99 MB

Python library for working with Integrated Water Flow Models

Home Page: https://SGMOmodeling.github.io/PyWFM

License: MIT License

Python 99.74% Makefile 0.09% Batchfile 0.11% CSS 0.06%
groundwater numerical-modeling python-library

pywfm's Introduction

PyWFM


python library to expose the functionality of the IWFM DLL

Full documentation of PyWFM is available here

To use the pywfm module, users need to download this repository

Note Users must also download the IWFM DLL.

The IWFM DLL can be downloaded from the CNRA Open Data Platform

Overview


The pywfm library includes 3 main classes (IWFMModel, IWFMBudget, and IWFMZBudget). Each of these inherits from the IWFMMiscellaneous base class. Many of the methods in the IWFMMiscellaneous base class cannot be used on their own because the IWFMMiscellaneous class was designed without direct access to the IWFM DLL. Users can access all of this functionality from within the IWFMModel, IWFMBudget, and IWFMZBudget classes.

Design


The pywfm library wraps each of the IWFM DLL functions so that the user does not have to deal with the IWFM DLL syntax directly. Instead, users familiar with python can work with standard python objects such as strings, ints, floats, lists, and numpy arrays.

Many parts of the IWFM DLL procedures are handled internally allowing the user to provide only a few pieces of required information to obtain results.

IWFMModel

the IWFMModel class can be run in two modes.

  1. is_for_inquiry=0, which allows running model simulations from python and interacting with the model simulations at runtime
  2. is_for_inquiry=1, which allows obtaining data from a model that has already been completed

IWFMBudget

the IWFMBudget class performs budget processing from the HDF output files

IWFMZBudget

the IWFMZBudget class performs ZBudgets based on user provided zone definitions and the HDF output files

IWFMModel methods

To obtain data from an already completed model, use the following code:

# import libraries
from pywfm import IWFMModel

# set paths to files needed to create model object
preprocessor_in_file = 'SampleModel/Preprocessor/PreProcessor_MAIN.IN'
simulation_in_file = 'SampleModel/Simulation/Simulation_MAIN.IN'

# create instance of the IWFMModel class
m = IWFMModel(preprocessor_in_file, simulation_in_file)

To see all methods available within the IWFMModel class, type the following:

from pywfm import IWFMModel

help(IWFMModel)

IWFMBudget methods

To use IWFMBudget, use the following code:

# import libraries
from pywfm import IWFMBudget

# set paths to files needed to create budget object
gw_budget_file = 'SampleModel/Results/GW.hdf'

# create instance of the IWFMBudget class
gw_budget = IWFMBudget(gw_budget_file)

IWFMZBudget methods

To use IWFMZBudget, use the following code:

# import libraries
from pywfm import IWFMZBudget

# set paths to files needed to create zbudget object
gw_budget_file = 'SampleModel/Results/GW_ZBud.hdf'

# create instance of the IWFMZBudget class
z = IWFMZBudget(zbudget_file)

pywfm's People

Contributors

hatch-tyler avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

pywfm's Issues

Fix ZBudget.get_column_headers_for_a_zone method

Currently, the method returns a tuple of column names and column IDs. The length of the column IDs array is the same as the initialized value of 200 regardless of the number of column names. both the column names list and the column IDs array should be the same length

Add method to IWFMModel to get transmissivity

Currently, pywfm includes a method IWFMModel.get_aquifer_horizontal_k and IWFMModel.get_aquifer_top_elevation, IWFMModel.get_aquifer_bottom_elevation, IWFMModel.get_stratigraphy_atXYcoordinate. However, it does not have a method to calculate layer transmissivity

Add method to get layer thicknesses

Currently, pywfm has methods for getting the top and bottom elevations (get_aquifer_top_elevations and get_aquifer_bottom_elevations) and stratigraphy at an XY coordinate (IWFMModel.get_stratigraphy_atXYcoordinate) in the model. The input file provides layers as thicknesses. However, no method currently exists to retrieve that data as thicknesses.

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.