Skip to content

Commit ea47ca0

Browse files
authored
Merge pull request #49 from su2code/update_cht_tutorial
Update and enhance CHT tutorial
2 parents f82458f + 5ed4492 commit ea47ca0

File tree

7 files changed

+73
-25
lines changed

7 files changed

+73
-25
lines changed

_data/tutorials.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
- Inc_Turbulent_NACA0012
2626
- Inc_Laminar_Step
2727
- Inc_Laminar_Cavity
28-
- Inc_Heated_Cylinders
2928

3029
- title: Structural Mechanics
3130
tutorials:
@@ -38,6 +37,7 @@
3837
tutorials:
3938
- Static_FSI
4039
- Dynamic_FSI_Python
40+
- Static_CHT
4141

4242
- title: Design Features
4343
tutorials:

_tutorials/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ Simulation of external, viscous, incompressible flow around the NACA 0012 using
6363
Simulation of internal, laminar, incompressible flow over a backward-facing step with an inlet velocity profile input from file.
6464
* [Laminar Buoyancy-driven Cavity](/tutorials/Inc_Laminar_Cavity/)
6565
Simulation of internal, laminar, incompressible flow in a differentially-heated cavity under the influence of gravity (classical natural convection case).
66-
* [Heated Cylinders with Conjugate Heat Transfer](/tutorials/Inc_Heated_Cylinders/)
67-
Simulation of a coupled CHT problem incorporating multiple physical zones.
6866

6967
#### Structural Mechanics
7068
* [Linear Elasticity](/tutorials/Linear_Elasticity/)
@@ -79,6 +77,10 @@ Simulation of a non-linear problem with multiple material definitions
7977
#### Multiphysics
8078
* [Static Fluid-Structure Interaction](/tutorials/Static_FSI/)
8179
Non-linear structural mechanics coupled with incompressible Navier-Stokes flow
80+
* [Dynamic Fluid-Structure Interaction with the Python wrapper](/tutorials/Dynamic_FSI_Python/)
81+
Linear Nastran-like model coupled with compressible unsteady RANS equations using the Python wrapper
82+
* [Static Conjugate Heat Transfer](/tutorials/Static_CHT/)
83+
Simulation of multiple heated cylinders in incompressible fluid flow.
8284

8385
#### Shape Design Features
8486

_tutorials/incompressible_flow/Inc_Heated_Cylinders/Inc_Heated_Cylinders.md renamed to _tutorials/multiphysics/steady_cht/Static_CHT.md

Lines changed: 68 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
---
2-
title: Heated Cylinders with Conjugate Heat Transfer
3-
permalink: /tutorials/Inc_Heated_Cylinders/
2+
title: Static Conjugate Heat Transfer (CHT)
3+
permalink: /tutorials/Static_CHT
44
written_by: oleburghardt
55
for_version: 7.0.0
6-
revised_by: talbring
7-
revision_date: 2020-03-03
8-
revised_version: 7.0.2
6+
revised_by: oleburghardt
7+
revision_date: 2021-01-18
8+
revised_version: 7.0.8
99
solver: MULTIPHYSICS
10-
requires: SU2_CFD
10+
requires: SU2_CFD, SU2_CFD_AD, SU2_DOT_AD, SU2_DEF
1111
complexity: advanced
12-
follows:
12+
follows: Inc_Laminar_Flat_Plate
13+
userguide: Multizone
1314
---
1415

15-
![Coupled_CHT](../../tutorials_files/incompressible_flow/Inc_Heated_Cylinders/images/coupled_cht.png)
16+
![Coupled_CHT](../../tutorials_files/multiphysics/steady_cht/images/coupled_cht.png)
1617

1718
## Goals
1819

@@ -28,7 +29,7 @@ The intent of this tutorial is to introduce a simple multiple physical zones cas
2829

2930
## Resources
3031

