r2ogs6

r2ogs6: An R wrapper of the OpenGeoSys 6 Multiphysics Simulator - Published in JOSS (2024)

https://github.com/joboog/r2ogs6

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
    1 of 6 committers (16.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

geoscience hydrogeology hydrology multi-physics opengeosys porous-media-flow r transport-modelling
Last synced: 4 months ago · JSON representation ·

Repository

R-API to the multiphysics simulator OpenGeoSys 6. THIS IS A MIRROR OF: https://gitlab.opengeosys.org/ogs/tools/r2ogs6

Basic Info
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Topics
geoscience hydrogeology hydrology multi-physics opengeosys porous-media-flow r transport-modelling
Created almost 3 years ago · Last pushed about 1 year ago
Metadata Files
Readme Contributing License Citation

README.md

r2ogs6

Pipeline Status Test Coverage DOI JOSS Submission

r2ogs6 provides a file--based interface of the multi--physics sub-surface process simulator OpenGeoSys 6 to the R programing and statistical computing environment. It enables geoscientist, hydrologists and engineers to perform and analyze simulation models of the sub--surface earth system with R. r2ogs6 provides means to: - pre-process (preparing input files) simulations with OpenGeoSys 6 - execute single and ensemble simulations - output post-processing and visualization

Setup

r2ogs6 requires an installation of OpenGeoSys 6. Furthermore, Python including the libraries numpy and vtk is required to read in the .vtu and .pvd files produced by OpenGeoSys 6. These can be install after having installed r2ogs6. r2ogs6 was tested with the following environment: python==3.10.12, vtk==9.3.1, numpy==1.26.4

r2ogs6 Installation

First, open a terminal and clone the r2ogs6 repository to your local machine.

git clone https://gitlab.opengeosys.org/ogs/tools/r2ogs6.git

To install r2ogs6, you first need the R-packages remotes and BiocManager. remotes is used for installing r2ogs6 and BiocManager to set the URLs to search dependencies on CRAN and bioconductor.org. For instance, the dependency rhdf5 is only available on bioconductor.org. Open a R console in your specific project:

r install.packages(c("remotes", "BiocManager"))

With remotes, you can now install r2ogs6 in your preferred library.

```r

Install r2ogs6. Change "path/to/r2ogs6" to that of the cloned repository!

remotes::install_local( path="path/to/r2ogs6", dependencies="Imports", repos=BiocManager::repositories() ) ```

Set-up Python

OpenGeoSys 6 requires a Python installation of version 3.8--3.11.

Linux systems

If you do not have Python installed yet you can do so with the reticulate library from your R console.

r reticulate::install_python(version = "3.10:latest")

Otherwise you can use the package manager of your linux distribution.

Windows

Ideally, install Python with a Python Windows installer. Of course you could also try:

r reticulate::install_python(version = "3.10:latest")

Install Python dependencies and OpenGeoSys 6

Create a Python virtual environment with a specific name (e.g. "r2ogs6) and the path to the Python executable you just installed.

r reticulate::virtualenv_create( envname="r2ogs6", python="/path/to/python", packages = c("numpy==1.26.4", "vtk==9.3.1") )

Make sure that reticulate::py_config()$python points to the python executable in the newly installed Python virtual environment. You can try to force reticulate to use the executable of your environment by:

reticulate::use_virtualenv(virtualenv="r2ogs6")

If that does not work, quit your R session and create a .Renviron file in your project folder where you can set the path to the created virtual python environment:

```

.Renviron linux

RETICULATE_PYTHON=/path/to/your/virtualenv/bin/python ```

This file is read at the start-up of R and forces reticulate to use your specific Python executable. Double check if your python envrionment is now recognized:

r reticulate::py_config()

Then you can install OpenGeoSys 6 (the Python dependencies numpy and vtk will be installed alongside) as Python module.

library(r2ogs6) install_ogs(ogs_version = "6.5.2", envname = "r2ogs6") Be aware, to install the OpenGeoSys 6 version compatible with the r2ogs6 version, see releases. Check if OpenGeoSys 6 was installed correctly.

reticulate::py_module_available("ogs")

The OpenGeoSys 6 binary should be located at /path/to/your/python_env/bin/ogs (Linux) or /path/to/your/python_env/Scripts/ogs (Windows). In your active R session you can temporarily set this path as default when using r2ogs6 (sets options("r2ogs6.default_ogs6_bin_path").)

set_ogs6_bin_path()

For setting this permanently, create a config.yml file in your project directory.

```yml

config.yml for linux

default: r2ogs6.defaultogs6binpath: /path/to/pythonenv/bin/ogs ```

Alternative manual setup of Python environment

Alternatively, you can set up the python environment including OpenGeoSys 6 without reticulate; have a look here. Be aware, to download or install the OpenGeoSys 6 version compatible with the r2ogs6 version, see releases.

Nevertheless r2ogs6 uses reticulate under the hood. So make sure that reticulate::py_config() shows the correct Python environment that you configured.

Usage

To quickly test if your set up works just run a benchmark shipped with the package. Remember that if you closed your R session in between you may have to reset the ogs_bin_path by set_ogs6_bin_path(). Now you can setup an example by:

``` sim_path <- tempdir()

Create new ogs object

ogs6obj <- OGS6$new( simname = "mysimulation", simpath = sim_path )

Read in a project setup file

prjpath <- system.file( "extdata/benchmarks/flownostrain/flownostrain.prj", package = "r2ogs6" ) readinprj(ogs6obj, prjpath = prjpath, readingml = T) ```

Just start the simulation, check if it succeeds (returns a "0" exit status) and hav a look at the output.

``` ogs6runsimulation(ogs6_obj)

ogs6readoutputfiles(ogs6obj) resultdf <- ogs6obj$pvds[[1]]$getpointdata(keys = c("pressure")) result_df ```

Further Reading

For tutorials on how to use the r2ogs6 package, have a look at its vignettes:

Corresponding HTML versions can be found here.

Links

Owner

  • Login: joboog
  • Kind: user

environmental data scientist, computational hydrologist, research software engineer

JOSS Publication

r2ogs6: An R wrapper of the OpenGeoSys 6 Multiphysics Simulator
Published
December 18, 2024
Volume 9, Issue 104, Page 5360
Authors
Ruben Heinrich
Leipzig University of Applied Sciences, Karl-Liebknecht-Strasse 132, 04277 Leipzig, Germany
Johannes Boog ORCID
Helmholtz Centre for Environmental Research, Department Environmental Informatics, Permoser Str. 15, 04318 Leipzig, Germany
Philipp Schad ORCID
Helmholtz Centre for Environmental Research, Department Environmental Informatics, Permoser Str. 15, 04318 Leipzig, Germany
Thomas Kalbacher ORCID
Helmholtz Centre for Environmental Research, Department Environmental Informatics, Permoser Str. 15, 04318 Leipzig, Germany
Editor
Kristen Thyng ORCID
Tags
OpenGeoSys finite element method physics based modeling groundwater flow modeling

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Heinrich
  given-names: Ruben
- family-names: Boog
  given-names: Johannes
  orcid: "https://orcid.org/0000-0003-0872-7098"
- family-names: Schad
  given-names: Philipp
  orcid: "https://orcid.org/0000-0003-3332-5867"
- family-names: Kalbacher
  given-names: Thomas
  orcid: "https://orcid.org/0000-0002-7866-5702"
doi: 10.5281/zenodo.14313641
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Heinrich
    given-names: Ruben
  - family-names: Boog
    given-names: Johannes
    orcid: "https://orcid.org/0000-0003-0872-7098"
  - family-names: Schad
    given-names: Philipp
    orcid: "https://orcid.org/0000-0003-3332-5867"
  - family-names: Kalbacher
    given-names: Thomas
    orcid: "https://orcid.org/0000-0002-7866-5702"
  date-published: 2024-12-18
  doi: 10.21105/joss.05360
  issn: 2475-9066
  issue: 104
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 5360
  title: "r2ogs6: An R wrapper of the OpenGeoSys 6 Multiphysics
    Simulator"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.05360"
  volume: 9
title: "r2ogs6: An R wrapper of the OpenGeoSys 6 Multiphysics Simulator"

GitHub Events

Total
  • Delete event: 2
  • Push event: 10
  • Create event: 3
Last Year
  • Delete event: 2
  • Push event: 10
  • Create event: 3

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 619
  • Total Committers: 6
  • Avg Commits per committer: 103.167
  • Development Distribution Score (DDS): 0.477
Past Year
  • Commits: 62
  • Committers: 1
  • Avg Commits per committer: 62.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
aheinri5 A****a@n****e 324
Johannes Boog j****g@y****e 256
phit0 p****d@s****e 30
aheinri5 a****a@n****e 4
Johannes Boog j****g@e****h 3
Ruben Heinrich r****h@w****e 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 1
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 8.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ldecicco-USGS (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels