Objective
This article explains how to perform a single-step vapor amount flash calculation using the Engine API. You will learn how to configure the required parameters, specify inflows and unit sets, and interpret the results returned by the flash operation. By following this guide, you will be able to calculate vapor amounts at given temperature and pressure conditions.
Prerequisites
- Engine API version 12.5.32.0 or later
- Access token and base URL for your deployment
- For more information, please refer to the following Support Center articles:
Run a vapor amount flash calculation
Send a request to your Engine API’s vapor-amount flash operation with the following parameters. The example below demonstrates a calculation at 25 °C and 1 atm with specified inflows and unit set information.
{
"params": {
"temperature": {
"value": 25,
"unit": "°C"
},
"pressure": {
"value": 1.0,
"unit": "atm"
},
"inflows": {
"unit": "mg/L",
"convergeVolumeTargetPhase": "total",
"values": {
"NAHSO3": 444000.0
},
"totalAmount": {
"value": 1.2,
"unit": "m3"
}
},
"optionalProperties": {
"electricalConductivity": false,
"viscosity": false,
"selfDiffusivity": false,
"heatCapacity": false,
"thermalConductivity": false,
"surfaceTension": false,
"interfacialTension": false,
"materialBalanceGroup": true,
"totalDissolvedSolids": false
},
"unitSetInfo": {
"total": "g",
"liq1_phs_comp": "mg/L",
"solid_phs_comp": "mol/mol",
"vapor_phs_comp": "mol/mol",
"liq2_phs_comp": "mol/mol",
"combined_phs_comp": "mg/L",
"pt": "atm",
"t": "°C",
"enthalpy": "J"
},
"vaporAmountMoles": {
"value": 0,
"unit": "mol"
},
"calculatedVariable": "pressure"
}
}
Notes and tips
- This operation is supported only on Engine API version 12.5.23.0 or newer. Requests on older versions will fail.
- Ensure all units match your expected unit set. The example uses °C, atm, mg/L, m3, g, and mol.
- Set
convergeVolumeTargetPhaseto the appropriate target for your scenario. In this example it istotal. - If your deployment requires authentication, include authorization headers as per your org’s standard.
Expected outputs
- Vapor amount at the specified conditions, reported in the configured unit set
- Any auxiliary variables your deployment returns for flash convergence and balances