neqsim-forward-separator-train
Skill167 starsChanged 7 months agoApache-2.0View on GitHub
Run one fluid (E300 or composition) through a forward-only, no-recycle separator train (HP, MP, LP, stock tank) like PVTsim/ECL300 and return GOR, Bo, STO API and gas per stage; also fit ONE shared stage P/T set to reservoir-simulation oil and gas rates over many fluids. USE WHEN: 'kjør dette for et gitt fluid', surface GOR/Bo/STO for an E300 fluid, or fitting the pseudo-process P/T per tank/scrubber of a reservoir simulation.
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-future-operation-studySkill
- neqsim-hazid-fmea-eta-ftaSkill
- neqsim-heat-integrationSkill
- neqsim-hydrogen-productionSkill
- neqsim-input-validationSkill
- 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
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
Do not use it for trains with recycles or with feedback from compressors or coolers into earlier stages.
- Distinctive: line 44
Ask the user for the stage P/T and feed conditions if they are not given.
- Distinctive: line 93
Only oil and gas rate matter (hence GOR).
- Very specific: line 122
Always report the fitted set together with its std_errors and the match quality.
- Distinctive: line 124
Use fluids from as many formations with different volatility as possible.
- Very specific: line 129
If formation_report shows a formation biased by more than a few percent GOR, one P/T set does not fit all formations.
≈ “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
Forward Separator Train for One Fluid
A forward train has no recycle: liquid cascades from stage to stage and every gas stream leaves the system. For a fixed composition and fixed stage pressures and temperatures the result is therefore unique and needs no iteration. This is the same separator test PVTsim and ECL300 run, so results can be compared directly.
The skill runs one fluid. To study variation, call it once per fluid (see "Many fluids" below).
When to Use
- A fluid is given as an E300 file (or a mole-fraction table) and surface results are needed.
- GOR, Bo, stock-tank oil density/API, or gas rate and gas MW per stage are requested.
- A PVTsim or ECL300 separator-test number must be reproduced or sanity-checked.
Do not use it for trains with recycles or with feedback from compressors or
coolers into earlier stages; build a ProcessSystem with recycles instead.
Inputs
| Input | Default | Notes |
E300 file or --composition JSON | required | Exactly one. JSON: {"eos":"srk","components":{"methane":0.7,...}} (srk or pr, library component names). |
--feed-p | 250 bara | Set to reservoir (or wellstream) pressure. |
--feed-t | 100 degC | Set to reservoir (or wellstream) temperature. |
--stages | 70:60,20:50,2:40 | bara:degC per stage, strictly falling pressure. Stock tank at 15 degC and 1.01325 bara is always appended. |
--flow | 100000 kg/hr | Only scales absolute rates; GOR and Bo do not depend on it. |
--out | none | Writes the result JSON. |
Ask the user for the stage P/T and feed conditions if they are not given. The defaults are placeholders, not a design.
Run
<python> scripts/run_forward_separator.py fluid.e300 --feed-p 300 --feed-t 110 \
--stages "70:60,20:50,2:40" --out result.json<python> is the interpreter with the neqsim package. The script builds, per
stage: ThrottlingValve to the stage pressure, Heater to the stage
temperature, Separator; the liquid outlet feeds the next stage.
Outputs (JSON)
GOR_Sm3_Sm3: total gas of all stages including stock tank, per Sm3 of stock-tank oil (gas at 15 degC, 1.01325 bara, ideal-gas conversion).Bo_m3_Sm3: feed volume at feed P/T divided by stock-tank oil volume.STO_density_kgm3,STO_API,STO_Sm3_h: stock-tank oil.stages[]:P_bara,T_C,gas_Sm3_h,gas_MW_gmol,liquid_kg_hper stage.feed_n_phases,mass_balance_rel_err,warnings[].
Validation checks (do before reporting)
mass_balance_rel_errbelow 1e-6.feed_n_phases: if 2 at feed P/T, the feed is not a single-phase reservoir fluid (feed below saturation, or feed P/T wrong). Bo then describes the mixed stream; say so, or correct the feed conditions.- GOR and API are physically plausible for the fluid type (black oil about 50-300 Sm3/Sm3, 25-40 API; volatile oil/condensate much higher GOR, higher API).
- For a PVTsim/ECL300 comparison, confirm the same stage P/T, the same standard conditions (15 degC, 1.01325 bara) and the same EOS parameters (volume shift, kij) before attributing differences to the model.
Many fluids
The user normally runs variations themselves: loop the script over several E300
files or composition JSONs and collect the GOR_Sm3_Sm3, Bo_m3_Sm3 and
STO_API fields into a table. scripts/make_variations.py base.e300 --n 30
--outdir d writes Latin-hypercube variations (+-20 % on each C1-C6 component, on
the C7+ amount and on a C7+ tilt, keeping the pseudo-component EOS parameters)
plus a manifest.csv. Keep stage P/T and feed P/T fixed across cases so the
cases are comparable.
Fit ONE P/T set to reservoir-simulation rates
A reservoir simulator applies one pseudo process (the same stage P/T) to every fluid it produces, from all formations. To reproduce its produced oil and gas rate, regress a single set of stage pressures and temperatures over all fluids. Only oil and gas rate matter (hence GOR); Bo and densities are not used.
Manifest CSV, one row per fluid: fluid (E300 path), oil_Sm3_h, gas_Sm3_h
(targets from the simulator), optional feed_kmol_h, feed_P_bara, feed_T_C,
weight, formation (label for the error report only; all formations share the
one P/T set).
<python> scripts/fit_separator_pt.py manifest.csv --x0 "80:70,25:55,3:45" \
--feed-p 300 --feed-t 110 --p-max 120 --out fit.json- Unknowns: P and T of every stage (stage count = number of
--x0stages; stock tank fixed at 15 degC, 1.01325 bara). Pressure falls along the train by construction. - Residuals: ln(model/target) for oil and for gas per fluid, so errors are relative.
- Output
fit.jsonand*_per_fluid.csv: fitted stages, per-fluid target vs model (oil, gas, GOR, % error),formation_report, parameter standard errors, Jacobian condition number, warnings.
Uniqueness is not guaranteed. Oil and gas rate alone constrain only a
combination of the stage conditions. Tested on synthetic targets (known train
60:55, 15:45, 1.8:35, 1 % noise): fluids varied +-20 % around one base gave a
pure data fit (--prior-weight 0) with huge standard errors that drifted to a
physically odd set at the same noise-level match. A weak prior toward --x0
(--prior-weight, default 0.02) selects one reproducible solution along the flat
valley; with three different base fluids the match was at the noise level
(about 1 % GOR) for every formation, and the standard errors shrank (about 7-21 degC,
a factor 1.8 in pressure). So:
- Always report the fitted set together with its
std_errors and the match quality; do not present poorly determined stages as measured values. - Use fluids from as many formations with different volatility as possible; that is what makes P/T better determined.
- Set
--x0to the simulator's own pseudo-process (or a typical train); the prior keeps the answer near it. Fix a stage you know by narrowing--t-min/--t-maxand--p-max. - If
formation_reportshows a formation biased by more than a few percent GOR, one P/T set does not fit all formations; say so instead of tuning further. - A run on 30 fluids and 3 stages takes about 1 minute.
Limits
- Equilibrium stages only; no entrainment, carry-over or separation efficiency.
- Water is not treated specially; an aqueous phase in the liquid outlet is counted as liquid.
- Stage gas rates are ideal-gas standard volumes, which can differ by a fraction of a percent from PVTsim's real-gas standard volumes.
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.

