Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using toml, updating the docs, and CI with OpenFOAM 12 #3

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and test pymm
name: Run pymm

on:
push:
Expand Down Expand Up @@ -43,9 +43,9 @@ jobs:

- name: Check code style and linting
run: |
black --check src/ tests/ setup.py
pylint src/ tests/ setup.py
mypy --ignore-missing-imports src/ tests/ setup.py
black --check src/ tests/
pylint src/ tests/
mypy --ignore-missing-imports src/ tests/

- name: Run the tests
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,6 @@ vpymm
cssr
debugging
developing
playgroud
tests/configs/files
tests/configs/output
32 changes: 15 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Build Status](https://github.com/cssr-tools/pymm/actions/workflows/CI.yml/badge.svg)](https://github.com/cssr-tools/pymm/actions/workflows/CI.yml)
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.8%20|%203.9%20|%203.10-blue.svg"></a>
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.8%20to%203.12-blue.svg"></a>
[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8430989.svg)](https://doi.org/10.5281/zenodo.8430989)
Expand All @@ -12,10 +12,17 @@ This repository provides a workflow to perform computational fluid dynamics (CFD

## Installation
You will first need to install
* OpenFOAM (https://www.openfoam.com) (tested with OpenFOAM-11)
* Gmsh (https://gmsh.info) (tested with Gmsh 4.8.4)
* OpenFOAM (https://www.openfoam.com) (tested with OpenFOAM-12)
* Gmsh (https://gmsh.info) (tested with Gmsh 4.13.1)

To install the _pymm_ executable in an existing Python environment:

```bash
pip install git+https://github.com/cssr-tools/pymm.git
```

If you are interested in modifying the source code, then you can clone the repository and install the Python requirements in a virtual environment with the following commands:

You will also need to install some Python packages, see ```requirements.txt``` for a complete list. You can install all the required Python packages in a virtual environment with the following commands:
```bash
# Clone the repo
git clone https://github.com/cssr-tools/pymm.git
Expand All @@ -27,21 +34,13 @@ python3 -m venv vpymm
source vpymm/bin/activate
# Upgrade pip, setuptools, and wheel
pip install --upgrade pip setuptools wheel
# Install the pymm package (in editable mode for contributions/modifications; otherwise, pip install .)
# Install the pymm package
pip install -e .
# For contributions/testing/linting, install the dev-requirements
pip install -r dev-requirements.txt
```
Depending on the location where OpenFOAM is installed, then before running pymm (inside the vpymm Python environment), you need to enter the OpenFOAM environment:
```bash
# Check where openFOAM is installed
echo $WM_PROJECT_DIR
# The return value was /opt/openfoam11, then we activate the environment
source /opt/openfoam11/etc/bashrc
# Then, if everything went fine, typing
gmshToFoam
# should print the argument flags for that OpenFOAM executable.
```

See the [_OpenFOAM page_](https://openfoam.org/download/12-ubuntu/), where from OpenFOAM-12 the simulator is available via apt get.

## Running pymm
You can run _pymm_ as a single command line:
Expand All @@ -51,7 +50,7 @@ pymm -i some_input_image.png -p some_input_parameters.txt -o some_output_folder
Run `pymm --help` to see all possible command line argument options. Inside the `some_input_parameters.txt` file you provide the framework parameters such as the dimensions of the microsystem, mesh size, inlet pressure, and more. See the .txt files in the examples folder.

## Getting started
See the [_documentation_](https://cssr-tools.github.io/pymm/introduction.html).
See the [_examples_](https://cssr-tools.github.io/pymm/examples.html) in the [_documentation_](https://cssr-tools.github.io/pymm/introduction.html).

## Journal papers using pymm
The following is a list of journal papers in which _pymm_ is used:
Expand All @@ -61,5 +60,4 @@ The following is a list of journal papers in which _pymm_ is used:

## About pymm
The image-based Python package for computational fluid dynamics pymm is funded by [_Center for Sustainable Subsurface Resources_](https://cssr.no) [project no. 331841] and [_NORCE Norwegian Research Centre As_](https://www.norceresearch.no) [project number 101070].

Contributions are more than welcome using the fork and pull request approach.
3 changes: 2 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
black
pylint
numpydoc
mypy
pylint
pytest-cov
sphinx
sphinx-rtd-theme
Binary file added docs/_images/plopm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/pycopm.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/pyopmspe11.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/_sources/introduction.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ where
Installation
------------

See the `Github page <https://github.com/cssr-tools/pymm>`_.
See the `Github page <https://github.com/cssr-tools/pymm>`_.

.. tip::

See the `CI.yml <https://github.com/cssr-tools/pymm/blob/main/.github/workflows/CI.yml>`_.
34 changes: 25 additions & 9 deletions docs/_sources/related.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
Related
=======

Below are some packages following the same configuration-file-to-postprocessing-folder approach;
check them out :).
Below are some tools that might be of interest; check them out 🙂.

**********
pyopmspe11
Expand All @@ -23,14 +22,22 @@ pyopmnearwell

`A framework to simulate near well dynamics using OPM Flow <https://github.com/daavid00/pyopmnearwell>`_.

*******
ad-micp
*******
******
pycopm
******

.. image:: ./figs/ad-micp.gif
:scale: 40%
.. image:: ./figs/pycopm.gif
:scale: 60%

`Simplified and flexible framework for coarsening geological models <https://github.com/cssr-tools/pycopm>`_.

*****
plopm
*****

.. image:: ./figs/plopm.png

`A module to study CO2 leakage remediation by microbially induced calcite precipitation (MICP) <https://github.com/daavid00/ad-micp>`_.
`Quick generation of PNG figures from a simulation model given any 2D slide <https://github.com/cssr-tools/plopm>`_.

********
expreccs
Expand All @@ -39,4 +46,13 @@ expreccs
.. image:: ./figs/expreccs.gif
:scale: 50%

`Expansion of ResourCes for CO2 Storage on the Horda Platform <https://github.com/daavid00/expreccs>`_.
`Expansion of ResourCes for CO2 Storage on the Horda Platform <https://github.com/daavid00/expreccs>`_.

*******
ad-micp
*******

.. image:: ./figs/ad-micp.gif
:scale: 40%

`A module to study CO2 leakage remediation by microbially induced calcite precipitation (MICP) <https://github.com/daavid00/ad-micp>`_.
2 changes: 1 addition & 1 deletion docs/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/doctools.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Base JavaScript utilities for all Sphinx HTML documentation.
*
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
4 changes: 2 additions & 2 deletions docs/_static/language_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
*
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/

var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"];


/* Non-minified version is copied as a separate JS file, is available */
/* Non-minified version is copied as a separate JS file, if available */

/**
* Porter Stemmer
Expand Down
Loading
Loading