@@ -20,18 +20,19 @@ In 2D, the freestream-normal unit vector ``\psi_L`` is given by
20
20
```
21
21
where ``\a lpha`` is the angle of attack.
22
22
Supposed to be used in conjunction with [`AnalysisSurfaceIntegral`](@ref)
23
- which stores the boundary information and semidiscretization.
23
+ which stores the the to-be-computed variables (for instance `LiftCoefficientPressure2D`)
24
+ and boundary information.
24
25
25
26
- `aoa::Real`: Angle of attack in radians (for airfoils etc.)
26
27
- `rho_inf::Real`: Free-stream density
27
28
- `u_inf::Real`: Free-stream velocity
28
29
- `l_inf::Real`: Reference length of geometry (e.g. airfoil chord length)
29
30
"""
30
31
function LiftCoefficientPressure2D (aoa, rho_inf, u_inf, l_inf)
31
- # psi_lift is the normal unit vector to the freestream direction.
32
- # Note: The choice of the normal vector psi_lift = (-sin(aoa), cos(aoa))
32
+ # ` psi_lift` is the normal unit vector to the freestream direction.
33
+ # Note: The choice of the normal vector ` psi_lift = (-sin(aoa), cos(aoa))`
33
34
# leads to positive lift coefficients for positive angles of attack for airfoils.
34
- # One could also use psi_lift = (sin(aoa), -cos(aoa)) which results in the same
35
+ # One could also use ` psi_lift = (sin(aoa), -cos(aoa))` which results in the same
35
36
# value, but with the opposite sign.
36
37
psi_lift = (- sin (aoa), cos (aoa))
37
38
return LiftCoefficientPressure (ForceState (psi_lift, rho_inf, u_inf, l_inf))
@@ -53,7 +54,8 @@ In 2D, the freestream-tangent unit vector ``\psi_D`` is given by
53
54
where ``\a lpha`` is the angle of attack.
54
55
55
56
Supposed to be used in conjunction with [`AnalysisSurfaceIntegral`](@ref)
56
- which stores the boundary information and semidiscretization.
57
+ which stores the the to-be-computed variables (for instance `DragCoefficientPressure2D`)
58
+ and boundary information.
57
59
58
60
- `aoa::Real`: Angle of attack in radians (for airfoils etc.)
59
61
- `rho_inf::Real`: Free-stream density
@@ -81,18 +83,19 @@ In 2D, the freestream-normal unit vector ``\psi_L`` is given by
81
83
```
82
84
where ``\a lpha`` is the angle of attack.
83
85
Supposed to be used in conjunction with [`AnalysisSurfaceIntegral`](@ref)
84
- which stores the boundary information and semidiscretization.
86
+ which stores the the to-be-computed variables (for instance `LiftCoefficientShearStress2D`)
87
+ and boundary information.
85
88
86
89
- `aoa::Real`: Angle of attack in radians (for airfoils etc.)
87
90
- `rho_inf::Real`: Free-stream density
88
91
- `u_inf::Real`: Free-stream velocity
89
92
- `l_inf::Real`: Reference length of geometry (e.g. airfoil chord length)
90
93
"""
91
94
function LiftCoefficientShearStress2D (aoa, rho_inf, u_inf, l_inf)
92
- # psi_lift is the normal unit vector to the freestream direction.
93
- # Note: The choice of the normal vector psi_lift = (-sin(aoa), cos(aoa))
95
+ # ` psi_lift` is the normal unit vector to the freestream direction.
96
+ # Note: The choice of the normal vector ` psi_lift = (-sin(aoa), cos(aoa))`
94
97
# leads to negative lift coefficients for airfoils.
95
- # One could also use psi_lift = (sin(aoa), -cos(aoa)) which results in the same
98
+ # One could also use ` psi_lift = (sin(aoa), -cos(aoa))` which results in the same
96
99
# value, but with the opposite sign.
97
100
psi_lift = (- sin (aoa), cos (aoa))
98
101
return LiftCoefficientShearStress (ForceState (psi_lift, rho_inf, u_inf, l_inf))
@@ -113,7 +116,8 @@ In 2D, the freestream-tangent unit vector ``\psi_D`` is given by
113
116
```
114
117
where ``\a lpha`` is the angle of attack.
115
118
Supposed to be used in conjunction with [`AnalysisSurfaceIntegral`](@ref)
116
- which stores the boundary information and semidiscretization.
119
+ which stores the the to-be-computed variables (for instance `DragCoefficientShearStress2D`)
120
+ and boundary information.
117
121
118
122
- `aoa::Real`: Angle of attack in radians (for airfoils etc.)
119
123
- `rho_inf::Real`: Free-stream density
@@ -196,6 +200,8 @@ function (drag_coefficient::DragCoefficientShearStress{RealT, 2})(u, normal_dire
196
200
(0.5f0 * rho_inf * u_inf^ 2 * l_inf)
197
201
end
198
202
203
+ # 2D version of the `analyze` function for `AnalysisSurfaceIntegral`, i.e.,
204
+ # `LiftCoefficientPressure` and `DragCoefficientPressure`.
199
205
function analyze (surface_variable:: AnalysisSurfaceIntegral , du, u, t,
200
206
mesh:: P4estMesh{2} ,
201
207
equations, dg:: DGSEM , cache, semi)
@@ -220,8 +226,8 @@ function analyze(surface_variable::AnalysisSurfaceIntegral, du, u, t,
220
226
i_node = i_node_start
221
227
j_node = j_node_start
222
228
for node_index in index_range
223
- u_node = Trixi. get_node_vars (cache. boundaries. u, equations, dg, node_index,
224
- boundary)
229
+ u_node = Trixi. get_node_vars (cache. boundaries. u, equations, dg,
230
+ node_index, boundary)
225
231
# Extract normal direction at nodes which points from the elements outwards,
226
232
# i.e., *into* the structure.
227
233
normal_direction = get_normal_direction (direction, contravariant_vectors,
@@ -247,8 +253,12 @@ function analyze(surface_variable::AnalysisSurfaceIntegral, du, u, t,
247
253
return surface_integral
248
254
end
249
255
250
- function analyze (surface_variable:: AnalysisSurfaceIntegral{Variable} ,
251
- du, u, t, mesh:: P4estMesh{2} ,
256
+ # 2D version of the `analyze` function for `AnalysisSurfaceIntegral` of viscous, i.e.,
257
+ # variables that require gradients of the solution variables.
258
+ # These are for parabolic equations readily available.
259
+ # Examples are `LiftCoefficientShearStress` and `DragCoefficientShearStress`.
260
+ function analyze (surface_variable:: AnalysisSurfaceIntegral{Variable} , du, u, t,
261
+ mesh:: P4estMesh{2} ,
252
262
equations, equations_parabolic,
253
263
dg:: DGSEM , cache, semi,
254
264
cache_parabolic) where {Variable <: VariableViscous }
@@ -279,8 +289,8 @@ function analyze(surface_variable::AnalysisSurfaceIntegral{Variable},
279
289
i_node = i_node_start
280
290
j_node = j_node_start
281
291
for node_index in index_range
282
- u_node = Trixi. get_node_vars (cache. boundaries. u, equations, dg, node_index,
283
- boundary)
292
+ u_node = Trixi. get_node_vars (cache. boundaries. u, equations, dg,
293
+ node_index, boundary)
284
294
# Extract normal direction at nodes which points from the elements outwards,
285
295
# i.e., *into* the structure.
286
296
normal_direction = get_normal_direction (direction, contravariant_vectors,
0 commit comments