From af1dcb06bda6cadbefba5cc9bd9954ad13e64b4d Mon Sep 17 00:00:00 2001 From: bmunguia Date: Thu, 10 Jul 2025 10:16:32 -0700 Subject: [PATCH 1/2] Update meson build instructions to include setup command --- _docs_v7/Build-SU2-Linux-MacOS.md | 46 ++++++++++--------- _docs_v7/Execution.md | 4 +- _docs_v7/Running-Unit-Tests.md | 12 ++--- .../Inc_Turbulent_Bend_Opt.md | 32 ++++++------- 4 files changed, 48 insertions(+), 46 deletions(-) diff --git a/_docs_v7/Build-SU2-Linux-MacOS.md b/_docs_v7/Build-SU2-Linux-MacOS.md index 25e133a6..1c179e37 100644 --- a/_docs_v7/Build-SU2-Linux-MacOS.md +++ b/_docs_v7/Build-SU2-Linux-MacOS.md @@ -47,7 +47,7 @@ Short summary of the minimal requirements: If you have these tools installed, you can create a configuration using the `meson.py` found in the root source code folder: ``` -./meson.py build +./meson.py setup build ``` Use `ninja` to compile and install the code @@ -62,10 +62,10 @@ Use `ninja` to compile and install the code ### Compilers ### Installing SU2 from source requires a C++ compiler. The GNU compilers (gcc/g++) are open-source, widely used, and reliable for building SU2. The Intel compiler set has been optimized to run on Intel hardware and has also been used successfully by the development team to build the source code, though it is commercially licensed. The Apple LLVM compiler (Clang) is also commonly used by the developers. -- GNU gcc / g++ -- Intel icc / icpc +- GNU gcc / g++ +- Intel icc / icpc - Apple LLVM (clang) - + **Note**: SU2 uses some C++11 features, that means at least GCC >= v4.7, Clang >= v3.0 or Intel C++ >= v12.0 is necessary. ### MPI ### @@ -76,7 +76,7 @@ It is possible to force the MPI mode with the meson option `-Dcustom-mpi=true`, ### Python ### -SU2 requires Python 3 for compilation and for running the python scripts. Make sure that you have properly set up the `python3` executables in your environment. +SU2 requires Python 3 for compilation and for running the python scripts. Make sure that you have properly set up the `python3` executables in your environment. ### Optional: swig and mpi4py ### If you want to use the python wrapper capabilities, also `swig` and `mpi4py` are required. On **Linux** `swig` should be available in the package manager of your distribution and `mpi4py` can be installed using [pip](https://pip.pypa.io/en/stable/). @@ -89,37 +89,39 @@ Install mpi4py with Python pip using easy install: $ easy_install pip $ pip install mpi4py - + --- ## Automatically installed dependencies ## -The following dependencies are automatically downloaded (or initialized if source code was cloned using `git`) during the [configuration](#configuration-and-compilation). +The following dependencies are automatically downloaded (or initialized if source code was cloned using `git`) during the [configuration](#configuration-and-compilation). ### Meson and Ninja ### -The build system of SU2 is based on a combination of [meson](http://mesonbuild.com/) (as the front-end) and [ninja](https://ninja-build.org/) (as the back-end). Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible. Ninja is a small low-level build system with a focus on speed. +The build system of SU2 is based on a combination of [meson](http://mesonbuild.com/) (as the front-end) and [ninja](https://ninja-build.org/) (as the back-end). Meson is an open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible. Ninja is a small low-level build system with a focus on speed. ### CoDiPack and MeDiPack ### -In order to use the discrete adjoint solver the compilation requires two additional (header-only) libraries. [CoDi](https://github.com/SciCompKL/CoDiPack) provides the AD datatype and [MeDi](https://github.com/SciCompKL/MeDiPack) provides the infrastructure for the MPI communication when the reverse mode of AD is used. +In order to use the discrete adjoint solver the compilation requires two additional (header-only) libraries. [CoDi](https://github.com/SciCompKL/CoDiPack) provides the AD datatype and [MeDi](https://github.com/SciCompKL/MeDiPack) provides the infrastructure for the MPI communication when the reverse mode of AD is used. ---- +--- ## Configuration and Compilation ## -Like mentioned above, SU2 uses meson and ninja for configuration and compilation, respectively. A configuration using meson is generated first and then an invocation of ninja is used to compile SU2 with this configuration. +Like mentioned above, SU2 uses meson and ninja for configuration and compilation, respectively. A configuration using meson is generated first and then an invocation of ninja is used to compile SU2 with this configuration. ### Basic Configuration ### -In the root folder of the sources you will find a python script called `meson.py`. This script generates a configuration. It will also check whether all dependencies are found and downloads some of them if necessary see [previous section](#automatically-installed-dependencies). +In the root folder of the sources you will find a python script called `meson.py`. This script generates a configuration. It will also check whether all dependencies are found and downloads some of them if necessary see [previous section](#automatically-installed-dependencies). **Note**: For the following steps you can also use preinstalled versions of `meson` and `ninja` available on your machine. Just replace the `./meson.py` and `./ninja` calls with the binaries of the respective installations. However, this way you have to manually make sure that the correct versions of [CoDiPack and MeDiPack](#codipack-and-medipack) are placed in the `externals/` folders. -The only required argument for `meson.py` is a name of a directory where it should store the configuration. You can have multiple configurations in different folders next to each other. To generate a basic configuration that will be stored in the folder `build` use +A configuration can be generated using `meson.py setup [builddir] [options]`, where the only required argument is `[builddir]`. For example, to generate a basic configuration that will be stored in the folder `build`, use ``` - ./meson.py build + ./meson.py setup build ``` +You can have multiple configurations in different folders next to each other. + Options can be passed to the script to enable or disable different features of SU2. Below you find a list of project options and their default values: - + | Option | Default value | Description | |---| --- | --- | | `-Denable-autodiff` | `false` | enable AD (reverse) support (needed for discrete adjoint solver) | @@ -127,7 +129,7 @@ Options can be passed to the script to enable or disable different features of S | `-Denable-pywrapper` | `false` | enable Python wrapper support| | `-Dwith-mpi` | `auto` | Set dependency mode for MPI (`auto`,`enabled`,`disabled`) | | `-Dwith-omp` | `false` | enable MPI+Threads support (experimental) | -| `-Denable-cgns` | `true` | enable CGNS support | +| `-Denable-cgns` | `true` | enable CGNS support | | `-Denable-tecio` | `true` | enable TECIO support | | `-Denable-mkl` | `false` | enable Intel MKL support | | `-Denable-openblas` | `false` | enable OpenBLAS support | @@ -139,20 +141,20 @@ Options can be passed to the script to enable or disable different features of S For example to enable AD support pass the option to the `meson.py` script along with a value: ``` -./meson.py build -Denable-autodiff=true +./meson.py setup build -Denable-autodiff=true ``` To set a installation directory for the binaries and python scripts, use the `--prefix` option, e.g.: ``` -./meson.py build -Denable-autodiff=true --prefix=/home/username/SU2 +./meson.py setup build -Denable-autodiff=true --prefix=/home/username/SU2 ``` If you are not interested in setting custom compiler flags and other options you can now go directly to the [Compilation](#compilation) section, otherwise continue reading the next section. ### Advanced Configuration ### -In general meson appends flags set with the environment variable `CXXFLAGS`. It is however recommended to use +In general meson appends flags set with the environment variable `CXXFLAGS`. It is however recommended to use mesons built-in options to set debug mode, warning levels and optimizations. All options can be found [here](https://mesonbuild.com/Builtin-options.html) or by using `./meson.py configure`. An already created configuration can be modified by using the `--reconfigure` flag, e.g.: ``` -./meson.py build --reconfigure --buildtype=debug +./meson.py setup build --reconfigure --buildtype=debug ``` Note that it is only possible to change one option at once. @@ -196,7 +198,7 @@ Profiling allows developers to identify inefficiencies in their code. SU2 can be /path/to/binary/SU2_CFD config.cfg ``` -After completion, a file called `gmon.out` is generated in your current working directory, indicating that the profiling was successful. In order to compile the analysis, run the command +After completion, a file called `gmon.out` is generated in your current working directory, indicating that the profiling was successful. In order to compile the analysis, run the command ``` gprof /path/to/binary/SU2_CFD > analysis.txt @@ -206,7 +208,7 @@ Now the file `analysis.txt` contains the profiling analysis summary. For more ad ### Compilation ### -Finally to compile and install SU2 use +Finally to compile and install SU2 use ``` ./ninja -C build install ``` diff --git a/_docs_v7/Execution.md b/_docs_v7/Execution.md index 109a9519..03b1032b 100644 --- a/_docs_v7/Execution.md +++ b/_docs_v7/Execution.md @@ -94,7 +94,7 @@ Options: * `-f FILE, --file=FILE` read config from FILE * `-n PARTITIONS, --partitions=PARTITIONS` number of PARTITIONS * `-s STEP, --step=STEP` finite difference STEP -* `-q QUIET, --quiet=QUIET` if True, output QUIET to log files +* `-q QUIET, --quiet=QUIET` if True, output QUIET to log files ### Shape Optimization Script (shape_optimization.py) @@ -114,7 +114,7 @@ Options: It is possible to call SU2 from python by importing it as a module. The first step is to compile SU2 with python wrapper support. For instance if your SU2 repository is in your home directory at *~/SU2*: -Usage: `$ ./meson.py build -Denable-pywrapper=true --prefix=~/SU2` +Usage: `$ ./meson.py setup build -Denable-pywrapper=true --prefix=~/SU2` The python module will then be available in the installation folder *~/SU2/bin*. To make the SU2 python wrapper available from everywhere in the system, add the installation path to *PYTHONPATH*: diff --git a/_docs_v7/Running-Unit-Tests.md b/_docs_v7/Running-Unit-Tests.md index 764cdd94..85ebfde5 100644 --- a/_docs_v7/Running-Unit-Tests.md +++ b/_docs_v7/Running-Unit-Tests.md @@ -24,19 +24,19 @@ In order to compile the unit tests, add the flag `-Denable-tests=true` to your meson configure call. Then, you can build and run the tests by calling `ninja test`. -## Running Tests +## Running Tests There are three ways to run the main unit tests: -1. `meson test -C builddir`, where `builddir` is the build directory. -2. `ninja test -C builddir`, where `builddir` is the build directory. +1. `meson test -C [builddir]`, where `[builddir]` is the build directory. +2. `ninja test -C [builddir]`, where `[builddir]` is the build directory. 3. `./UnitTests/test_driver` from the SU2 build directory. If you have run `ninja install`, then the `test_driver` executable will also be located in the `bin` directory where you have installed SU2. The first option will call ninja, which will then run the `test_driver` executable. The second option will call the `test_driver` executable. -The last option, manually running the test driver, gives the most flexibility. +The last option, manually running the test driver, gives the most flexibility. This help page will focus on the command-line options for that last option. By default, Catch2 will only show the output from failing tests. To also @@ -48,7 +48,7 @@ are actually three test drivers: `test_driver`, `test_driver_AD`, and `test_driver_DD`. These test drivers are built or run depending on the type of installation (e.g. direcdiff, autodiff). For the most common use-case, you will not have a directdiff -or autodiff build and will only use `test_driver`. If you call +or autodiff build and will only use `test_driver`. If you call `meson_test` or `ninja test`, the correct drivers will run automatically. For more on tests using algorithmic differentiation or direct differentiation, see the section "AD and @@ -88,7 +88,7 @@ run: ``` To run tests matching a specific tag, write the tag name in square braces -as an argument for the test driver. For example, if I want to run the +as an argument for the test driver. For example, if I want to run the tests with the tag "Dual Grid", I would run: ``` diff --git a/_tutorials/design_features/Inc_Turbulent_Bend_Opt/Inc_Turbulent_Bend_Opt.md b/_tutorials/design_features/Inc_Turbulent_Bend_Opt/Inc_Turbulent_Bend_Opt.md index bf43128f..afdb8cf5 100644 --- a/_tutorials/design_features/Inc_Turbulent_Bend_Opt/Inc_Turbulent_Bend_Opt.md +++ b/_tutorials/design_features/Inc_Turbulent_Bend_Opt/Inc_Turbulent_Bend_Opt.md @@ -4,8 +4,8 @@ permalink: /tutorials/Inc_Turbulent_Bend_Opt/ written_by: Nijso Beishuizen for_version: 8.0.1 revised_by: -revision_date: -revised_version: +revision_date: +revised_version: solver: INC_RANS requires: SU2_CFD, FADO complexity: advanced @@ -22,7 +22,7 @@ follows: Inc_Turbulent_Bend This tutorial closely follows the design optimization setup of the 2D mixing channel, see the tutorial on design optimization for [Species Transport](/tutorials/Species_Transport/). We will use the python framework [FADO](https://github.com/su2code/FADO) to set up the optimization problem. In this tutorial however we will optimize the pressure drop of the 90 degree pipe bend. The CFD results were already discussed previously in [this tutorial](/tutorials/Inc_Turbulent_Bend/). Here we focus on the following aspects: * Setup of the FFD box for a 3D problem using SU2_DEF. -* Setup of the FADO problem: +* Setup of the FADO problem: - using previous solutions of the CFD and adjoint solver to reduce computing time. - automatically add the correct keywords for the FFD box (type and degrees of freedom). - discussion of mesh quality issues and improvement using FFD constraints. @@ -34,7 +34,7 @@ If you have not done so already, please first have a look at the prerequisite tu Besides the python library FADO, you will need to compile SU2 with automatic differentiation support. Note that the script provided uses 8 cores, so you need to compile with mpi support as well as enable autodiff: ``` -./meson.py build --optimization=2 -Ddebug=false -Denable-autodiff=true -Dwith-mpi=enabled --prefix=/home/user/Codes/su2_github_develop/su2/ +./meson.py setup build --optimization=2 -Ddebug=false -Denable-autodiff=true -Dwith-mpi=enabled --prefix=/home/user/Codes/su2_github_develop/su2/ ``` ## Resources @@ -43,7 +43,7 @@ You can find the resources for this tutorial in the folder [design/Inc_Turbulent ## 1. Basic setup of FFD box and FADO Usually, designs are created with a CAD tool. These designs are then discretized into a computational mesh for CFD analysis. When optimizing a design, we then only have the discretized mesh available. We could manipulate the mesh nodes directly but this does not lead to very smooth deformations. Instead we modify our mesh using FFD boxes. The nodes of the FFD box are moved according to the design sensitivities, and the mesh nodes inside the FFD box are then smoothly deformed using Bezier curves (default) or B-splines. -Figure (1) above shows the setup that we will be using. +Figure (1) above shows the setup that we will be using. ### Creation of the FFD box The FFD box can be created and added to the .su2 mesh file using SU2_DEF. The important parameters to add to the configuration file are: @@ -65,32 +65,32 @@ DV_MARKER= ( wall, symmetry) DV_PARAM= (1.0) ``` Our FFD box is 5x5x5 cells, or 6x6x6=216 nodes. With each 3 degrees of freedom for the x-,y- and z-direction, we get a total of 648 d.o.f. The box is slightly larger than our original bend, but most importantly the symmetry plane is completely inside the FFD box. -We run the command +We run the command ``` $ SU2_DEF sudo_0_add_FFD_box.cfg ``` -We will only use the file *sudo_0_add_FFD_box.cfg* to create the FFD box. This command will create a new .su2 mesh called *mesh_out.su2* that has the definition of the FFD box added to the file. Note that at this stage we need to provide the boundaries inside the FFD box that are allowed to deform using the keyword **DV_MARKER**. The nodes on the boundaries inside the FFD box are part of the information that is added with the FFD box to the mesh_out.su2 mesh file. +We will only use the file *sudo_0_add_FFD_box.cfg* to create the FFD box. This command will create a new .su2 mesh called *mesh_out.su2* that has the definition of the FFD box added to the file. Note that at this stage we need to provide the boundaries inside the FFD box that are allowed to deform using the keyword **DV_MARKER**. The nodes on the boundaries inside the FFD box are part of the information that is added with the FFD box to the mesh_out.su2 mesh file. ### Setup the FADO script optimization.py -Previously the python script *set_ffd_design_var.py* was used in the tutorial on the optimization of the mixing channel. We can however create the correct entries with a couple of simple python commands and add them directly to the main python script that FADO will use, *optimization.py*. We already used *optimization.py* before in the tutorial [Species Transport](/tutorials/Species_Transport/) and we will highlight some changes here. +Previously the python script *set_ffd_design_var.py* was used in the tutorial on the optimization of the mixing channel. We can however create the correct entries with a couple of simple python commands and add them directly to the main python script that FADO will use, *optimization.py*. We already used *optimization.py* before in the tutorial [Species Transport](/tutorials/Species_Transport/) and we will highlight some changes here. For the optimization, we need to modify 2 things in our config file: **DV_KIND** and **DV_PARAM**. The keyword **DV_PARAM** contains N entries of the form *( BOX, 0, 0, 0, 1.0, 0.0, 0.0 );* - Note that the meaning of the entries are *( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp )* , meaning that after the keyword **BOX**, we get the 3 indices i,j,k of the FFD box, followed by the allowed displacement of that index in the x-,y- and z-direction. Mesh nodes in the symmetry plane only move in the symmetry plane, so symmetry is preserved. + Note that the meaning of the entries are *( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp )* , meaning that after the keyword **BOX**, we get the 3 indices i,j,k of the FFD box, followed by the allowed displacement of that index in the x-,y- and z-direction. Mesh nodes in the symmetry plane only move in the symmetry plane, so symmetry is preserved. The list of FFD control points can be created using: ```python s = "FFD_CONTROL_POINT" ffd_string = s for i in range((DX**NDIM)*NDIM - 1): - ffd_string = ffd_string + ", " + s + ffd_string = ffd_string + ", " + s ``` In the sudo.cfg file we have a placeholder which has the form: ``` -DV_KIND= __FFD_CTRL_PTS__ +DV_KIND= __FFD_CTRL_PTS__ ``` And we automatically replace the placeholder **\_\_FFD_CTRL_PTS\_\_** in the fado script during run-time using the command ``` @@ -135,7 +135,7 @@ As you can see, the row of cells just above the symmetry plane has collapsed ont ### constrained FFD deformation The problem here is that the mesh nodes on the symmetry plane are not allowed to move vertically, they only move horizontally outward inside the symmetry plane. Unfortunately, the FFD deformation is such that mesh nodes just above the symmetry plane are moved down, almost on the symmetry plane. To improve the quality of the mesh deformation, we disallow the vertical movement of the FFD box nodes on the nodes in the bottom plane of the FFD box, with j-index 0 and vertical displacement (0,1,0). In Figure (3), the plane with index j=0 is the bottom plane, indicated in yellow. So we remove entries in the **DV_PARAM** list of the form *(BOX, i_Ind, 0, k_Ind, 0,1,0)*. Additionally, we also disallow the vertical movement of the nodes in the plane j=1. -Since we disallow vertical movement in 2x(6x6)=72 nodes in the planes with $$j=0$ and $j=1$$, The total degrees of freedom is then $$648 - 72 = 576$$ d.o.f. +Since we disallow vertical movement in 2x(6x6)=72 nodes in the planes with $$j=0$ and $j=1$$, The total degrees of freedom is then $$648 - 72 = 576$$ d.o.f. ![Pressure bend](../../../tutorials_files/design_features/Inc_Turbulent_Bend/opt_iter0_pressure_ffdbox.png "Pressure distribution") @@ -164,7 +164,7 @@ for j in jlist: dv_param_string = dv_param_string.replace(remove_dof, "", 1) ``` -Another modification to the configuration file that we would like to add is to restart from the solution of the previous design. SU2 will automatically interpolate the solution to the nearest neighbor if the mesh coordinates do not match. Since we might not have an initial solution to start with, we would like to switch from **RESTART= NO** to **RESTART= YES** after the first iteration. +Another modification to the configuration file that we would like to add is to restart from the solution of the previous design. SU2 will automatically interpolate the solution to the nearest neighbor if the mesh coordinates do not match. Since we might not have an initial solution to start with, we would like to switch from **RESTART= NO** to **RESTART= YES** after the first iteration. We can do this with a simple *sed* command that searches and replaces the string in config.cfg in the working directory and then copies the config file back to the base dir: @@ -172,12 +172,12 @@ We can do this with a simple *sed* command that searches and replaces the string restart_yes="sed -i 's/RESTART_SOL= NO/RESTART_SOL= YES/' config.cfg && cp " + configCopy + " ../../" ``` -The easiest way to perform the update is to simply add it as another ExternalRun process: +The easiest way to perform the update is to simply add it as another ExternalRun process: ```python update_restart = ExternalRun("UPDATE_RESTART",restart_yes,False) # True means sym links are used for addData update_restart.addData(configCopy) ``` -This means that we will call this function every design iteration, but only in the first design iteration will it have an effect. +This means that we will call this function every design iteration, but only in the first design iteration will it have an effect. FADO copies the restart file and all other necessary files from the base directory (where you start your script) into the working directory. Here, the working directory is called *OPTIM*. Inside *OPTIM* we have subdirectories for the different runs, i.e. *OPTIM/DEFORM*, OPTIM/DIRECT*, *OPTIM/ADJOINT* and *OPTIM/DOT*. When all runs in this directory are done, they are archived in *DSN_001*, *DSN_002*, etc. @@ -203,7 +203,7 @@ We have set it to run 5 design iterations. Please note that the optimization was The objective values for the 5 design iterations are given in the table below. -| iteration | $$\Delta P$$, total| $$\Delta P$$, bend| gain, total| gain, bend | +| iteration | $$\Delta P$$, total| $$\Delta P$$, bend| gain, total| gain, bend | | --------|--------|--------|--------|--------| |0|89.0 [Pa]|20.7 [Pa]| -| - | |1|84.9 [Pa]|16.6 [Pa]|4.6 \%|19.8 \%| From 9e1e82fb337dedfa8cab08255d60425c646111bf Mon Sep 17 00:00:00 2001 From: bmunguia Date: Mon, 14 Jul 2025 13:57:13 -0700 Subject: [PATCH 2/2] Merge branch 'master' into update_meson_instructions --- _includes/head.html | 5 ++- _includes/topnav.html | 1 - .../Inc_Turbulent_Bend_Opt.md | 12 +++---- .../Inc_Von_Karman/Inc_Von_Karman.md | 14 ++++---- index.html | 35 ++++++++----------- 5 files changed, 31 insertions(+), 36 deletions(-) diff --git a/_includes/head.html b/_includes/head.html index cd199958..1e4389db 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -19,7 +19,10 @@ - + + + + diff --git a/_includes/topnav.html b/_includes/topnav.html index 747df544..89903b83 100644 --- a/_includes/topnav.html +++ b/_includes/topnav.html @@ -27,7 +27,6 @@ diff --git a/_tutorials/design_features/Inc_Turbulent_Bend_Opt/Inc_Turbulent_Bend_Opt.md b/_tutorials/design_features/Inc_Turbulent_Bend_Opt/Inc_Turbulent_Bend_Opt.md index afdb8cf5..32e527ed 100644 --- a/_tutorials/design_features/Inc_Turbulent_Bend_Opt/Inc_Turbulent_Bend_Opt.md +++ b/_tutorials/design_features/Inc_Turbulent_Bend_Opt/Inc_Turbulent_Bend_Opt.md @@ -135,7 +135,7 @@ As you can see, the row of cells just above the symmetry plane has collapsed ont ### constrained FFD deformation The problem here is that the mesh nodes on the symmetry plane are not allowed to move vertically, they only move horizontally outward inside the symmetry plane. Unfortunately, the FFD deformation is such that mesh nodes just above the symmetry plane are moved down, almost on the symmetry plane. To improve the quality of the mesh deformation, we disallow the vertical movement of the FFD box nodes on the nodes in the bottom plane of the FFD box, with j-index 0 and vertical displacement (0,1,0). In Figure (3), the plane with index j=0 is the bottom plane, indicated in yellow. So we remove entries in the **DV_PARAM** list of the form *(BOX, i_Ind, 0, k_Ind, 0,1,0)*. Additionally, we also disallow the vertical movement of the nodes in the plane j=1. -Since we disallow vertical movement in 2x(6x6)=72 nodes in the planes with $$j=0$ and $j=1$$, The total degrees of freedom is then $$648 - 72 = 576$$ d.o.f. +Since we disallow vertical movement in 2x(6x6)=72 nodes in the planes with $$j=0$$ and $$j=1$$, The total degrees of freedom is then $$648 - 72 = 576$$ d.o.f. ![Pressure bend](../../../tutorials_files/design_features/Inc_Turbulent_Bend/opt_iter0_pressure_ffdbox.png "Pressure distribution") @@ -206,13 +206,13 @@ The objective values for the 5 design iterations are given in the table below. | iteration | $$\Delta P$$, total| $$\Delta P$$, bend| gain, total| gain, bend | | --------|--------|--------|--------|--------| |0|89.0 [Pa]|20.7 [Pa]| -| - | -|1|84.9 [Pa]|16.6 [Pa]|4.6 \%|19.8 \%| -|2|82.1 [Pa]|13.8 [Pa]|7.8 \%|33.3 \%| -|3|81.6 [Pa]|13.3 [Pa]|8.3 \%|35.7 \%| -|4|79.9 [Pa]|11.6 [Pa]|10 \%|44 \%| +|1|84.9 [Pa]|16.6 [Pa]|4.6 %|19.8 %| +|2|82.1 [Pa]|13.8 [Pa]|7.8 %|33.3 %| +|3|81.6 [Pa]|13.3 [Pa]|8.3 %|35.7 %| +|4|79.9 [Pa]|11.6 [Pa]|10 %|44 %| -We see that the global pressure drop between the inlet and the outlet reduces from 89 Pa to 80 Pa, a reduction of more than 10 \%. However, since we are optimizing only the bend, we should subtract the pressure drop of the straight parts and only consider the pressure drop of the bend for a more fair comparison. In paraview, we can integrate the pressure in a 2D slice at the start and end of the bend. The pressure drop of the bend comes to $$\Delta P = 20.7 Pa$$. That means that the reduction of pressure drop in the bend is actually 44 \% ! +We see that the global pressure drop between the inlet and the outlet reduces from 89 Pa to 80 Pa, a reduction of more than 10 %. However, since we are optimizing only the bend, we should subtract the pressure drop of the straight parts and only consider the pressure drop of the bend for a more fair comparison. In paraview, we can integrate the pressure in a 2D slice at the start and end of the bend. The pressure drop of the bend comes to $$\Delta P = 20.7 Pa$$. That means that the reduction of pressure drop in the bend is actually 44 % ! ![Optimized bend](../../../tutorials_files/design_features/Inc_Turbulent_Bend/opt_iter5_pressure_ffdbox.png "Optimized bend") #### Figure (4): Optimized bend after 5 design iterations, with the deformed FFD box. diff --git a/_tutorials/incompressible_flow/Inc_Von_Karman/Inc_Von_Karman.md b/_tutorials/incompressible_flow/Inc_Von_Karman/Inc_Von_Karman.md index 7cf450b8..83a221f8 100644 --- a/_tutorials/incompressible_flow/Inc_Von_Karman/Inc_Von_Karman.md +++ b/_tutorials/incompressible_flow/Inc_Von_Karman/Inc_Von_Karman.md @@ -33,11 +33,11 @@ The resources for this tutorial can be found in the [incompressible_flow/Inc_Von ### Background -When the Reynolds number $$Re=\rho \cdot V \cdot D / \mu$$ is low (Re < 40), the flow around a circular cylinder is laminar and steady. At around Re=49, the flow becomes unsteady and a periodic shedding of vortices forms in the wake of the cylinder, known as vortex shedding. The frequency of this vortex shedding is usually expressed in terms of the Strouhal number $$St= f \ cdot D / U_{\infty}$$, with f the shedding frequency, D the diameter of the cylinder and U the far-field velocity. Important experimental work can be found in the paper of Williamson, *Vortex Dynamics in the Cylinder Wake*, Annual Review of Fluid Mechanics (1996) [doi](https://doi.org/10.1146/annurev.fl.28.010196.002401). After around Re=180, a second frequency is observed experimentally, in the longitudinal direction. This frequency can only be observed in a 3D simulation. The increase in number of frequencies continues until after around Re=1000 the flow is considered fully turbulent. +When the Reynolds number $$Re=\rho \cdot V \cdot D / \mu$$ is low (Re < 40), the flow around a circular cylinder is laminar and steady. At around Re=49, the flow becomes unsteady and a periodic shedding of vortices forms in the wake of the cylinder, known as vortex shedding. The frequency of this vortex shedding is usually expressed in terms of the Strouhal number $$St= f \cdot D / U_{\infty}$$, with f the shedding frequency, D the diameter of the cylinder and U the far-field velocity. Important experimental work can be found in the paper of Williamson, *Vortex Dynamics in the Cylinder Wake*, Annual Review of Fluid Mechanics (1996) [doi](https://doi.org/10.1146/annurev.fl.28.010196.002401). After around Re=180, a second frequency is observed experimentally, in the longitudinal direction. This frequency can only be observed in a 3D simulation. The increase in number of frequencies continues until after around Re=1000 the flow is considered fully turbulent. ### Problem Setup -The configuration is a circular cylinder of 5 mm surrounded by a far field at $$L = 30 D$$ and a rectangular wake region of $$X = 150 D$$. The far-field velocity is $$U_{\infty} = 0.12 m/s$$. With a viscosity of $$\mu=1.0 \cdot 10^{-5}$$ and a density of $$\rho = 1 kg/m3$$, the Reynolds number is $$Re=120$$. +The configuration is a circular cylinder of diameter $$D=0.01 m$$ surrounded by a far field at $$L = 30 D$$ and a rectangular wake region of $$X = 150 D$$. The far-field velocity is $$U_{\infty} = 0.12 m/s$$. With a viscosity of $$\mu=1.0 \cdot 10^{-5}$$ and a density of $$\rho = 1 kg/m3$$, the Reynolds number is $$Re = 120$$. ![von_karman_mesh](../../../tutorials_files/incompressible_flow/Inc_Von_Karman/images/mesh.png) Figure 2: Computational domain for the von Karman vortex shedding. @@ -176,7 +176,7 @@ print("strouhal number = ",St) ``` -When we compare the Strouhal number with the experimental data from Williamson, we see in Figure 4 that the frequency is underpredicted. We will vary some numerical settings to investigate if we can improve the prediction of the Strouhal number. +When we compare the Strouhal number with the experimental data from Williamson, we see in Figure 4 that the frequency is slightly overpredicted. We will vary some numerical settings to investigate the impact on the prediction of the Strouhal number. @@ -184,12 +184,12 @@ When we compare the Strouhal number with the experimental data from Williamson, ![validation](../../../tutorials_files/incompressible_flow/Inc_Von_Karman/images/strouhal_cylinder_karman_variation.png) -Figure (5): Comparison of different numerical settings +Figure (5): Comparison of different numerical settings. In Figure 5, we see the effect of different numerical settings on the prediction of the Strouhal number. The second order scheme predicts a Strouhal number of $$St = 0.1734$$, slightly over predicting the experimental value of $$St_{exp} = 0.170$$. Note that our predictions of the Strouhal frequency depends on the number of samples and sampling rate that we provide to the FFT. We took 2500 timesteps of 0.01 s which contains enough cycles for an accurate frequency prediction using an fft. -When switching from second order in time to first order, the Strouhal number is under predicted by 6 \% compared to the experimental value. Also, when increasing the time step from 0.01 s to 0.02 seconds, the St decreases by 2 \%. When increasing the time step even further to $$ \Delta t = 0.04 s%%, St is under predicted by 8 \%. The period of the dimensional frequency is $$f \approx 0.5 s$$, so with a timestep of 0.01 s we have 50 time steps per period, we have 25 time steps when $$\Delta t = 0.02 s$$, and only 12 time steps when $$\Delta t = 0.04 s$$. It is clear that 12 time steps per period is not sufficient. +When switching from second order in time to first order, the Strouhal number is under predicted by 6 % compared to the experimental value. Also, when increasing the time step from 0.01 s to 0.02 seconds, the St decreases by 2 \%. When increasing the time step even further to $$ \Delta t = 0.04 s $$, St is under predicted by 8 %. The period of the dimensional frequency is $$f \approx 0.5 s$$, so with a timestep of 0.01 s we have 50 time steps per period, we have 25 time steps when $$\Delta t = 0.02 s$$, and only 12 time steps when $$\Delta t = 0.04 s$$. It is clear that 12 time steps per period is not sufficient. -It is also known that the size of the computational domain influences the results, so we reduce the domain by half, $$L = 15 D$$ and $$X = 75 D$$. The Strouhal then increases to $$St = 0.1768$$, an increase of 2 \%. It seems that a far-field that is 15D away from the cylinder is sufficient. +It is also known that the size of the computational domain influences the results, so we reduce the domain by half, $$L = 15 D$$ and $$X = 75 D$$. The Strouhal then increases to $$St = 0.1768$$, an increase of 2 %. It seems that a far-field that is 15D away from the cylinder is sufficient. As a final test, the testcase can be executed for varying Reynolds numbers, ranging from Re=60 to Re=180, giving the result in Figure (6). @@ -204,4 +204,4 @@ We get a pretty good agreement compared to the experimentally measured values. The paraview statefile to create the movie can be found here: [statefile_with_particles.pvsm](https://github.com/su2code/Tutorials/blob/master/incompressible_flow/Inc_Von_Karman/statefile_with_particles.pvsm) and here: [statefile_movablearrow_timeseries.pvsm](https://github.com/su2code/Tutorials/blob/master/incompressible_flow/Inc_Von_Karman/statefile_movablearrow_timeseries.pvsm) -Note that you have to select your own, local files when you load the statefile. \ No newline at end of file +Note that you have to select your own, local files when you load the statefile. diff --git a/index.html b/index.html index 90a5f70e..0671526f 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,7 @@ }) }) - +
@@ -40,30 +40,23 @@

