# Add Kinetics

Kinetic reactions and their rate constants can be incorporated into the chemistry file using the "kinetics" field. The OLI Engine supports two types of kinetics: Arrhenius and user-defined. These are derived from the Reaction Kinetics (section 1.11) and Non-standard Rate Law (section 1.11.2) in the OLI Studio user manual.&#x20;

Below is a sample code featuring kinetics.

```json
{
  "params": {
    "thermodynamicFramework": "MSE (H3O+ ion)",
    "modelName": "testModel",
    "phases": [
      "liquid1",
      "vapor",
      "solid",
      "liquid2"
    ],
    "inflows": [
      {
        "name": "H2O"
      },
      {
        "name": "NACL"
      },
      {
        "name": "UREA"
      },
      {
        "name": "NH3"
      },
      {
        "name": "CO2"
      },
      {
        "name": "CACO3"
      },
      {
        "name": "Benzene"
      },
      {
        "name": "Ethanol"
      }
    ],
    "kinetics": {
      "enabled": true,
      "data": [
        {
          "enabled": true,
          "reaction": "2NH3AQ+CO2AQ=UREAAQ+H2O",
          "rateSpecification": "Arrhenius",
          "comment": "decide rate type names std/arrhenious vs user-defined/spec",
          "rateData": [
            {
              "name": "KF",
              "value": 2000.0,
              "enabled": true
            },
            {
              "name": "AR",
              "value": 1.2e-4,
              "enabled": true
            },
            {
              "name": "BR",
              "value": 3480.78
            },
            {
              "name": "ER1",
              "value": 2.0
            },
            {
              "name": "ER2",
              "value": 1.0
            },
            {
              "name": "EP1",
              "value": 1.0
            },
            {
              "name": "EP2",
              "value": 0.0
            }
          ]
        },
        {
          "enabled": true,
          "reaction": "NH3AQ+H2O=NH4ION+OHION",
          "rateSpecification": "user-defined",
          "comment": "decide rate type names std/arrhenious vs user-defined/spec",
          "rateData": [
            {
              "name": "FXRATE",
              "value": "LNH3AQ+ANH3AQ+LH2O+AH2O",
              "enabled": true
            },
            {
              "name": "RXRATE",
              "value": "LNH4ION+ANH4ION+LOHION+AOHION",
              "enabled": true
            },
            {
              "name": "KF1",
              "value": 3.0,
              "enabled": true
            },
            {
              "name": "KR1",
              "value": "KF1/KEQ",
              "enabled": true
            }
          ],
          "rate": "(KF1*EXP(FXRATE)-KR1*EXP(RXRATE))*VOLLIQ/1000"
        }
      ]
    }
  }
}
```

{% hint style="info" %}
Kinetics is an optional field for generating .dbs files.
{% endhint %}

The "`data`" JSON object is always required when utilizing kinetics.&#x20;

| kinetics |    always required   | type        |
| -------- | :------------------: | ----------- |
| data     | :heavy\_check\_mark: | JSON Object |

Within "`data`" object, the following input fields must be included.

| data              |    always required   | type                 |
| ----------------- | :------------------: | -------------------- |
| reaction          | :heavy\_check\_mark: | String               |
| rateSpecification | :heavy\_check\_mark: | String               |
| rateData          | :heavy\_check\_mark: | Array of JSON Object |

{% hint style="info" %}
Please refer to section 1.11, "Reaction Kinetics," and section 1.11.2, "Non-standard Rate Law," in the OLI Studio manual for more information on reactions and user-defined equations.
{% endhint %}

{% hint style="info" %}
Refer to [kinetics-query](https://devdocs.olisystems.com/chemistry-model-files/chembuilder-api/chembuilder-query/kinetics-query "mention") for information on species and equilibrium reactions.
{% endhint %}

{% hint style="info" %}
In the "rateSpecification", either "Arrhenius" for standard rate law or "user-defined" for non-standard rate law is required.
{% endhint %}

{% hint style="info" %}
Kinetics and its internal JSON objects can be enabled or disabled using [enabled-keyword](https://devdocs.olisystems.com/chemistry-model-files/chembuilder-api/supporting-information-for-chembuilder/enabled-keyword "mention").
{% endhint %}
