Water analysis
This function performs electroneutrality and property reconciliation calculations from incomplete and/or inaccurate water sample data based on ionic species input.
water analysis
POST
https://api.olisystems.com/engine/flash/{dbs_file_id}/wateranalysis
run a water analysis calculation with anions, cations and nuetrals as input
Headers
Authorization
string
Bearer {access_token}
Content-Type
string
application/json
Request payload
each entry in the params.waterAnalysisInputs follows a JSON format described below.
params.waterAnalysisInputs
type
description
group
string
Properties/Cations/Anions/Electroneutrality Options/Calculation Options
name
string
name of entity under the group
value
number/string
value of entity
unit
string
unit of entity
charge
number
charge of species if group is Cations/Anions
specifying temperature and pressure
units of temperature and pressure can be found here.
specifying volume
units of volume can be found here.
volume can only be specified when inflows are in concentration or molar concentration units. 1 L will be assumed when the volume is not specified.
specifying stream amount
Stream amount can be specified as units of mole or mass.
Stream amount cannot be specified when inflows are specified as concentration or molar concentration units.
specifying species inputs
The three types of species that can be specified in the water sample are "Cations", "Anions" or "Neutrals". Example input and description are given below.
key
value type
description
group
string
species type, i.e. "Cations", "Anions", or "Neutrals"
name
string
species name
unit
string
species composition units
value
number
species composition
charge
number
species charge
species composition unit types
units
concentration
mg/L, g/L, kg/m3, lb/ft3, lb/gal
molar concentration
mol/L, mol/m3, mmol/L, lbmol/ft3
mole
mass
mole fraction
mass fraction
name and charge can be retrieved using chemistry information call.
charge input is optional. A warning will be generated in the output if user input charge is inconsistent with the current chemistry model, and the chemistry model value will be used.
units for species input can be found here.
Electroneutrality options
Since the charge balance may not be conserved for the water sample data, OLI supports several options to reconcile the electroneutrality. Example input and description are given below.
value
description
DominantIon
the species with the most charge contribution is added or removed
ProrateCations
all cations are added or removed proportionally w.r.t. original molar concentration
ProrateAnions
all anions are added or removed proportionally w.r.t. original molar concentration
Prorate
all cations or anions are added proportionally w.r.t. original molar concentration
AutoNACL
NAION or CLION is added
MakeupIon
a user-selected ion species is added or removed
if "MakeupIon" is selected, then an additional object is needed to specify the user-selected ion. See the example below.
Allowing solids to form
Users can specify whether to allow potential solids to form. To select excluding or including specified solid(s) to form, please refer to excluded/included solid species section in Optional Inputs.
Calculating alkalinity
Optionally the alkalinity of the solution can be computed. Example input and description are given below.
group
name
type of value
description
Calculation Options
CalcAlkalnity
boolean
option to calculate alkalinity
Calculation Options
AlkalinityPhTitrant
string
name of pH titrant used in alkalinity measurement
Properties
AlkalinityTitrationEndPointpH
number
endpoint pH in alkalinity measurement
Property reconciliation type
Different property reconciliation types can be specified with the type specified in the value field. Example input and description are given below.
value
description
EquilCalcOnly
only perform equilibrium calculation without any property reconciliation
ReconcilePh
reconcile solution pH to a specified measured value by adjusting acid and base titrant amount
ReconcilePhAndAlkalinity
reconcile both pH and alkalinity to measured values by adjusting pH and alkalinity titrant amount
ReconcilePhAndAlkalinityAndTic
reconcile pH, alkalinity, and total inorganic carbon (TIC) to measured values by adjusting titrant amount
ReconcileCo2Gas
reconcile gas-phase CO2 content (mole %) to a measured value by adjusting CO2 amount
These options are described in more detail below.
Reconciling pH only
There is an option to only reconcile pH to a measured value. Example input and description are given below.
group
name
value type
description
Calculation Options
CalcType
string
set to "ReconcilePh"
Properties
pH
number
measured pH
Calculation Options
PhAcidTitrant
string
pH acid titrant name
Calculation Options
PhBaseTitrant
string
pH base titrant name
Calculation Options
Titrant
string
single pH titrant name
Both PhAcidTitrant and PhBaseTitrant need to be specified; otherwise, Titrant needs to specified as a single pH titrant. The "value" field of the titrant object needs to be specified as the inflow name of the titrant species. The available inflow names in the chemistry model can be retrieved from chemistry information call under result.inflows.
Reconcile pH and alkalinity
Both pH and alkalinity may be reconciled simultaneously. In addition to the specifications of "Reconcile pH", measured alkalinity also needs to be specified. Example input and description are given below.
group
name
type of value
description
Calculation Options
CalcType
string
set to "ReconcilePhAndAlkalinity"
Calculation Options
AlkalinityPhTitrant
string
inflow name of alkalinity pH titrant
Properties
AlkalinityTitrationEndPointpH
number
endpoint pH in alkalinity measurement
Properties
Alkalinity
number
measured alkalinity value
Units for alkalinity can be found here.
Reconcile pH, alkalinity, and TIC
This option allows reconciling measured pH, alkalinity, and total inorganic carbon (TIC) simultaneously. In addition to the specifications of "Reconcile pH and alkalinity", measured TIC also needs to be specified. Example input and description are given below.
group
name
value (type)
description
Calculation Options
CalcType
string
set to "ReconcilePhAndAlkalinityAndTic"
Properties
TIC
number
measured Total Inorganic Carbon
Units for TIC can be found here.
Reconcile gas-phase CO2 content
In this calculation option, CO2 is added to reach measured gas phase CO2 content, with the rest of the gas phase filled with CH4.
group
name
type of value
description
Calculation Options
CalcType
string
set to "ReconcileCo2Gas"
Properties
CO2GasFraction
number
measured gas-phase CO2 content
Units for CO2GasFraction can be found here.
This option required CO2 and CH4 to be present in the chemistry model.
Response (status = PROCESSED)
The output of this calculation is the stream output which is common result output for all OLI's flash calculations or an error. In addition to this output the result also contains the water analysis output information and can be conveniently retrieved from the data.result.waterAnalysisOutput object. A description of this object is given below.
data.result.waterAnalysisOutput
type
description
addedIonsToBalance
ions that were added to maintain electronuetrality
addedPhTitrants
amount of titrant added to reconcile pH
alkalinity
calculated alkalinity value
addedAlkalinityTitrant
amount of titrant to reconcile alkalinity
addedTICTitrant
amount of titrant added to reconcile TIC
Survey Calculation
Survey calculation is supported for the variables below. Please refer to Survey calculation for explained input schema.
supported params.surveyInputs[{}].field
"/params/waterAnalysisInputs/i/value" where i is the index (0 based) of params.waterAnalysisInputs variable object to be surveyed
Last updated