Known Limits
Valid operating ranges, correlation boundaries, and edge-case behaviour for all SepAgent calculation engines.
Guarded (was crash)
Warning issued
Graceful / correct
Gas Properties (Z-factor, Density, Pseudocriticals)
| Parameter | Lower Limit | Upper Limit | Behaviour at Limit | Notes |
| Gas molecular weight |
> 0 |
~100 lb/lbmol |
Warning if Z outside 0.3–1.5 |
DPR correlation most reliable for 10–60 MW range |
| Temperature |
−459.67 °F |
~500 °F |
Warning below absolute zero; DPR fallback when Tpr < 0.919 |
Z-factor falls back to 1.0 when Tpr < 0.919 (near-critical) |
| Pressure |
14.7 psia |
~10,000 psia |
KGPSA floors at 0.05 above ~3,500 psia |
DPR Z-factor reliable to ~10,000 psia; beyond that use iterative (DAK) |
| CO2 + H2S + N2 sum |
0 |
< 1.0 |
Guarded — pure impurity gas now uses component pseudocriticals directly |
Previously caused ZeroDivisionError at sum = 1.0 |
| Reduced temperature (Tpr) |
> 0.919 |
~3.0 |
Falls back to Z = 1.0 below 0.919 |
DPR has sqrt(Tpr − 0.919) term |
Separator Sizing & K-Factors
| Parameter | Lower Limit | Upper Limit | Behaviour at Limit | Notes |
| Gas density vs liquid density |
ρgas must be < ρliq |
Guarded — sets Vdesign = 0 with warning |
Previously caused math domain error (sqrt of negative) |
| GPSA K-factor (KGPSA) |
0.05 ft/s |
0.35 ft/s |
Warning when K falls below 0.05; floored at 0.05 |
K = 0.35 − 0.0001×(P − 100), floors at P ≅ 3,100 psia |
| Droplet diameter |
> 0 µm |
~1000 µm |
Graceful at 0 (CD returns 1.0 as fallback) |
Industry standard: 150 µm for mist pad sizing |
| Safety factor |
0% |
100% |
At 100% → Vdesign = 0 (no flow allowed) |
Typical: 10–15% |
| Vessel L/D ratio |
User-defined min |
User-defined max |
Warning when L/D exceeds range |
Typical: 1.5–7.0 (2P), 2–6 (3P) |
| Stokes settling velocity |
0 |
10 in/min |
Capped at 10 in/min (MAX_SETTLING_VEL_IN_MIN) |
Practical limit for large droplets in low-viscosity fluids |
ASME VIII Pressure Vessel Design
| Parameter | Lower Limit | Upper Limit | Behaviour at Limit | Notes |
| Design pressure (UG-27 shell) |
0 psig |
~29,166 psig |
Guarded — denominator (2SE − 1.2P) goes ≤ 0; warning + floor at 3/8″ |
Limit = 2 × S × E / 1.2 = 2 × 17,500 × 1.0 / 1.2. Use Div. 2 beyond this. |
| Design pressure (UG-32 head) |
0 psig |
~175,000 psig |
Guarded — same pattern as shell |
Head factor is 0.2 so limit is much higher: 2 × 17,500 / 0.2 |
| Shell thickness |
3/8″ (0.375″) |
open |
Warning at > 3″; second warning at > 4″ |
Above 3″ consider Div. 2; above 4″ exceeds field fabrication limits |
| Allowable stress (S) |
SA-516 Gr 70 default: 17,500 psi |
User override |
Flows through to ASME formulas |
3P engine uses ASME_ALLOWABLE_STRESS_PSI from constants.py |
Nozzle Sizing
| Parameter | Lower Limit | Upper Limit | Behaviour at Limit | Notes |
| Gas / liquid flow |
≥ 0 |
open |
Guarded — negative flows clamped to 0; sqrt protected |
Previously caused math domain error with negative flow |
| Minimum nozzle size |
2″ NPS |
open |
All nozzles floor at MIN_NOZZLE_NPS (2″) |
Industry minimum practical size |
| ρV² limit |
60 lb/(ft·s²) |
Used for inlet and gas outlet sizing |
API 14E / GPSA recommendation |
| Liquid velocity limit (2P / 3P) |
5 ft/s (2P) / 6 ft/s (3P) |
Used for liquid outlet sizing |
Industry practice |
3-Phase Separator Rating
| Parameter | Lower Limit | Upper Limit | Behaviour at Limit | Notes |
| Oil flow |
0 lb/hr |
open |
At 0 → retention time = 999 min (sentinel) |
Effectively infinite retention when no oil flows |
| Water flow |
0 lb/hr |
open |
At 0 → retention time = 999 min |
Boot retention also returns 999 min at zero water flow |
| Interface level = NLL |
Zero light-liquid layer |
LL retention = 0 min → reports LL_ok = true (0 ≥ 0) |
Physically meaningless but mathematically consistent |
| Oil viscosity |
> 0 cP |
~500+ cP |
Very long required retention times (correct physics) |
Heavy oil may require larger vessels or heating |
| NLL near vessel ID (liquid full) |
Gas area → 0 |
Gas velocity caps at 999 ft/s sentinel; gas check FAIL |
Correctly identifies insufficient gas capacity |
| Vessel OD |
~24″ |
~144″ |
Tested across full range |
Very small vessels may be geometrically unrealistic for 3-phase |
Coil Bundle Sizing
| Parameter | Lower Limit | Upper Limit | Behaviour at Limit | Notes |
| LMTD temperatures |
Tout > Tbath |
Tin > Tout |
Warning if temp ordering invalid; LMTD = 0 → Areq = 0 |
dT1 = dT2 handled as special case (LMTD = dT1) |
| Design pressure (B31.3) |
0 psig |
~flange class limit |
Flange FAIL warning when P exceeds B16.5 rating |
B16.5 tables cover Class 150 through 2500 |
| Tube velocity |
3 ft/s |
8 ft/s |
"CHECK" status outside range |
Low velocity → poor HTC; high velocity → excessive dP / erosion |
| Bundle dimensions |
open |
84″ W × 54″ H (default) |
"TOO BIG" status when bundle exceeds max |
Configurable by user |
| Pipe schedule |
NPS 1 – 6, Sch 40/80/160/XXS |
Falls back to user-entered OD/wall if NPS not in table |
ASME B36.10 pipe data table |
3D Viewer (URL Parameters)
| Parameter | Lower Limit | Upper Limit | Behaviour at Limit | Notes |
| All numeric URL params |
Any float (including 0) |
NaN-safe parsing; falls back to defaults |
Uses isNaN() check instead of || fallback |
| Missing parameters |
N/A |
All parameters have sensible defaults |
Viewer works standalone without any URL params |
Pipe Sizing
| Parameter | Lower Limit | Upper Limit | Behaviour at Limit | Notes |
| Phase type |
L / V / 2P |
Each phase type activates the appropriate calculation method |
Liquid = Darcy-Weisbach, Vapor = Fanning/isothermal, 2-Phase = Dukler + Beggs & Brill |
| Pipe NPS |
1″ |
24″ |
Warning if NPS not found in pipe data table |
Sch 40 / 80 / 160 from ASME B36.10 |
| Flow rates (WV, WL) |
> 0 |
open |
Guarded — division by zero protected |
Zero flow returns error message |
| Mach number (vapor) |
0 |
1.0 |
Warning when Ma > 0.5; critical warning at Ma ≥ 1.0 |
Isothermal compressible flow assumes Ma < 0.3 for accuracy |
| ρV² (erosional) |
0 |
10,000 |
Warning when ρV² exceeds API 14E erosional velocity |
API 14E: Ve = C / √ρmix, typical C = 100–150 |
| Reynolds number |
< 2,100 (laminar) |
> 108 |
Colebrook-White iterative solver converges across full range |
Laminar uses f = 64/Re; turbulent uses iterative Colebrook-White |
TEG Dehydration
| Parameter | Lower Limit | Upper Limit | Behaviour at Limit | Notes |
| Gas flow rate |
> 0 MMSCFD |
open |
Guarded — zero flow returns validation error |
Typical: 1–500 MMSCFD |
| Operating pressure |
100 psia |
~2,500 psia |
Bukacek correlation accuracy degrades at extremes |
Best accuracy 200–2,000 psia |
| TEG lean concentration |
95.0 wt% |
99.97 wt% |
Warning if lean < rich concentration |
Typical: 98.5–99.5%; Stripping gas achieves 99.9%+ |
| Water content (saturated gas) |
~1 lb/MMSCF |
~8,000 lb/MMSCF |
Bukacek correlation with McKetta-Wehe chart |
Sour gas uses Whitson-Brule HEC correction |
| Contactor diameter |
~12″ |
open |
Sized from Souders-Brown K-factor at 70% flood |
GPSA Figure 20-81 basis |
Hydrate Inhibitor
| Parameter | Lower Limit | Upper Limit | Behaviour at Limit | Notes |
| Inhibitor type |
MeOH / EG |
Each type uses correct molecular weight and depression constants |
MeOH: MW = 32.04, EG: MW = 62.07 |
| Hydrate formation temperature |
−10 °F |
~80 °F |
Warning if no hydrate risk (Top > Thyd) |
Katz chart with Wichert H2S/CO2/C3 correction |
| Temperature depression (ΔT) |
0 °F |
~100 °F |
Large ΔT requires high inhibitor concentration |
Hammerschmidt equation; Carroll method for high ΔT |
| MeOH vapour-phase loss |
0 |
open |
K-value partitioning from GPSA |
Significant at low pressures and high temperatures |
| Gas gravity |
0.55 |
1.5 |
Katz chart validity limited to sweet natural gas |
Sour gas uses Wichert correction factors |
Amine Sweetening
| Parameter | Lower Limit | Upper Limit | Behaviour at Limit | Notes |
| Amine type |
MEA / DEA / MDEA / DGA |
Each amine has specific concentration, loading, and reboiler duty |
MDEA supports CO2 slip factor for selective removal |
| Acid gas loading |
0 mol/mol |
Type-specific max |
Warning if loading exceeds amine-specific maximum |
MEA: 0.35, DEA: 0.35, MDEA: 0.45, DGA: 0.35 mol/mol |
| H2S + CO2 in feed |
> 0 ppm or % |
open |
Guarded — zero acid gas returns validation error |
Typical: 1–30% CO2, 0.001–5% H2S |
| Contactor diameter |
~12″ |
open |
Souders-Brown flooding correlation at 70–80% of flood |
GPSA contactor sizing method |
| Reboiler duty |
open |
open |
Calculated from BTU/gal × circulation rate |
MEA: 1,000; DEA: 1,000; MDEA: 900; DGA: 1,150 BTU/gal |
EG Heater / Coil Sizing
| Parameter | Lower Limit | Upper Limit | Behaviour at Limit | Notes |
| EG concentration |
0 wt% |
100 wt% |
Property polynomials valid across full range |
Typical: 60–80 wt% for freeze protection |
| Bath temperature |
−40 °F |
350 °F |
EG thermal degradation above ~330 °F |
EG property polynomials fitted from −40 to 350 °F |
| LMTD |
> 0 |
open |
Guarded — zero LMTD returns warning (no heat transfer driving force) |
dT1 = dT2 handled as special case |
| Tube velocity |
3 ft/s |
8 ft/s |
Warning outside recommended range |
Low velocity → poor heat transfer; high velocity → excessive ΔP |
| Firetube heat flux |
open |
10,000 BTU/hr·ft² |
Warning if heat flux exceeds recommended maximum |
Typical: 6,000–8,000 BTU/hr·ft² for EG service |
Flare System
| Parameter | Lower Limit | Upper Limit | Behaviour at Limit | Notes |
| Flare gas flow |
> 0 MMSCFD |
open |
Guarded — zero flow returns validation error |
Typical: 0.5–200 MMSCFD |
| Tip Mach number |
0 |
0.5 |
Warning when Ma > 0.5 at tip; size up to next standard tip |
GPSA method: Ma ≤ 0.5 at flare tip for stable combustion |
| Radiation intensity at grade |
open |
500 BTU/hr·ft² |
Warning if radiation exceeds API 521 personnel limit |
API 521: 500 BTU/hr·ft² max at property line; 1,500 at base of stack |
| Stack height |
30 ft |
~500 ft |
Calculated from radiation model to meet grade-level limit |
API 521 radiation geometry; wind angle correction |
| KOD liquid dropout velocity |
> 0 |
open |
Tan (1967) method from Hydrocarbon Processing |
API 521 liquid dropout at KOD inlet |
| Purge rate |
> 0 |
open |
Husa method and Buss & Tromans (IChemE 1995) methods |
Prevents air ingress into flare header |