research: Dütsch config from the shipped config_lbm.json schema; real-loader test
The generated config failed the real loader (KeyError: cuda). It now copies src/CelerisLab/configs/config_lbm.json and overrides only grid, physics, collision/streaming/storage, y walls, LES off and uniform inlet profile; inlet scheme and outlet mode stay the template's and are recorded in case.json. New CPU test loads the generated file with load_lbm_config. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fbe7b2fb7c
commit
dc6713e951
2 files changed
+37
-4
No files matched your search
@@ -85,3 +85,22 @@ def test_exact_point_inside_body_is_missing_even_with_fluid_corners():
|
||||
assert value is None and used == () and total == 0.0
|
||||
value, used, total = p.sample(field, fluid, 3.35, 3.0, centre, radius) # just outside
|
||||
assert value is not None and total > 0.0
|
||||
|
||||
|
||||
def test_generated_config_passes_the_real_loader(tmp_path):
|
||||
import json
|
||||
import sys
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "research/duetsch_re100_kc5"))
|
||||
try:
|
||||
import run
|
||||
finally:
|
||||
sys.path.pop(0)
|
||||
from CelerisLab.config import load_lbm_config
|
||||
cfg_dict, u_max, n = run.config(20, 10.0, 2520)
|
||||
path = tmp_path / "config_lbm.json"
|
||||
path.write_text(json.dumps(cfg_dict))
|
||||
cfg = load_lbm_config(str(path))
|
||||
assert (cfg.nx, cfg.ny) == (n, n) == (200, 200)
|
||||
assert cfg.collision == "MRT" and cfg.streaming == "double_buffer" and not cfg.ddf_shifting
|
||||
assert cfg.velocity == 0.0 and cfg.viscosity == pytest.approx(u_max * 20 / 100)
|
||||
assert cfg.y_wall_bc == "bounce_back"
|
||||
Reference in new issue
Block a user