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
37 changes: 10 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
os: ['ubuntu-latest']
defaults:
run:
shell: bash -l {0}
shell: bash -leo pipefail {0}
working-directory: ${{github.workspace}}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
os: ['ubuntu-latest', 'macos-latest']
defaults:
run:
shell: bash -l {0}
shell: bash -leo pipefail {0}
working-directory: ${{github.workspace}}

steps:
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
os: ['ubuntu-latest', 'macos-latest']
defaults:
run:
shell: bash -l {0}
shell: bash -leo pipefail {0}
working-directory: ${{github.workspace}}

steps:
Expand All @@ -119,7 +119,7 @@ jobs:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

- name: Formatting and sorting import
- name: Test
run: |
pixi run test

Expand All @@ -133,7 +133,7 @@ jobs:
os: ['ubuntu-latest']
defaults:
run:
shell: bash -l {0}
shell: bash -leo pipefail {0}
working-directory: ${{github.workspace}}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
os: ['ubuntu-22.04']
defaults:
run:
shell: bash -l {0}
shell: bash -leo pipefail {0}
working-directory: ${{github.workspace}}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -205,58 +205,47 @@ jobs:
cd OFsolvers/OF9/birdmultiphaseEulerFoam
export WM_COMPILE_OPTION=Debug
./Allwmake
cd ../../../
- name: Run deckwer17 PBE
run: |
cd experimental_cases/OF9/deckwer17
bash run.sh
cd ../../../
- name: Run deckwer17 constantD
run: |
cd experimental_cases/OF9/deckwer17
cp constant/phaseProperties_constantd constant/phaseProperties
bash run.sh
cd ../../../
- name: Run deckwer19 PBE
run: |
cd experimental_cases/OF9/deckwer19
bash run.sh
cd ../../../
- name: Run side sparger tutorial
run: |
cd tutorial_cases/OF9/side_sparger
bash run.sh
cd ../../../
- name: Run bubble column tutorial
run: |
cd tutorial_cases/OF9/bubble_column_20L
bash run.sh
cd ../../../
- name: Run stirred-tank tutorial
run: |
cd tutorial_cases/OF9/stirred_tank
bash run.sh
cd ../../../
- name: Run reactive loop reactor tutorial
run: |
cd tutorial_cases/OF9/loop_reactor_reacting
bash run.sh
cd ../../../
- name: Run mixing loop reactor tutorial
run: |
cd tutorial_cases/OF9/loop_reactor_mixing
bash run.sh
cd ../../../
- name: Run airlift reactor tutorial
run: |
cd tutorial_cases/OF9/airlift_40m
bash run.sh
cd ../../../
- name: Run flat panel reactor tutorial
run: |
cd tutorial_cases/OF9/FlatPanel_250L_ASU
bash run.sh
cd ../../../

Regression-Test-OF13:
name: Regression-Test-OF13 (${{ matrix.python-version }}, ${{ matrix.os }})
Expand All @@ -268,7 +257,7 @@ jobs:
os: ['ubuntu-22.04']
defaults:
run:
shell: bash -l {0}
shell: bash -leo pipefail {0}
working-directory: ${{github.workspace}}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -301,33 +290,29 @@ jobs:
cd OFsolvers/OF13/birdmultiphaseEuler
export WM_COMPILE_OPTION=Debug
./Allwmake
cd ../../../
- name: Run bubble column
run: |
cd tutorial_cases/OF13/bubble_column
./Allrun --test
cd ../../../
- name: STR MRF
run: |
cd tutorial_cases/OF13/STR_MRF
./Allrun --test
cd ../../../
- name: STR rotating mesh
run: |
cd tutorial_cases/OF13/STR_rotatingMesh
./Allrun --test
cd ../../../

