diff --git a/_data/tutorials.yml b/_data/tutorials.yml index 06106357..e1540ef7 100644 --- a/_data/tutorials.yml +++ b/_data/tutorials.yml @@ -54,6 +54,10 @@ - Unsteady_Shape_Opt_NACA0012 - Species_Transport +- title: Workflow Setup + tutorials: + - paraview_live + - title: Event Content tutorials: - event_content diff --git a/_data/vandv.yml b/_data/vandv.yml index 08037da4..d989810f 100644 --- a/_data/vandv.yml +++ b/_data/vandv.yml @@ -11,3 +11,7 @@ - 30p30n - swbli - LM_transition + +- title: Incompressbile Flow + vandv: + - SANDIA_jet \ No newline at end of file diff --git a/_docs_v7/Convective-Schemes.md b/_docs_v7/Convective-Schemes.md index f296111d..62d25c6d 100755 --- a/_docs_v7/Convective-Schemes.md +++ b/_docs_v7/Convective-Schemes.md @@ -32,7 +32,7 @@ To achieve second-order in space, upwind schemes need to be used with MUSCL reco | Solver | Version | | --- | --- | -| `EULER`, `NAVIER_STOKES`, `RANS` | 7.0.0 | +| `EULER`, `NAVIER_STOKES`, `RANS` | 8.0.0 | ### Central Schemes ### @@ -46,9 +46,7 @@ In implicit time marching it improves the numerical properties of the Jacobian m To maintain CFL at lower-than-default values of dissipation coefficients, a higher factor should be used. `JST_MAT` benefits from higher values (~8.0). -All compressible central schemes support vectorization (`USE_VECTORIZATION= YES`) with no robustness downsides, see the build instructions for how to tune the compilation for maximum vectorization performance. - -**Note:** The Lax-Friedrich scheme is always used on coarse multigrid levels when any central scheme is selected. +**Note:** The Lax-Friedrich scheme is always used on coarse multigrid levels when any central scheme is selected. All compressible central schemes use vectorization, see the build instructions for how to tune the compilation for maximum performance. ### Upwind Schemes ### @@ -62,28 +60,25 @@ All compressible central schemes support vectorization (`USE_VECTORIZATION= YES` - `SLAU` - Simple Low dissipation AUSM scheme; - `SLAU2` - SLAU with the alternative pressure flux formulation; - `HLLC` - Harten-Lax-van Leer-Contact; -- `CUSP` - Convective Upwind Split Pressure; - `MSW` - Modified Steger-Warming. Some of the schemes above have tunning parameters or accept extra options, the following table lists those options and indicates to which schemes they apply (if a scheme does not appear on the table, no options apply to it). -| Option \ Scheme | `ROE` | `L2ROE` | `TURKEL_PREC` | `AUSMPLUSUP[2]` | `SLAU[2]` | `HLLC` | `CUSP` | -| --------------------------------- | ----- | ------- | ------------- | --------------- | --------- | ------ | ------ | -| **`ROE_KAPPA`** | X | X | X | | | X | | -| **`ENTROPY_FIX_COEFF`** | X | X | X | | | | X | -| **`ROE_LOW_DISSIPATION`** | X | | | | X | | | -| **`USE_ACCURATE_FLUX_JACOBIANS`** | | | | X | X | | | -| **`MIN/MAX_ROE_TURKEL_PREC`** | | | X | | | | | -| **`USE_VECTORIZATION`** | X | | | | | | | +| Option \ Scheme | `ROE` | `L2ROE` | `TURKEL_PREC` | `AUSMPLUSUP[2]` | `SLAU[2]` | `HLLC` | +| --------------------------------- | ----- | ------- | ------------- | --------------- | --------- | ------ | +| **`ROE_KAPPA`** | X | X | X | | | X | +| **`ENTROPY_FIX_COEFF`** | X | X | X | | | | +| **`ROE_LOW_DISSIPATION`** | X | | | | X | | +| **`USE_ACCURATE_FLUX_JACOBIANS`** | | | | X | X | | +| **`MIN/MAX_ROE_TURKEL_PREC`** | | | X | | | | - `ROE_KAPPA`, default 0.5, constant that multiplies the left and right state sum; - `ENTROPY_FIX_COEFF`, default 0.001, puts a lower bound on dissipation by limiting the minimum convective Eigenvalue to a fraction of the speed of sound. Increasing it may help overcome convergence issues, at the expense of making the solution sensitive to this parameter. - `ROE_LOW_DISSIPATION`, default `NONE`, methods to reduce dissipation in regions where certain conditions are verified, `FD` (wall distance based), `NTS` (Travin and Shur), `FD_DUCROS` and `NTS_DUCROS` as before plus Ducros' shock sensor; - `USE_ACCURATE_FLUX_JACOBIANS`, default `NO`, if set to `YES` accurate flux Jacobians are used instead of Roe approximates, slower on a per iteration basis but in some cases allows much higher CFL values to be used and therefore faster overall convergence; - `MIN_ROE_TURKEL_PREC` and `MAX_ROE_TURKEL_PREC`, defaults 0.01 and 0.2 respectively, reference Mach numbers for Turkel preconditioning; -- `USE_VECTORIZATION`, default `NO`, if `YES` use the vectorized (SSE, AVX, or AVX512) implementation which is faster but may be less robust against initial solution transients. -**Note:** Some schemes are not compatible with all other features of SU2, the AUSM family and CUSP are not compatible with unsteady simulations of moving grids, non-ideal gases are only compatible with the standard Roe and HLLC schemes. +**Note:** Some schemes are not compatible with all other features of SU2, the AUSM family is not compatible with unsteady simulations of moving grids, non-ideal gases are only compatible with the standard Roe and HLLC schemes. The only upwind scheme that uses vectorization is the Roe scheme (ideal gas only), see the build instructions for how to tune the compilation for maximum performance. ## Incompressible Flow ## @@ -99,12 +94,13 @@ Some of the schemes above have tunning parameters or accept extra options, the f `FDS` - Flux Difference Splitting with low speed preconditioning, this scheme does not have tuning parameters. -## Turbulence Equations ## +## Turbulence and Scalar/Species Equations ## | Solver | Version | | --- | --- | -| `RANS`, `INC_RANS` | 7.0.0 | +| `RANS`, `INC_RANS` | 8.0.0 | -Only one method is currently available: `SCALAR_UPWIND` which must be selected via option `CONV_NUM_METHOD_TURB`. -This method does not have any special parameters. +For compressible flows the only method available is `SCALAR_UPWIND` which must be selected via option `CONV_NUM_METHOD_TURB`. +For incompressible flows the `BOUNDED_SCALAR` method is also available, this includes a divergence correction to prevent spurious production/destruction of the transported scalar while convergence is not reached. +These methods do not have any special parameters. diff --git a/_docs_v7/Quick-Start.md b/_docs_v7/Quick-Start.md index e2fecd99..534f2053 100644 --- a/_docs_v7/Quick-Start.md +++ b/_docs_v7/Quick-Start.md @@ -3,7 +3,7 @@ title: Quick Start permalink: /docs_v7/Quick-Start/ --- -Welcome to the Quick Start Tutorial for the SU2 software suite. This tutorial is intended to demonstrate some of the key features of the analysis and design tools in an easily accessible format. Completion of this tutorial only requires a few minutes. If you haven't done so already, please visit the [Download](/download.html) and [Installation](/docs_v7/Installation/) pages to obtain the most recent stable release of the software and details for installation. This tutorial requires only the SU2_CFD tool from the SU2 suite. +Welcome to the Quick Start Tutorial for the SU2 software suite. This tutorial is intended to demonstrate some of the key features of the analysis and design tools in an easily accessible format. Completion of this tutorial only requires a few minutes. If you haven't done so already, please visit the [Download](/download.html) and [Installation](/docs_v7/Installation/) pages to obtain the most recent stable release of the software and details for installation. This tutorial requires only the SU2_CFD tool from the SU2 suite (and optionally the SU2_CFD_AD tool). --- @@ -13,22 +13,24 @@ Welcome to the Quick Start Tutorial for the SU2 software suite. This tutorial is - [Background](#background) - [Problem Setup](#problem-setup) - [Mesh Description](#mesh-description) - - [Configuration File Options](#configuration-file-options) - - [Running SU2](#running-su2) - - [Results](#results) - - [Flow Solution](#flow-solution) - - [Adjoint Solution](#adjoint-solution) + - [Direct Problem Configuration](#direct-problem-configuration) + - [Running SU2 Direct Analysis](#running-su2-direct-analysis) + - [Direct Analysis Results](#direct-analysis-results) + - [Running SU2 Adjoint Analysis](#running-su2-adjoint-analysis) + - [Adjoint Analysis Results](#adjoint-analysis-results) +- [Conclusions](#conclusions) --- - + ## Goals -Upon completing this simple tutorial, the user will be familiar with performing the flow and continuous adjoint simulation of external, inviscid flow around a 2D geometry and be able to plot both the flow solution and the surface sensitivities that result. The specific geometry chosen for the tutorial is the NACA 0012 airfoil. Consequently, the following capabilities of SU2 will be showcased in this tutorial: -- Steady, 2D, Euler and Continuous Adjoint Euler equations +Upon completing this simple tutorial, the user will be familiar with performing the flow and continuous (and/or discrete) adjoint simulation of external, inviscid flow around a 2D geometry and be able to plot both the flow solution and the surface sensitivities that result. The specific geometry chosen for the tutorial is the NACA 0012 airfoil. Consequently, the following capabilities of SU2 will be showcased in this tutorial: + +- Steady, 2D, Euler and Continuous/Discrete Adjoint Euler equations - Multigrid - JST numerical scheme for spatial discretization - Euler implicit time integration @@ -36,7 +38,7 @@ Upon completing this simple tutorial, the user will be familiar with performing ## Resources -The files necessary to run this tutorial are included in the [SU2/QuickStart/](https://github.com/su2code/SU2/tree/master/QuickStart) directory. For the other tutorials, the files will be found in the TestCases/ repository. Two files are needed as input to the code: a [configuration file](https://github.com/su2code/SU2/blob/master/QuickStart/inv_NACA0012.cfg) describing the options for the particular problem, and the corresponding computational [mesh file](https://github.com/su2code/SU2/blob/master/QuickStart/mesh_NACA0012_inv.su2). The files are in QuickStart/ and can also be found in the TestCases repository under TestCases/euler/naca0012. +The files necessary to run this tutorial are included in the [SU2/QuickStart/](https://github.com/su2code/SU2/tree/master/QuickStart) of the [SU2](https://github.com/su2code/SU2) repository. Some auxiliary files, useful to automate the tutorial simulations and the visualization of results, may be found in the [QuickStart](https://github.com/su2code/Tutorials/tree/master/compressible_flow/QuickStart) directory of the [Tutorials](https://github.com/su2code/Tutorials) repository. Files for other tutorials may be found in the same repository. For a start, two files are needed as input to the code: a [configuration file](https://github.com/su2code/SU2/blob/master/QuickStart/inv_NACA0012.cfg) describing the options for the particular problem, and the corresponding computational [mesh file](https://github.com/su2code/SU2/blob/master/QuickStart/mesh_NACA0012_inv.su2). ## Tutorial @@ -44,13 +46,13 @@ The following tutorial will walk you through the steps required to compute the f ### Background -The NACA0012 airfoil is one of the four-digit wing sections developed by the National Advisory Committee for Aeronautics (NACA), and it is a widely used geometry for many CFD test cases. The numbering system is such that the first number indicates the maximum camber (in percent of chord), the second shows the location of the maximum camber (in tens of percent of chord) and the last two digits indicate the maximum thickness (in percent of chord). More information on these airfoil sections can be found here or in the book 'Theory of Wing Sections' by Abbott and von Doenhoff. +The NACA 0012 airfoil is one of the four-digit wing sections developed by the National Advisory Committee for Aeronautics (NACA), and it is a widely used geometry for many CFD test cases. The numbering system is such that the first number indicates the maximum camber (in percent of chord), the second shows the location of the maximum camber (in tens of percent of chord) and the last two digits indicate the maximum thickness (in percent of chord). More information on these airfoil sections can be found here or in the book 'Theory of Wing Sections' by Abbott and von Doenhoff. ### Problem Setup -This problem will solve the Euler equations on the NACA0012 airfoil at an angle of attack of 1.25 degrees, using air with the following freestream conditions: +This problem will solve the Euler equations on the NACA 0012 airfoil at an angle of attack of 1.25 degrees, using air with the following freestream conditions: -- Pressure = 101,325 Pa +- Pressure = 101325 Pa - Temperature = 273.15 K - Mach number = 0.8 @@ -58,82 +60,88 @@ The aim is to find the flow solution and the adjoint solution with respect to an ### Mesh Description -The unstructured mesh provided is in the native .su2 format. It consists of 10,216 triangular cells, 5,233 points, and two boundaries (or "markers") named *airfoil* and *farfield*. The airfoil surface uses a flow-tangency Euler wall boundary condition, while the farfield uses a standard characteristic-based boundary condition. The figure below gives a view of the mesh. +The unstructured mesh provided is in the native .su2 format. It consists of 10216 triangular cells, 5233 points, and two boundaries (or "markers") named *airfoil* and *farfield*. The airfoil surface uses a flow-tangency Euler wall boundary condition, while the farfield uses a standard characteristic-based boundary condition. The figure below gives a view of the mesh.  Figure (1): Far-field and zoom view of the computational mesh. -### Configuration File Options +### Direct Problem Configuration Aside from the mesh, the only other file required to run the SU2_CFD solver details the configuration options. It defines the problem, including all options for the numerical methods, flow conditions, multigrid, etc., and also specifies the names of the input mesh and output files. In keeping simplicity for this tutorial, only two configuration options will be discussed. More configuration options will be discussed throughout the remaining tutorials. Upon opening the inv_NACA0012.cfg file in a text editor, one of the early options is the MATH_PROBLEM: ``` -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT) MATH_PROBLEM= DIRECT ``` -SU2 is capable of running the direct and adjoint problems for several sets of equations. The direct analysis solves for the flow around the geometry, and quantities of interest such as the lift and drag coefficient on the body will be computed. Solving the adjoint problem leads to an efficient method for obtaining the change in a single objective function (e.g., the drag coefficient) relative to a large number of design variables (surface deformations). The direct and adjoint solutions often couple to provide the objective analysis and gradient information needed by an optimizer when performing aerodynamic shape design. In this tutorial, we will perform DIRECT and CONTINUOUS_ADJOINT solutions for the NACA 0012 airfoil. +SU2 is capable of running the direct and adjoint problems for several sets of equations. The direct analysis solves for the flow around the geometry, and quantities of interest such as the lift and drag coefficient on the body will be computed. Solving the adjoint problem leads to an efficient method for obtaining the change in a single objective function (e.g., the drag coefficient) relative to a large number of design variables (surface deformations). The direct and adjoint solutions often couple to provide the objective analysis and gradient information needed by an optimizer when performing aerodynamic shape design. In this tutorial, we will first perform a DIRECT simulation for the NACA 0012 airfoil. -The user can also set the format for the solution files: +The user can also set the format for the output files: ``` % Output file format -OUTPUT_FILES= (RESTART, TECPLOT, SURFACE_TECPLOT) +OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_CSV) ``` -SU2 can output solution files in the .vtk (ParaView), .dat (Tecplot ASCII), and .szplt (Tecplot binary) formats which can be opened in the ParaView and Tecplot visualization software packages, respectively. We have set the file type to TECPLOT in this tutorial by, but users without access to Tecplot are encouraged to download and use the freely available [ParaView](http://www.paraview.org) package. To output solution files for ParaView, set the `OUTPUT_FILES` option to `(RESTART, PARAVIEW, SURFACE_PARAVIEW)` which is the default value if the option is not present. +SU2 can output solution files in the .vtu (ParaView), .dat (Tecplot ASCII), and .szplt (Tecplot binary) formats which can be opened in the ParaView and Tecplot visualization software packages, respectively. We have set the file type to PARAVIEW in this tutorial: in order to visualize the solution, users are encouraged to download and use the freely available [ParaView](https://www.paraview.org) package. The output format for the data on the *airfoil* boundary is set to SURFACE_CSV (Comma Separated Values): the resulting text file may be plotted with various graphing tools or with LaTeX packages such as [PGFPlots](https://pgfplots.sourceforge.net/). Please note that, if the `OUTPUT_FILES` option is not present in the configuration file, its default value is `(RESTART, PARAVIEW, SURFACE_PARAVIEW)`. -### Running SU2 +### Running SU2 Direct Analysis The first step in this tutorial is to solve the Euler equations: 1. Either navigate to the QuickStart/ directory or create a directory in which to run the tutorial. If you have created a new directory, copy the config file (inv_NACA0012.cfg) and the mesh file (mesh_NACA0012_inv.su2) to this directory. - 2. Run the executable by entering `SU2_CFD inv_NACA0012.cfg` at the command line. If you have not set the $SU2_RUN environment variable you will need to run `../bin/SU2_CFD inv_NACA0012.cfg` (from the QuickStart directory) or use the appropriate path to your SU2_CFD executable at the command line. + 2. Run the executable by entering `SU2_CFD inv_NACA0012.cfg` at the command line. If you have not set the appropriate environment variables, you may need to specify the path to your SU2_CFD executable in the command line. 3. SU2 will print residual updates with each iteration of the flow solver, and the simulation will finish after reaching the specified convergence criteria. - 4. Files containing the flow results (with "flow" in the file name) will be written upon exiting SU2. The flow solution can be visualized in ParaView (.vtk) or Tecplot (.dat or .szplt). More specifically, these files are: - - **flow.szplt** or **flow.vtk** - full volume flow solution. - - **surface_flow.szplt** or **surface_flow.vtk** - flow solution along the airfoil surface. - - **surface_flow.csv** - comma separated values (.csv) file containing values along the airfoil surface. + 4. Files containing the flow results (with "flow" in the file name) will be written upon exiting SU2. The flow solution can be visualized in ParaView (.vtu) or Tecplot (.dat or .szplt). More specifically, these files are: + - **flow.vtu** (or **flow.szplt**) - full volume flow solution. + - **surface_flow.csv** (or **surface_flow.vtu** or **surface_flow.szplt**) - file containing values along the airfoil surface. - **restart_flow.dat** - restart file in an internal format for restarting this simulation in SU2. - - **history.dat** or **history.csv** - file containing the convergence history information. + - **history.csv** (or **history.dat**) - file containing the convergence history information. -Next, we want to run the adjoint solution to get the sensitivity of the objective function (the drag over the airfoil) to conditions within the flow: - 1. Open the config file and change the parameter `MATH_PROBLEM` from `DIRECT` to `CONTINUOUS_ADJOINT`, and save this file. - 2. Rename the restart file (restart_flow.dat) to "solution_flow.dat" so that the adjoint code has access to the direct flow solution. - 3. Run the executable again by entering `SU2_CFD inv_NACA0012.cfg` at the command line. - 4. SU2 will print residual updates with each iteration of the adjoint solver, and the simulation will finish after reaching the specified convergence criteria. - 5. Files containing the adjoint results (with "adjoint" in the file name) will be written upon exiting SU2. The flow solution can be visualized in ParaView (.vtk) or Tecplot (.dat or .szplt). More specifically, these files are: - - **adjoint.szplt** or **adjoint.vtk** - full volume adjoint solution. - - **surface_adjoint.szplt** or **surface_adjoint.vtk** - adjoint solution along the airfoil surface. - - **surface_adjoint.csv** - comma separated values (.csv) file containing values along the airfoil surface. - - **restart_adj_cd.dat** - restart file in an internal format for restarting this simulation in SU2. Note that the name of the objective appears in the file name. - - **history.dat** or **history.csv** - file containing the convergence history information. +### Direct Analysis Results -Note that as of SU2 v4.1, you can also compute a discrete adjoint for the Euler equations. Assuming that you have built the code with [algorithmic differentiation support](/docs_v7/Build-SU2-Linux-MacOS/#basic-configuration), you can run the discrete adjoint with the following steps instead: - 1. Open the config file and change the parameter `MATH_PROBLEM` from `DIRECT` to `DISCRETE_ADJOINT`, and save this file. - 2. Rename the restart file (restart_flow.dat) to "solution_flow.dat" so that the adjoint code has access to the direct flow solution. - 3. Run the executable again by entering `SU2_CFD_AD inv_NACA0012.cfg` at the command line. Note that the `SU2_CFD_AD` executable will only be available when the source has been compiled with AD support. +The following figures were created in ParaView using the SU2 results. These results are contained in the **flow.vtu** file. -### Results + -The following figures were created in Tecplot using the SU2 results. These results are contained in the flow.dat, surface_flow.dat, adjoint.dat, and surface_adjoint.dat files. +Figure (2): Pressure contours around the NACA 0012 airfoil. -#### Flow Solution + - +Figure (3): Mach number contours around the NACA 0012 airfoil. -Figure (2): Pressure contours around the NACA 0012 airfoil. +The following plot was created in LaTeX with PGFPlots using the SU2 results. These results are contained in the **surface_flow.csv** file. - + + +Figure (4): Coefficient of pressure distribution along the airfoil surface. Notice the strong shock on the upper surface (top line) and a weaker shock along the lower surface (bottom line). + +### Running SU2 Adjoint Analysis + +Next, we want to run the adjoint solution to get the sensitivity of the objective function (the drag over the airfoil) to conditions within the flow: + 1. Open the config file and change the parameter `MATH_PROBLEM` from `DIRECT` to `CONTINUOUS_ADJOINT`, and the parameter `OUTPUT_FILES` from `(RESTART, PARAVIEW, SURFACE_CSV)` to `(RESTART, SURFACE_CSV)`; save this file. + 2. Rename (or symlink) the restart file (restart_flow.dat) to "solution_flow.dat" so that the adjoint code has access to the direct flow solution. + 3. Run the executable again by entering `SU2_CFD inv_NACA0012.cfg` at the command line. + 4. SU2 will print residual updates with each iteration of the adjoint solver, and the simulation will finish after reaching the specified convergence criteria. + 5. Files containing the adjoint results (with "adjoint" in the file name) will be written upon exiting SU2. More specifically, these files are: + - **surface_adjoint.csv** (or **surface_adjoint.vtu** or **surface_adjoint.szplt**) - file containing adjoint values along the airfoil surface. + - **restart_adj_cd.dat** - restart file in an internal format for restarting this simulation in SU2. Note that the name of the objective appears in the file name. + - **history.csv** (or **history.dat**) - file containing the convergence history information. + - (**adjoint.vtu** or **adjoint.szplt**, if requested) - full volume adjoint solution, that can be visualized in ParaView or Tecplot. -Figure (3): Coefficient of pressure distribution along the airfoil surface. Notice the strong shock on the upper surface (top line) and a weaker shock along the lower surface (bottom line). +Note that as of SU2 v4.1 or later, you can also compute a discrete adjoint for the Euler equations. Assuming that you have built the code with [algorithmic differentiation support](/docs_v7/Build-SU2-Linux-MacOS/#basic-configuration), you can run the discrete adjoint with the following steps instead: + 1. Open the config file and change the parameter `MATH_PROBLEM` to `DISCRETE_ADJOINT`, and the parameter `OUTPUT_FILES` to `(RESTART, SURFACE_CSV)`; save this file. + 2. Rename (or symlink) the restart file (restart_flow.dat) to "solution_flow.dat" so that the adjoint code has access to the direct flow solution. + 3. Run the executable by entering `SU2_CFD_AD inv_NACA0012.cfg` at the command line. Note that the `SU2_CFD_AD` executable will only be available when the source has been compiled with AD support. + 4. SU2 will again print residual updates with each iteration of the adjoint solver, and the simulation will finish after reaching the specified convergence criteria. + 5. Similar files containing the adjoint results will be written upon exiting SU2. -#### Adjoint Solution +### Adjoint Analysis Results - +The following plot was created in LaTeX with PGFPlots using the SU2 results and comparing the output from the continuous and discrete adjoint approaches. These results are contained in the two **surface_adjoint.csv** files. -Figure (4): Contours of the adjoint density variable. + - +Figure (5): Surface sensitivities. The surface sensitivity is the change in the objective function due to an infinitesimal deformation of the surface in the local normal direction. These values may be refined at each node on the airfoil surface from the flow and adjoint solutions at negligible computational cost using an additional step not described in this tutorial. -Figure (5): Surface sensitivities. The surface sensitivity is the change in the objective function due to an infinitesimal deformation of the surface in the local normal direction. These values are calculated at each node on the airfoil surface from the flow and adjoint solutions at negligible computational cost using an additional step not described in this tutorial. +## Conclusions Congratulations! You've successfully performed your first flow simulations with SU2. Move on to the [tutorials](https://su2code.github.io/tutorials/home) to learn much more about using the code, and don't forget to read through the information in the user's guide. Having problems with the quick start or visualizing the results? Visit the [FAQs](/docs_v7/FAQ) page, or see our forum at [CFD-online](http://www.cfd-online.com/Forums/su2/). diff --git a/_docs_v7/Slope-Limiters-and-Shock-Resolution.md b/_docs_v7/Slope-Limiters-and-Shock-Resolution.md index 019c40db..9b87f733 100644 --- a/_docs_v7/Slope-Limiters-and-Shock-Resolution.md +++ b/_docs_v7/Slope-Limiters-and-Shock-Resolution.md @@ -96,6 +96,9 @@ The `SLOPE_LIMITER_` options above may each be changed to use different limiters | `BARTH_JESPERSEN` | Barth-Jespersen | This limiter is a smooth version of the commonly seen Barth-Jespersen limiter seen in the literature | | `VENKATAKRISHNAN` | Venkatakrishnan | | | `VENKATAKRISHNAN_WANG` | Venkatakrishnan-Wang | | +| `NISHIKAWA_R3` | Nishikawa-R3 | | +| `NISHIKAWA_R4` | Nishikawa-R4 | | +| `NISHIKAWA_R5` | Nishikawa-R5 | | | `SHARP_EDGES` | Venkatakrishnan with sharp-edge modification | This limiter should not be used for flow solvers | | `WALL_DISTANCE` | Venkatakrishnan with wall distance modification | This limiter should not be used for flow solvers | | `VAN_ALBADA_EDGE` | Van Albada (edge formulation) | This limiter is only implemented for flow solvers and does not output limiter values when using the VOLUME_OUTPUT option | @@ -106,7 +109,7 @@ The default limiter is `VENKATAKRISHNAN`. The `VENKAT_LIMITER_COEFF` parameter is generally a small constant, defaulting to $$0.05$$, but its specific definition depends on the limiter being used. -For the `VENKATAKRISHNAN`, `SHARP_EDGES`, and `WALL_DISTANCE` limiters, the `VENKAT_LIMITER_COEFF` parameter refers to $$K$$ in $$\epsilon^2=\left(K\bar{\Delta} \right)^3$$, where $$\bar{\Delta}$$ is an average grid size (this is hardcoded as 1m and thus all tuning is via $$K$$). +For the `VENKATAKRISHNAN`, `SHARP_EDGES`, and `WALL_DISTANCE` limiters, the `VENKAT_LIMITER_COEFF` parameter refers to $$K$$ in $$\epsilon^2=\left(K\bar{\Delta} \right)^3$$, where $$\bar{\Delta}$$ is an average grid size (this is hardcoded as 1m and thus all tuning is via $$K$$). For NISHIKAWA_Rp limiters, $$\epsilon^p=\left(K\bar{\Delta} \right)^{p+1}$$ (p = 3, 4 or 5). The $$K$$ parameter defines a threshold, below which oscillations are not damped by the limiter, as described by [Venkatakrishnan](https://doi.org/10.1006/jcph.1995.1084). Thus, a large value will approach the case of using no limiter with undamped oscillations, while too small of a value will slow the convergence and add extra diffusion. The SU2 implementation of the `BARTH_JESPERSEN` limiter actually uses `VENKATAKRISHNAN` with $$K=0$$. @@ -115,10 +118,10 @@ The SU2 implementation of the `BARTH_JESPERSEN` limiter actually uses `VENKATAKR When using the `VENKATAKRISHNAN_WANG` limiter, `VENKAT_LIMITER_COEFF` is instead $$\varepsilon '$$ in $$\varepsilon = \varepsilon ' (q_{max} - q_{min})$$, where $$q_{min}$$ and $$q_{max}$$ are the respective *global* minimum and maximum of the field variable being limited. This global operation incurs extra time costs due to communication between MPI ranks. The original work by [Wang](https://doi.org/10.2514/6.1996-2091) suggests using `VENKAT_LIMITER_COEFF` in the range of $$[0.01, 0.20]$$, where again larger values approach the case of using no limiter. -**Note:** unlike the aforementioned `VENKATAKRISHNAN` limiter, the `VENKATAKRISHNAN_WANG` limiter does not depend directly on the mesh size and can thus be used without non-dimensionalization. If the `VENKATAKRISHNAN` limiter is used outside of non-dimensional mode, the fields with larger values (pressure and temperature) will generally be limited more aggressively than velocity. +**Note:** unlike the aforementioned `VENKATAKRISHNAN` limiter and NISHIKAWA_Rp limiter, the `VENKATAKRISHNAN_WANG` limiter does not depend directly on the mesh size and can thus be used without non-dimensionalization. If the `VENKATAKRISHNAN` limiter is used outside of non-dimensional mode, the fields with larger values (pressure and temperature) will generally be limited more aggressively than velocity. -The `NONE`, `BARTH_JESPERSEN`, `VENKATAKRISHNAN`, and `VENKATAKRISHNAN_WANG` limiter options all have no **geometric modifier**. +The `NONE`, `BARTH_JESPERSEN`, `VENKATAKRISHNAN`, `VENKATAKRISHNAN_WANG`, and NISHIKAWA_Rp limiter options all have no **geometric modifier**. A geometric modifier increases limiting near walls or sharp edges. This is done by multiplying the limiter value by a **geometric factor**. For both the `SHARP_EDGES` and `WALL_DISTANCE` limiters, the influence of the geometric modifier is controlled with `ADJ_SHARP_LIMITER_COEFF` which defaults to 3.0. diff --git a/_docs_v7/Theory.md b/_docs_v7/Theory.md index e8d406d5..d4c9b995 100644 --- a/_docs_v7/Theory.md +++ b/_docs_v7/Theory.md @@ -15,6 +15,7 @@ This page contains a very brief summary of the different governing equation sets - [Incompressible Euler](#incompressible-euler) - [Turbulence Modeling](#turbulence-modeling) - [Species Transport](#species-transport) +- [Combustion](#flamelet-combustion-model) - [Elasticity](#elasticity) - [Heat Conduction](#heat-conduction) @@ -273,6 +274,23 @@ where $$\mu_T$$ is the eddy viscosity and $$Sc_{T}$$ $$[-]$$ the turbulent Schmi --- +# Combustion # + +| Solver | Version | +| --- | --- | +| `INC_NAVIER_STOKES` | 8.0.0 | + +Combustion with tabulated chemistry solves the scalar transport equations for total enthalpy $h_t=h + h_{chem}$, which is the sum of the sensible enthalpy and the chemical enthalpy. Additionally, it solves a transport equation for the progress variable $C$, indicating the progress of combustion. Reaction source terms for the progress variable, as well as necessary thermodynamic quantities like density, temperature, viscosity, heat capacity, etc. are all obtained from a 2D lookup table where the properties are stored as a function of the progress variable and total enthalpy. Note that temperature is now a quantity that is retrieved from the lookup table. These lookup tables are constructed from 1D detailed chemistry simulations, using codes like Cantera, Ember, FlameMaster (RWTH Aachen) or Chem1d (TU Eindhoven) and are also known as flamelets or Flamelet Generated Manifolds (FGM). + +The progress variable-enthalpy approach is used to simulate laminar premixed flames. Nonpremixed flames can also be simulated by simply using a lookup table for non-premixed flames. The progress variable then effectively becomes a mixture fraction. Combustion with conjugate heat transfer is also supported in the tabulated chemistry approach. +Additional transport of (reacting) species can be supported as well. The source terms for these additional species have to be stored in the lookup table. A split-source-term approach is supported, where the source term is assumed to be of the form $$S_{total} = S_{Production} + Y \cdot S_{Consumption}.$$ We store the production and consumption terms in the lookup table and construct the total source term internally. If only a total source term is available, the consumption source term can be set to zero. + +At the moment there is no turbulence-chemistry interaction implemented in this approach and the Lewis number is assumed to be $Le=1$ + +For a detailed introduction to flamelet modeling see the work of van Oijen et al. https://www.sciencedirect.com/science/article/pii/S0360128515300137 + +--- + # Elasticity # | Solver | Version | diff --git a/_tutorials/contribute.md b/_tutorials/contribute.md index c1ffa3e7..2a12b404 100644 --- a/_tutorials/contribute.md +++ b/_tutorials/contribute.md @@ -15,14 +15,14 @@ Do you want to contribute to SU2 with a tutorial? It's easy! Just create a fork The tutorials in this section of the site are stored under the `_tutorials` folder. To add your contributions: -**1.** Create a new subfolder in `_tutorials/` as `_tutorials/Your_Folder_Name`, where you will store your subgroup of tutorials. You can also add your conribution to an existing folder if it fits better within the existing structure. +**1.** Create a new subfolder in `_tutorials/` as `_tutorials/Your_Folder_Name`, where you will store your subgroup of tutorials. You can also add your contribution to an existing folder if it fits better within the existing structure. **2.** Add a new Markdown file inside the subfolder, as `_tutorials/Your_Folder_Name/Your_Tutorial.md`. Add the following [front matter](https://jekyllrb.com/docs/frontmatter/) to your file: ``` --- title: Your Tutorial Title -permalink: /docs/Your_Folder_Name/Your_Tutorial/ +permalink: /tutorials/Your_Folder_Name/Your_Tutorial/ --- I'm contributing to SU2! @@ -32,7 +32,7 @@ I'm contributing to SU2! ``` - title: Your Subgroup of Tutorials - docs: + tutorials: - Your_Tutorial ``` diff --git a/_tutorials/workflow_features/paraview_live/paraview_live.md b/_tutorials/workflow_features/paraview_live/paraview_live.md new file mode 100644 index 00000000..c905e926 --- /dev/null +++ b/_tutorials/workflow_features/paraview_live/paraview_live.md @@ -0,0 +1,100 @@ +--- +title: Realtime update of residuals and solution in paraview +permalink: /tutorials/paraview_live/ +written_by: Nijso Beishuizen +for_version: 7.5.0 +solver: all +requires: paraview +complexity: easy +--- + +## Introduction + +Often we want to view the solution residuals to see if the solution converges. If the residuals seem to stall or oscillate, this might be an indication that the setup is incorrect. A setting has to be changed or the mesh quality has to be improved to ensure convergence. Sometimes this stalling behavior is temporary, and a look at an intermediate paraview solution can lead to more insight. The intermediate solution can also show if the solution is converging towards the expected solution. In this tutorial we will briefly discuss a paraview setup that will give a live update of the residuals as well as the paraview solution. + +## SU2 Configuration file + +We will first discuss some SU2 options that affect our workflow. + +The residuals are saved in the history file. The filename is given by the keyword **CONV_FILENAME= history**. Its contents are determined by the keyword **HISTORY_OUTPUT**. We usually store the RMS values of the residuals with the number of iterations, so we set **HISTORY_OUTPUT= ITER RMS_RES**. The file can be saved either in tecplot format or as comma separated values (csv). We use the csv file format because it is very easy to read in paraview. This is the default but can be set explicitly with the keyword **TABULAR_FORMAT= CSV**. The filename will now be called **history.csv** . The paraview solution is written every x iterations in the filename given by **VOLUME_FILENAME** and x depends on the value of **OUTPUT_WRT_FREQ**. You can save a (2D or 3D) paraview solution using either **OUTPUT_FILES= PARAVIEW** with the extension (suffix) *.vtu* or **OUTPUT_FILES= PARAVIEW_MULTIBLOCK** with extension *.vtm*. To summarize, the following settings are recommended for the paraview live update: + +```bash +TABULAR_FORMAT= CSV +CONV_FILENAME= history +OUTPUT_FILES= RESTART, PARAVIEW, PARAVIEW_MULTIBLOCK +OUTPUT_WRT_FREQ= 100, 10, 10 +VOLUME_FILENAME= flow +VOLUME_OUTPUT= RESIDUAL, PRIMITIVE, SOLUTION +HISTORY_OUTPUT= ITER, RMS_RES +``` + +## Paraview setup + +The paraview live update will simply reload the contents of these files every x seconds, where x is a user defined value. If you haven't installed paraview yet, you can download the latest version here: + +[paraview download](https://www.paraview.org/download/) + +We open paraview and add a new source. Choose *Live Programmable Source*. + +Then choose the *Output Data Set Type* from the list. If you save a regular paraview file, the output filename ends with *.vtu*. Then choose *vtkUnstructuredGrid*. If you save a multiblock paraview file that has the extension *.vtm*, then choose vtkMultiBlockDataSet. + +In the *Script* section, copy the following python script: + +```python +# .vtu paraview +from paraview.vtk.vtkIOXML import vtkXMLUnstructuredGridReader as vtuReader +reader = vtuReader() +reader.SetFileName('flow.vtu') +reader.Update() +self.GetOutputDataObject(0).ShallowCopy(reader.GetOutput()) +``` + +or for a multiblock paraview file: + +```python +# .vtm multiblock +from paraview.vtk.vtkIOXML import vtkXMLMultiBlockDataReader as vtmreader +vtmreader = vtmreader() +vtmreader.SetFileName('flow.vtm') +vtmreader.Update() +self.GetOutputDataObject(0).ShallowCopy(vtmreader.GetOutput()) +``` + +The only thing you need to change here is the filename. Note that this script assumes that you have started paraview in the directory where the paraview filename can be found. The section *Script (RequestInformation)* can be left empty. In the next section, called *Script (CheckNeedsUpdate)*, write the following: + +```python +import time +# the update frequency is 30 seconds +UpdateFrequency = 30 +if not hasattr(self, "_my_time"): + setattr(self, "_my_time", time.time()) + +t = time.time() +lastTime = getattr(self, "_my_time") + +if t - lastTime > UpdateFrequency: + setattr(self, "_my_time", t) + self.SetNeedsUpdate(True) +``` + +And that's it! You now have a paraview viewer that automatically reads the paraview solution file every 30 seconds! Below the script section you can choose as coloring one of the solution fields, as with a regular paraview session. + +You can create a similar setup for the history file to view the residuals. We therefore create a second *Live Programmable Source*. We can keep the *CheckNeedsUpdate* block the same, but since this file gets updated every iteration, we can change the frequency to a lower value, for instance 5 seconds. To load the history file, we set the *Output Data Set Type* to *vtkTable* and add the following code to the *Script* block: + +```python +import numpy as np +import pandas as pd + +data = pd.read_csv("history.csv",sep=',') +print(data.keys()) +print(len(data.columns)) +for name in data.keys(): + array = data[name].to_numpy() + output.RowData.append(array, name) +``` + +If you now create 2 RenderView windows next to each other (either use *Split Horizontal axis* or use *Split Vertical Axis*) you can visualize the contour in one window and the residuals in the second window. Make sure that when you create the viewing window for the line plot, it is set to *Line Chart View*. The contour plot window uses the default *Render View*. You can now select the residuals from the *Series Parameters* list. + + +Figure (1): screenshot of the paraview live setup. + diff --git a/_vandv/SANDIA_jet.md b/_vandv/SANDIA_jet.md new file mode 100644 index 00000000..108d2f93 --- /dev/null +++ b/_vandv/SANDIA_jet.md @@ -0,0 +1,157 @@ +--- +title: 2D Axisymmetric, Nonpremixed, Nonreacting, Variable Density, Turbulent Jet Flow +permalink: /vandv/SANDIA_jet/ +--- + +| Solver | Version | Author | +| --- | --- | --- | +| `INC_RANS` | 7.5.0 | Sem Bosmans | + + +The details of the 2D Axisymmetric, Nonpremixed, Nonreacting, Variable Density, Turbulent Jet Flow are taken from [Sandia National Laboratories database](https://tnfworkshop.org/data-archives/simplejet/propanejet/)$$^{1},^{2}$$. + +By comparing the results of SU2 simulations case against the experimental data, as well as OpenFOAM simulation results $$^{3}$$ (and MFSim $$^{4}$$), we can build a high degree of confidence that the composition-dependent model is implemented correctly in combination with the SST turbulence model. Therefore, the goal of this case is to validate the implementation of the composition-dependent model in SU2. + +## Problem Setup +The problem consists of a turbulent propane jet mixing into coflowing air. The schematic overview of this problem is given in the figure below: + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+