# Field3D.compute\_reaction\_rates\_batch

[![badge](https://img.shields.io/badge/Source%20Code-06D40C?style=plastic)](https://github.com/LorenzoPiu/aPriori/blob/main/src/aPriori/DNS.py#L901-L1064)

### **Field3D.**<mark style="color:red;">compute\_reaction\_rates\_batch</mark>(self, n\_chunks = 5000, tau\_c='SFR', tau\_m='Kolmo'):

***

### Description

Computes the reaction rates in batches for a filtered field.

This method calculates reaction rates in chunks for a filtered field, suitable for large datasets. The reaction rates can be computed in different modes specified by `tau_c` and `tau_m`.

### Parameters

* `n_chunks` (int, optional): Number of chunks to divide the field into for batch processing. Default is 5000.
* `tau_c` (str, optional): Mode for computing the chemical timescale. Default is 'SFR'.
* `tau_m` (str, optional): Mode for computing the mixing timescale. Default is 'Kolmo'.

### Raises

* `ValueError`: If the field is not filtered or if the species' molar concentrations and reaction rates are not in the data folder.
* `AttributeError`: If required attributes (`attr_list`, `bool_list`, `folder_path`) are not defined.

### Workflow

1. **Validation**:
   * Ensures all mass fractions are in the folder.
   * Confirms the field is filtered and sets the mode to 'Batch'.
2. **Paths Preparation**:
   * Builds lists for reaction rates paths and species' mass fractions paths.
   * Checks if the reaction rates files already exist and prompts the user for confirmation to overwrite them.
3. **Reaction Rates Computation**:
   * Initializes chunk generators for temperature, pressure, density, and timescales.
   * Computes reaction rates and heat release rates in chunks using the Cantera library.
   * Saves computed chunks to respective files.

### Returns

None

### Example

```python
>>> field = Field3D('your_folder_path')
>>> field.compute_reaction_rates_batch(n_chunks=5000, tau_c='SFR', tau_m='Kolmo')
```
