neqsim-input-validation
Skill167 starsChanged 7 months agoApache-2.0View on GitHub
Input validation rules for NeqSim simulations. USE WHEN: setting up thermodynamic systems, process equipment, or running simulations. Catches physically impossible or suspect inputs before simulation runs, saving time and providing corrective guidance.
In this repository140 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- analyze-convergenceSkill
- analyze-gibbs-convergenceSkill
- book-creationSkill
- design-flash-benchmarkSkill
- design-reactor-benchmarkSkill
- figure-discussionSkill
- generate-publication-figuresSkill
- journal-formattingSkill
- neqsim-acid-gas-treatingSkill
- neqsim-advanced-control-mpc-and-virtual-sensingSkill
- neqsim-agent-handoffSkill
- neqsim-agentic-process-optimizationSkill
- neqsim-api-patternsSkill
- neqsim-autonomous-investigationSkill
- neqsim-capability-mapSkill
- neqsim-capacity-and-utilization-analysisSkill
- neqsim-capacity-increase-screeningSkill
- neqsim-ccs-hydrogenSkill
- neqsim-code-healthSkill
- neqsim-code-hygieneSkill
- neqsim-code-reviewSkill
- neqsim-column-internals-and-rate-basedSkill
- neqsim-compressor-antisurge-recycleSkill
- neqsim-consequence-analysisSkill
- neqsim-continuous-task-improvementSkill
- neqsim-controllability-operabilitySkill
- neqsim-cooling-waterSkill
- neqsim-cpa-water-boundariesSkill
- neqsim-depressurization-mdmtSkill
- neqsim-distillation-designSkill
- neqsim-document-intelligence-extractionSkill
- neqsim-dynamic-equipment-implementationSkill
- neqsim-dynamic-simulationSkill
- neqsim-electrolyte-systemsSkill
- neqsim-emulsion-separationSkill
- neqsim-energy-systems-and-electrificationSkill
- neqsim-engineering-design-packageSkill
- neqsim-eos-regressionSkill
- neqsim-equipment-cost-estimationSkill
- neqsim-exploration-strategy-selectionSkill
- neqsim-field-developmentSkill
- neqsim-field-economicsSkill
- neqsim-firewater-deluge-designSkill
- neqsim-flow-accelerated-corrosionSkill
- neqsim-flow-assuranceSkill
- neqsim-flow-assurance-study-reportSkill
- neqsim-forward-separator-trainSkill
- neqsim-future-operation-studySkill
- neqsim-hazid-fmea-eta-ftaSkill
- neqsim-heat-integrationSkill
- neqsim-hydrogen-productionSkill
- neqsim-integrated-production-and-lifecycleSkill
- neqsim-in-writingSkill
- neqsim-java8-rulesSkill
- neqsim-jurisdiction-regulatory-basisSkill
- neqsim-literature-searchSkill
- neqsim-lng-liquefactionSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
Corrective action: Verify units — NeqSim uses bara (absolute), not barg (gauge) or psia.
- Distinctive: line 62
Corrective action: Search COMP.csv for the correct component name.
- Distinctive: line 167
Use this checklist before every simulation setup:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
NeqSim Input Validation Rules
Validate inputs before creating NeqSim objects or running simulations. Each rule includes the check, the error it prevents, and the corrective action.
Thermodynamic System Inputs
Temperature
| Check | Valid Range | Error If Violated |
| T > 0 K (> -273.15 C) | 50-1000 K typical | Absolute zero violation — physically impossible |
| T < 2000 K | Engineering range | Above 2000 K, EOS models are not validated |
| Constructor uses Kelvin | SystemSrkEos(273.15 + T_C, P) | Passing Celsius directly gives wrong results silently |
Corrective action: Convert Celsius to Kelvin: T_K = 273.15 + T_C
Pressure
| Check | Valid Range | Error If Violated |
| P > 0 bara | 0.001-2000 bara typical | Zero/negative pressure is physically impossible |
| P < 5000 bara | Engineering range | Above ~2000 bara, cubic EOS accuracy degrades significantly |
Corrective action: Verify units — NeqSim uses bara (absolute), not barg (gauge) or psia.
Composition
| Check | Rule | Error If Violated |
| Sum of mole fractions | Should be ~1.0 (tolerance: 0.999-1.001) | Wrong mixture composition — all properties incorrect |
| Each fraction >= 0 | No negative fractions | Physically impossible |
| Each fraction <= 1 | No fraction > 100% | Physically impossible |
| At least 1 component | Cannot have empty system | NeqSim crashes on empty system |
Corrective action: Normalize fractions: x_i = x_i / sum(x). Or alert user that fractions don't sum to 1.
Component Names
Valid component names must match entries in src/main/resources/data/COMP.csv.
Common correct names:
| Correct Name | Common Mistakes |
"methane" | "CH4", "Methane", "c1" |
"ethane" | "C2H6", "C2" |
"propane" | "C3H8", "C3" |
"n-butane" | "butane", "nC4" |
"i-butane" | "isobutane", "iC4" |
"CO2" | "co2", "carbon dioxide" |
"H2S" | "h2s", "hydrogen sulfide" |
"nitrogen" | "N2", "Nitrogen" |
"water" | "H2O", "Water" |
"MEG" | "meg", "ethylene glycol" |
Corrective action: Search COMP.csv for the correct component name.
Mixing Rule
| Check | Rule | Error If Violated |
| Mixing rule is set | setMixingRule() must be called after addComponent() | Flash gives wrong results or crashes |
| CPA systems use numeric rule | setMixingRule(10) for CPA EOS | String mixing rules don't work with CPA |
| Default for ordinary cubic EOS | setMixingRule("classic") for SRK/PR when no specific model basis requires another rule | A generic default can override the governing model |
| ISO 18453 / GERG-water | SystemGERGwaterEos with setMixingRule(8) | Classic or CPA defaults change the named ISO model basis |
Corrective action: Select the EOS and mixing rule from the governing named standard or validated
task model before applying defaults. For ordinary SRK/PR, "classic" is a default; for CPA,
numeric rule 10 is the usual setup. For ISO 18453 / GERG-water, retain rule 8 and follow the
ISO 18453 / GERG-water execution rule.
Set the selected rule after adding all components; never replace a specified model with a generic
CPA or classic-rule recommendation.
Process Equipment Inputs
Stream
| Check | Rule |
| Flow rate > 0 | Zero flow breaks downstream equipment |
| Flow rate units specified | setFlowRate(value, "kg/hr") — always include unit string |
| Stream has a fluid object | new Stream("name", fluid) — fluid must not be null |
Compressor
| Check | Rule |
| Outlet pressure > inlet pressure | Compressor cannot decompress (use valve/expander) |
| Pressure ratio < 6 per stage | Single-stage ratio above ~4-6 is unrealistic |
| Isentropic efficiency 0.5-0.95 | Values outside this range are non-physical |
| Inlet stream has gas phase | Compressor cannot handle pure liquid |
Valve / Throttle
| Check | Rule |
| Outlet pressure < inlet pressure | Valve reduces pressure (use compressor to increase) |
| Outlet pressure > 0 bara | Cannot throttle to zero pressure |
Heat Exchanger / Cooler / Heater
| Check | Rule |
| Outlet temperature set | Must specify target temperature or duty |
| Cooler: T_out < T_in | Cooler reduces temperature |
| Heater: T_out > T_in | Heater increases temperature |
Temperature in Kelvin for setOutTemperature() | Common mistake: passing Celsius to method expecting Kelvin |
Separator
| Check | Rule |
| Inlet has 2+ phases at conditions | Single-phase feed produces no separation |
| Use ThreePhaseSeparator for water | Standard Separator handles gas/liquid only |
Pipeline
| Check | Rule |
| Length > 0 meters | Zero-length pipe has no effect |
| Diameter > 0 meters | Must specify pipe inner diameter |
| Diameter typically 0.05-1.5 m | Values outside range are suspect |
EOS Selection Validation
| Fluid Type | Required EOS | Wrong EOS Symptom |
| ISO 18453 / GERG-water water dew point | SystemGERGwaterEos with mixing rule 8, or Standard_ISO18453 | CPA, GERG-2008, or ordinary PR changes the requested model basis |
| General hydrocarbons + water, without a specified model basis | CPA (SystemSrkCPAstatoil) | SRK/PR gives near-zero water solubility in HC |
| Hydrocarbons + MEG/methanol | CPA (SystemSrkCPAstatoil) | Wrong hydrate inhibition prediction |
| Pure hydrocarbons (no polar) | SRK or PR | CPA is slower with no benefit |
| Custody transfer / fiscal metering | GERG-2008 (SystemGERG2008Eos) | Cubic EOS not accurate enough for custody |
| Electrolyte / brine / pH | Electrolyte CPA | SRK/CPA ignores ionic interactions |
Corrective action: Match EOS to the governing standard and task model, then the fluid type. CPA is a general water/polar-system option; it does not replace the named ISO 18453 / GERG-water calculation. Resolve an unspecified model basis before claiming standard-specific results.
Order-of-Operations Validation
These operations must happen in the correct sequence:
1. Create fluid (SystemSrkEos, etc.)
2. Add ALL components
3. Set mixing rule ← BEFORE characterization or flash
4. Characterize plus fractions (if oil) ← AFTER mixing rule
5. Create database (if needed)
6. Run flash (TPflash, etc.)
7. Call initProperties() ← AFTER flash, BEFORE reading properties
8. Read properties (density, viscosity, etc.)Common order violations:
- Characterizing before setting mixing rule →
ArrayIndexOutOfBoundsException - Reading properties before
initProperties()→ zero values for transport properties - Adding components after setting mixing rule → mixing rule parameters stale
Quick Validation Checklist
Use this checklist before every simulation setup:
- Temperature in Kelvin for constructors (not Celsius)
- Pressure in bara (not barg or psia)
- Mole fractions sum to ~1.0
- Component names match COMP.csv exactly
- Mixing rule set after all components added
- EOS and mixing rule match the named standard/task basis (ISO 18453: GERG-water and rule 8)
- Flash called before reading properties
initProperties()called after flash- Equipment connected via outlet streams (not new streams)
- ProcessSystem.run() called once after building full flowsheet
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

