How to Calculate Turbulent Kinetic Energy in Openfoam: Step-by-step Guide

Calculating turbulent kinetic energy (TKE) in OpenFOAM involves setting up the simulation correctly and extracting the relevant data. This guide provides a step-by-step process to help users accurately determine TKE within their computational models.

Setting Up the Simulation

Begin by choosing an appropriate turbulence model, such as k-ε or k-ω, which directly provide TKE as part of their variables. Ensure your case includes the necessary initial and boundary conditions for turbulence quantities.

Configure the solver settings in the control dictionary to include turbulence modeling. For example, in the constant/turbulenceProperties file, specify the turbulence model and related parameters.

Running the Simulation

Execute the simulation using the appropriate solver, such as simpleFoam or pisoFoam. Monitor the convergence to ensure the solution reaches a steady or transient state as required.

Extracting Turbulent Kinetic Energy Data

After the simulation completes, access the output data. TKE is typically stored in the postProcessing directory if you have set up probes or function objects to record it. Alternatively, extract TKE directly from the field files.

Use OpenFOAM utilities like foamDataToDict or custom scripts to read the TKE values from the output files. The TKE is usually stored under the variable k.

Calculating TKE

To calculate the TKE at a specific point or region, use the formula:

TKE = 0.5 * (u’^2 + v’^2 + w’^2)

In OpenFOAM, the variable k directly represents this value. Confirm that the data corresponds to the turbulence kinetic energy for your region of interest.

Summary

Calculating TKE in OpenFOAM involves selecting the right turbulence model, running the simulation, and extracting the variable k. Proper setup and data extraction are essential for accurate results.