31-
The resources for this tutorial can be found in the [incompressible_flow/Inc_Heated_Cylinders](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders) directory in the [tutorial repository](https://github.com/su2code/Tutorials). You will need the configuration files for all physical zones ([flow_cylinder.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/flow_cylinder.cfg), [solid_cylinder1.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/solid_cylinder1.cfg), [solid_cylinder2.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/solid_cylinder2.cfg), [solid_cylinder3.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/solid_cylinder3.cfg)), the cofiguration file to invoke a multiphysics simulation run ([cht_2d_3cylinders.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/cht_2d_3cylinders.cfg)) and the mesh file ([mesh_cht_3cyl.su2](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/mesh_cht_3cyl.su2)).
32+
The resources for this tutorial can be found in the [multiphysics/steady_cht](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht) directory in the [tutorial repository](https://github.com/su2code/Tutorials). You will need the configuration files for all physical zones ([flow_cylinder.cfg](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/flow_cylinder.cfg), [solid_cylinder1.cfg](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/solid_cylinder1.cfg), [solid_cylinder2.cfg](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/solid_cylinder2.cfg), [solid_cylinder3.cfg](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/solid_cylinder3.cfg)), the cofiguration file to invoke a multiphysics simulation run ([cht_2d_3cylinders.cfg](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/cht_2d_3cylinders.cfg)) and the mesh file ([mesh_cht_3cyl_ffd.su2](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/mesh_cht_3cyl_ffd.su2)).
3233

3334

3435
## Tutorial
@@ -61,14 +62,14 @@ A constant temperature boundary condition of 350 K on the inner core drives the
6162
The computational mesh for the fluid zone is composed 33700 elements (quad-dominant). The far-field boundary contains 80 line elements and the cylinders surfaces all have 400 line elemtents.
6263
The meshes for all three cylinders are composed of 4534 elements (quad-dominant) each, their inner diamaters are composed of 40 line elements, at their outer diamaters the mesh matches the one of the fluid zone.
6364

64-
![Lam Plate Mesh](../../tutorials_files/incompressible_flow/Inc_Heated_Cylinders/images/heated_cylinders_mesh.png)
65+
![Lam Plate Mesh](../../tutorials_files/multiphysics/steady_cht/images/heated_cylinders_mesh.png)
6566
Figure (1): Figure of the computational mesh with all four physical zones.
6667

6768
Uniform velocity boundary conditions are used for the farfield.
6869

6970
### Configuration File Options
7071

71-
Several of the key configuration file options for this simulation are highlighted here. First we show how we start a multiphysics simulation run incorporating CHT by choosing the following options in a main config file [cht_2d_3cylinders.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/cht_2d_3cylinders.cfg) (see [https://su2code.github.io/docs/Multizone](https://su2code.github.io/docs/Multizone) how to setup a multiphysics simulation in general):
72+
Several of the key configuration file options for this simulation are highlighted here. First we show how we start a multiphysics simulation run incorporating CHT by choosing the following options in a main config file [cht_2d_3cylinders.cfg](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/cht_2d_3cylinders.cfg) (see [https://su2code.github.io/docs/Multizone](https://su2code.github.io/docs/Multizone) how to setup a multiphysics simulation in general):
7273

7374
```
7475
MARKER_ZONE_INTERFACE= (cylinder_outer1, cylinder_inner1, cylinder_outer2, cylinder_inner2, cylinder_outer3, cylinder_inner3)
@@ -79,7 +80,7 @@ MARKER_CHT_INTERFACE= (cylinder_outer1, cylinder_inner1, cylinder_outer2, cylind
7980

8081
By setting `MARKER_CHT_INTERFACE` for the outer diameters, temperature and heat flux data will be exchanged between the solvers at these boundaries in each outer iteration.
8182

82-
As in the [laminar flat plate with heat transfer tutorial](/tutorials/Inc_Laminar_Flat_Plate/), we activate the energy equation in the flow domain config ([flow_cylinder.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/flow_cylinder.cfg)) but this time we allow for variable density as the heat input causes a non-neglectable influence on the density:
83+
As in the [laminar flat plate with heat transfer tutorial](/tutorials/Inc_Laminar_Flat_Plate/), we activate the energy equation in the flow domain config ([flow_cylinder.cfg](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/flow_cylinder.cfg)) but this time we allow for variable density as the heat input causes a non-neglectable influence on the density:
8384

8485
```
8586
% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------%
@@ -107,7 +108,7 @@ FLUID_MODEL= INC_IDEAL_GAS
107108
SPECIFIC_HEAT_CP= 1004.703
108109
```
109110

110-
The config files for the solid zones are quite short and mostly identical. E.g. for the first cylinder in upstream direction ([solid_cylinder1.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/solid_cylinder1.cfg)), we have to invoke the heat equation solver by
111+
The config files for the solid zones are quite short and mostly identical. E.g. for the first cylinder in upstream direction ([solid_cylinder1.cfg](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/solid_cylinder1.cfg)), we have to invoke the heat equation solver by
111112

112113
```
113114
% Physical governing equations (EULER, NAVIER_STOKES,
@@ -137,7 +138,7 @@ THERMAL_CONDUCTIVITY_SOLID= 0.1028
137138

138139
### Running SU2
139140

140-
The CHT simulation for the provided mesh will execute relatively, given that the coupled outer loop has to converge to a interface temperature solution as well. To run this test case, follow these steps at a terminal command line:
141+
The CHT simulation for the provided mesh will execute relatively quick, given that the coupled outer loop has to converge to a interface temperature solution as well. To run this test case, follow these steps at a terminal command line:
141142
1. Move to the directory containing the config files and the mesh files. Make sure that the SU2 tools were compiled, installed, and that their install location was added to your path.
142143
2. Run the executable by entering
143144

@@ -167,37 +168,82 @@ As for this test case, the objective function will be the sum of all integrated
167168
```
168169
% For a weighted sum of objectives: separate by commas, add OBJECTIVE_WEIGHT and MARKER_MONITORING in matching order.
169170
OBJECTIVE_FUNCTION= TOTAL_HEATFLUX
170-
%
171+
172+
```
173+
174+
in [cht_2d_3cylinders.cfg](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/cht_2d_3cylinders.cfg),
175+
176+
```
171177
% Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated
172178
MARKER_MONITORING= (cylinder_outer1, cylinder_outer2, cylinder_outer3)
173179
```
174180
175-
in [flow_cylinder.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/flow_cylinder.cfg) and
181+
in [flow_cylinder.cfg](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/flow_cylinder.cfg) and
176182
177183
```
178184
% Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated
179185
MARKER_MONITORING= ( NONE )
180186
```
181187
182-
in [solid_cylinder1.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/solid_cylinder1.cfg), [solid_cylinder2.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/solid_cylinder2.cfg) and [solid_cylinder3.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/solid_cylinder3.cfg).
188+
in [solid_cylinder1.cfg](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/solid_cylinder1.cfg), [solid_cylinder2.cfg](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/solid_cylinder2.cfg) and [solid_cylinder3.cfg](https://github.com/su2code/Tutorials/tree/master/multiphysics/steady_cht/solid_cylinder3.cfg).
183189
One could also set objective functions in all the solid config files seperately which would in the end give same results.
184190
185-
Based on all four solution files from the different zones ([solution_flow_0.dat](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/solution_flow_0.dat), [solution_flow_1.dat]([../../](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/)Inc_Heated_Cylinders/solution_flow_1.dat), [solution_flow_2.dat](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/solution_flow_2.dat), [solution_flow_3.dat](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Heated_Cylinders/solution_flow_3.dat)) that can be found in the directory that contains the config files and the mesh, we start the discrete adjoint run by entering
191+
Based on all four solution files from the different zones (`solution_flow_0.dat` and so on), we start the discrete adjoint run by entering
186192
187193
```
188194
$ SU2_CFD_AD cht_2d_3cylinders.cfg
189195
```
190196
191-
### Results
197+
### Results and Validation
192198
193-
Results are given here for the SU2 discrete adjoint solutions for the integrated heat fluxes from all three solid cylinders into the incompressible fluid flow.
194199
Surface node sensitivities can be obtained from the discrete adjoint solutions via
195200
196201
```
202+
$ cp restart_adj_totheat_0.dat solution_adj_totheat_0.dat
203+
$ cp restart_adj_totheat_1.dat solution_adj_totheat_1.dat
204+
$ cp restart_adj_totheat_2.dat solution_adj_totheat_2.dat
205+
$ cp restart_adj_totheat_3.dat solution_adj_totheat_3.dat
197206
$ SU2_DOT_AD cht_2d_3cylinders.cfg
198207
```
199208
200-
and be checked against finite differences to find a perfect agreement.
209+
which are written to surface output files for each zone. Sensitivites from `surface_sens_0.dat` are shown as blue arrows, for all solid zones (`surface_sens_1.dat`, `surface_sens_2.dat`, `surface_sens_3.dat`) as red arrows.
201210
202-
![Coupled_CHT_Sens](../../tutorials_files/incompressible_flow/Inc_Heated_Cylinders/images/heated_cylinders_sens.png)
211+
![Coupled_CHT_Sens](../../tutorials_files/multiphysics/steady_cht/images/heated_cylinders_sens.png)
203212
Figure (2): Heat flux sensitivities obtained from the discrete adjoint flow solution (blue) and the discrete adjoint heat solutions (red), their sum giving the correct result. Note the sensitivity change in downstream direction in both directions and magnitude.
213+
214+
In order to validate the sensitivities (and therefore the discrete adjoint solutions, too), a free-form deformation box was already created around the first heated cylinder, to project all sensitivities onto one design variable (a FFD box control point) to check the obtained derivative against finite differences.
215+
216+
![Coupled_CHT_FFD](../../tutorials_files/multiphysics/steady_cht/images/heated_cylinders_ffd.png)
217+
Figure (3): FFD box of degree 24x1.
218+
219+
The upper middle control point at (12,1), moving into y-direction, is then used to define a single design parameter modifying the shape. This can be done by
220+
221+
```
222+
DV_KIND= FFD_CONTROL_POINT_2D
223+
DV_MARKER= ( cylinder_outer1, cylinder_inner1 )
224+
DV_PARAM= ( MAIN_BOX, 12, 1, 0.0, 1.0 )
225+
```
226+
227+
as in the main config file. The derivative of the integrated heat flux with respect to this design veriable was thus alsp automatically computed and written to `of_grad_0.dat` and `of_grad_1.dat`; the other to cylinders are giving no direct contribution as their shape is not affected).
228+
229+
We will check the derivative (0.152507 + 0.234148 + 0.0 + 0.0 = 0,386655) against finite differences at magnitudes from 1.0e-2 to 1.0e-6. To this end, we have to deform the multizone mesh by setting
230+
231+
```
232+
DV_VALUE= 0.00001
233+
```
234+
235+
and running
236+
237+
```
238+
$ SU2_DEF cht_2d_3cylinders.cfg
239+
```
240+
241+
which will produce the deformed multizone mesh `mesh_cht_3cyl_out.su2`, on which the integrated heatflux can be recomputed (analogously for other magnitudes). Relative errors to the value generated from discrete adjoints are given below.
242+
243+
magnitude | heatflux value | FD derivative | rel. error (%)
244+
--- | --- | --- | ---
245+
1.0e-2 | -31.89331058028049 | 0,390077422 | 0,8861153
246+
1.0e-3 | -31.89682435269217 | 0.387001813 | 0.0906675
247+
1.0e-4 | -31.89717268560501 | 0.386688997 | 0.0097636
248+
1.0e-5 | -31.89720748792119 | 0.38665835 | 0.0018381
249+
1.0e-6 | -31.89721096784924 | 0.38665548 | 0.001095

tutorials_files/incompressible_flow/Inc_Heated_Cylinders/images/coupled_cht.png renamed to tutorials_files/multiphysics/steady_cht/images/coupled_cht.png

File renamed without changes.
512 KB
Loading

tutorials_files/incompressible_flow/Inc_Heated_Cylinders/images/heated_cylinders_mesh.png renamed to tutorials_files/multiphysics/steady_cht/images/heated_cylinders_mesh.png

File renamed without changes.

tutorials_files/incompressible_flow/Inc_Heated_Cylinders/images/heated_cylinders_sens.png renamed to tutorials_files/multiphysics/steady_cht/images/heated_cylinders_sens.png

File renamed without changes.

0 commit comments

Comments
 (0)