MAIA bb96820c
Multiphysics at AIA
|
In this tutorial you will learn how to run a two-dimensional Reynolds-Averaged-Navier-Stokes simulation (2D RANS) of the (unactuated) flat plate using the 2D structured grid created in the previous tutorial. For more details about the numerical methods, please refer to the following sections on the structured grid and the structured finite volume solver.
The figure below provides an overview of the unactuated flat plate used for the 2D RANS. More information about the numerical setup and methods can be found in this paper [Albers2020].
This tutorial is split into two parts, one for runnning the 2D RANS and one for post-processing the simulations results with focus on the skin friction coefficient.
Download and unzip this tutorial here and change the directory to the 2D RANS folder 2_rans
:
Create symbolic links to the compiled MAIA executable (if not already, please refer to the setup tutorial), the 2D RANS grid created in the previous tutorial and to the Python files which are needed to plot/analyze the convergence and to reset/clear the tutorial for the next test run. The last mentioned files are located one level up in the tools
folder:
Test if MAIA is correctly linked by opening MAIA's help:
Open and have a look at the properties_run_rans.toml
file, which contains the settings used for running the 2D RANS with the structured grid:
Porperty | Explanation |
---|---|
Ma | Mach number |
Re | momentum thickness based Reynolds number \( \mathrm{Re}_{\theta} = u_{\infty} \theta / \nu \) at \( x_0 \) |
gridInputFileName | Structured grid file used for the 2D RANS, like "./grid_rans.hdf5" |
solutionOutput | Output directory for solution files, like "./out/" |
restartVariablesFileName | Name of the restart file to restart/continue the simulation, like "./restart_rans.hdf5" |
timeSteps | Final number of timesteps to simulate, e.g., 20000 |
solutionInterval | Output interval in timesteps resp. interval after which the solutions are saved every time, e.g., 10000 |
rescalingBLT | Rescaling factor concerning the boundary layer theory, delta99 at the inflow |
fullRANS | Boolean for using RANS, i.e., true |
ransMethod | RANS method, e.g., "RANS_SA_DV" for the Spalart-Allmaras turbulence model??? |
solvertype.0 | Solver part of MAIA, e.g., "MAIA_STRUCTURED" for the structured finite volume solver |
Run the 2D RANS in sequence with the following command:
Tip: Allocate some computational resources for running the 2D RANS. By utilizing OpenMPI you can run the simulation in parallel using noCores
processors:
The print message on the console should look like this:
Running the simulation results in the following files:
File(s) | Explanation |
---|---|
2_rans/out/SomeTimestep.hdf5 | Solution files for predefined timestep intervals, like 10000.hdf5 |
2_rans/out/auxData20000.hdf5 | Auxiliary solution files for the final timestep. Purpose??? |
2_rans/maia_log | Log file containing information of how the simulation has run |
2_rans/Residual | Residuals of the simulation for every timestep |
2_rans/theta_inflow.dat | Momentum-based boundary layer thickness \( \delta_2 = \theta \) at \( x_0 = 0 \) for every timestep |
Check if the solution is converged and if \( \delta_2 (x_0 = 0) = \theta (x_0 = 0) = 1 \), i.e., ThetaInflow = d2(x=0) = 1
:
The momentum-based boundary layer thickness \( \delta_2 (x_0 = 0) = \theta (x_0 = 0) \) at the inflow \( x_0 = 0 \) against the number of timesteps should look like this:
The residuals against the number of timesteps should look like this:
If not converged rerun/continue the RANS with a larger number of timesteps in properties_run_rans.toml
:
Rerun the RANS:
Open properties_run_rans.toml
, increase the number of timesteps denoted as the porperty timeSteps
, save it and jump to step 4.
Restart/Continue from the current RANS: How to continue??? Do we even need to show that??? Currently no restart file created/used!
If not d2(x=0)=1 adjust rescalingBLT
parameter in properties_run_rans.toml
and rerun the 2D RANS until ThetaInflow = d2(x=0) = 1
. This condition must be meet to achieve the desired and predefined Reynolds number. The following rule of thumb can be used to select the new rescaling factor based on the previous/old converged ThetaInflow
:
Condition to meet:
Resulting rule of thumb to select the new rescaling factor rescalingBLT_new
:
Rerun the RANS:
Open properties_run_rans.toml
, change the boundary layer rescaling factor denoted as the porperty rescalingBLT
to the value of the newly computed rescalingBLT_new
, save it and jump to step 4.
Check plausibility of the flow:
Check the last hdf5-solution file LastTimestep.hdf5
, e.g., 20000.hdf5
, with HDFView
The hdf5-solution file should look like this:
or with ParaView
The hdf5-solution file should look like this when using the \( u \) velocity component and the visualization as a surface:
Download and unzip bltools.py
in the tools
folder: Currently, bltools.py
and the corresponding post-processing scripts are located in tools
. Where to get the newest version of bltools.py
: https://git.rwth-aachen.de/aia/MAIA/tools/-/tree/master/postprocessing/structured/blpp
Change the directory to the post-processing folder post
and create symbolic links to the post-processing scripts in the tools
folder. Currently the data
is not created automatically, therefore it has to be created by the user with mkdir data
:
Run the post-processing evaluation file eval_rans.py
, for example to calculate the streamwise skin friction coefficient \( c_{f,x} = \frac{ 2 \tau_{\mathrm{wall}} }{ \rho_{\infty} v^2_{\infty} }\) (local drag coefficient):
The print message on the console should look like this:
The resulting files are:
File(s) | Explanation |
---|---|
2_rans/post/data/bl_reference.dat | Boundary layer reference data |
2_rans/post/data/profile_reference_iposNum.dat | Post-processing results at certain i-positions |
bl_reference.npz
contains the same information as the bl_reference.dat
, but consisting of multiple zipped npy
-files tailored to the use of Python.
Visualize the drag coefficient and check if the 2D RANS results are porper to use for the next tutorial dealing with the Synthetic Turbulence Generation (STG):
What means proper (comparison with the empirical law) and why 95% of the empirical law? And where does the empirical formula come from?
Check the evolution of the grid resolution along the streamwise direction:
The resulting plot should look like this: