Simulate water flow through a pipe connector
- Tools
- Gmsh, OpenFOAM simpleFoam
- Time limit
- 8 hours
Agent is asked to calculate the pressure drop of water flowing through a pipe connector, and how the velocity and pressure change along it.
Agent Input
What the agent is given: the instruction and its input files.
Water flows through this pipe connector. Calculate the pressure drop, and how the velocity and pressure change along it. The part is /workspace/connector.step. Save the submission in /workspace/submission.
connector.step is the only source of geometry. Its units are millimetres. The flow conditions are in /workspace/flow_details.md.
Use Gmsh and OpenFOAM simpleFoam. The mesh must take at most 5 minutes in Gmsh and the solve at most 20 minutes in simpleFoam, using 1 process.
Submit these items:
model/run.sh- The command is
bash model/run.sh OUT_DIR. - The script runs with no network and only the packages installed here.
- Only scripts in
model/are copied (.py,.sh,.geo,.json). These scripts must be at most 5 MB in total. - The run must write the Gmsh mesh
fluid.mshand a ready-to-run OpenFOAM case to OUT_DIR. Do not runsimpleFoaminmodel/run.sh.
- The command is
- The OpenFOAM case
system/controlDictsetsapplication simpleFoam, withwriteFormat asciiand no function objects.- The mesh and the fields are in ASCII. All cells are tetrahedra from
fluid.msh. The boundary patches are namedinlet,outletandwall. - The mesh has at most 1,000,000 cells.
- The solve must converge: the last initial residuals of
pandUmust be at most 1e-5.
results.json, in m, m/s, m³/s and Pa. Pressure is static gauge pressure in Pa. It holds:inletandoutletobjects, each with:area_m2flow_m3s, the flow through the patchmean_p_Pa, the area-weighted mean pressure
pressure_drop_Pa, inletmean_p_Paminus outletmean_p_Pasections, a list of three objects for the planes X = 20, 100 and 180 mm, in that order. Each object holds:area_m2, the water area on the planeflow_m3s, the flow through the planemean_p_Pa, the area-weighted mean pressuremean_speed_ms, the area-weighted mean speedpeak_speed_ms, the largest speed on the plane
static_pressure_recovery_Pa,mean_p_Paat X = 180 mm minusmean_p_Paat X = 100 mmtotal_pressure_loss_Pa, the inlet value minus the outlet value of the flux-weighted mean total pressure. Weight each face by the absolute value of its flux, |φ|, so a face where water flows back in also has a positive weight.
You have 28800 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
Grading & Reference Solution
How the submission is scored, and a human expert-authored reference solution.
Gates
Script builds mesh and case; verifier's solve runs and reads back.
- Results file is valid · results.json exists and parses as a JSON object.
- Model scripts present · model/run.sh exists; only .py, .sh, .geo, .json copied to an offline read-only sandbox.
- Script builds mesh and case · run.sh writes fluid.msh, controlDict, fvSchemes, fvSolution, polyMesh, transport/turbulenceProperties, 0/U, 0/p; one retry.
- simpleFoam finishes · simpleFoam on the case, one process.
- Solve reads back and post-processes×2 · Inlet, outlet, wall patches cover the mesh; post-processing runs on the last time.
Solved mesh is the submitted connector mesh; converged; conserves the flow.
- Mesh is the declared mesh · Every fluid.msh tetrahedron is in the solved mesh (mm or m), nodes matching.
- Solver converged · Last initial residuals of p and U.
- Fluid volume · Solved mesh volume vs connector.step passage (0.001804293 m³).
- Fluid in the right place · Occupancy spread on a reference grid of the passage; catches a displaced passage.
- Wall area · Wall patch area vs reference.
- Inlet and outlet ports×2 · Inlet planar at Y = −15 mm, outlet at X = 215 mm; area vs π × 40² mm².
- Physically plausible speed · Largest speed anywhere.
- Inlet flow · Inlet patch flow vs stated 1 L/min.
- Flow balance · Net flux through all patches.
- Port velocity matches face flux×2 · Integrated normal velocity vs solver face flux, inlet and outlet.
Scored Categories
Laminar simpleFoam with the stated boundary conditions; results.json matches the solve.
- Solver as asked · simpleFoam; no function objects, fvOptions, porosity, MRF, dynamic mesh or gravity.
- Fluid properties · nu vs μ / ρ = 0.001002 / 998.2; simulationType laminar.
- Walls no-slip · Speed and flux on the wall patch.
- Inlet profile · Inlet velocity vs developed parabola for 1 L/min along Y: cross-flow and area-weighted RMS.
- Outlet pressure · Largest |p| on the outlet patch.
- Outlet velocity condition · U boundary type on the outlet in 0/U.
- Reported values match the solve · All results.json values vs verifier's post-processing; |v − e| ≤ atol + rtol |e|.
Mesh within the cell budget and of sound quality.
- Cell budget · Cells in the solved mesh.
- Mesh quality · Largest face non-orthogonality.
Pressure and velocity match the reference on sections, points, walls and planes.
- Section values×15 · Cuts at X = 20, 100, 180 mm: area, flow, mean pressure, mean and peak speed.
- Reference points inside the mesh · Share of reference sample points outside the solved mesh.
- Pressure at fixed points×6 · 95th pct |Δp| vs wall-refined reference: elbow, narrowing, throat, widening, outlet, near wall.
- Speed at fixed points×6 · Median relative speed error, same six regions (floor 5×10⁻⁴ m/s).
- Velocity vector at fixed points×6 · Median relative velocity-vector error, same six regions.
- Velocity components at fixed points×10 · Median relative error of ux (six regions), uy (elbow, narrowing, near wall), uz (elbow).
- Wall shear×4 · Area-mean wall shear in elbow, narrowing, throat; total wall shear force.
- Cutting-plane values×3 · Planes X = 20–180 mm every 20, Y = 40 and 80 mm: mean, peak speed, mean pressure.
- Port values×5 · Inlet and outlet area and flow, inlet mean pressure vs reference.
Pressure drop, recovery, loss and Reynolds numbers inside the mesh-study bands.
- Pressure drop · Inlet minus outlet area-mean pressure.
- Static pressure recovery · Mean pressure at X = 180 mm minus X = 100 mm.
- Total pressure loss · Inlet minus outlet flux-weighted total pressure.
- Reynolds numbers×2 · Inlet and throat (X = 100 mm), ρ = 998.2 kg/m³, μ = 0.001002 Pa·s.
Sample Model Trials
- Loses 2 of 15 weight points on 1 of 4 categories (field accuracy).
- Its other run scored 0: it failed a gate.
- Loses 9 of 15 weight points on 2 of 4 categories (field accuracy, key results and findings).
- Key results and findings: Pressure drop: 127.1 mPa, reference 123.5 ± 3.3 mPa (+2.9 %)
- Key results and findings: Static pressure recovery: 14.8 mPa, reference 13.0 ± 1.8 mPa (+14.0 %)
- + 3 more failed checks
Reference Agent Output Failed Checks