| name | cfd-pipeline-validation-points-in-the-pipeline |
| description | Sub-skill of cfd-pipeline: Validation Points in the Pipeline (+1). |
| version | 1.0.1 |
| category | engineering |
| type | reference |
| scripts_exempt | true |
Validation Points in the Pipeline (+1)
Validation Points in the Pipeline
| Stage | What to Check | Tool | Failure Mode |
|---|
| Geometry | Watertight STL, units (meters) | FreeCAD / meshio | Open surfaces break meshing |
| Mesh | checkMesh quality, patch names | OpenFOAM checkMesh | Bad cells cause solver divergence |
| BCs | Patches match mesh, physically consistent | Script above | Missing BC crashes solver |
| Solver | Residuals converging, Courant < 1 | Log parsing | Divergence = wrong mesh/BCs/schemes |
| Results | Value ranges physical, conservation | ParaView validation | Non-physical = wrong setup |
| Export | Image non-blank, data non-empty | File size check | Rendering/export config |
Full Pipeline Validation Script
def validate_cfd_pipeline(case_dir, output_dir):
"""Validate entire CFD pipeline from mesh to results."""
import subprocess
import os
status = {"stages": {}, "overall": True}
mesh_check = subprocess.run(
['checkMesh', '-case', case_dir],
capture_output=True, text=True
)
mesh_ok = 'FAILED' not in mesh_check.stdout
status["stages"]["mesh"] = {"passed": mesh_ok}
if not mesh_ok:
status["overall"] = False
import glob
time_dirs = [d for d in glob.glob(os.path.join(case_dir, '[0-9]*'))
if os.path.isdir(d) and d.split('/')[-1] != '0']
solver_ok = len(time_dirs) > 0
status["stages"]["solver"] = {"passed": solver_ok, "time_steps": len(time_dirs)}
if not solver_ok:
status["overall"] = False
log_files = glob.glob(os.path.join(case_dir, ))
log_files:
re
log_text = (log_files[]).read()
final_residuals = re.findall(, log_text)
final_residuals:
last_residuals = {}
name, val final_residuals:
last_residuals[name] = (val)
converged = (v < v last_residuals.values())
status[][] = {: converged, : last_residuals}
converged:
status[] =
os.path.isdir(output_dir):
images = [f f os.listdir(output_dir) f.endswith()]
viz_ok = (images) > (
os.path.getsize(os.path.join(output_dir, f)) > f images
)
status[][] = {: viz_ok, : (images)}
status