# kth-nek5000/deepturbulence architecture

> Architecture diagram of the GitHub repository kth-nek5000/deepturbulence, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kth-nek5000/deepturbulence
- Repository: https://github.com/kth-nek5000/deepturbulence

## Overview

This repository generates time series from the nine-equation Moehlis wall-turbulence model, trains MLP or LSTM predictors, and applies trained models to test series. The README also documents amplitude plotting and flow-field visualization. MATLAB source excerpts were not provided, so the documented generation and visualization roles are shown without inferring internal calls; training and prediction links follow the sampled Python code.

Main entry points: [`Neural networks models/trained_nn_models`](https://github.com/kth-nek5000/deepturbulence/tree/master/Neural%20networks%20models/trained_nn_models) (Trained models), [`Neural networks models/predict_using_mlp.py`](https://github.com/kth-nek5000/deepturbulence/blob/master/Neural%20networks%20models/predict_using_mlp.py) (MLP prediction), [`Neural networks models/predict_using_lstm.py`](https://github.com/kth-nek5000/deepturbulence/blob/master/Neural%20networks%20models/predict_using_lstm.py) (LSTM prediction), [`Data generator (Moehlis model)/moehlis_model_script.m`](https://github.com/kth-nek5000/deepturbulence/blob/master/Data%20generator%20(Moehlis%20model)/moehlis_model_script.m) (Generate series)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Data generation"]
  node_single_series["Generate series"]
  node_odefun["Moehlis ODE"]
  node_dataset_gen["Batch generation<br/>[moehlis_data_gen.m]"]
end

subgraph group_training["Model training"]
  node_mlp_train["Train MLP<br/>[train_mlp_model.py]"]
  node_lstm_train["Train LSTM"]
  node_trained_models[("Trained models")]
end

subgraph group_prediction["Prediction"]
  node_mlp_predict["MLP prediction"]
  node_lstm_predict["LSTM prediction"]
end

subgraph group_inspection["Data inspection"]
  node_plot_amplitudes["Plot amplitudes<br/>[plot_amplitudes.m]"]
  node_visualize_fields["Visualize flow<br/>[visualize_fields.m]"]
end

node_researcher(("Researcher"))
node_training_data["Time-series data"]
node_test_data["Test series"]
node_prediction_results["Predicted series"]

node_researcher -->|"runs"| node_single_series
node_researcher -->|"runs"| node_dataset_gen
node_single_series -->|"generates"| node_training_data
node_dataset_gen -->|"gathers series"| node_training_data
node_training_data -->|"loads"| node_mlp_train
node_training_data -->|"loads"| node_lstm_train
node_mlp_train -->|"saves model"| node_trained_models
node_lstm_train -->|"saves model"| node_trained_models
node_test_data -->|"loads"| node_mlp_predict
node_test_data -->|"loads"| node_lstm_predict
node_trained_models -->|"loads model"| node_mlp_predict
node_trained_models -->|"loads model"| node_lstm_predict
node_mlp_predict -->|"saves predictions"| node_prediction_results
node_lstm_predict -->|"saves predictions"| node_prediction_results
node_researcher -->|"runs"| node_plot_amplitudes
node_researcher -->|"runs"| node_visualize_fields

click node_single_series "https://github.com/kth-nek5000/deepturbulence/blob/master/Data%20generator%20(Moehlis%20model)/moehlis_model_script.m"
click node_odefun "https://github.com/kth-nek5000/deepturbulence/blob/master/Data%20generator%20(Moehlis%20model)/moehlis_model_odefun.m"
click node_dataset_gen "https://github.com/kth-nek5000/deepturbulence/blob/master/Data%20generator%20(Moehlis%20model)/moehlis_data_gen.m"
click node_mlp_train "https://github.com/kth-nek5000/deepturbulence/blob/master/Neural%20networks%20models/train_mlp_model.py"
click node_lstm_train "https://github.com/kth-nek5000/deepturbulence/blob/master/Neural%20networks%20models/train_lstm_model.py"
click node_trained_models "https://github.com/kth-nek5000/deepturbulence/tree/master/Neural%20networks%20models/trained_nn_models"
click node_mlp_predict "https://github.com/kth-nek5000/deepturbulence/blob/master/Neural%20networks%20models/predict_using_mlp.py"
click node_lstm_predict "https://github.com/kth-nek5000/deepturbulence/blob/master/Neural%20networks%20models/predict_using_lstm.py"
click node_plot_amplitudes "https://github.com/kth-nek5000/deepturbulence/blob/master/Data%20generator%20(Moehlis%20model)/plot_amplitudes.m"
click node_visualize_fields "https://github.com/kth-nek5000/deepturbulence/blob/master/Data%20generator%20(Moehlis%20model)/visualize_fields.m"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_single_series,node_odefun,node_dataset_gen toneBlue
class node_mlp_train,node_lstm_train,node_trained_models toneAmber
class node_mlp_predict,node_lstm_predict toneMint
class node_plot_amplitudes,node_visualize_fields toneRose
class node_researcher,node_training_data,node_test_data,node_prediction_results toneIndigo
```

## Components

### Data generation

- [Generate series](https://github.com/kth-nek5000/deepturbulence/blob/master/Data%20generator%20(Moehlis%20model)/moehlis_model_script.m): `Data generator (Moehlis model)/moehlis_model_script.m`
- [Moehlis ODE](https://github.com/kth-nek5000/deepturbulence/blob/master/Data%20generator%20(Moehlis%20model)/moehlis_model_odefun.m): `Data generator (Moehlis model)/moehlis_model_odefun.m`
- [Batch generation](https://github.com/kth-nek5000/deepturbulence/blob/master/Data%20generator%20(Moehlis%20model)/moehlis_data_gen.m): `Data generator (Moehlis model)/moehlis_data_gen.m`

### Model training

- [Train MLP](https://github.com/kth-nek5000/deepturbulence/blob/master/Neural%20networks%20models/train_mlp_model.py): `Neural networks models/train_mlp_model.py`
- [Train LSTM](https://github.com/kth-nek5000/deepturbulence/blob/master/Neural%20networks%20models/train_lstm_model.py): `Neural networks models/train_lstm_model.py`
- [Trained models](https://github.com/kth-nek5000/deepturbulence/tree/master/Neural%20networks%20models/trained_nn_models): `Neural networks models/trained_nn_models`

### Prediction

- [MLP prediction](https://github.com/kth-nek5000/deepturbulence/blob/master/Neural%20networks%20models/predict_using_mlp.py): `Neural networks models/predict_using_mlp.py`
- [LSTM prediction](https://github.com/kth-nek5000/deepturbulence/blob/master/Neural%20networks%20models/predict_using_lstm.py): `Neural networks models/predict_using_lstm.py`

### Data inspection

- [Plot amplitudes](https://github.com/kth-nek5000/deepturbulence/blob/master/Data%20generator%20(Moehlis%20model)/plot_amplitudes.m): `Data generator (Moehlis model)/plot_amplitudes.m`
- [Visualize flow](https://github.com/kth-nek5000/deepturbulence/blob/master/Data%20generator%20(Moehlis%20model)/visualize_fields.m): `Data generator (Moehlis model)/visualize_fields.m`

### Other components

- **Researcher**
- **Time-series data**
- **Test series**
- **Predicted series**

## Connections

- Researcher → Generate series: runs
- Researcher → Batch generation: runs
- Generate series → Time-series data: generates
- Batch generation → Time-series data: gathers series
- Time-series data → Train MLP: loads
- Time-series data → Train LSTM: loads
- Train MLP → Trained models: saves model
- Train LSTM → Trained models: saves model
- Test series → MLP prediction: loads
- Test series → LSTM prediction: loads
- Trained models → MLP prediction: loads model
- Trained models → LSTM prediction: loads model
- MLP prediction → Predicted series: saves predictions
- LSTM prediction → Predicted series: saves predictions
- Researcher → Plot amplitudes: runs
- Researcher → Visualize flow: runs
