--- name: civil-networks description: Water, wastewater and stormwater network engine. Runs real EPANET hydraulic simulations via WNTR (pressures, flows, velocities, headloss), does Hazen-Williams / Manning hydraulic checks, SWMM stormwater model inspection via swmmio, and extracts pipe/fitting BOQ from the network model. Use when a user asks about water network, EPANET, hydraulic analysis, pipe sizing, pressure check, flow/velocity, headloss, stormwater, SWMM, sewer, drainage capacity, or pipe BOQ. ---
💧 civil-networks — محرّك شبكات المياه والصرف والأمطار
> بديل داخلي لـ WaterGEMS/SewerGEMS: EPANET (عبر wntr) + SWMM (عبر swmmio) + hydraulic checks + BOQ extraction. > مُتحقّق: wntr 1.4.0 + EPANET solver يعملان فعلياً.
---
🎯 القدرات
1. EPANET hydraulic sim (wntr) — بناء/تشغيل شبكة مياه فعلية → ضغوط، تدفقات، سرعات، headloss. 2. Hydraulic checks — Hazen-Williams (ضغط الأنابيب) + Manning (مجاري السيول/الصرف الثقالي). 3. Velocity / pressure validation — تحقق من حدود التصميم (سرعة 0.6-3 m/s، ضغط min). 4. SWMM inspection (swmmio) — قراءة موديل SWMM (.inp) وتلخيص العُقد والروابط. 5. Pipe BOQ — استخراج أطوال الأنابيب حسب القطر من الموديل لبناء BOQ.
---
🛠️ السكربت
scripts/networks.py
الأوامر
bash
1) Run a demo EPANET network (built-in) — pressures/flows/velocities
python3 scripts/networks.py epanet-demo2) Run an existing EPANET .inp file
python3 scripts/networks.py epanet --inp network.inp3) Hazen-Williams headloss check (single pipe)
python3 scripts/networks.py hw --flow 0.02 --diameter 0.2 --length 500 --C 1004) Manning open-channel / gravity sewer check
python3 scripts/networks.py manning --diameter 0.3 --slope 0.005 --n 0.0135) SWMM model summary
python3 scripts/networks.py swmm --inp model.inp6) Pipe BOQ from EPANET inp (lengths by diameter)
python3 scripts/networks.py boq --inp network.inppython3 scripts/networks.py --help
---
📐 المعادلات الهيدروليكية (داخل code blocks — لا LaTeX)
Hazen-Williams headloss (SI):
hf = 10.67 L Q^1.852 / ( C^1.852 D^4.87 ) [m]
Q = flow (m3/s), D = diameter (m), L = length (m), C = roughness coeffVelocity:
v = Q / A, A = pi
D^2 / 4 [m/s]
Design limits: 0.6 <= v <= 3.0 m/s (potable); flush velocity >= 0.7 m/sManning (gravity flow, full pipe):
Q = (1/n) A R^(2/3) S^(1/2)
A = piD^2/4, R = D/4 (full), S = slope, n = Manning's n
Sewer self-cleansing velocity >= 0.6-0.75 m/s
🔗 التكامل
- BOQ →
quantity-takeoff-engine. - منهجية التنفيذ (trenching/testing) →
civil-methodology-engine. - HEC-RAS / مجاري كبيرة → مرجعية خارجية (غير مدمجة بعد).
⚠️ قواعد
- تحقق دائماً من حدود السرعة والضغط — شبكة "تعمل" عددياً قد تفشل تصميمياً.
- EPANET نتائجه steady-state؛ للـ transient/water-hammer استخدم أدوات مخصصة.
- وحدات SI افتراضياً (m, m3/s, m).