Skip to main content

ogs5py: a python API for OpenGeoSys5

Project description

Welcome to ogs5py

DOI PyPI version Build Status Documentation Status Code style: black

ogs5py-LOGO

Purpose

ogs5py is A python-API for the OpenGeoSys 5 scientific modeling package.

Installation

You can install the latest version with the following command:

pip install ogs5py

Documentation for ogs5py

You can find the documentation under geostat-framework.readthedocs.io.

Further Information

Tutorials and Examples

In the following a simple transient pumping test is simulated on a radial symmetric mesh. The point output at the observation well is plotted afterwards.

from ogs5py import OGS
from ogs5py.reader import readtec_point
from matplotlib import pyplot as plt

model = OGS(task_root="pump_test", task_id="model")

# generate a radial mesh
model.msh.generate("radial", dim=2, rad=range(51))
# generate a radial outer boundary
model.gli.generate("radial", dim=2, rad_out=50.)
model.gli.add_points([0., 0., 0.], "pwell")
model.gli.add_points([1., 0., 0.], "owell")

model.bc.add_block(  # boundary condition
    PCS_TYPE='GROUNDWATER_FLOW',
    PRIMARY_VARIABLE='HEAD',
    GEO_TYPE=['POLYLINE', "boundary"],
    DIS_TYPE=['CONSTANT', 0.0],
)
model.st.add_block(  # source term
    PCS_TYPE='GROUNDWATER_FLOW',
    PRIMARY_VARIABLE='HEAD',
    GEO_TYPE=['POINT', "pwell"],
    DIS_TYPE=['CONSTANT_NEUMANN', -1.0e-04],
)
model.ic.add_block(  # initial condition
    PCS_TYPE='GROUNDWATER_FLOW',
    PRIMARY_VARIABLE='HEAD',
    GEO_TYPE='DOMAIN',
    DIS_TYPE=['CONSTANT', 0.0],
)
model.mmp.add_block(  # medium properties
    GEOMETRY_DIMENSION=2,
    STORAGE=[1, 1.0e-04],
    PERMEABILITY_TENSOR=['ISOTROPIC', 1.0e-4],
    POROSITY=0.2,
)
model.num.add_block(  # numerical solver
    PCS_TYPE='GROUNDWATER_FLOW',
    LINEAR_SOLVER=[2, 5, 1.0e-14, 1000, 1.0, 100, 4],
)
model.out.add_block(  # point observation
    PCS_TYPE='GROUNDWATER_FLOW',
    NOD_VALUES='HEAD',
    GEO_TYPE=['POINT', "owell"],
    DAT_TYPE='TECPLOT',
    TIM_TYPE=['STEPS', 1],
)
model.pcs.add_block(  # set the process type
    PCS_TYPE='GROUNDWATER_FLOW',
    NUM_TYPE='NEW',
)
model.tim.add_block(  # set the timesteps
    PCS_TYPE='GROUNDWATER_FLOW',
    TIME_START=0,
    TIME_END=600,
    TIME_STEPS=[
        [10, 30],
        [5, 60],
    ],
)
model.write_input()
success = model.run_model()

point = readtec_point(
    task_root="pump_test",
    task_id="model",
    pcs='GROUNDWATER_FLOW',
)
time = point['owell']["TIME"]
head = point['owell']["HEAD"]

plt.plot(time, head)
plt.show()

Drawdown

Reader

It comes along with a set of handy readers for almost all output formats:

  • VTK Domain output

    from ogs5py.reader import readvtk
    
  • PVD Domain output

    from ogs5py.reader import readpvd
    
  • TECPLOT point output

    from ogs5py.reader import readtec_point
    
  • TECPLOT polyline output

    from ogs5py.reader import readtec_polyline
    

OGS5 executable

The OGS5 executable needs to be in your sys-path under ogs[.exe]. Otherwise you need to specify the path to the executable within the run command:

model.run_model(ogs_root="path/to/ogs")

Requirements:

Contact

You can contact us via info@geostat-framework.org.

License

GPL © 2018-2019 (inspired by Falk Hesse and Miao Jing)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ogs5py-0.6.3.tar.gz (199.3 kB view details)

Uploaded Source

Built Distributions

ogs5py-0.6.3-py3-none-any.whl (130.0 kB view details)

Uploaded Python 3

ogs5py-0.6.3-py2-none-any.whl (130.0 kB view details)

Uploaded Python 2

File details

Details for the file ogs5py-0.6.3.tar.gz.

File metadata

  • Download URL: ogs5py-0.6.3.tar.gz
  • Upload date:
  • Size: 199.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

File hashes

Hashes for ogs5py-0.6.3.tar.gz
Algorithm Hash digest
SHA256 62df90e561647c08deea00f9449410a650b2931b8f84c8189218366483907731
MD5 d9b373ac5b6fdf8aaaba90ea29fed5db
BLAKE2b-256 3b8dfc429ef745c650f2318b676999f4cff573a215dff89b81135d95609551d8

See more details on using hashes here.

Provenance

File details

Details for the file ogs5py-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: ogs5py-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 130.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

File hashes

Hashes for ogs5py-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5b05049b726b1409b88ede13c72ba29b61024d9fda1d4583ede304dbd47511d7
MD5 3163a5ee88926b1c37c9c16d19dbbc6e
BLAKE2b-256 4a2468dadb8b9486f6eecec43b51dfd70ca2f870c9cc5b126430718a8c673a95

See more details on using hashes here.

Provenance

File details

Details for the file ogs5py-0.6.3-py2-none-any.whl.

File metadata

  • Download URL: ogs5py-0.6.3-py2-none-any.whl
  • Upload date:
  • Size: 130.0 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

File hashes

Hashes for ogs5py-0.6.3-py2-none-any.whl
Algorithm Hash digest
SHA256 4880bb68bb0b847af4d27fb3199f37edb8b1f8ad9758adb12421c0497904e79b
MD5 4bacf7b16b90b65f96c1c85105aefbe9
BLAKE2b-256 14c9055e965489b6c20b81bb50c0d61372a9d311f99a5bee4d3120640a5617e3

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page