> For the complete documentation index, see [llms.txt](https://devdocs.olisystems.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devdocs.olisystems.com/oli-scalechem-api/main-methods/scale-scenario.md).

# Scale scenario

### Request payload

```json
{
    "method": "scalechem.mixerCalculation",
    "params": {
        "name": "mixer",
        "chemistryModel": "mixerChemistry",
        "externalStreams": [...<snip>...],
        "inletInputs": [...<snip>...],
        "scenarios": [...<snip>...]
    }
}
```

| **params**      | type             | description                                                                                                           |
| --------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------- |
| name            | string           | name of output stream                                                                                                 |
| chemistryModel  | string           | [chemistry model file (dbs) name](/oli-scalechem-api/main-methods.md#chemistry-model) for scale scenario calculations |
| externalStreams | array of objects | [inputs for external streams](#external-streams)                                                                      |
| inletInputs     | array of objects | [flow rate specifications for mixer inlet streams](#undefined)                                                        |
| scenarios       | array of objects | [scale scenario specification](#undefined)                                                                            |

After combining all inlet streams, this calculation performs a series of calculations in the locations specified as below, where the outlet of each location is passed as the inlet to the next location.

### Scale scenario inputs

```json
{
    "method": "scalechem.mixerCalculation",
    "params": {
        ...<snip>...,
        "scenarios": [
        {
            "location": "Stock tank",
            "temperature": {
                "unit": "°C",
                "value": 20
            },
            "pressure": {
                "unit": "bar",
                "value": 2
            }
        },
        {
            "location": "Stock tank",
            "temperature": {
                "unit": "°C",
                "value": 15
            },
            "pressure": {
                "unit": "bar",
                "value": 1.5
            },
            "dropSolids": true
        },
        ...<snip>...
        ]
    }
}
```

|                           |                                     |                                                                                                                                |
| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| **params.scenarios\[{}]** | type                                | description                                                                                                                    |
| location                  | string                              | location name                                                                                                                  |
| temperature               | [valueObject](/terms-definition.md) | specified temperature with [unit](/input-unit-set.md)                                                                          |
| pressure                  | [valueObject](/terms-definition.md) | specified pressure with [unit](/input-unit-set.md)                                                                             |
| dropSolids                | boolean                             | optional. If specified as true, all solids in the outlet are removed when passing as inlet to next location. Default is false. |

### Additional input

{% hint style="info" %}
In addition to the inputs shown above, some optional properties may also be specified. They can be viewed [here](/optional-inputs.md).
{% endhint %}

### Response (status = PROCESSED)

```json
{
    "code": 200,
    "result": {
       "external stream 1": {...<snip>...},
       "external stream 2": {...<snip>...},
       ...<snip>...,
       "scenarioOutputs": [
       {
          "location": "Stock tank", 
          "result": {...<snip>...}
       },
       ...<snip>...
       ]
    },
    "message": "Results returned successfully", 
    "status": "PROCESSED"
}
```

The "result" contains all [stream outputs ](/stream-output-json.md)for each external stream. Results of each location are listed as an array of objects in **result.scenarioOutputs**, with location and result of corresponding [stream output](/stream-output-json.md).

by their names specified in the input.

### Survey Calculation

Survey calculation is supported for the variables below. Please refer to [Survey calculation](/survey-calculation.md) for explained input schema.

| supported **params.surveyInputs\[{}].field**                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------------------- |
| "/params/temperature/value"                                                                                                         |
| "/params/pressure/value"                                                                                                            |
| "/params/inletInputs/***i***/totalAmount/value" where ***i*** is the index (0 based) of the **params.inletInputs** array of objects |
| "/params/scenarios/***i***/temperature/value" where ***i*** is the index (0 based) of the **params.scenarios** array of objects     |
| "/params/scenarios/***i***/pressure/value" where ***i*** is the index (0 based) of the **params.scenarios** array of objects        |
