# Field3D.compute\_mixing\_timescale

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

### **Field3D.**<mark style="color:red;">compute\_mixing\_timescale</mark>(self, mode='Kolmo'):

***

### Description

Computes the mixing timescale for the field, useful for turbulence modeling.

This method calculates the mixing timescale using either the Kolmogorov model or the integral length scale model. The computation relies on residual kinetic energy and residual dissipation rate fields.

### Parameters

* `mode` (str, optional): The mode of timescale computation. Valid options are 'Kolmo' (Kolmogorov) or 'Int' (Integral length scale). Default is 'Kolmo'.

### Raises

* `ValueError`: If the specified mode is not valid.
* `Warning`: If the 'C\_mix' attribute is not defined for the integral length scale model.

### Workflow

1. **Validation**
   * Checks if `mode` is valid.
2. **Mode: 'Kolmo'**
   * Computes the Kolmogorov timescale: \[ \tau\_m^{Kolmo} = \sqrt{\frac{k\_r}{\epsilon\_r} \sqrt{\frac{\mu}{\rho \epsilon\_r}}} ]
   * Saves the computed timescale to a file.
3. **Mode: 'Int'**
   * Ensures `C_mix` is defined, initializes to 0.1 if not.
   * Computes the integral length scale timescale: \[ \tau\_m^{Int} = \frac{C\_{mix} k\_r}{\epsilon\_r} ]
   * Saves the computed timescale and `C_mix` value to files.

### Returns

None

### Example

```python
>>> field = Field3D('your_folder_path')
>>> field.compute_mixing_timescale(mode='Kolmo')
```
