neqsim-produced-water-scale-screening
Skill4 starsChanged 5 months agoApache-2.0View on GitHub
Public produced-water brine builder and screening-level scale evaluation. USE WHEN: a task needs to turn an ion analysis, preset, or TDS value into a NeqSim-ready electrolyte ion mapping and a quick scale/mixing-incompatibility screening (BaSO4, SrSO4, CaSO4, CaCO3), and should be directed to validated NeqSim checkScalePotential methods for design-grade work.
In this repository90 other files it gives its agents.
- neqsim-document-intelligence-extractionSkill
- neqsim-co2-emissions-screeningSkill
- neqsim-energy-emissions-screeningSkill
- neqsim-weather-dataSkill
- neqsim-anp-open-dataSkill
- neqsim-artificial-lift-screeningSkill
- neqsim-asset-value-npv-screeningSkill
- neqsim-capex-opex-screeningSkill
- neqsim-design-basis-screeningSkill
- neqsim-economy-basis-screeningSkill
- neqsim-ncs-infrastructure-networkSkill
- neqsim-ncs-ownership-equitySkill
- neqsim-ncs-value-chain-optimizationSkill
- neqsim-norwegian-continental-shelf-dataSkill
- neqsim-psc-bid-economics-screeningSkill
- neqsim-reservoir-depletion-screeningSkill
- neqsim-reservoir-facility-value-chainSkill
- neqsim-reservoir-model-builderSkill
- neqsim-resource-classification-screeningSkill
- neqsim-hydrate-margin-checkSkill
- neqsim-hydrate-screeningSkill
- neqsim-multiphase-flow-slug-screeningSkill
- neqsim-olga-multiphase-simulatorSkill
- neqsim-surf-cooldown-screeningSkill
- neqsim-two-phase-flow-regime-screeningSkill
- neqsim-wax-margin-checkSkill
- neqsim-acoustic-induced-vibration-screeningSkill
- neqsim-adsorbent-capillary-condensation-screeningSkill
- neqsim-ageing-life-extension-screeningSkill
- neqsim-cfd-couplingSkill
- neqsim-compressor-antisurge-recycleSkill
- neqsim-compressor-operating-window-checkSkill
- neqsim-compressor-power-screeningSkill
- neqsim-continuous-improvement-toolkitSkill
- neqsim-control-authority-screeningSkill
- neqsim-control-valve-cv-screeningSkill
- neqsim-dry-gas-seal-screeningSkill
- neqsim-dynamic-instrument-controller-setupSkill
- neqsim-dynamic-process-preparationSkill
- neqsim-fem-couplingSkill
- neqsim-fired-heater-duty-screeningSkill
- neqsim-flow-induced-vibration-screeningSkill
- neqsim-gas-scrubber-sizing-screeningSkill
- neqsim-gas-turbine-performance-screeningSkill
- neqsim-heat-exchanger-fouling-assessmentSkill
- neqsim-line-velocity-checkSkill
- neqsim-noise-screeningSkill
- neqsim-pipe-wall-thickness-screeningSkill
- neqsim-piping-flexibility-screeningSkill
- neqsim-pressure-drop-screeningSkill
- neqsim-pump-hydraulics-screeningSkill
- neqsim-reciprocating-compressor-screeningSkill
- neqsim-reliability-data-screeningSkill
- neqsim-sand-erosion-screeningSkill
- neqsim-separator-modellingSkill
- neqsim-teg-dehydration-modelingSkill
- neqsim-uncertainty-quantificationSkill
- neqsim-utility-balance-screeningSkill
- neqsim-water-dewpoint-dehydration-screeningSkill
- neqsim-benchmark-reference-dataSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
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
- Distinctive: line 16
Use this skill to build a normalized produced-water (brine) description from an ion analysis, a built-in preset, or a single …
- Distinctive: line 27
When a user wants to convert a water analysis into a NeqSim electrolyte fluid input.
- Distinctive: line 28
When a user asks which oilfield scales (barite, celestite, gypsum/anhydrite, calcite) a water tends to form.
- Distinctive: line 29
When screening seawater-injection or commingling incompatibility (formation-water Ba/Sr meeting injected SO4).
- Distinctive: line 30
When an agent should explain that validated NeqSim methods are required for design-grade scale and inhibitor work.
- Very specific: line 97
If the optional neqsim Python package is available, the result records that fact so an agent can recommend moving to validated NeqSim scale …
- Distinctive: line 122
No electrolyte-EOS or Pitzer activity model is performed in this skill.
- Distinctive: line 124
No kinetics, supersaturation ageing, or deposition modelling.
- Distinctive: line 125
No proprietary scale models, inhibitor correlations, or company operating limits.
- Distinctive: line 126
Not suitable for scale-management design, inhibitor selection, or operating-limit decisions.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
Produced Water Scale Screening
Use this skill to build a normalized produced-water (brine) description from an
ion analysis, a built-in preset, or a single total-dissolved-solids value; check
its charge balance; and emit a NeqSim-ready ion mapping for
neqsim.thermo.util.ProducedWaterFluidBuilder. It also computes
screening-level scale saturation indices, a two-water mixing-incompatibility
sweep, and informational CO2/H2S corrosion flags. It is intentionally simple and
should guide users toward validated NeqSim electrolyte-CPA scale calculations for
real work.
When to Use
- When a user wants to convert a water analysis into a NeqSim electrolyte fluid input.
- When a user asks which oilfield scales (barite, celestite, gypsum/anhydrite, calcite) a water tends to form.
- When screening seawater-injection or commingling incompatibility (formation-water Ba/Sr meeting injected SO4).
- When an agent should explain that validated NeqSim methods are required for design-grade scale and inhibitor work.
Inputs
ions_mg_l: explicit ion concentrations in mg/L (e.g.Na+,Cl-,Ca++,Mg++,Ba++,Sr++,SO4--,HCO3-).preset: one ofseawater,formation_water_high_ba,brackish.tds_mg_l: total dissolved solids in mg/L (modelled as pure NaCl).temperature_c: temperature in C (default 25.0).pressure_bara: pressure in bara (default 1.0).ph: optional in-situ pH (required for calcite screening).- For corrosion flags:
co2_mol_percent,h2s_mol_percentof the associated gas.
Exactly one of ions_mg_l, preset, or tds_mg_l must be supplied to build.
Outputs
tds_mg_l: sum of ion concentrations in mg/L.molality: ion molality in mol/kg.ionic_strength_mol_kg: brine ionic strength in mol/kg.charge_balance_error_pct: cation-anion imbalance as a percentage.neqsim_components: mole-fraction mapping ofwater+ ions for the NeqSim builder.neqsim_available: whether the optional NeqSim package is importable.ScaleResult.saturation_index:log10(IAP/Ksp)per mineral;>0means supersaturation.ScaleResult.risk/MixIncompatibility.risk:low,moderate,high, orunknown.MixIncompatibility.worst_fraction_a/worst_saturation_index: worst blend point.corrosion_flags: human-readable CO2/H2S screening flags.warnings: non-fatal screening warnings (charge balance, ionic-strength validity, unsupported ions).
Engineering Method
Ion concentrations are converted to molality with public molar masses. Ionic
strength is I = 0.5 * sum(m_i * z_i^2). Activity coefficients use the Davies
equation log10(gamma) = -A * z^2 * (sqrt(I)/(1+sqrt(I)) - 0.3*I) with
A = 0.509. For each scale the saturation index is
SI = log10(IAP / Ksp) where IAP = (gamma*m_cation)*(gamma*m_anion), using
public 25 degC solubility products (BaSO4 1.08e-10, SrSO4 3.44e-7, CaSO4 gypsum
3.14e-5, CaCO3 calcite 3.36e-9). Carbonate is derived from bicarbonate and pH via
[CO3--] = K2 * [HCO3-] / [H+] with K2 = 4.69e-11. The mixing sweep blends two
waters on a volume basis and reports the worst-case SI per mineral. Risk bands:
SI >= 0.5 high, SI >= 0.0 moderate, otherwise low; missing ions or pH give
unknown.
This is not a Pitzer or electrolyte-EOS model. Solubility products are fixed at 25 degC, and the Davies model is only valid up to roughly 0.5 mol/kg, so indices for concentrated brines are indicative only.
Python Usage Pattern
from produced_water_scale_screening import ProducedWaterBuilder, ScaleScreener
builder = ProducedWaterBuilder()
formation = builder.build(preset="formation_water_high_ba", ph=6.5)
seawater = builder.build(preset="seawater", ph=8.1)
# NeqSim electrolyte-CPA builder input:
print(formation.neqsim_components)
screener = ScaleScreener()
for result in screener.screen(seawater).results:
print(result.salt, result.saturation_index, result.risk)
# Seawater-injection incompatibility (Ba/Sr meeting SO4):
for item in screener.mixing_incompatibility(formation, seawater):
print(item.salt, item.worst_fraction_a, item.worst_saturation_index, item.risk)If the optional neqsim Python package is available, the result records that
fact so an agent can recommend moving to validated NeqSim scale workflows. If
not, the example still runs with the public screening logic.
Validation Checklist
- Exactly one of
ions_mg_l,preset, ortds_mg_lis provided. - Ion concentrations are finite and non-negative.
- Charge balance error is reviewed (warned above 10%).
- pH is supplied when calcite screening is required.
- Ionic-strength validity warning is heeded for concentrated brines.
- Saturation indices are not used as inhibitor doses, deposition rates, or operating limits.
- Real scale work is redirected to validated NeqSim electrolyte-CPA methods and qualified review.
Common Mistakes
| Symptom | Cause | Fix |
Calcite always unknown | pH not supplied | Provide in-situ pH so [CO3--] can be derived |
BaSO4 unknown for a single water | No sulfate (or no barium) present | Use the mixing sweep with a sulfate-bearing water |
| SI looks too low for a strong brine | Davies model beyond validity (I > 0.5) | Treat as indicative; rerun with NeqSim checkScalePotential |
| Ion ignored | Unrecognized ion name | Use supported names (Na+, Ca++, Ba++, SO4--, ...) |
Limitations
- No electrolyte-EOS or Pitzer activity model is performed in this skill.
- Solubility products are fixed at 25 degC; no temperature or pressure dependence.
- No kinetics, supersaturation ageing, or deposition modelling.
- No proprietary scale models, inhibitor correlations, or company operating limits.
- Not suitable for scale-management design, inhibitor selection, or operating-limit decisions.
Related NeqSim Functionality
This educational screening corresponds to validated, rigorous functionality in the NeqSim Java library that a qualified engineer should use for design-grade work:
neqsim.thermo.util.ProducedWaterFluidBuilder— builds an electrolyte-CPA produced-water system from TDS, a type preset, or explicit ions (theneqsim_componentsmapping feedscreateFromIons).neqsim.thermodynamicoperations.ThermodynamicOperations#checkScalePotential(int)— rigorous scale-potential evaluation on an electrolyte-CPA fluid.neqsim.thermodynamicoperations.ThermodynamicOperations#addIonToScaleSaturation(int, String, String)— register a scale salt / ion pair for saturation tracking.neqsim.process.chemistry.scale.ElectrolyteScaleCalculator— activity-corrected saturation index (CaCO3, BaSO4, CaSO4, SrSO4) from ion mg/L.neqsim.process.chemistry.scale.ScaleKinetics— induction time and reaction-vs-transport growth regime on top of a saturation index.neqsim.process.chemistry.scale.BrineMixingScaleEvaluator— mixing-fraction sweep for incompatible brines (worst mineral and mixing fraction).neqsim.process.corrosion.PipeSegmentIntegrity— coupled per-segment CO2 corrosion + CaCO3 scale profile along aPipeBeggsAndBrillsline (locate worst corrosion/scale segments).
In Python the same classes are reachable through the neqsim package (for
example from neqsim import jneqsim).
References
- NeqSim repository: https://github.com/equinor/neqsim
- NeqSim Skills Guide: https://github.com/equinor/neqsim/blob/master/docs/integration/skills_guide.md
- NORSOK M-001 (materials selection) and ISO 15156 / NACE MR0175 (sour service) for the corrosion-flag context.
- Public oilfield-scale literature on barite/celestite/calcite saturation for background.
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.