Regression-Test-OF-pixi:
name: Regression-Test-OF-pixi (${{ matrix.os }})
Regression-Test-OF9-pixi:
name: Regression-Test-OF9-pixi (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-22.04']
defaults:
run:
shell: bash -l {0}
shell: bash -leo pipefail {0}
working-directory: ${{github.workspace}}
steps:
- uses: actions/checkout@v4
Expand All @@ -345,10 +330,8 @@ jobs:
cd OFsolvers/OF9/birdmultiphaseEulerFoam
export WM_COMPILE_OPTION=Debug
./Allwmake
cd ../../../
- name: Run bubble column tutorial
run: |
cd tutorial_cases/OF9/bubble_column_20L
bash run_pixi.sh
cd ../../../

16 changes: 8 additions & 8 deletions bird/meshing/stirred_tank_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def get_reactor_geom(yamlfile):

def write_ofoam_preamble(outfile, react):
outfile.write(
r"/*--------------------------------*- C++ -*----------------------------------*\\\n"
"/*--------------------------------*- C++ -*----------------------------------*\\\n"
)
outfile.write(
"| ========= | |\n"
Expand All @@ -29,7 +29,7 @@ def write_ofoam_preamble(outfile, react):
"| \\/ M anipulation | |\n"
)
outfile.write(
r"\*---------------------------------------------------------------------------*/\n"
"/*---------------------------------------------------------------------------*/\n"
)
outfile.write("FoamFile\n")
outfile.write("{\n")
Expand All @@ -39,18 +39,18 @@ def write_ofoam_preamble(outfile, react):
outfile.write("\tobject blockMeshDict;\n")
outfile.write("}\n\n")
outfile.write(
r"// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n\n"
"// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n\n"
)
outfile.write("convertToMeters 1.0;\n\n")
outfile.write(
r"// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n\n"
"// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n\n"
)


def write_vertices(outfile, react):
outfile.write(
"\n"
+ r"// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //"
+ "// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //"
+ "\n"
)
outfile.write("vertices\n(\n")
Expand Down Expand Up @@ -166,7 +166,7 @@ def write_edges(outfile, react):
reacthts = react.reacthts

outfile.write(
r"\n// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n"
"\n// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n"
)
outfile.write("edges\n(\n")

Expand Down Expand Up @@ -204,7 +204,7 @@ def write_edges(outfile, react):

def write_blocks(outfile, react):
outfile.write(
r"\n// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n"
"\n// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\n"
)
outfile.write("blocks\n(\n")

Expand Down Expand Up @@ -326,7 +326,7 @@ def write_patches(outfile, react):

outfile.write(
"\n"
+ r"// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //"
+ "// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //"
+ "\n"
)
outfile.write("patches\n(\n")
Expand Down
13 changes: 7 additions & 6 deletions experimental_cases/OF9/deckwer17/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ else
./Allclean
fi

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

set -Eeuo pipefail # -E: trap also fires inside functions/subshells
trap 'exit_code=$?
echo "ERROR: Something failed! Running cleanup..."
./Allclean || true
exit $exit_code' ERR

if ! type "python" &> /dev/null; then
echo "<python> could not be found"
echo "Skipping Mesh generation"
else
# Generate blockmeshDict
python ../../applications/write_block_cyl_mesh.py -i ../../bird/meshing/block_cyl_mesh_templates/coflowing/input.json -t ../../bird/meshing/block_cyl_mesh_templates/coflowing/topology.json -o system
python ../../../applications/write_block_cyl_mesh.py -i ../../../bird/meshing/block_cyl_mesh_templates/coflowing/input.json -t ../../../bird/meshing/block_cyl_mesh_templates/coflowing/topology.json -o system

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

fi

Expand Down
13 changes: 8 additions & 5 deletions experimental_cases/OF9/deckwer19/run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash
set -e # Exit on any error
# Define what to do on error
trap 'echo "ERROR: Something failed! Running cleanup..."; ./Allclean' ERR

set -Eeuo pipefail # -E: trap also fires inside functions/subshells
trap 'exit_code=$?
echo "ERROR: Something failed! Running cleanup..."
./Allclean || true
exit $exit_code' ERR

if ! type "blockMesh" &> /dev/null; then
echo "<blockMesh> could not be found"
Expand All @@ -16,10 +19,10 @@ if ! type "python" &> /dev/null; then
echo "Skipping Mesh generation"
else
# Generate blockmeshDict
python ../../applications/write_block_cyl_mesh.py -i ../../bird/meshing/block_cyl_mesh_templates/coflowing/input.json -t ../../bird/meshing/block_cyl_mesh_templates/coflowing/topology.json -o system
python ../../../applications/write_block_cyl_mesh.py -i ../../../bird/meshing/block_cyl_mesh_templates/coflowing/input.json -t ../../../bird/meshing/block_cyl_mesh_templates/coflowing/topology.json -o system

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

fi

Expand Down
8 changes: 5 additions & 3 deletions tutorial_cases/OF9/FlatPanel_250L_ASU/presteps.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash
set -e # Exit on any error
# Define what to do on error
trap 'echo "ERROR: Something failed! Running cleanup..."; ./Allclean' ERR
set -Eeuo pipefail # -E: trap also fires inside functions/subshells
trap 'exit_code=$?
echo "ERROR: Something failed! Running cleanup..."
./Allclean || true
exit $exit_code' ERR

cp -r 0.orig 0
m4 ./system/panel.m4 > ./system/blockMeshDict
Expand Down
8 changes: 5 additions & 3 deletions tutorial_cases/OF9/airlift_40m/presteps.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash
set -e # Exit on any error
# Define what to do on error
trap 'echo "ERROR: Something failed! Running cleanup..."; ./Allclean' ERR
set -Eeuo pipefail # -E: trap also fires inside functions/subshells
trap 'exit_code=$?
echo "ERROR: Something failed! Running cleanup..."
./Allclean || true
exit $exit_code' ERR

m4 system/conc_cylinder_mesh.m4 > system/blockMeshDict
rm -rf 0
Expand Down
17 changes: 10 additions & 7 deletions tutorial_cases/OF9/bubble_column_20L/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
# Clean case
./Allclean

set -e # Exit on any error
# Define what to do on error
trap 'echo "ERROR: Something failed! Running cleanup..."; ./Allclean' ERR
set -Eeuo pipefail # -E: trap also fires inside functions/subshells
trap 'exit_code=$?
echo "ERROR: Something failed! Running cleanup..."
./Allclean || true
exit $exit_code' ERR


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

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

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


echo PRESTEP 2
Expand All @@ -27,7 +29,8 @@ transformPoints "scale=(0.001 0.001 0.001)"

# Inlet BC
surfaceToPatch -tol 1e-3 inlets.stl
export newmeshdir=$(foamListTimes -latestTime)
newmeshdir=$(foamListTimes -latestTime)
export newmeshdir
rm -rf constant/polyMesh/
cp -r $newmeshdir/polyMesh ./constant
rm -rf $newmeshdir
Expand Down
6 changes: 3 additions & 3 deletions tutorial_cases/OF9/bubble_column_20L/run_pixi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ 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
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
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 .
pixi run python ../../../applications/write_species_thermo_prop.py -cf .


echo PRESTEP 2
Expand Down
Loading
Loading