Survey calculation

In comparison to single-point calculation, survey calculation allows users to perform a series of calculations by varying one or more input variables.

JSON input (example)

Here two isothermal flash inputs are taken as examples to illustrate the survey calculation input.

{
    "params": {
        "temperature": {
            "value": 30.0,
            "unit": "°C"
        },
        "pressure": {
            "value": 1.5,
            "unit": "atm"
        },
        "inflows": {
            "unit": "mol",
            "values": {
                "H2O": 50.0,
                "NACL": 20.0
            }
        },
        "surveyInputs": [
            {
                "variableField": "/params/temperature/value",
                "values": [30.0, 35.0, 40.0, 45.0, 50.0]
            }
        ],
        "surveyOutputsByField": [
            {
                "field": "/solid/trueConcentration/values/NACL",
                "defaultValue": 0
            }
        ]
    }
}

params.surveyInputs[ { } ]

type

description

variableField

string

JSON pointer to the survey variable in input schema

values

array of numbers

series of survey variable values for calculation

The survey calculation runs the series of input JSON by overwriting the survey variable values.

When an input variable is specified as a survey variable, e.g. "/params/temperature/value", the source input JSON field, params.temperature.value, is optional as it will be overwritten by the survey calculation inputs. However, params.temperature.unit is still required.

When multiple survey variables are specified, the values in each params.surveyInputs[{}].values array are updated simultaneously. When the arrays are specified in different sizes, the last value of the shorter array(s) will be used to run the survey calculation until the longest array is completed.

Specific stream output can be shown in an array for user's convinience.

params.surveyOutputsByField

type

description

field

string

JSON pointer to the stream output of interest in the survey calculation

defaultValue

number

optional, default value if specified field in stream output does not exist in specific point

Response (status = PROCESSED)

{
    "code": 200,
    "result": {
        "surveyOutputs": [
            {
                "phases": {...<snip>...},
                "phaseSummary": [...<snip>...],
                "total": {...<snip>...}
            },
            {...<snip>...},
            {...<snip>...},
            {...<snip>...}
        ]
    },
    "surveyOutputsByField": [
    {
        "field": "/solid/trueConcentration/values/NACL",
        "results": [0.0, 1.35, 1.51, 1.7],
        "presence": [true, true, true, true]
    }],
    "message": "Results returned successfully", 
    "status": "PROCESSED"
}

result.surveyOutputs list an array of objects as the full stream output of each survey calculation result. result.surveyOutputsByField lists the specific output in one array along the survey calculations.

result.surveyOutputsByField[{}]

type

description

field

string

JSON pointer to the stream output of interest in the survey calculation, as specified in input

results

array of numbers

specific values in the stream outputs along the survey calculations

presence

array of boolean

presence of the specific output. False if the individual calculation inside the survey did not converge. Also false if the specific field does not exist in stream output, unless the "defaultValue" is provided in survey inputs.

Last updated