# Precipitation point flash

This function calculates the equilibrium solution at the precipitation point of a specified solid species by varying one inflow species.

## precipitation point

<mark style="color:green;">`POST`</mark> `https://api.olisystems.com/engine/flash/{dbs_file_id}/precipitation-point`

determine the minimum amount of an inflow species required to precipitate a solid

#### Headers

| Name          | Type   | Description            |
| ------------- | ------ | ---------------------- |
| Authorization | string | Bearer {access\_token} |
| Content-Type  | string | application/json       |

{% tabs %}
{% tab title="200 Please look at "API call blueprint" page on how to obtain results" %}

```
{
	"code": 200,
	"data": {
		"file_id": "dee854a6-59db-487d-ad08-a20dee691133",
		"jobId": "f6b3375e-cd0f-4ace-a5ee-71e047b76754",
		"resultsLink": "https://devapi.olisystems.com/result/flash/f6b3375e-cd0f-4ace-a5ee-71e047b76754?context=engine",
		"status": "IN PROGRESS"
	},
	"message": "Process execution started Successfully",
	"status": "SUCCESS"
}
```

{% endtab %}
{% endtabs %}

### Request payload

```javascript
{
    "params": {
        "temperature": {
            "value": 30.0,
            "unit": "°C"
        },
        "pressure": {
            "value": 1.5,
            "unit": "atm"
        },
        "solidToPrecipitate": "NACLPPT",
        "inflowToAdjust": "NACL",
        "inflows": {
            "unit": "mol",
            "values": {
                "H2O": 50.0,
                "CO2": 10.0,
                "NACL": 0.0,
                "BENZENE": 10.0
            }
        }
    }
}
```

| **params**         | type                                | description                                                                                |
| ------------------ | ----------------------------------- | ------------------------------------------------------------------------------------------ |
| temperature        | [valueObject](/terms-definition.md) | specified or initial guess temperature with unit                                           |
| pressure           | [valueObject](/terms-definition.md) | specified or initial guess pressure with unit                                              |
| solidToPrecipitate | string                              | specified **solid species** at precipitation point                                         |
| inflowToAdjust     | string                              | **inflow species** whose amount is to be adjusted to achieve precipitation point condition |

{% hint style="info" %}
**params.solidToPrecipitate** and **params.inflowToAdjust** are species and inflow names retrieved from the [chemistry information](/group1/api-functions/chemistry-info.md) call, under **result.species(trueName)** and **result.inflows(baseName)** respectively.&#x20;
{% endhint %}

{% 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)

```javascript
{
    "code": 200,
    "data": {
        "result": {
           "calculatedVariables": [
                {
                    "name": "NACL",
                    "type": "inflow",
                    "unit": "mol",
                    "value": 5.531398835682553
                }
            ],
            ...<snip>...
        }
    }, 
    "message": "Results returned successfully", 
    "status": "PROCESSED"
}
```

The output of this calculation is the [stream output ](/stream-output-json.md)which is common result output for all OLI's flash calculations or an [error](/error-output.md). In addition to this output the result also contains the amount of the added  inflow (**params.inflowToAdjust**) can be conveniently retrieved from the **data.result.calculatedVariables** array

| <p>data.result.calculatedVariables</p><p><a href="/pages/-MKpla3yKkV7cet4Iee_"> </a><a href="/pages/-MKpla3yKkV7cet4Iee_">\[ { } ]</a></p> | type   | description                                                  |
| ------------------------------------------------------------------------------------------------------------------------------------------ | ------ | ------------------------------------------------------------ |
| type                                                                                                                                       | string | type of calculated variable, i.e. inflow amount for "inflow" |
| name                                                                                                                                       | string | name of adjusted inflow species                              |
| value                                                                                                                                      | number | the final amount of adjusted inflow                          |
| unit                                                                                                                                       | string | [unit](/input-unit-set.md) of inflow amount                  |

### 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"                     |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devdocs.olisystems.com/group1/api-functions/precipitation-point.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