Powerful. Fast. Free.

5th Annual SU2 Conference

The 5th edition of the SU2 conference takes place in Varenna/Italy from 30th of September to 2nd of October.

-

Registration and abstract submission are open now and the links to the respective platforms together with all up-to-date information can be found on the conference website.

+

Registration and abstract submission are open now and the links to the respective platforms together with all up-to-date information can be found on the conference website.


- +
-
- -

What is SU2?

-
-

Computational analysis tools have revolutionized the way we design engineering systems, but most established codes are proprietary, unavailable, or prohibitively expensive for many users. The SU2 team is changing this, making multiphysics analysis and design optimization software freely available and involving everyone in its creation and development.

- -

Find a detailed description of the code philosophy, components, and implementations in the SU2 AIAA Journal article. Whether it's discrete adjoints, non-ideal compressible CFD, high-performance computing, or incompressible flows with heat transfer, SU2 has something for you.

-
-
-
- -
+
+ +
+

What is SU2?

+
+

Computational analysis tools have revolutionized the way we design engineering systems, but most established codes are proprietary, unavailable, or prohibitively expensive for many users. The SU2 team is changing this, making multiphysics analysis and design optimization software freely available and involving everyone in its creation and development.

+ +

Find a detailed description of the code philosophy, components, and implementations in the SU2 AIAA Journal article. Whether it's discrete adjoints, non-ideal compressible CFD, high-performance computing, or incompressible flows with heat transfer, SU2 has something for you.

+

@@ -105,10 +98,10 @@

<

A strong foundation.

The SU2 community continues to grow rapidly, and together, we are making a measurable, worldwide impact on CFD. Now, it's time to tap into our collective expertise, creativity, and skills to take the project to the next level.

- +

We are proud to announce the SU2 Foundation, a new non-profit organization formed in the United States. The mission of the SU2 Foundation is to promote global software development and education to increase the pace of innovation in the engineering sciences for the benefit of all society.

- +