Skip to content
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
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,37 @@ jobs:
bash run.sh
cd ../../

Regression-Test-OF-pixi:
name: Regression-Test-OF-pixi (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-22.04']
defaults:
run:
shell: bash -l {0}
working-directory: ${{github.workspace}}
steps:
- uses: actions/checkout@v4
- uses: gerlero/setup-openfoam@v1
with:
openfoam-version: 9
- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.9.4
with:
pixi-version: v0.62.2
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- name: Compile solver
run: |
cd OFsolvers/birdmultiphaseEulerFoam
export WM_COMPILE_OPTION=Debug
./Allwmake
cd ../../
- name: Run bubble column tutorial
run: |
cd tutorial_cases/bubble_column_20L
bash run_pixi.sh
cd ../../

2 changes: 1 addition & 1 deletion bird/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Bio reactor design version"""

__version__ = "0.0.53"
__version__ = "0.0.54"
9 changes: 8 additions & 1 deletion docs/source/bubbleColumn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ To simply run the entire tutorial, do:
cd ${BCE_CASE}
bash run.sh

This test is run as part of the continuous integration
If you use pixi, make sure to run ``pixi shell`` first or

.. code-block:: console

cd ${BCE_CASE}
bash run_pixi.sh

These tests are run as part of the continuous integration

Geometry
------------
Expand Down
17 changes: 17 additions & 0 deletions docs/source/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ You can automatically enforce the formatting guidelines with

pip install nox
nox -s lint -- write
nox -s spell -- write

If you use pixi, you can run

.. code-block:: console

pixi shell
pixi run lint-write
pixi run spell-write

Tests
------------
Expand All @@ -30,6 +38,15 @@ To run the unit tests
cd ${BIRD_HOME}/../
pytest .

If you use pixi

.. code-block:: console

pixi shell
BIRD_HOME=`python -c "import bird; print(bird.BIRD_DIR)"`
cd ${BIRD_HOME}/../
pixi run test

To run the regression tests

.. code-block:: console
Expand Down
26 changes: 25 additions & 1 deletion docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Quick start

.. _installation_dev:

Installation of python package for developers
Installation of python package for developers (recommended)
------------


Expand All @@ -18,6 +18,23 @@ Installation of python package for developers

.. _installation_users:

Installation of python package for developers (with pixi)
------------

This requires installing pixi. If it is not available on your machine, follow `Pixi Installation <https://pixi.prefix.dev/latest/installation/>`_
Once installed, pixi does not require the conda environment creation and pip install gymnastics, and can be used as

.. code-block:: console

git clone https://github.com/NREL/BioReactorDesign.git
cd BioReactorDesign
pixi shell

This will activate an environment for you (equivalent to ``pip install -e .``)
Alternatively to the ``pixi shell``, in any directory of BiRD, you can use ``pixi run python myscript.py`` instead of ``python myscript.py``

.. _installation_users:

Installation of python package for users
------------

Expand Down Expand Up @@ -64,3 +81,10 @@ Run an example
cd tutorial_cases/bubble_column_20L
bash run.sh

If you run with pixi

.. code-block:: console

cd tutorial_cases/bubble_column_20L
bash run_pixi.sh

57 changes: 57 additions & 0 deletions tutorial_cases/bubble_column_20L/run_pixi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

# Clean case
./Allclean

set -e # Exit on any error
# Define what to do on error
trap 'echo "ERROR: Something failed! Running cleanup..."; ./Allclean' ERR


echo PRESTEP 1
# Generate blockmeshDict
pixi run python ../../applications/write_block_cyl_mesh.py -i system/mesh.json -t system/topology.json -o system

# Generate boundary stl
pixi run python ../../applications/write_stl_patch.py -i system/inlets_outlets.json

# Generate species thermo properties
pixi run python ../../applications/write_species_thermo_prop.py -cf .


echo PRESTEP 2
# Mesh gen
blockMesh -dict system/blockMeshDict
transformPoints "rotate=((0 0 1) (0 1 0))"
transformPoints "scale=(0.001 0.001 0.001)"

# Inlet BC
surfaceToPatch -tol 1e-3 inlets.stl
export newmeshdir=$(foamListTimes -latestTime)
rm -rf constant/polyMesh/
cp -r $newmeshdir/polyMesh ./constant
rm -rf $newmeshdir
cp constant/polyMesh/boundary /tmp
sed -i -e 's/inlets\.stl/inlet/g' /tmp/boundary
cat /tmp/boundary > constant/polyMesh/boundary

# setup IC
cp -r 0.orig 0
setFields

# Scale
transformPoints "scale=(0.19145161188225573 0.19145161188225573 0.19145161188225573)"

# Setup mass flow rate
# Get inlet area
postProcess -func 'patchIntegrate(patch="inlet", field="alpha.gas")'
postProcess -func writeCellVolumes
writeMeshObj

echo PRESTEP 3
pixi run python writeGlobalVars.py
cp constant/phaseProperties_pbe constant/phaseProperties


echo RUN
birdmultiphaseEulerFoam
Loading