Skip to content

Commit f04ae25

Browse files
committed
Updates in CHT tutorial markdown file, some more stuff on validation of the discrete adjoint solutions.
1 parent 8881352 commit f04ae25

File tree

1 file changed

+63
-20
lines changed

1 file changed

+63
-20
lines changed

_tutorials/multiphysics/steady_cht/Static_CHT.md

Lines changed: 63 additions & 20 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
1010
requires: SU2_CFD
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,
@@ -167,37 +168,79 @@ 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 1.0e-5 and 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 1.0e-6). Relative errors to the value generated from discrete adjoints are given below.
242+
243+
magnitude | heatflux value | finite difference derivative | rel. error (%)
244+
--- | --- | --- | ---
245+
1.0e-5 | -31,89720748792119 | 0,38665835 | 0,0008672
246+
1.0e-6 | -31,89721096784924 | 0,38665548 | 0,0001241

0 commit comments

Comments
 (0)