Package: ogs5py
Welcome to ogs5pyPurposeogs5py is A python-API for theOpenGeoSys 5scientific modeling package.InstallationYou can install the latest version with the following command:pip install ogs5pyOr with conda:conda install ogs5pyCitationIf you are using ogs5py in your publication please cite our paper:Müller, S., Zech, A. and Heße, F.:
ogs5py: A Python-API for the OpenGeoSys 5 Scientific Modeling Package.
Groundwater, 59: 117-122.https://doi.org/10.1111/gwat.13017, 2021.You can cite the Zenodo code publication of ogs5py by:Sebastian Müller. GeoStat-Framework/ogs5py. Zenodo.https://doi.org/10.5281/zenodo.2546767If you want to cite a specific version, have a look at theZenodo site.Documentation for ogs5pyYou can find the documentation underogs5py.readthedocs.io.Further InformationGeneral homepage:https://www.opengeosys.org/ogs-5OGS5 Repository:https://github.com/ufz/ogs5Keyword documentation:https://ogs5-keywords.netlify.comOGS5 Benchmarks:https://github.com/ufz/ogs5-benchmarksogs5py Benchmarks:https://github.com/GeoStat-Framework/ogs5py_benchmarksTutorials and ExamplesIn the following a simple transient pumping test is simulated on a radial symmetric mesh.
The point output at the observation well is plotted afterwards.
For more details on this example, see:Tutorial 1fromogs5pyimportOGS,specialrange,generate_timefrommatplotlibimportpyplotasplt# discretization and parameterstime=specialrange(0,3600,50,typ="cub")rad=specialrange(0,1000,100,typ="cub")obs=rad[21]angles=32storage=1e-3transmissivity=1e-4rate=-1e-3# model setupmodel=OGS(task_root="pump_test",task_id="model")# generate a radial mesh and geometry ("boundary" polyline)model.msh.generate("radial",dim=2,rad=rad,angles=angles)model.gli.generate("radial",dim=2,rad_out=rad[-1],angles=angles)model.gli.add_points([0.0,0.0,0.0],"pwell")model.gli.add_points([obs,0.0,0.0],"owell")model.bc.add_block(# boundary conditionPCS_TYPE="GROUNDWATER_FLOW",PRIMARY_VARIABLE="HEAD",GEO_TYPE=["POLYLINE","boundary"],DIS_TYPE=["CONSTANT",0.0],)model.st.add_block(# source termPCS_TYPE="GROUNDWATER_FLOW",PRIMARY_VARIABLE="HEAD",GEO_TYPE=["POINT","pwell"],DIS_TYPE=["CONSTANT_NEUMANN",rate],)model.ic.add_block(# initial conditionPCS_TYPE="GROUNDWATER_FLOW",PRIMARY_VARIABLE="HEAD",GEO_TYPE="DOMAIN",DIS_TYPE=["CONSTANT",0.0],)model.mmp.add_block(# medium propertiesGEOMETRY_DIMENSION=2,STORAGE=[1,storage],PERMEABILITY_TENSOR=["ISOTROPIC",transmissivity],)model.num.add_block(# numerical solverPCS_TYPE="GROUNDWATER_FLOW",LINEAR_SOLVER=[2,5,1e-14,1000,1.0,100,4],)model.out.add_block(# point observationPCS_TYPE="GROUNDWATER_FLOW",NOD_VALUES="HEAD",GEO_TYPE=["POINT","owell"],DAT_TYPE="TECPLOT",)model.pcs.add_block(# set the process typePCS_TYPE="GROUNDWATER_FLOW",NUM_TYPE="NEW")model.tim.add_block(# set the timestepsPCS_TYPE="GROUNDWATER_FLOW",**generate_time(time))model.write_input()model.run_model()OGS5 executableTo obtain an OGS5 executable,ogs5pybrings a download routine:fromogs5pyimportdownload_ogsdownload_ogs()Then a executable is stored in the ogs5py config path and will be called
when a model is run.You can pass aversionstatement to thedownload_ogsroutine, to
obtain a specific version (5.7, 5.7.1 (win only) and 5.8).
For OGS 5.7 there are executables for Windows/Linux and MacOS.
For "5.8" there are no MacOS pre-builds.If you have compiled your own OGS5 version, you can add your executable
to the ogs5py config path with:fromogs5pyimportadd_exeadd_exe("path/to/your/ogs/exe")Otherwise you need to specify the path to the executable within the run command:model.run_model(ogs_exe="path/to/ogs")Requirements:NumPy >= 1.14.5Pandas >= 0.23.2meshio >= 4lxml >= 4pexpect >= 4vtk >= 9ContactYou can contact us viainfo@geostat-framework.org.LicenseMIT© 2018-2023 (inspired by Falk Hesse and Miao Jing)This project is based onOGSPY.