ADflow  v1.0
ADflow is a finite volume RANS solver tailored for gradient-based aerodynamic design optimization.
surfaceIntegrations_fast_b.f90
Go to the documentation of this file.
1 ! generated by tapenade (inria, ecuador team)
2 ! tapenade 3.16 (develop) - 22 aug 2023 15:51
3 !
5  implicit none
6 
7 contains
8  subroutine getcostfunctions(globalvals, funcvalues)
9  use constants
11  use flowvarrefstate, only : pref, rhoref, tref, lref, gammainf, pinf&
12 & , uref, uinf
18  use inputtsstabderiv, only : tsstability
20  use flowutils_fast_b, only : getdirvector
21  implicit none
22 ! input/output
23  real(kind=realtype), dimension(:, :), intent(in) :: globalvals
24  real(kind=realtype), dimension(:), intent(out) :: funcvalues
25 ! working
26  real(kind=realtype) :: fact, factmoment, ovrnts
27  real(kind=realtype), dimension(3, ntimeintervalsspectral) :: force, &
28 & forcep, forcev, forcem, moment, cforce, cforcep, cforcev, cforcem, &
29 & cmoment, cofx, cofy, cofz
30  real(kind=realtype), dimension(3) :: vcoordref, vfreestreamref
31  real(kind=realtype) :: mavgptot, mavgttot, mavgrho, mavgps, mflow, &
32 & mavgmn, mavga, mavgvx, mavgvy, mavgvz, garea, mavgvi, fxlift, fylift&
33 & , fzlift
34  real(kind=realtype) :: vdotn, mag, u, v, w, ks_comp
35  integer(kind=inttype) :: sps
36  real(kind=realtype), dimension(8) :: dcdq, dcdqdot
37  real(kind=realtype), dimension(8) :: dcdalpha, dcdalphadot
38  real(kind=realtype), dimension(8) :: coef0
39  intrinsic log
40  intrinsic exp
41  intrinsic sqrt
42 ! factor used for time-averaged quantities.
44 ! sum pressure and viscous contributions
45  force = globalvals(ifp:ifp+2, :) + globalvals(ifv:ifv+2, :) + &
46 & globalvals(iflowfm:iflowfm+2, :)
47  forcep = globalvals(ifp:ifp+2, :)
48  forcev = globalvals(ifv:ifv+2, :)
49  forcem = globalvals(iflowfm:iflowfm+2, :)
50  cofx = globalvals(icoforcex:icoforcex+2, :)
51  cofy = globalvals(icoforcey:icoforcey+2, :)
52  cofz = globalvals(icoforcez:icoforcez+2, :)
53  moment = globalvals(imp:imp+2, :) + globalvals(imv:imv+2, :) + &
54 & globalvals(iflowmm:iflowmm+2, :)
56  cforce = fact*force
57  cforcep = fact*forcep
58  cforcev = fact*forcev
59  cforcem = fact*forcem
60 ! moment factor has an extra lengthref
61  fact = fact/(lengthref*lref)
62  cmoment = fact*moment
63 ! zero values since we are summing.
64  funcvalues = zero
65 !$ad ii-loop
66 ! here we finally assign the final function values
67  do sps=1,ntimeintervalsspectral
68  funcvalues(costfuncforcex) = funcvalues(costfuncforcex) + ovrnts*&
69 & force(1, sps)
70  funcvalues(costfuncforcey) = funcvalues(costfuncforcey) + ovrnts*&
71 & force(2, sps)
72  funcvalues(costfuncforcez) = funcvalues(costfuncforcez) + ovrnts*&
73 & force(3, sps)
74  funcvalues(costfuncforcexpressure) = funcvalues(&
75 & costfuncforcexpressure) + ovrnts*forcep(1, sps)
76  funcvalues(costfuncforceypressure) = funcvalues(&
77 & costfuncforceypressure) + ovrnts*forcep(2, sps)
78  funcvalues(costfuncforcezpressure) = funcvalues(&
79 & costfuncforcezpressure) + ovrnts*forcep(3, sps)
80  funcvalues(costfuncforcexviscous) = funcvalues(&
81 & costfuncforcexviscous) + ovrnts*forcev(1, sps)
82  funcvalues(costfuncforceyviscous) = funcvalues(&
83 & costfuncforceyviscous) + ovrnts*forcev(2, sps)
84  funcvalues(costfuncforcezviscous) = funcvalues(&
85 & costfuncforcezviscous) + ovrnts*forcev(3, sps)
86  funcvalues(costfuncforcexmomentum) = funcvalues(&
87 & costfuncforcexmomentum) + ovrnts*forcem(1, sps)
88  funcvalues(costfuncforceymomentum) = funcvalues(&
89 & costfuncforceymomentum) + ovrnts*forcem(2, sps)
90  funcvalues(costfuncforcezmomentum) = funcvalues(&
91 & costfuncforcezmomentum) + ovrnts*forcem(3, sps)
92 ! ------------
93  funcvalues(costfuncforcexcoef) = funcvalues(costfuncforcexcoef) + &
94 & ovrnts*cforce(1, sps)
95  funcvalues(costfuncforceycoef) = funcvalues(costfuncforceycoef) + &
96 & ovrnts*cforce(2, sps)
97  funcvalues(costfuncforcezcoef) = funcvalues(costfuncforcezcoef) + &
98 & ovrnts*cforce(3, sps)
99  funcvalues(costfuncforcexcoefpressure) = funcvalues(&
100 & costfuncforcexcoefpressure) + ovrnts*cforcep(1, sps)
101  funcvalues(costfuncforceycoefpressure) = funcvalues(&
102 & costfuncforceycoefpressure) + ovrnts*cforcep(2, sps)
103  funcvalues(costfuncforcezcoefpressure) = funcvalues(&
104 & costfuncforcezcoefpressure) + ovrnts*cforcep(3, sps)
105  funcvalues(costfuncforcexcoefviscous) = funcvalues(&
106 & costfuncforcexcoefviscous) + ovrnts*cforcev(1, sps)
107  funcvalues(costfuncforceycoefviscous) = funcvalues(&
108 & costfuncforceycoefviscous) + ovrnts*cforcev(2, sps)
109  funcvalues(costfuncforcezcoefviscous) = funcvalues(&
110 & costfuncforcezcoefviscous) + ovrnts*cforcev(3, sps)
111  funcvalues(costfuncforcexcoefmomentum) = funcvalues(&
112 & costfuncforcexcoefmomentum) + ovrnts*cforcem(1, sps)
113  funcvalues(costfuncforceycoefmomentum) = funcvalues(&
114 & costfuncforceycoefmomentum) + ovrnts*cforcem(2, sps)
115  funcvalues(costfuncforcezcoefmomentum) = funcvalues(&
116 & costfuncforcezcoefmomentum) + ovrnts*cforcem(3, sps)
117 ! ------------
118 ! center of pressure (these are actually center of all forces)
119 ! protect the divisions against zero, and divide the weighed sum by the force magnitude
120 ! for this time spectral instance before we add it to the sum
121  if (force(1, sps) .ne. zero) then
122  cofx(:, sps) = cofx(:, sps)/force(1, sps)
123  else
124  cofx(:, sps) = zero
125  end if
126  if (force(2, sps) .ne. zero) then
127  cofy(:, sps) = cofy(:, sps)/force(2, sps)
128  else
129  cofy(:, sps) = zero
130  end if
131  if (force(3, sps) .ne. zero) then
132  cofz(:, sps) = cofz(:, sps)/force(3, sps)
133  else
134  cofz(:, sps) = zero
135  end if
136 ! fx
137  funcvalues(costfunccoforcexx) = funcvalues(costfunccoforcexx) + &
138 & ovrnts*cofx(1, sps)
139  funcvalues(costfunccoforcexy) = funcvalues(costfunccoforcexy) + &
140 & ovrnts*cofx(2, sps)
141  funcvalues(costfunccoforcexz) = funcvalues(costfunccoforcexz) + &
142 & ovrnts*cofx(3, sps)
143 ! fy
144  funcvalues(costfunccoforceyx) = funcvalues(costfunccoforceyx) + &
145 & ovrnts*cofy(1, sps)
146  funcvalues(costfunccoforceyy) = funcvalues(costfunccoforceyy) + &
147 & ovrnts*cofy(2, sps)
148  funcvalues(costfunccoforceyz) = funcvalues(costfunccoforceyz) + &
149 & ovrnts*cofy(3, sps)
150 ! fz
151  funcvalues(costfunccoforcezx) = funcvalues(costfunccoforcezx) + &
152 & ovrnts*cofz(1, sps)
153  funcvalues(costfunccoforcezy) = funcvalues(costfunccoforcezy) + &
154 & ovrnts*cofz(2, sps)
155  funcvalues(costfunccoforcezz) = funcvalues(costfunccoforcezz) + &
156 & ovrnts*cofz(3, sps)
157 ! ------------
158  funcvalues(costfuncmomx) = funcvalues(costfuncmomx) + ovrnts*&
159 & moment(1, sps)
160  funcvalues(costfuncmomy) = funcvalues(costfuncmomy) + ovrnts*&
161 & moment(2, sps)
162  funcvalues(costfuncmomz) = funcvalues(costfuncmomz) + ovrnts*&
163 & moment(3, sps)
164  funcvalues(costfuncmomxcoef) = funcvalues(costfuncmomxcoef) + &
165 & ovrnts*cmoment(1, sps)
166  funcvalues(costfuncmomycoef) = funcvalues(costfuncmomycoef) + &
167 & ovrnts*cmoment(2, sps)
168  funcvalues(costfuncmomzcoef) = funcvalues(costfuncmomzcoef) + &
169 & ovrnts*cmoment(3, sps)
170 ! final part of the ks computation
171  if (computesepsensorks) then
172 ! only calculate the log part if we are actually computing for separation for ks method.
173  ks_comp = ovrnts*(sepsenmaxfamily(sps)+log(globalvals(&
174 & isepsensorks, sps))/sepsenmaxrho)
175  funcvalues(costfuncsepsensorks) = funcvalues(costfuncsepsensorks&
176 & ) + ks_comp
177  funcvalues(costfuncsepsensorksarea) = funcvalues(&
178 & costfuncsepsensorksarea) + ovrnts*globalvals(isepsensorksarea&
179 & , sps)*ks_comp*one/(one+exp(2*sepsensorkssharpness*(ks_comp+&
180 & sepsensorksoffset))) + ovrnts*globalvals(isepsensorarea, sps)
181  end if
182  funcvalues(costfuncsepsensor) = funcvalues(costfuncsepsensor) + &
183 & ovrnts*globalvals(isepsensor, sps)
184  funcvalues(costfunccavitation) = funcvalues(costfunccavitation) + &
185 & ovrnts*globalvals(icavitation, sps)
186 ! final part of the ks computation
187  if (computecavitation) then
188 ! only calculate the log part if we are actually computing for cavitation.
189 ! if we are not computing cavitation, the icpmin in globalvals will be zero,
190 ! which doesn't play well with log. we just want to return zero here.
191  funcvalues(costfunccpmin) = funcvalues(costfunccpmin) + ovrnts*(&
192 & cpmin_family(sps)-log(globalvals(icpmin, sps))/cpmin_rho)
193  end if
194  funcvalues(costfuncaxismoment) = funcvalues(costfuncaxismoment) + &
195 & ovrnts*globalvals(iaxismoment, sps)
196  funcvalues(costfuncsepsensoravgx) = funcvalues(&
197 & costfuncsepsensoravgx) + ovrnts*globalvals(isepavg, sps)
198  funcvalues(costfuncsepsensoravgy) = funcvalues(&
199 & costfuncsepsensoravgy) + ovrnts*globalvals(isepavg+1, sps)
200  funcvalues(costfuncsepsensoravgz) = funcvalues(&
201 & costfuncsepsensoravgz) + ovrnts*globalvals(isepavg+2, sps)
202  funcvalues(costfuncarea) = funcvalues(costfuncarea) + ovrnts*&
203 & globalvals(iarea, sps)
204  funcvalues(costfuncflowpower) = funcvalues(costfuncflowpower) + &
205 & ovrnts*globalvals(ipower, sps)
206  funcvalues(costfunccperror2) = funcvalues(costfunccperror2) + &
207 & ovrnts*globalvals(icperror2, sps)
208 ! mass flow like objective
209  mflow = globalvals(imassflow, sps)
210  if (mflow .ne. zero) then
211  mavgptot = globalvals(imassptot, sps)/mflow
212  mavgttot = globalvals(imassttot, sps)/mflow
213  mavgrho = globalvals(imassrho, sps)/mflow
214  mavgps = globalvals(imassps, sps)/mflow
215  mavgmn = globalvals(imassmn, sps)/mflow
216  mavga = globalvals(imassa, sps)/mflow
217  mavgvx = globalvals(imassvx, sps)/mflow
218  mavgvy = globalvals(imassvy, sps)/mflow
219  mavgvz = globalvals(imassvz, sps)/mflow
220  mavgvi = globalvals(imassvi, sps)/mflow
221  mag = sqrt(globalvals(imassnx, sps)**2 + globalvals(imassny, sps&
222 & )**2 + globalvals(imassnz, sps)**2)
223  else
224  mavgptot = zero
225  mavgttot = zero
226  mavgrho = zero
227  mavgps = zero
228  mavgmn = zero
229  mavga = zero
230  mavgvx = zero
231  mavgvy = zero
232  mavgvz = zero
233  mavgvi = zero
234  end if
235 ! area averaged objectives
236  garea = globalvals(iarea, sps)
237  if (garea .ne. zero) then
238 ! area averaged pressure
239  funcvalues(costfuncaavgptot) = funcvalues(costfuncaavgptot) + &
240 & ovrnts*globalvals(iareaptot, sps)/garea
241  funcvalues(costfuncaavgps) = funcvalues(costfuncaavgps) + ovrnts&
242 & *globalvals(iareaps, sps)/garea
243  end if
244  funcvalues(costfuncmdot) = funcvalues(costfuncmdot) + ovrnts*mflow
245  funcvalues(costfuncmavgptot) = funcvalues(costfuncmavgptot) + &
246 & ovrnts*mavgptot
247  funcvalues(costfuncmavgttot) = funcvalues(costfuncmavgttot) + &
248 & ovrnts*mavgttot
249  funcvalues(costfuncmavgrho) = funcvalues(costfuncmavgrho) + ovrnts&
250 & *mavgrho
251  funcvalues(costfuncmavgps) = funcvalues(costfuncmavgps) + ovrnts*&
252 & mavgps
253  funcvalues(costfuncmavgmn) = funcvalues(costfuncmavgmn) + ovrnts*&
254 & mavgmn
255  funcvalues(costfuncmavga) = funcvalues(costfuncmavga) + ovrnts*&
256 & mavga
257  funcvalues(costfuncmavgvx) = funcvalues(costfuncmavgvx) + ovrnts*&
258 & mavgvx
259  funcvalues(costfuncmavgvy) = funcvalues(costfuncmavgvy) + ovrnts*&
260 & mavgvy
261  funcvalues(costfuncmavgvz) = funcvalues(costfuncmavgvz) + ovrnts*&
262 & mavgvz
263  funcvalues(costfuncmavgvi) = funcvalues(costfuncmavgvi) + ovrnts*&
264 & mavgvi
265 ! bending moment calc - also broken.
266 ! call computerootbendingmoment(cforce, cmoment, liftindex, bendingmoment)
267 ! funcvalues(costfuncbendingcoef) = funcvalues(costfuncbendingcoef) + ovrnts*bendingmoment
268  end do
269 ! lift and drag (coefficients): dot product with the lift/drag direction.
270  funcvalues(costfunclift) = funcvalues(costfuncforcex)*liftdirection(&
271 & 1) + funcvalues(costfuncforcey)*liftdirection(2) + funcvalues(&
273  funcvalues(costfuncliftpressure) = funcvalues(costfuncforcexpressure&
274 & )*liftdirection(1) + funcvalues(costfuncforceypressure)*&
275 & liftdirection(2) + funcvalues(costfuncforcezpressure)*&
276 & liftdirection(3)
277  funcvalues(costfuncliftviscous) = funcvalues(costfuncforcexviscous)*&
279 & (2) + funcvalues(costfuncforcezviscous)*liftdirection(3)
280  funcvalues(costfuncliftmomentum) = funcvalues(costfuncforcexmomentum&
281 & )*liftdirection(1) + funcvalues(costfuncforceymomentum)*&
282 & liftdirection(2) + funcvalues(costfuncforcezmomentum)*&
283 & liftdirection(3)
284 !-----
285  funcvalues(costfuncdrag) = funcvalues(costfuncforcex)*dragdirection(&
286 & 1) + funcvalues(costfuncforcey)*dragdirection(2) + funcvalues(&
288  funcvalues(costfuncdragpressure) = funcvalues(costfuncforcexpressure&
289 & )*dragdirection(1) + funcvalues(costfuncforceypressure)*&
290 & dragdirection(2) + funcvalues(costfuncforcezpressure)*&
291 & dragdirection(3)
292  funcvalues(costfuncdragviscous) = funcvalues(costfuncforcexviscous)*&
294 & (2) + funcvalues(costfuncforcezviscous)*dragdirection(3)
295  funcvalues(costfuncdragmomentum) = funcvalues(costfuncforcexmomentum&
296 & )*dragdirection(1) + funcvalues(costfuncforceymomentum)*&
297 & dragdirection(2) + funcvalues(costfuncforcezmomentum)*&
298 & dragdirection(3)
299 !-----
300  funcvalues(costfuncliftcoef) = funcvalues(costfuncforcexcoef)*&
301 & liftdirection(1) + funcvalues(costfuncforceycoef)*liftdirection(2)&
302 & + funcvalues(costfuncforcezcoef)*liftdirection(3)
303  funcvalues(costfuncliftcoefpressure) = funcvalues(&
304 & costfuncforcexcoefpressure)*liftdirection(1) + funcvalues(&
305 & costfuncforceycoefpressure)*liftdirection(2) + funcvalues(&
307  funcvalues(costfuncliftcoefviscous) = funcvalues(&
308 & costfuncforcexcoefviscous)*liftdirection(1) + funcvalues(&
309 & costfuncforceycoefviscous)*liftdirection(2) + funcvalues(&
311  funcvalues(costfuncliftcoefmomentum) = funcvalues(&
312 & costfuncforcexcoefmomentum)*liftdirection(1) + funcvalues(&
313 & costfuncforceycoefmomentum)*liftdirection(2) + funcvalues(&
315 !-----
316  funcvalues(costfuncdragcoef) = funcvalues(costfuncforcexcoef)*&
317 & dragdirection(1) + funcvalues(costfuncforceycoef)*dragdirection(2)&
318 & + funcvalues(costfuncforcezcoef)*dragdirection(3)
319  funcvalues(costfuncdragcoefpressure) = funcvalues(&
320 & costfuncforcexcoefpressure)*dragdirection(1) + funcvalues(&
321 & costfuncforceycoefpressure)*dragdirection(2) + funcvalues(&
323  funcvalues(costfuncdragcoefviscous) = funcvalues(&
324 & costfuncforcexcoefviscous)*dragdirection(1) + funcvalues(&
325 & costfuncforceycoefviscous)*dragdirection(2) + funcvalues(&
327  funcvalues(costfuncdragcoefmomentum) = funcvalues(&
328 & costfuncforcexcoefmomentum)*dragdirection(1) + funcvalues(&
329 & costfuncforceycoefmomentum)*dragdirection(2) + funcvalues(&
331 ! ----- center of lift
332 ! dot product the 3 forces with the lift direction separately
333  fxlift = funcvalues(costfuncforcex)*liftdirection(1)
334  fylift = funcvalues(costfuncforcey)*liftdirection(2)
335  fzlift = funcvalues(costfuncforcez)*liftdirection(3)
336 ! run the weighed average for the 3 components of center of lift
337 ! protect against division by zero
338  if (fxlift + fylift + fzlift .ne. zero) then
339  funcvalues(costfunccofliftx) = (fxlift*funcvalues(&
340 & costfunccoforcexx)+fylift*funcvalues(costfunccoforceyx)+fzlift*&
341 & funcvalues(costfunccoforcezx))/(fxlift+fylift+fzlift)
342  funcvalues(costfunccoflifty) = (fxlift*funcvalues(&
343 & costfunccoforcexy)+fylift*funcvalues(costfunccoforceyy)+fzlift*&
344 & funcvalues(costfunccoforcezy))/(fxlift+fylift+fzlift)
345  funcvalues(costfunccofliftz) = (fxlift*funcvalues(&
346 & costfunccoforcexz)+fylift*funcvalues(costfunccoforceyz)+fzlift*&
347 & funcvalues(costfunccoforcezz))/(fxlift+fylift+fzlift)
348  else
349  funcvalues(costfunccofliftx) = zero
350  funcvalues(costfunccoflifty) = zero
351  funcvalues(costfunccofliftz) = zero
352  end if
353 ! -------------------- time spectral objectives ------------------
354  if (tsstability) then
355  print*, &
356 & 'error: tsstabilityderivatives are *broken*. they need to be ', &
357 & 'completely verifed from scratch'
358  stop
359  end if
360  end subroutine getcostfunctions
361 
362  subroutine wallintegrationface(localvalues, mm)
363 !
364 ! wallintegrations computes the contribution of the block
365 ! given by the pointers in blockpointers to the force and
366 ! moment of the geometry. a distinction is made
367 ! between the inviscid and viscous parts. in case the maximum
368 ! yplus value must be monitored (only possible for rans), this
369 ! value is also computed. the separation sensor and the cavita-
370 ! tion sensor is also computed
371 ! here.
372 !
373  use constants
374  use communication
375  use blockpointers
376  use flowvarrefstate
381  use bcpointers
382  implicit none
383 ! input/output variables
384  real(kind=realtype), dimension(nlocalvalues), intent(inout) :: &
385 & localvalues
386  integer(kind=inttype) :: mm
387 ! local variables.
388  real(kind=realtype), dimension(3) :: fp, fv, mp, mv
389  real(kind=realtype), dimension(3) :: cofsumfx, cofsumfy, cofsumfz
390  real(kind=realtype) :: yplusmax, sepsensorks, sepsensor, &
391 & sepsensoravg(3), sepsensorarea, cavitation, cpmin_ks_sum, &
392 & sepsensorksarea
393  integer(kind=inttype) :: i, j, ii, blk
394  real(kind=realtype) :: pm1, fx, fy, fz, fn
395  real(kind=realtype) :: vecttangential(3)
396  real(kind=realtype) :: vectdotproductfsnormal
397  real(kind=realtype) :: xc, xco, yc, yco, zc, zco, qf(3), r(3), n(3)&
398 & , l
399  real(kind=realtype) :: fact, rho, mul, yplus, dwall
400  real(kind=realtype) :: v(3), sensor, sensor1, cp, tmp, plocal, &
401 & ks_exponent
402  real(kind=realtype) :: tauxx, tauyy, tauzz
403  real(kind=realtype) :: tauxy, tauxz, tauyz
404  real(kind=realtype), dimension(3) :: refpoint
405  real(kind=realtype), dimension(3, 2) :: axispoints
406  real(kind=realtype) :: mx, my, mz, cellarea, m0x, m0y, m0z, mvaxis, &
407 & mpaxis
408  real(kind=realtype) :: cperror, cperror2
409  intrinsic mod
410  intrinsic max
411  intrinsic sqrt
412  intrinsic cos
413  intrinsic exp
414  select case (bcfaceid(mm))
415  case (imin, jmin, kmin)
416  fact = -one
417  case (imax, jmax, kmax)
418  fact = one
419  end select
420 ! determine the reference point for the moment computation in
421 ! meters.
422  refpoint(1) = lref*pointref(1)
423  refpoint(2) = lref*pointref(2)
424  refpoint(3) = lref*pointref(3)
425 ! determine the points defining the axis about which to compute a moment
426  axispoints(1, 1) = lref*momentaxis(1, 1)
427  axispoints(1, 2) = lref*momentaxis(1, 2)
428  axispoints(2, 1) = lref*momentaxis(2, 1)
429  axispoints(2, 2) = lref*momentaxis(2, 2)
430  axispoints(3, 1) = lref*momentaxis(3, 1)
431  axispoints(3, 2) = lref*momentaxis(3, 2)
432 ! initialize the force and moment coefficients to 0 as well as
433 ! yplusmax.
434  fp = zero
435  fv = zero
436  mp = zero
437  mv = zero
438  cofsumfx = zero
439  cofsumfy = zero
440  cofsumfz = zero
441  yplusmax = zero
442  sepsensor = zero
443  sepsensorks = zero
444  sepsensorarea = zero
445  sepsensorksarea = zero
446  cavitation = zero
447  cpmin_ks_sum = zero
448  sepsensoravg = zero
449  mpaxis = zero
450  mvaxis = zero
451  cperror2 = zero
452 !$ad ii-loop
453 !
454 ! integrate the inviscid contribution over the solid walls,
455 ! either inviscid or viscous. the integration is done with
456 ! cp. for closed contours this is equal to the integration
457 ! of p; for open contours this is not the case anymore.
458 ! question is whether a force for an open contour is
459 ! meaningful anyway.
460 !
461 ! loop over the quadrilateral faces of the subface. note that
462 ! the nodal range of bcdata must be used and not the cell
463 ! range, because the latter may include the halo's in i and
464 ! j-direction. the offset +1 is there, because inbeg and jnbeg
465 ! refer to nodal ranges and not to cell ranges. the loop
466 ! (without the ad stuff) would look like:
467 !
468 ! do j=(bcdata(mm)%jnbeg+1),bcdata(mm)%jnend
469 ! do i=(bcdata(mm)%inbeg+1),bcdata(mm)%inend
470  do ii=0,(bcdata(mm)%jnend-bcdata(mm)%jnbeg)*(bcdata(mm)%inend-bcdata&
471 & (mm)%inbeg)-1
472  i = mod(ii, bcdata(mm)%inend - bcdata(mm)%inbeg) + bcdata(mm)%&
473 & inbeg + 1
474  j = ii/(bcdata(mm)%inend-bcdata(mm)%inbeg) + bcdata(mm)%jnbeg + 1
475 ! compute the average pressure minus 1 and the coordinates
476 ! of the centroid of the face relative from from the
477 ! moment reference point. due to the usage of pointers for
478 ! the coordinates, whose original array starts at 0, an
479 ! offset of 1 must be used. the pressure is multipled by
480 ! fact to account for the possibility of an inward or
481 ! outward pointing normal.
482  pm1 = fact*(half*(pp2(i, j)+pp1(i, j))-pinf)*pref
484  cp = (half*(pp2(i, j)+pp1(i, j))-pinf)*tmp
485  cperror = cp - bcdata(mm)%cptarget(i, j)
486  cperror2 = cperror2 + cperror*cperror
487  xc = fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1, &
488 & 1)) - refpoint(1)
489  yc = fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1, &
490 & 2)) - refpoint(2)
491  zc = fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1, &
492 & 3)) - refpoint(3)
493  if (bcdata(mm)%iblank(i, j) .lt. 0) then
494  blk = 0
495  else
496  blk = bcdata(mm)%iblank(i, j)
497  end if
498  fx = pm1*ssi(i, j, 1)
499  fy = pm1*ssi(i, j, 2)
500  fz = pm1*ssi(i, j, 3)
501 ! note from ay: technically, we can just compute the moments using the center of force
502 ! terms. however, the moment computations coded here distinguish pressure,
503 ! viscous, and momentum contributions to moment. even though these individual
504 ! contributions are not exposed to python, i still wanted to keep how it's done in the
505 ! code in case its useful in the future. this is also true for the face integrations
506 ! update the inviscid force and moment coefficients. iblank as we sum
507  fp(1) = fp(1) + fx*blk
508  fp(2) = fp(2) + fy*blk
509  fp(3) = fp(3) + fz*blk
510  mx = yc*fz - zc*fy
511  my = zc*fx - xc*fz
512  mz = xc*fy - yc*fx
513  mp(1) = mp(1) + mx*blk
514  mp(2) = mp(2) + my*blk
515  mp(3) = mp(3) + mz*blk
516 ! the force integral for the center of pressure computation.
517 ! we need the cell centers wrt origin
518  xco = fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
519 & , 1))
520  yco = fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
521 & , 2))
522  zco = fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
523 & , 3))
524 ! accumulate in the sums. each force component is tracked separately
525 ! force-x
526  cofsumfx(1) = cofsumfx(1) + xco*fx*blk
527  cofsumfx(2) = cofsumfx(2) + yco*fx*blk
528  cofsumfx(3) = cofsumfx(3) + zco*fx*blk
529 ! force-y
530  cofsumfy(1) = cofsumfy(1) + xco*fy*blk
531  cofsumfy(2) = cofsumfy(2) + yco*fy*blk
532  cofsumfy(3) = cofsumfy(3) + zco*fy*blk
533 ! force-z
534  cofsumfz(1) = cofsumfz(1) + xco*fz*blk
535  cofsumfz(2) = cofsumfz(2) + yco*fz*blk
536  cofsumfz(3) = cofsumfz(3) + zco*fz*blk
537 ! compute the r and n vectores for the moment around an
538 ! axis computation where r is the distance from the
539 ! force to the first point on the axis and n is a unit
540 ! normal in the direction of the axis
541  r(1) = fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
542 & , 1)) - axispoints(1, 1)
543  r(2) = fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
544 & , 2)) - axispoints(2, 1)
545  r(3) = fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
546 & , 3)) - axispoints(3, 1)
547  l = sqrt((axispoints(1, 2)-axispoints(1, 1))**2 + (axispoints(2, 2&
548 & )-axispoints(2, 1))**2 + (axispoints(3, 2)-axispoints(3, 1))**2)
549  n(1) = (axispoints(1, 2)-axispoints(1, 1))/l
550  n(2) = (axispoints(2, 2)-axispoints(2, 1))/l
551  n(3) = (axispoints(3, 2)-axispoints(3, 1))/l
552 ! compute the moment of the force about the first point
553 ! used to define the axis, and the project that axis in
554 ! the n direction
555  m0x = r(2)*fz - r(3)*fy
556  m0y = r(3)*fx - r(1)*fz
557  m0z = r(1)*fy - r(2)*fx
558  mpaxis = mpaxis + (m0x*n(1)+m0y*n(2)+m0z*n(3))*blk
559 ! save the face-based forces and area
560  bcdata(mm)%fp(i, j, 1) = fx
561  bcdata(mm)%fp(i, j, 2) = fy
562  bcdata(mm)%fp(i, j, 3) = fz
563  cellarea = sqrt(ssi(i, j, 1)**2 + ssi(i, j, 2)**2 + ssi(i, j, 3)**&
564 & 2)
565  bcdata(mm)%area(i, j) = cellarea
566 ! get normalized surface velocity:
567  v(1) = ww2(i, j, ivx)
568  v(2) = ww2(i, j, ivy)
569  v(3) = ww2(i, j, ivz)
570  v = v/(sqrt(v(1)**2+v(2)**2+v(3)**2)+1e-16)
571  if (computesepsensorks) then
572 ! freestream projection over the surface.
573  vectdotproductfsnormal = veldirfreestream(1)*bcdata(mm)%norm(i, &
574 & j, 1) + veldirfreestream(2)*bcdata(mm)%norm(i, j, 2) + &
575 & veldirfreestream(3)*bcdata(mm)%norm(i, j, 3)
576 ! tangential vector on the surface, which is the freestream projected vector
577  vecttangential(1) = veldirfreestream(1) - vectdotproductfsnormal&
578 & *bcdata(mm)%norm(i, j, 1)
579  vecttangential(2) = veldirfreestream(2) - vectdotproductfsnormal&
580 & *bcdata(mm)%norm(i, j, 2)
581  vecttangential(3) = veldirfreestream(3) - vectdotproductfsnormal&
582 & *bcdata(mm)%norm(i, j, 3)
583  vecttangential = vecttangential/(sqrt(vecttangential(1)**2+&
584 & vecttangential(2)**2+vecttangential(3)**2)+1e-16)
585 ! computing separation sensor
586 ! velocity dot products
587  sensor = v(1)*vecttangential(1) + v(2)*vecttangential(2) + v(3)*&
588 & vecttangential(3)
589 ! sepsensor value
590  sensor = (cos(degtorad*sepsensorksphi)-sensor)/(-cos(degtorad*&
591 & sepsensorksphi)+cos(zero)+1e-16)
592 ! also do the ks-based spensenor max computation
594 & , sepsenmaxrho, ks_exponent)
595  sepsensorksarea = sepsensorksarea + blk*cellarea
596  sepsensorarea = cellarea*blk*one/(one+exp(-(2*&
597 & sepsensorkssharpness*(sensor+sepsensorksoffset)))) + &
598 & sepsensorarea
599  sepsensorks = sepsensorks + ks_exponent*blk
600  end if
601 ! dot product with free stream
602  sensor = -(v(1)*veldirfreestream(1)+v(2)*veldirfreestream(2)+v(3)*&
603 & veldirfreestream(3))
604 !now run through a smooth heaviside function:
605  sensor = one/(one+exp(-(2*sepsensorsharpness*(sensor-&
606 & sepsensoroffset))))
607 ! and integrate over the area of this cell and save, blanking as we go.
608  sensor = sensor*cellarea*blk
609  sepsensor = sepsensor + sensor
610 ! also accumulate into the sepsensoravg
611 ! x-y-zco are computed above for center of force computations
612  sepsensoravg(1) = sepsensoravg(1) + sensor*xco
613  sepsensoravg(2) = sepsensoravg(2) + sensor*yco
614  sepsensoravg(3) = sepsensoravg(3) + sensor*zco
615  if (computecavitation) then
616  plocal = pp2(i, j)
617  tmp = two/(gammainf*machcoef*machcoef)
618  cp = tmp*(plocal-pinf)
619  sensor1 = -cp - cavitationnumber
620  sensor1 = sensor1**cavexponent/(one+exp(2*cavsensorsharpness*(-&
621 & sensor1+cavsensoroffset)))
622  sensor1 = sensor1*cellarea*blk
623  cavitation = cavitation + sensor1
624 ! also do the ks-based cpmin computation
625  ks_exponent = exp(cpmin_rho*(-cp+cpmin_family(spectralsol)))
626  cpmin_ks_sum = cpmin_ks_sum + ks_exponent*blk
627  end if
628  end do
629 !
630 ! integration of the viscous forces.
631 ! only for viscous boundaries.
632 !
633  if (bctype(mm) .eq. nswalladiabatic .or. bctype(mm) .eq. &
634 & nswallisothermal) then
635 ! initialize dwall for the laminar case and set the pointer
636 ! for the unit normals.
637  dwall = zero
638 !$ad ii-loop
639 ! loop over the quadrilateral faces of the subface and
640 ! compute the viscous contribution to the force and
641 ! moment and update the maximum value of y+.
642  do ii=0,(bcdata(mm)%jnend-bcdata(mm)%jnbeg)*(bcdata(mm)%inend-&
643 & bcdata(mm)%inbeg)-1
644  i = mod(ii, bcdata(mm)%inend - bcdata(mm)%inbeg) + bcdata(mm)%&
645 & inbeg + 1
646  j = ii/(bcdata(mm)%inend-bcdata(mm)%inbeg) + bcdata(mm)%jnbeg + &
647 & 1
648  if (bcdata(mm)%iblank(i, j) .lt. 0) then
649  blk = 0
650  else
651  blk = bcdata(mm)%iblank(i, j)
652  end if
653  tauxx = viscsubface(mm)%tau(i, j, 1)
654  tauyy = viscsubface(mm)%tau(i, j, 2)
655  tauzz = viscsubface(mm)%tau(i, j, 3)
656  tauxy = viscsubface(mm)%tau(i, j, 4)
657  tauxz = viscsubface(mm)%tau(i, j, 5)
658  tauyz = viscsubface(mm)%tau(i, j, 6)
659 ! compute the viscous force on the face. a minus sign
660 ! is now present, due to the definition of this force.
661  fx = -(fact*(tauxx*ssi(i, j, 1)+tauxy*ssi(i, j, 2)+tauxz*ssi(i, &
662 & j, 3))*pref)
663  fy = -(fact*(tauxy*ssi(i, j, 1)+tauyy*ssi(i, j, 2)+tauyz*ssi(i, &
664 & j, 3))*pref)
665  fz = -(fact*(tauxz*ssi(i, j, 1)+tauyz*ssi(i, j, 2)+tauzz*ssi(i, &
666 & j, 3))*pref)
667 ! compute the coordinates of the centroid of the face
668 ! relative from the moment reference point. due to the
669 ! usage of pointers for xx and offset of 1 is present,
670 ! because x originally starts at 0.
671  xc = fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
672 & , 1)) - refpoint(1)
673  yc = fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
674 & , 2)) - refpoint(2)
675  zc = fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
676 & , 3)) - refpoint(3)
677 ! update the viscous force and moment coefficients, blanking as we go.
678  fv(1) = fv(1) + fx*blk
679  fv(2) = fv(2) + fy*blk
680  fv(3) = fv(3) + fz*blk
681  mx = yc*fz - zc*fy
682  my = zc*fx - xc*fz
683  mz = xc*fy - yc*fx
684  mv(1) = mv(1) + mx*blk
685  mv(2) = mv(2) + my*blk
686  mv(3) = mv(3) + mz*blk
687 ! the force integral for the center of pressure computation.
688 ! we need the cell centers wrt origin
689  xco = fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+&
690 & 1, 1))
691  yco = fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+&
692 & 1, 2))
693  zco = fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+&
694 & 1, 3))
695 ! accumulate in the sums. each force component is tracked separately
696 ! force-x
697  cofsumfx(1) = cofsumfx(1) + xco*fx*blk
698  cofsumfx(2) = cofsumfx(2) + yco*fx*blk
699  cofsumfx(3) = cofsumfx(3) + zco*fx*blk
700 ! force-y
701  cofsumfy(1) = cofsumfy(1) + xco*fy*blk
702  cofsumfy(2) = cofsumfy(2) + yco*fy*blk
703  cofsumfy(3) = cofsumfy(3) + zco*fy*blk
704 ! force-z
705  cofsumfz(1) = cofsumfz(1) + xco*fz*blk
706  cofsumfz(2) = cofsumfz(2) + yco*fz*blk
707  cofsumfz(3) = cofsumfz(3) + zco*fz*blk
708 ! compute the r and n vectors for the moment around an
709 ! axis computation where r is the distance from the
710 ! force to the first point on the axis and n is a unit
711 ! normal in the direction of the axis
712  r(1) = fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j&
713 & +1, 1)) - axispoints(1, 1)
714  r(2) = fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j&
715 & +1, 2)) - axispoints(2, 1)
716  r(3) = fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j&
717 & +1, 3)) - axispoints(3, 1)
718  l = sqrt((axispoints(1, 2)-axispoints(1, 1))**2 + (axispoints(2&
719 & , 2)-axispoints(2, 1))**2 + (axispoints(3, 2)-axispoints(3, 1)&
720 & )**2)
721  n(1) = (axispoints(1, 2)-axispoints(1, 1))/l
722  n(2) = (axispoints(2, 2)-axispoints(2, 1))/l
723  n(3) = (axispoints(3, 2)-axispoints(3, 1))/l
724 ! compute the moment of the force about the first point
725 ! used to define the axis, and then project that axis in
726 ! the n direction
727  m0x = r(2)*fz - r(3)*fy
728  m0y = r(3)*fx - r(1)*fz
729  m0z = r(1)*fy - r(2)*fx
730  mvaxis = mvaxis + (m0x*n(1)+m0y*n(2)+m0z*n(3))*blk
731 ! save the face based forces for the slice operations
732  bcdata(mm)%fv(i, j, 1) = fx
733  bcdata(mm)%fv(i, j, 2) = fy
734  bcdata(mm)%fv(i, j, 3) = fz
735 ! compute the tangential component of the stress tensor,
736 ! which is needed to monitor y+. the result is stored
737 ! in fx, fy, fz, although it is not really a force.
738 ! as later on only the magnitude of the tangential
739 ! component is important, there is no need to take the
740 ! sign into account (it should be a minus sign).
741  fx = tauxx*bcdata(mm)%norm(i, j, 1) + tauxy*bcdata(mm)%norm(i, j&
742 & , 2) + tauxz*bcdata(mm)%norm(i, j, 3)
743  fy = tauxy*bcdata(mm)%norm(i, j, 1) + tauyy*bcdata(mm)%norm(i, j&
744 & , 2) + tauyz*bcdata(mm)%norm(i, j, 3)
745  fz = tauxz*bcdata(mm)%norm(i, j, 1) + tauyz*bcdata(mm)%norm(i, j&
746 & , 2) + tauzz*bcdata(mm)%norm(i, j, 3)
747  fn = fx*bcdata(mm)%norm(i, j, 1) + fy*bcdata(mm)%norm(i, j, 2) +&
748 & fz*bcdata(mm)%norm(i, j, 3)
749  fx = fx - fn*bcdata(mm)%norm(i, j, 1)
750  fy = fy - fn*bcdata(mm)%norm(i, j, 2)
751  fz = fz - fn*bcdata(mm)%norm(i, j, 3)
752 ! compute the local value of y+. due to the usage
753 ! of pointers there is on offset of -1 in dd2wall..
754  end do
755  else
756 ! if we had no viscous force, set the viscous component to zero
757  bcdata(mm)%fv = zero
758  end if
759 ! increment the local values array with the values we computed here.
760  localvalues(ifp:ifp+2) = localvalues(ifp:ifp+2) + fp
761  localvalues(ifv:ifv+2) = localvalues(ifv:ifv+2) + fv
762  localvalues(imp:imp+2) = localvalues(imp:imp+2) + mp
763  localvalues(imv:imv+2) = localvalues(imv:imv+2) + mv
764  localvalues(icoforcex:icoforcex+2) = localvalues(icoforcex:icoforcex&
765 & +2) + cofsumfx
766  localvalues(icoforcey:icoforcey+2) = localvalues(icoforcey:icoforcey&
767 & +2) + cofsumfy
768  localvalues(icoforcez:icoforcez+2) = localvalues(icoforcez:icoforcez&
769 & +2) + cofsumfz
770  localvalues(isepsensor) = localvalues(isepsensor) + sepsensor
771  localvalues(isepsensorks) = localvalues(isepsensorks) + sepsensorks
772  localvalues(isepsensorksarea) = localvalues(isepsensorksarea) + &
773 & sepsensorksarea
774  localvalues(isepsensorarea) = localvalues(isepsensorarea) + &
775 & sepsensorarea
776  localvalues(icavitation) = localvalues(icavitation) + cavitation
777  localvalues(icpmin) = localvalues(icpmin) + cpmin_ks_sum
778  localvalues(isepavg:isepavg+2) = localvalues(isepavg:isepavg+2) + &
779 & sepsensoravg
780  localvalues(iaxismoment) = localvalues(iaxismoment) + mpaxis + &
781 & mvaxis
782  localvalues(icperror2) = localvalues(icperror2) + cperror2
783  end subroutine wallintegrationface
784 
785  subroutine ksaggregationfunction(g, max_g, g_rho, ks_g)
786  use precision
787  implicit none
788  real(kind=realtype), intent(inout) :: ks_g
789  real(kind=realtype), intent(in) :: g, max_g, g_rho
790  intrinsic exp
791  ks_g = exp(g_rho*(g-max_g))
792  end subroutine ksaggregationfunction
793 
794  subroutine flowintegrationface(isinflow, localvalues, mm)
795  use constants
796  use blockpointers, only : bctype, bcfaceid, bcdata, &
798  use flowvarrefstate, only : pref, pinf, rhoref, timeref, lref, tref,&
800  use inputphysics, only : pointref, flowtype, rgasdim
802  use bcpointers, only : ssi, sface, ww1, ww2, pp1, pp2, xx, gamma1, &
803 & gamma2
804  use utils_fast_b, only : mynorm2
805  implicit none
806 ! input/output variables
807  logical, intent(in) :: isinflow
808  real(kind=realtype), dimension(nlocalvalues), intent(inout) :: &
809 & localvalues
810  integer(kind=inttype), intent(in) :: mm
811 ! local variables
812  real(kind=realtype) :: massflowrate, mass_ptot, mass_ttot, mass_ps, &
813 & mass_mn, mass_a, mass_rho, mass_vx, mass_vy, mass_vz, mass_nx, &
814 & mass_ny, mass_nz, mass_vi
815  real(kind=realtype) :: area_ptot, area_ps
816  real(kind=realtype) :: govgm1, gm1ovg, viconst, vilocal, pratio
817  real(kind=realtype) :: mredim
818  integer(kind=inttype) :: i, j, ii, blk
819  real(kind=realtype) :: internalflowfact, inflowfact, fact, xc, xco, &
820 & yc, yco, zc, zco, mx, my, mz
821  real(kind=realtype) :: sf, vmag, vnm, vnmfreestreamref, vxm, vym, &
822 & vzm, fx, fy, fz, u, v, w
823  real(kind=realtype) :: pm, ptot, ttot, rhom, gammam, am
824  real(kind=realtype) :: area, cellarea, overcellarea
825  real(kind=realtype), dimension(3) :: fp, mp, fmom, mmom, refpoint, &
826 & sfacecoordref
827  real(kind=realtype), dimension(3) :: cofsumfx, cofsumfy, cofsumfz
828  real(kind=realtype) :: mnm, massflowratelocal
829  intrinsic sqrt
830  intrinsic mod
831  intrinsic max
832  intrinsic min
833  refpoint(1) = lref*pointref(1)
834  refpoint(2) = lref*pointref(2)
835  refpoint(3) = lref*pointref(3)
836 ! note that these are *opposite* of force integrations. the reason
837 ! is that we want positive mass flow into the domain and negative
838 ! mass flow out of the domain. since the low faces have ssi
839 ! vectors pointining into the domain, this is correct. the high
840 ! end faces need to flip this.
841  select case (bcfaceid(mm))
842  case (imin, jmin, kmin)
843  fact = one
844  case (imax, jmax, kmax)
845  fact = -one
846  end select
847 ! the sign of momentum forces are flipped for internal flows
848  internalflowfact = one
849  if (flowtype .eq. internalflow) internalflowfact = -one
850  inflowfact = one
851  if (isinflow) inflowfact = -one
852 ! loop over the quadrilateral faces of the subface. note that
853 ! the nodal range of bcdata must be used and not the cell
854 ! range, because the latter may include the halo's in i and
855 ! j-direction. the offset +1 is there, because inbeg and jnbeg
856 ! refer to nodal ranges and not to cell ranges. the loop
857 ! (without the ad stuff) would look like:
858 !
859 ! do j=(bcdata(mm)%jnbeg+1),bcdata(mm)%jnend
860 ! do i=(bcdata(mm)%inbeg+1),bcdata(mm)%inend
861  mredim = sqrt(pref*rhoref)
862  fp = zero
863  mp = zero
864  fmom = zero
865  mmom = zero
866  cofsumfx = zero
867  cofsumfy = zero
868  cofsumfz = zero
869  massflowrate = zero
870  area = zero
871  mass_ptot = zero
872  mass_ttot = zero
873  mass_ps = zero
874  mass_mn = zero
875  mass_a = zero
876  mass_rho = zero
877  mass_vx = zero
878  mass_vy = zero
879  mass_vz = zero
880  mass_nx = zero
881  mass_ny = zero
882  mass_nz = zero
883  mass_vi = zero
884  area_ptot = zero
885  area_ps = zero
886 !$ad ii-loop
887  do ii=0,(bcdata(mm)%jnend-bcdata(mm)%jnbeg)*(bcdata(mm)%inend-bcdata&
888 & (mm)%inbeg)-1
889  i = mod(ii, bcdata(mm)%inend - bcdata(mm)%inbeg) + bcdata(mm)%&
890 & inbeg + 1
891  j = ii/(bcdata(mm)%inend-bcdata(mm)%inbeg) + bcdata(mm)%jnbeg + 1
892  if (addgridvelocities) then
893  sf = sface(i, j)
894  else
895  sf = zero
896  end if
897  if (bcdata(mm)%iblank(i, j) .lt. 0) then
898  blk = 0
899  else
900  blk = bcdata(mm)%iblank(i, j)
901  end if
902  vxm = half*(ww1(i, j, ivx)+ww2(i, j, ivx))
903  vym = half*(ww1(i, j, ivy)+ww2(i, j, ivy))
904  vzm = half*(ww1(i, j, ivz)+ww2(i, j, ivz))
905  rhom = half*(ww1(i, j, irho)+ww2(i, j, irho))
906  pm = half*(pp1(i, j)+pp2(i, j))
907  gammam = half*(gamma1(i, j)+gamma2(i, j))
908  vnm = vxm*ssi(i, j, 1) + vym*ssi(i, j, 2) + vzm*ssi(i, j, 3) - sf
909  vmag = sqrt(vxm**2 + vym**2 + vzm**2) - sf
910  am = sqrt(gammam*pm/rhom)
911  mnm = vmag/am
912  cellarea = sqrt(ssi(i, j, 1)**2 + ssi(i, j, 2)**2 + ssi(i, j, 3)**&
913 & 2)
914  area = area + cellarea*blk
915  overcellarea = 1/cellarea
916  call computeptot(rhom, vxm, vym, vzm, pm, ptot)
917  call computettot(rhom, vxm, vym, vzm, pm, ttot)
918  massflowratelocal = rhom*vnm*blk*fact*mredim
919  massflowrate = massflowrate + massflowratelocal
920 ! re-dimentionalize quantities
921  pm = pm*pref
922  mass_ptot = mass_ptot + ptot*massflowratelocal*pref
923  mass_ttot = mass_ttot + ttot*massflowratelocal*tref
924  mass_rho = mass_rho + rhom*massflowratelocal*rhoref
925  mass_a = mass_a + am*massflowratelocal*uref
926  mass_ps = mass_ps + pm*massflowratelocal
927  mass_mn = mass_mn + mnm*massflowratelocal
928  area_ptot = area_ptot + ptot*pref*cellarea*blk
929  area_ps = area_ps + pm*cellarea*blk
930  sfacecoordref(1) = sf*ssi(i, j, 1)*overcellarea
931  sfacecoordref(2) = sf*ssi(i, j, 2)*overcellarea
932  sfacecoordref(3) = sf*ssi(i, j, 3)*overcellarea
933  mass_vx = mass_vx + (vxm*uref-sfacecoordref(1))*massflowratelocal
934  mass_vy = mass_vy + (vym*uref-sfacecoordref(2))*massflowratelocal
935  mass_vz = mass_vz + (vzm*uref-sfacecoordref(3))*massflowratelocal
936  govgm1 = gammainf/(gammainf-one)
937  gm1ovg = one/govgm1
938  viconst = two*govgm1*rgasdim
939  if (one .gt. one/ptot) then
940  pratio = one/ptot
941  else
942  pratio = one
943  end if
944  vilocal = sqrt(viconst*(one-pratio**gm1ovg)*ttot*tref)
945  mass_vi = mass_vi + vilocal*massflowratelocal
946  mass_nx = mass_nx + ssi(i, j, 1)*overcellarea*massflowratelocal
947  mass_ny = mass_ny + ssi(i, j, 2)*overcellarea*massflowratelocal
948  mass_nz = mass_nz + ssi(i, j, 3)*overcellarea*massflowratelocal
949  xc = fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1, &
950 & 1)) - refpoint(1)
951  yc = fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1, &
952 & 2)) - refpoint(2)
953  zc = fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1, &
954 & 3)) - refpoint(3)
955 ! pressure forces. note that these need a *negative* and to subtract
956 ! the reference pressure sign to be consistent with the force
957 ! computation on the walls.
958  pm = -((pm-pinf*pref)*fact*blk)
959  fx = pm*ssi(i, j, 1)
960  fy = pm*ssi(i, j, 2)
961  fz = pm*ssi(i, j, 3)
962 ! update the pressure force and moment coefficients.
963  fp(1) = fp(1) + fx
964  fp(2) = fp(2) + fy
965  fp(3) = fp(3) + fz
966  mx = yc*fz - zc*fy
967  my = zc*fx - xc*fz
968  mz = xc*fy - yc*fx
969  mp(1) = mp(1) + mx
970  mp(2) = mp(2) + my
971  mp(3) = mp(3) + mz
972 ! the force integral for the center of pressure computation.
973 ! we need the cell centers wrt origin
974  xco = fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
975 & , 1))
976  yco = fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
977 & , 2))
978  zco = fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
979 & , 3))
980 ! center of force computations. here we accumulate in the sums.
981 ! accumulate in the sums. each force component is tracked separately
982 ! blanking is included in the mdot multiplier for the force.
983 ! force-x
984  cofsumfx(1) = cofsumfx(1) + xco*fx
985  cofsumfx(2) = cofsumfx(2) + yco*fx
986  cofsumfx(3) = cofsumfx(3) + zco*fx
987 ! force-y
988  cofsumfy(1) = cofsumfy(1) + xco*fy
989  cofsumfy(2) = cofsumfy(2) + yco*fy
990  cofsumfy(3) = cofsumfy(3) + zco*fy
991 ! force-z
992  cofsumfz(1) = cofsumfz(1) + xco*fz
993  cofsumfz(2) = cofsumfz(2) + yco*fz
994  cofsumfz(3) = cofsumfz(3) + zco*fz
995 ! momentum forces are a little tricky. we negate because
996 ! have to re-apply fact to massflowratelocal to undoo it, because
997 ! we need the signed behavior of ssi to get the momentum forces correct.
998 ! also, the sign is flipped between inflow and outflow types
999  massflowratelocal = massflowratelocal*fact/timeref*blk/cellarea*&
1000 & internalflowfact*inflowfact
1001  fx = massflowratelocal*ssi(i, j, 1)*vxm
1002  fy = massflowratelocal*ssi(i, j, 2)*vym
1003  fz = massflowratelocal*ssi(i, j, 3)*vzm
1004  fmom(1) = fmom(1) + fx
1005  fmom(2) = fmom(2) + fy
1006  fmom(3) = fmom(3) + fz
1007  mx = yc*fz - zc*fy
1008  my = zc*fx - xc*fz
1009  mz = xc*fy - yc*fx
1010  mmom(1) = mmom(1) + mx
1011  mmom(2) = mmom(2) + my
1012  mmom(3) = mmom(3) + mz
1013 ! center of force computations. here we accumulate in the sums.
1014 ! each force component is tracked separately
1015 ! blanking is included in the mdot multiplier for the force.
1016 ! force-x
1017  cofsumfx(1) = cofsumfx(1) + xco*fx
1018  cofsumfx(2) = cofsumfx(2) + yco*fx
1019  cofsumfx(3) = cofsumfx(3) + zco*fx
1020 ! force-y
1021  cofsumfy(1) = cofsumfy(1) + xco*fy
1022  cofsumfy(2) = cofsumfy(2) + yco*fy
1023  cofsumfy(3) = cofsumfy(3) + zco*fy
1024 ! force-z
1025  cofsumfz(1) = cofsumfz(1) + xco*fz
1026  cofsumfz(2) = cofsumfz(2) + yco*fz
1027  cofsumfz(3) = cofsumfz(3) + zco*fz
1028  end do
1029 ! increment the local values array with what we computed here
1030  localvalues(imassflow) = localvalues(imassflow) + massflowrate
1031  localvalues(iarea) = localvalues(iarea) + area
1032  localvalues(imassrho) = localvalues(imassrho) + mass_rho
1033  localvalues(imassa) = localvalues(imassa) + mass_a
1034  localvalues(imassptot) = localvalues(imassptot) + mass_ptot
1035  localvalues(imassttot) = localvalues(imassttot) + mass_ttot
1036  localvalues(imassps) = localvalues(imassps) + mass_ps
1037  localvalues(imassmn) = localvalues(imassmn) + mass_mn
1038  localvalues(ifp:ifp+2) = localvalues(ifp:ifp+2) + fp
1039  localvalues(iflowfm:iflowfm+2) = localvalues(iflowfm:iflowfm+2) + &
1040 & fmom
1041  localvalues(iflowmp:iflowmp+2) = localvalues(iflowmp:iflowmp+2) + mp
1042  localvalues(iflowmm:iflowmm+2) = localvalues(iflowmm:iflowmm+2) + &
1043 & mmom
1044  localvalues(icoforcex:icoforcex+2) = localvalues(icoforcex:icoforcex&
1045 & +2) + cofsumfx
1046  localvalues(icoforcey:icoforcey+2) = localvalues(icoforcey:icoforcey&
1047 & +2) + cofsumfy
1048  localvalues(icoforcez:icoforcez+2) = localvalues(icoforcez:icoforcez&
1049 & +2) + cofsumfz
1050  localvalues(iareaptot) = localvalues(iareaptot) + area_ptot
1051  localvalues(iareaps) = localvalues(iareaps) + area_ps
1052  localvalues(imassvx) = localvalues(imassvx) + mass_vx
1053  localvalues(imassvy) = localvalues(imassvy) + mass_vy
1054  localvalues(imassvz) = localvalues(imassvz) + mass_vz
1055  localvalues(imassnx) = localvalues(imassnx) + mass_nx
1056  localvalues(imassny) = localvalues(imassny) + mass_ny
1057  localvalues(imassnz) = localvalues(imassnz) + mass_nz
1058  localvalues(imassvi) = localvalues(imassvi) + mass_vi
1059  end subroutine flowintegrationface
1060 ! ----------------------------------------------------------------------
1061 ! |
1062 ! no tapenade routine below this line |
1063 ! |
1064 ! ----------------------------------------------------------------------
1065 
1066 end module surfaceintegrations_fast_b
1067 
Definition: BCData.F90:1
real(kind=realtype), dimension(:, :), pointer gamma2
Definition: BCPointers.F90:14
real(kind=realtype), dimension(:, :), pointer pp1
Definition: BCPointers.F90:11
real(kind=realtype), dimension(:, :), pointer sface
Definition: BCPointers.F90:17
real(kind=realtype), dimension(:, :, :), pointer ww1
Definition: BCPointers.F90:10
real(kind=realtype), dimension(:, :), pointer pp2
Definition: BCPointers.F90:11
real(kind=realtype), dimension(:, :, :), pointer xx
Definition: BCPointers.F90:16
real(kind=realtype), dimension(:, :), pointer gamma1
Definition: BCPointers.F90:14
real(kind=realtype), dimension(:, :, :), pointer ww2
Definition: BCPointers.F90:10
real(kind=realtype), dimension(:, :, :), pointer ssi
Definition: BCPointers.F90:15
logical addgridvelocities
integer(kind=inttype) spectralsol
type(viscsubfacetype), dimension(:), pointer viscsubface
integer(kind=inttype), dimension(:), pointer bcfaceid
integer(kind=inttype), dimension(:), pointer bctype
integer(kind=inttype), dimension(:), pointer inbeg
integer(kind=inttype), parameter costfuncaxismoment
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmavgptot
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforceyviscous
Definition: constants.F90:348
integer(kind=inttype), parameter isepavg
Definition: constants.F90:455
integer(kind=inttype), parameter imassvz
Definition: constants.F90:455
integer(kind=inttype), parameter iareaps
Definition: constants.F90:455
real(kind=realtype), parameter degtorad
Definition: constants.F90:89
real(kind=realtype), parameter zero
Definition: constants.F90:71
integer(kind=inttype), parameter costfuncforceycoefviscous
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforceypressure
Definition: constants.F90:348
integer(kind=inttype), parameter costfunccoforcexx
Definition: constants.F90:348
integer(kind=inttype), parameter imax
Definition: constants.F90:293
integer(kind=inttype), parameter costfuncforcexmomentum
Definition: constants.F90:348
integer(kind=inttype), parameter iflowmp
Definition: constants.F90:455
integer(kind=inttype), parameter imassnx
Definition: constants.F90:455
integer(kind=inttype), parameter kmin
Definition: constants.F90:296
integer(kind=inttype), parameter costfunccoforcexz
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncdragviscous
Definition: constants.F90:348
integer(kind=inttype), parameter imassflow
Definition: constants.F90:455
integer(kind=inttype), parameter jmax
Definition: constants.F90:295
integer(kind=inttype), parameter costfuncforcexcoefpressure
Definition: constants.F90:348
integer(kind=inttype), parameter icoforcez
Definition: constants.F90:455
integer(kind=inttype), parameter costfuncliftcoefpressure
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncdragcoefviscous
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmdot
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncdragcoef
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncdragcoefmomentum
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncarea
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforcexpressure
Definition: constants.F90:348
integer(kind=inttype), parameter costfunccoforceyy
Definition: constants.F90:348
integer(kind=inttype), parameter costfunccavitation
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmomzcoef
Definition: constants.F90:348
integer(kind=inttype), parameter imassptot
Definition: constants.F90:455
integer(kind=inttype), parameter costfuncmavga
Definition: constants.F90:348
integer(kind=inttype), parameter iflowfm
Definition: constants.F90:455
integer(kind=inttype), parameter icperror2
Definition: constants.F90:455
integer(kind=inttype), parameter costfunccperror2
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncliftmomentum
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforcezcoefviscous
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncaavgps
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforcexviscous
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncaavgptot
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncflowpower
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforceymomentum
Definition: constants.F90:348
integer, parameter irho
Definition: constants.F90:34
integer(kind=inttype), parameter costfuncliftviscous
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforcex
Definition: constants.F90:348
integer(kind=inttype), parameter nswalladiabatic
Definition: constants.F90:260
integer(kind=inttype), parameter costfuncliftpressure
Definition: constants.F90:348
integer(kind=inttype), parameter imassnz
Definition: constants.F90:455
integer(kind=inttype), parameter costfuncforceycoefpressure
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmomxcoef
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforcezmomentum
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforcezcoefmomentum
Definition: constants.F90:348
integer(kind=inttype), parameter imp
Definition: constants.F90:455
integer, parameter ivx
Definition: constants.F90:35
integer(kind=inttype), parameter costfuncmomz
Definition: constants.F90:348
integer(kind=inttype), parameter imassa
Definition: constants.F90:455
integer(kind=inttype), parameter ipower
Definition: constants.F90:455
integer(kind=inttype), parameter ifv
Definition: constants.F90:455
integer(kind=inttype), parameter costfuncsepsensorksarea
Definition: constants.F90:348
integer(kind=inttype), parameter imassny
Definition: constants.F90:455
integer(kind=inttype), parameter costfuncmomy
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmavgvy
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmomx
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforcez
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmavgvx
Definition: constants.F90:348
integer(kind=inttype), parameter costfunccoforcexy
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncdragmomentum
Definition: constants.F90:348
integer(kind=inttype), parameter isepsensorarea
Definition: constants.F90:455
integer(kind=inttype), parameter costfuncforcexcoef
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmavgvi
Definition: constants.F90:348
integer(kind=inttype), parameter icoforcex
Definition: constants.F90:455
integer(kind=inttype), parameter costfunccoforceyx
Definition: constants.F90:348
real(kind=realtype), parameter one
Definition: constants.F90:72
integer(kind=inttype), parameter costfuncforcexcoefmomentum
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmavgps
Definition: constants.F90:348
integer(kind=inttype), parameter iflowmm
Definition: constants.F90:455
integer(kind=inttype), parameter imassvy
Definition: constants.F90:455
integer(kind=inttype), parameter costfunccoforceyz
Definition: constants.F90:348
real(kind=realtype), parameter half
Definition: constants.F90:80
integer(kind=inttype), parameter costfunccofliftx
Definition: constants.F90:348
integer(kind=inttype), parameter costfunccoforcezz
Definition: constants.F90:348
integer(kind=inttype), parameter costfunccpmin
Definition: constants.F90:348
integer(kind=inttype), parameter imassvx
Definition: constants.F90:455
integer(kind=inttype), parameter imassrho
Definition: constants.F90:455
integer(kind=inttype), parameter imin
Definition: constants.F90:292
integer(kind=inttype), parameter costfunccoflifty
Definition: constants.F90:348
integer(kind=inttype), parameter imassmn
Definition: constants.F90:455
integer(kind=inttype), parameter costfuncforcezcoefpressure
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmavgmn
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforceycoef
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncliftcoefmomentum
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforcey
Definition: constants.F90:348
integer(kind=inttype), parameter icoforcey
Definition: constants.F90:455
integer(kind=inttype), parameter costfuncdrag
Definition: constants.F90:348
integer, parameter ivz
Definition: constants.F90:37
integer(kind=inttype), parameter iarea
Definition: constants.F90:455
integer(kind=inttype), parameter costfunccofliftz
Definition: constants.F90:348
integer(kind=inttype), parameter imassvi
Definition: constants.F90:455
integer(kind=inttype), parameter costfuncforcexcoefviscous
Definition: constants.F90:348
integer(kind=inttype), parameter iaxismoment
Definition: constants.F90:455
real(kind=realtype), parameter two
Definition: constants.F90:73
integer(kind=inttype), parameter costfuncsepsensoravgz
Definition: constants.F90:348
integer(kind=inttype), parameter imv
Definition: constants.F90:455
integer(kind=inttype), parameter costfuncdragcoefpressure
Definition: constants.F90:348
integer(kind=inttype), parameter isepsensorksarea
Definition: constants.F90:455
integer(kind=inttype), parameter imassps
Definition: constants.F90:455
real(kind=realtype), parameter fourth
Definition: constants.F90:82
integer(kind=inttype), parameter isepsensor
Definition: constants.F90:455
integer(kind=inttype), parameter nswallisothermal
Definition: constants.F90:261
integer(kind=inttype), parameter costfunclift
Definition: constants.F90:348
integer(kind=inttype), parameter costfunccoforcezy
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmavgttot
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncliftcoef
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmomycoef
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncsepsensoravgy
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmavgvz
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncliftcoefviscous
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncsepsensoravgx
Definition: constants.F90:348
integer(kind=inttype), parameter icpmin
Definition: constants.F90:455
integer(kind=inttype), parameter costfunccoforcezx
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforcezpressure
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforcezviscous
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncmavgrho
Definition: constants.F90:348
integer(kind=inttype), parameter kmax
Definition: constants.F90:297
integer, parameter ivy
Definition: constants.F90:36
integer(kind=inttype), parameter costfuncsepsensor
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncsepsensorks
Definition: constants.F90:348
integer(kind=inttype), parameter isepsensorks
Definition: constants.F90:455
integer(kind=inttype), parameter icavitation
Definition: constants.F90:455
integer(kind=inttype), parameter imassttot
Definition: constants.F90:455
integer(kind=inttype), parameter jmin
Definition: constants.F90:294
integer(kind=inttype), parameter costfuncforcezcoef
Definition: constants.F90:348
integer(kind=inttype), parameter internalflow
Definition: constants.F90:120
integer(kind=inttype), parameter ifp
Definition: constants.F90:455
integer(kind=inttype), parameter costfuncdragpressure
Definition: constants.F90:348
integer(kind=inttype), parameter costfuncforceycoefmomentum
Definition: constants.F90:348
integer(kind=inttype), parameter iareaptot
Definition: constants.F90:455
subroutine computettot(rho, u, v, w, p, ttot)
subroutine computeptot(rho, u, v, w, p, ptot)
subroutine getdirvector(refdirection, alpha, beta, winddirection, liftindex)
real(kind=realtype) gammainf
real(kind=realtype) uinf
real(kind=realtype) pinf
real(kind=realtype) rgas
real(kind=realtype) uref
real(kind=realtype) rhoref
real(kind=realtype) tref
real(kind=realtype) lref
real(kind=realtype) rhoinf
real(kind=realtype) pref
real(kind=realtype) timeref
real(kind=realtype) sepsensorsharpness
Definition: inputParam.F90:307
real(kind=realtype) cavsensoroffset
Definition: inputParam.F90:309
real(kind=realtype) cavsensorsharpness
Definition: inputParam.F90:310
logical computesepsensorks
Definition: inputParam.F90:303
real(kind=realtype) sepsensoroffset
Definition: inputParam.F90:304
real(kind=realtype) sepsensorkssharpness
Definition: inputParam.F90:308
real(kind=realtype) sepsensorksphi
Definition: inputParam.F90:306
real(kind=realtype) sepsensorksoffset
Definition: inputParam.F90:305
integer(kind=inttype) cavexponent
Definition: inputParam.F90:311
logical computecavitation
Definition: inputParam.F90:312
real(kind=realtype) cpmin_rho
Definition: inputParam.F90:606
real(kind=realtype) sepsenmaxrho
Definition: inputParam.F90:608
integer(kind=inttype) equations
Definition: inputParam.F90:583
real(kind=realtype), dimension(:), allocatable sepsenmaxfamily
Definition: inputParam.F90:609
real(kind=realtype), dimension(3) pointref
Definition: inputParam.F90:602
real(kind=realtype), dimension(3, 2) momentaxis
Definition: inputParam.F90:603
integer(kind=inttype) liftindex
Definition: inputParam.F90:592
real(kind=realtype), dimension(3) dragdirection
Definition: inputParam.F90:601
real(kind=realtype) beta
Definition: inputParam.F90:591
real(kind=realtype), dimension(:), allocatable cpmin_family
Definition: inputParam.F90:607
real(kind=realtype) lengthref
Definition: inputParam.F90:598
real(kind=realtype) machcoef
Definition: inputParam.F90:593
real(kind=realtype) cavitationnumber
Definition: inputParam.F90:605
real(kind=realtype), dimension(3) liftdirection
Definition: inputParam.F90:600
integer(kind=inttype) flowtype
Definition: inputParam.F90:583
real(kind=realtype) surfaceref
Definition: inputParam.F90:598
real(kind=realtype) rgasdim
Definition: inputParam.F90:595
real(kind=realtype), dimension(3) veldirfreestream
Definition: inputParam.F90:599
real(kind=realtype) alpha
Definition: inputParam.F90:591
integer(kind=inttype) ntimeintervalsspectral
Definition: inputParam.F90:645
integer, parameter realtype
Definition: precision.F90:112
subroutine getcostfunctions(globalvals, funcvalues)
subroutine flowintegrationface(isinflow, localvalues, mm)
subroutine ksaggregationfunction(g, max_g, g_rho, ks_g)
subroutine wallintegrationface(localvalues, mm)
subroutine computetsderivatives(force, moment, coef0, dcdalpha, dcdalphadot, dcdq, dcdqdot)
real(kind=realtype) function mynorm2(x)