Skip to content

Commit 660c798

Browse files
committed
little clean-up
1 parent 15423fd commit 660c798

7 files changed

Lines changed: 6 additions & 54 deletions

File tree

.github/workflows/run-dumux-benchmark.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
CACHE_NUMBER: 1 # increase to reset cache manually
1212

1313
jobs:
14-
tests:
14+
dumux-tests:
1515
runs-on: ubuntu-latest
1616

1717
steps:
@@ -45,6 +45,6 @@ jobs:
4545
- name: Upload results
4646
uses: actions/upload-artifact@v4
4747
with:
48-
name: convergence-results
48+
name: results
4949
path: benchmarks/rotating-cylinders/dumux/results
5050
retention-days: 5

.github/workflows/run-openfoam-benchmark.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
CACHE_NUMBER: 1 # increase to reset cache manually
1212

1313
jobs:
14-
openfoam:
14+
openfoam-tests:
1515
runs-on: ubuntu-latest
1616

1717
steps:
@@ -45,6 +45,6 @@ jobs:
4545
- name: Upload OpenFOAM results
4646
uses: actions/upload-artifact@v4
4747
with:
48-
name: openfoam-results
48+
name: results
4949
path: benchmarks/rotating-cylinders/openfoam/results
5050
retention-days: 5

benchmarks/rotating-cylinders/dumux/Snakefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ rule all:
1111
input:
1212
"solution_metrics.json",
1313
"test_rotatingcylinders.zip"
14-
# "test_rotatingcylinders-00000.vtu"
1514

1615
rule run_simulation:
1716
input:
1817
rc_parameters_file = "parameters.json"
1918
output:
2019
zip = "test_rotatingcylinders.zip",
2120
metrics = "solution_metrics.json"
22-
# "test_rotatingcylinders-00000.vtu"
2321
resources:
2422
serial_run=1
2523
singularity:

benchmarks/rotating-cylinders/dumux/plot_results.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,13 @@
3737
from __future__ import annotations
3838

3939
import argparse
40-
import json
4140
import re
4241
import tempfile
4342
import zipfile
4443
from pathlib import Path
4544

4645
import matplotlib.pyplot as plt
4746
import numpy as np
48-
import pandas as pd
4947

5048
# ParaView
5149
from paraview import servermanager

benchmarks/rotating-cylinders/dumux/run_benchmark.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import json
2-
import shutil
32
import subprocess
43
import zipfile
54
import os
@@ -36,15 +35,7 @@
3635
# Copy the selected parameter file to the output directory with a standardised name
3736
with open(output_dir / "parameters.json", "w") as outfile:
3837
json.dump(data, outfile, indent=2)
39-
40-
# Copy files from root_dir to output_dir, excluding non-matching parameter files.
41-
for item in root_dir.iterdir():
42-
if item.is_file():
43-
if item.name.startswith("parameters_") and item.suffix == ".json":
44-
continue
45-
# else:
46-
# shutil.copy(item, output_dir / item.name)
47-
38+
4839
# Run the Snakemake workflow for the configuration
4940
subprocess.run([
5041
"snakemake",

benchmarks/rotating-cylinders/openfoam/compute_l2_error.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import re
2121
import sys
2222
import numpy as np
23-
import matplotlib.pyplot as plt
2423
from pathlib import Path
2524

2625

@@ -283,39 +282,6 @@ def process_config(case_dir: Path) -> dict | None:
283282
print(f" Saved: {out_path.relative_to(case_dir.parent)}")
284283
return metrics
285284

286-
287-
# # ---------------------------------------------------------------------------
288-
# # Convergence plot
289-
# # ---------------------------------------------------------------------------
290-
291-
# def plot_convergence(results: list, results_dir: Path):
292-
# results.sort(key=lambda d: d["cells_radial"])
293-
294-
# confs = [d["conf"] for d in results]
295-
# p_errors = [d["l2_error_pressure_rel"] for d in results]
296-
# v_errors = [d["l2_error_velocity_rel"] for d in results]
297-
298-
# fig, ax = plt.subplots(figsize=(10, 6))
299-
# ax.plot(confs, p_errors, marker="o", linewidth=1.5,
300-
# label=r"Relative $L^2$ Error — Pressure")
301-
# ax.plot(confs, v_errors, marker="s", linewidth=1.5,
302-
# label=r"Relative $L^2$ Error — Velocity")
303-
304-
# ax.set_yscale("log")
305-
# ax.set_xlabel("Configuration")
306-
# ax.set_ylabel("Relative $L^2$ Error")
307-
# ax.set_title("OpenFOAM Rotating Cylinders — Convergence Summary")
308-
# ax.legend()
309-
# ax.grid(True, which="both", linestyle="-", alpha=0.3)
310-
# plt.xticks(rotation=45)
311-
# plt.tight_layout()
312-
313-
# plot_path = results_dir / "solution_metrics_plot.png"
314-
# fig.savefig(plot_path, dpi=150)
315-
# plt.close(fig)
316-
# print(f"\nConvergence plot saved to: {plot_path}")
317-
318-
319285
# ---------------------------------------------------------------------------
320286
# Entry point
321287
# ---------------------------------------------------------------------------

benchmarks/rotating-cylinders/openfoam/run_benchmark.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import zipfile
44
import os
55
from pathlib import Path
6-
import numpy as np
7-
import matplotlib.pyplot as plt
86

97
root_dir = Path(__file__).resolve().parent
108
zip_path = root_dir.parent / "rotating-cylinders.zip"
@@ -66,6 +64,7 @@
6664
if item.is_file() and item.name not in {"solution_metrics.json", "parameters.json"} and item != output_zip_path:
6765
zf.write(item, item.relative_to(output_dir))
6866
item.unlink()
67+
6968
# Remove any empty subdirectories left after zipping
7069
for item in sorted(output_dir.rglob("*"), reverse=True):
7170
if item.is_dir():

0 commit comments

Comments
 (0)