10
10
FrontLeftTopCamera ,
11
11
Inputs ,
12
12
LeftCamera ,
13
+ NonlinearResiduals ,
13
14
PatternCaption ,
14
15
RearCamera ,
15
16
RearRightBottomCamera ,
16
17
Settings ,
18
+ SubsetLimit ,
17
19
Summary ,
18
20
Table ,
19
21
TopCamera ,
@@ -31,6 +33,7 @@ def generate_report(
31
33
include_cfl : bool = False ,
32
34
include_forces_moments_table : bool = False ,
33
35
include_forces_moments_charts : bool = False ,
36
+ include_forces_moments_alpha_charts : bool = False ,
34
37
include_cf_vec : bool = False ,
35
38
include_cp : bool = False ,
36
39
include_yplus : bool = False ,
@@ -42,8 +45,6 @@ def generate_report(
42
45
43
46
exclude = freestream_surfaces
44
47
45
- SOLVER_VERSION = __solver_version__
46
-
47
48
top_camera = TopCamera (pan_target = (3.5 , 0 , - 0.5 ), dimension = 15 , dimension_dir = "height" )
48
49
bottom_camera = BottomCamera (pan_target = (3.5 , 0 , - 0.5 ), dimension = 15 , dimension_dir = "height" )
49
50
front_camera = FrontCamera (pan_target = (3.5 , 0 , - 0.5 ), dimension = 15 , dimension_dir = "width" )
@@ -94,24 +95,20 @@ def generate_report(
94
95
avg = Average (fraction = 0.1 )
95
96
96
97
force_list = [
97
- "totalCD " ,
98
- "totalCL " ,
99
- "totalCFx " ,
100
- "totalCFy " ,
101
- "totalCFz " ,
102
- "totalCMx " ,
103
- "totalCMy " ,
104
- "totalCMz " ,
98
+ "CD " ,
99
+ "CL " ,
100
+ "CFx " ,
101
+ "CFy " ,
102
+ "CFz " ,
103
+ "CMx " ,
104
+ "CMy " ,
105
+ "CMz " ,
105
106
]
106
107
107
- residuals_list = ["0_cont" , "1_momx" , "2_momy" , "3_momz" , "4_energ" , "5_nuHat" ]
108
-
109
108
for model in params .models :
110
109
if model .type == "Fluid" :
111
110
turbulence_solver = model .turbulence_model_solver .type_name
112
111
113
- cfl_list = ["0_NavierStokes_cfl" , f"1_{ turbulence_solver } _cfl" ]
114
-
115
112
CD = DataItem (data = "surface_forces/totalCD" , exclude = exclude , title = "CD" , operations = avg )
116
113
CL = DataItem (data = "surface_forces/totalCL" , exclude = exclude , title = "CL" , operations = avg )
117
114
CFX = DataItem (data = "surface_forces/totalCFx" , exclude = exclude , title = "CFx" , operations = avg )
@@ -158,45 +155,50 @@ def generate_report(
158
155
items .append (table )
159
156
160
157
if include_residuals :
161
- residual_charts = [
162
- Chart2D (
163
- x = f"nonlinear_residuals/{ step_type } " ,
164
- y = f"nonlinear_residuals/{ residual } " ,
165
- force_new_page = True ,
166
- section_title = "Residuals" ,
167
- fig_name = f"{ residual } _fig" ,
168
- )
169
- for residual in residuals_list
170
- ]
171
- items .extend (residual_charts )
158
+ residual_chart = NonlinearResiduals (
159
+ force_new_page = True , section_title = "Nonlinear residuals" , fig_name = f"nonlin-res_fig"
160
+ )
161
+ items .append (residual_chart )
172
162
173
163
if include_cfl and params .time_stepping .CFL .type == "adaptive" :
174
- cfl_charts = [
175
- Chart2D (
176
- x = f"cfl/{ step_type } " ,
177
- y = f"cfl/{ cfl } " ,
178
- force_new_page = True ,
179
- section_title = "CFL" ,
180
- fig_name = f"{ cfl } _fig" ,
181
- )
182
- for cfl in cfl_list
183
- ]
184
- items .extend (cfl_charts )
164
+ cfl_chart = Chart2D (
165
+ x = f"cfl/{ step_type } " ,
166
+ y = ["cfl/0_NavierStokes_cfl" , f"cfl/1_{ turbulence_solver } _cfl" ],
167
+ force_new_page = True ,
168
+ section_title = "CFL" ,
169
+ fig_name = "cfl_fig" ,
170
+ y_log = True ,
171
+ )
172
+ items .append (cfl_chart )
185
173
186
174
if include_forces_moments_charts :
187
175
force_charts = [
188
176
Chart2D (
189
177
x = f"surface_forces/{ step_type } " ,
190
- y = f"surface_forces/{ force } " ,
178
+ y = f"surface_forces/total { force } " ,
191
179
force_new_page = True ,
192
180
section_title = "Forces/Moments" ,
193
181
fig_name = f"{ force } _fig" ,
194
182
exclude = exclude ,
183
+ ylim = SubsetLimit (subset = (0.5 , 1 ), offset = 0.25 ),
195
184
)
196
185
for force in force_list
197
186
]
198
187
items .extend (force_charts )
199
188
189
+ if include_forces_moments_alpha_charts :
190
+ force_alpha_charts = [
191
+ Chart2D (
192
+ x = f"params/operating_condition/alpha" ,
193
+ y = f"total_forces/averages/{ force } " ,
194
+ force_new_page = True ,
195
+ section_title = "Averaged Forces/Moments against alpha" ,
196
+ fig_name = f"{ force } _alpha_fig" ,
197
+ )
198
+ for force in force_list
199
+ ]
200
+ items .extend (force_alpha_charts )
201
+
200
202
if include_yplus :
201
203
y_plus_screenshots = [
202
204
Chart3D (
@@ -271,7 +273,7 @@ def generate_report(
271
273
report = report .create_in_cloud (
272
274
"sweep-script-report" ,
273
275
cases ,
274
- solver_version = SOLVER_VERSION ,
276
+ solver_version = __solver_version__ ,
275
277
)
276
278
277
279
report .wait ()
0 commit comments