31 real(kind=realtype),
dimension(:, :),
intent(in) :: globalvals
32 real(kind=realtype),
dimension(:, :),
intent(in) :: globalvalsd
33 real(kind=realtype),
dimension(:),
intent(out) :: funcvalues
34 real(kind=realtype),
dimension(:),
intent(out) :: funcvaluesd
36 real(kind=realtype) :: fact, factmoment, ovrnts
37 real(kind=realtype) :: factd
38 real(kind=realtype),
dimension(3, ntimeintervalsspectral) :: force, &
39 & forcep, forcev, forcem, moment, cforce, cforcep, cforcev, cforcem, &
40 & cmoment, cofx, cofy, cofz
41 real(kind=realtype),
dimension(3, ntimeintervalsspectral) :: forced&
42 & , forcepd, forcevd, forcemd, momentd, cforced, cforcepd, cforcevd, &
43 & cforcemd, cmomentd, cofxd, cofyd, cofzd
44 real(kind=realtype),
dimension(3) :: vcoordref, vfreestreamref
45 real(kind=realtype) :: mavgptot, mavgttot, mavgrho, mavgps, mflow, &
46 & mavgmn, mavga, mavgvx, mavgvy, mavgvz, garea, mavgvi, fxlift, fylift&
48 real(kind=realtype) :: mavgptotd, mavgttotd, mavgrhod, mavgpsd, &
49 & mflowd, mavgmnd, mavgad, mavgvxd, mavgvyd, mavgvzd, garead, mavgvid&
50 & , fxliftd, fyliftd, fzliftd
51 real(kind=realtype) :: vdotn, mag, u, v, w, ks_comp
52 real(kind=realtype) :: ks_compd
53 integer(kind=inttype) :: sps
54 real(kind=realtype),
dimension(8) :: dcdq, dcdqdot
55 real(kind=realtype),
dimension(8) :: dcdalpha, dcdalphadot
56 real(kind=realtype),
dimension(8) :: coef0
60 real(kind=realtype) :: arg1
61 real(kind=realtype) :: arg1d
62 real(kind=realtype) :: temp
63 real(kind=realtype) :: temp0
64 real(kind=realtype),
dimension(3) :: temp1
68 forced = globalvalsd(
ifp:
ifp+2, :) + globalvalsd(
ifv:
ifv+2, :) + &
70 force = globalvals(
ifp:
ifp+2, :) + globalvals(
ifv:
ifv+2, :) + &
72 forcepd = globalvalsd(
ifp:
ifp+2, :)
73 forcep = globalvals(
ifp:
ifp+2, :)
74 forcevd = globalvalsd(
ifv:
ifv+2, :)
75 forcev = globalvals(
ifv:
ifv+2, :)
84 momentd = globalvalsd(
imp:
imp+2, :) + globalvalsd(
imv:
imv+2, :) + &
86 moment = globalvals(
imp:
imp+2, :) + globalvals(
imv:
imv+2, :) + &
93 cforced = force*factd + fact*forced
95 cforcepd = forcep*factd + fact*forcepd
97 cforcevd = forcev*factd + fact*forcevd
99 cforcemd = forcem*factd + fact*forcemd
100 cforcem = fact*forcem
104 cmomentd = moment*factd + fact*momentd
105 cmoment = fact*moment
161 & + ovrnts*cforced(1, sps)
163 & ovrnts*cforce(1, sps)
165 & + ovrnts*cforced(2, sps)
167 & ovrnts*cforce(2, sps)
169 & + ovrnts*cforced(3, sps)
171 & ovrnts*cforce(3, sps)
212 if (force(1, sps) .ne.
zero)
then
213 temp1 = cofx(:, sps)/force(1, sps)
214 cofxd(:, sps) = (cofxd(:, sps)-temp1*forced(1, sps))/force(1, &
218 cofxd(:, sps) = 0.0_8
221 if (force(2, sps) .ne.
zero)
then
222 temp1 = cofy(:, sps)/force(2, sps)
223 cofyd(:, sps) = (cofyd(:, sps)-temp1*forced(2, sps))/force(2, &
227 cofyd(:, sps) = 0.0_8
230 if (force(3, sps) .ne.
zero)
then
231 temp1 = cofz(:, sps)/force(3, sps)
232 cofzd(:, sps) = (cofzd(:, sps)-temp1*forced(3, sps))/force(3, &
236 cofzd(:, sps) = 0.0_8
241 & ovrnts*cofxd(1, sps)
243 & ovrnts*cofx(1, sps)
245 & ovrnts*cofxd(2, sps)
247 & ovrnts*cofx(2, sps)
249 & ovrnts*cofxd(3, sps)
251 & ovrnts*cofx(3, sps)
254 & ovrnts*cofyd(1, sps)
256 & ovrnts*cofy(1, sps)
258 & ovrnts*cofyd(2, sps)
260 & ovrnts*cofy(2, sps)
262 & ovrnts*cofyd(3, sps)
264 & ovrnts*cofy(3, sps)
267 & ovrnts*cofzd(1, sps)
269 & ovrnts*cofz(1, sps)
271 & ovrnts*cofzd(2, sps)
273 & ovrnts*cofz(2, sps)
275 & ovrnts*cofzd(3, sps)
277 & ovrnts*cofz(3, sps)
292 & ovrnts*cmomentd(1, sps)
294 & ovrnts*cmoment(1, sps)
296 & ovrnts*cmomentd(2, sps)
298 & ovrnts*cmoment(2, sps)
300 & ovrnts*cmomentd(3, sps)
302 & ovrnts*cmoment(3, sps)
316 temp0 =
one + exp(arg1)
321 & ks_compd-temp*exp(arg1)*arg1d)/temp0 + ovrnts*globalvalsd(&
362 & globalvalsd(
iarea, sps)
364 & globalvals(
iarea, sps)
366 & ovrnts*globalvalsd(
ipower, sps)
368 & ovrnts*globalvals(
ipower, sps)
376 if (mflow .ne.
zero)
then
378 mavgptotd = (globalvalsd(
imassptot, sps)-temp0*mflowd)/mflow
381 mavgttotd = (globalvalsd(
imassttot, sps)-temp0*mflowd)/mflow
383 temp0 = globalvals(
imassrho, sps)/mflow
384 mavgrhod = (globalvalsd(
imassrho, sps)-temp0*mflowd)/mflow
386 temp0 = globalvals(
imassps, sps)/mflow
387 mavgpsd = (globalvalsd(
imassps, sps)-temp0*mflowd)/mflow
389 temp0 = globalvals(
imassmn, sps)/mflow
390 mavgmnd = (globalvalsd(
imassmn, sps)-temp0*mflowd)/mflow
392 temp0 = globalvals(
imassa, sps)/mflow
393 mavgad = (globalvalsd(
imassa, sps)-temp0*mflowd)/mflow
395 temp0 = globalvals(
imassvx, sps)/mflow
396 mavgvxd = (globalvalsd(
imassvx, sps)-temp0*mflowd)/mflow
398 temp0 = globalvals(
imassvy, sps)/mflow
399 mavgvyd = (globalvalsd(
imassvy, sps)-temp0*mflowd)/mflow
401 temp0 = globalvals(
imassvz, sps)/mflow
402 mavgvzd = (globalvalsd(
imassvz, sps)-temp0*mflowd)/mflow
404 temp0 = globalvals(
imassvi, sps)/mflow
405 mavgvid = (globalvalsd(
imassvi, sps)-temp0*mflowd)/mflow
408 & + globalvals(
imassnz, sps)**2
433 garead = globalvalsd(
iarea, sps)
434 garea = globalvals(
iarea, sps)
435 if (garea .ne.
zero)
then
439 & ovrnts*(globalvalsd(
iareaptot, sps)-temp0*garead)/garea
442 temp0 = globalvals(
iareaps, sps)/garea
444 & ovrnts*(globalvalsd(
iareaps, sps)-temp0*garead)/garea
678 if (fxlift + fylift + fzlift .ne.
zero)
then
720 &
'error: tsstabilityderivatives are *broken*. they need to be ', &
721 &
'completely verifed from scratch'
741 real(kind=realtype),
dimension(:, :),
intent(in) :: globalvals
742 real(kind=realtype),
dimension(:),
intent(out) :: funcvalues
744 real(kind=realtype) :: fact, factmoment, ovrnts
745 real(kind=realtype),
dimension(3, ntimeintervalsspectral) :: force, &
746 & forcep, forcev, forcem, moment, cforce, cforcep, cforcev, cforcem, &
747 & cmoment, cofx, cofy, cofz
748 real(kind=realtype),
dimension(3) :: vcoordref, vfreestreamref
749 real(kind=realtype) :: mavgptot, mavgttot, mavgrho, mavgps, mflow, &
750 & mavgmn, mavga, mavgvx, mavgvy, mavgvz, garea, mavgvi, fxlift, fylift&
752 real(kind=realtype) :: vdotn, mag, u, v, w, ks_comp
753 integer(kind=inttype) :: sps
754 real(kind=realtype),
dimension(8) :: dcdq, dcdqdot
755 real(kind=realtype),
dimension(8) :: dcdalpha, dcdalphadot
756 real(kind=realtype),
dimension(8) :: coef0
760 real(kind=realtype) :: arg1
764 force = globalvals(
ifp:
ifp+2, :) + globalvals(
ifv:
ifv+2, :) + &
766 forcep = globalvals(
ifp:
ifp+2, :)
767 forcev = globalvals(
ifv:
ifv+2, :)
772 moment = globalvals(
imp:
imp+2, :) + globalvals(
imv:
imv+2, :) + &
776 cforcep = fact*forcep
777 cforcev = fact*forcev
778 cforcem = fact*forcem
781 cmoment = fact*moment
813 & ovrnts*cforce(1, sps)
815 & ovrnts*cforce(2, sps)
817 & ovrnts*cforce(3, sps)
840 if (force(1, sps) .ne.
zero)
then
841 cofx(:, sps) = cofx(:, sps)/force(1, sps)
845 if (force(2, sps) .ne.
zero)
then
846 cofy(:, sps) = cofy(:, sps)/force(2, sps)
850 if (force(3, sps) .ne.
zero)
then
851 cofz(:, sps) = cofz(:, sps)/force(3, sps)
857 & ovrnts*cofx(1, sps)
859 & ovrnts*cofx(2, sps)
861 & ovrnts*cofx(3, sps)
864 & ovrnts*cofy(1, sps)
866 & ovrnts*cofy(2, sps)
868 & ovrnts*cofy(3, sps)
871 & ovrnts*cofz(1, sps)
873 & ovrnts*cofz(2, sps)
875 & ovrnts*cofz(3, sps)
884 & ovrnts*cmoment(1, sps)
886 & ovrnts*cmoment(2, sps)
888 & ovrnts*cmoment(3, sps)
899 & , sps)*ks_comp*
one/(
one+exp(arg1)) + ovrnts*globalvals(&
923 & globalvals(
iarea, sps)
925 & ovrnts*globalvals(
ipower, sps)
930 if (mflow .ne.
zero)
then
931 mavgptot = globalvals(
imassptot, sps)/mflow
932 mavgttot = globalvals(
imassttot, sps)/mflow
933 mavgrho = globalvals(
imassrho, sps)/mflow
934 mavgps = globalvals(
imassps, sps)/mflow
935 mavgmn = globalvals(
imassmn, sps)/mflow
936 mavga = globalvals(
imassa, sps)/mflow
937 mavgvx = globalvals(
imassvx, sps)/mflow
938 mavgvy = globalvals(
imassvy, sps)/mflow
939 mavgvz = globalvals(
imassvz, sps)/mflow
940 mavgvi = globalvals(
imassvi, sps)/mflow
942 & + globalvals(
imassnz, sps)**2
957 garea = globalvals(
iarea, sps)
958 if (garea .ne.
zero)
then
961 & ovrnts*globalvals(
iareaptot, sps)/garea
963 & *globalvals(
iareaps, sps)/garea
1059 if (fxlift + fylift + fzlift .ne.
zero)
then
1077 &
'error: tsstabilityderivatives are *broken*. they need to be ', &
1078 &
'completely verifed from scratch'
1119 real(kind=realtype),
dimension(nlocalvalues),
intent(inout) :: &
1121 real(kind=realtype),
dimension(nlocalvalues),
intent(inout) :: &
1123 integer(kind=inttype) :: mm
1125 real(kind=realtype),
dimension(3) :: fp, fv, mp, mv
1126 real(kind=realtype),
dimension(3) :: fpd, fvd, mpd, mvd
1127 real(kind=realtype),
dimension(3) :: cofsumfx, cofsumfy, cofsumfz
1128 real(kind=realtype),
dimension(3) :: cofsumfxd, cofsumfyd, cofsumfzd
1129 real(kind=realtype) :: yplusmax, sepsensorks, sepsensor, &
1130 & sepsensoravg(3), sepsensorarea, cavitation, cpmin_ks_sum, &
1132 real(kind=realtype) :: sepsensorksd, sepsensord, sepsensoravgd(3), &
1133 & sepsensoraread, cavitationd, cpmin_ks_sumd, sepsensorksaread
1134 integer(kind=inttype) :: i, j, ii, blk
1135 real(kind=realtype) :: pm1, fx, fy, fz, fn
1136 real(kind=realtype) :: pm1d, fxd, fyd, fzd
1137 real(kind=realtype) :: vecttangential(3)
1138 real(kind=realtype) :: vecttangentiald(3)
1139 real(kind=realtype) :: vectdotproductfsnormal
1140 real(kind=realtype) :: vectdotproductfsnormald
1141 real(kind=realtype) :: xc, xco, yc, yco, zc, zco, qf(3), r(3), n(3)&
1143 real(kind=realtype) :: xcd, xcod, ycd, ycod, zcd, zcod, rd(3)
1144 real(kind=realtype) :: fact, rho, mul, yplus, dwall
1145 real(kind=realtype) :: v(3), sensor, sensor1, cp, tmp, plocal, &
1147 real(kind=realtype) :: vd(3), sensord, sensor1d, cpd, tmpd, plocald&
1149 real(kind=realtype) :: tauxx, tauyy, tauzz
1150 real(kind=realtype) :: tauxxd, tauyyd, tauzzd
1151 real(kind=realtype) :: tauxy, tauxz, tauyz
1152 real(kind=realtype) :: tauxyd, tauxzd, tauyzd
1153 real(kind=realtype),
dimension(3) :: refpoint
1154 real(kind=realtype),
dimension(3) :: refpointd
1155 real(kind=realtype),
dimension(3, 2) :: axispoints
1156 real(kind=realtype) :: mx, my, mz, cellarea, m0x, m0y, m0z, mvaxis, &
1158 real(kind=realtype) :: mxd, myd, mzd, cellaread, m0xd, m0yd, m0zd, &
1160 real(kind=realtype) :: cperror, cperror2
1161 real(kind=realtype) :: cperrord, cperror2d
1167 real(kind=realtype) :: arg1
1168 real(kind=realtype) :: arg1d
1169 real(kind=realtype) :: result1
1170 real(kind=realtype) :: result1d
1171 real(kind=realtype) :: temp
1172 real(kind=realtype) :: temp0
1173 real(kind=realtype) :: temp1
1174 real(kind=realtype) :: tempd
1209 sepsensorarea =
zero
1210 sepsensorksarea =
zero
1217 sepsensoravgd = 0.0_8
1222 cpmin_ks_sumd = 0.0_8
1225 vecttangentiald = 0.0_8
1226 sepsensorksd = 0.0_8
1227 sepsensorksaread = 0.0_8
1230 sepsensoraread = 0.0_8
1263 temp =
half*(pp2(i, j)+pp1(i, j)) -
pinf
1265 pm1 = fact*(temp*
pref)
1270 temp =
half*(pp2(i, j)+pp1(i, j)) -
pinf
1271 cpd = tmp*(
half*(pp2d(i, j)+pp1d(i, j))-
pinfd) + temp*tmpd
1274 cperror = cp -
bcdata(mm)%cptarget(i, j)
1275 cperror2d = cperror2d + 2*cperror*cperrord
1276 cperror2 = cperror2 + cperror*cperror
1277 xcd =
fourth*(xxd(i, j, 1)+xxd(i+1, j, 1)+xxd(i, j+1, 1)+xxd(i+1, &
1278 & j+1, 1)) - refpointd(1)
1279 xc =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1, &
1281 ycd =
fourth*(xxd(i, j, 2)+xxd(i+1, j, 2)+xxd(i, j+1, 2)+xxd(i+1, &
1282 & j+1, 2)) - refpointd(2)
1283 yc =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1, &
1285 zcd =
fourth*(xxd(i, j, 3)+xxd(i+1, j, 3)+xxd(i, j+1, 3)+xxd(i+1, &
1286 & j+1, 3)) - refpointd(3)
1287 zc =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1, &
1289 if (
bcdata(mm)%iblank(i, j) .lt. 0)
then
1292 blk =
bcdata(mm)%iblank(i, j)
1294 fxd = ssi(i, j, 1)*pm1d + pm1*ssid(i, j, 1)
1295 fx = pm1*ssi(i, j, 1)
1296 fyd = ssi(i, j, 2)*pm1d + pm1*ssid(i, j, 2)
1297 fy = pm1*ssi(i, j, 2)
1298 fzd = ssi(i, j, 3)*pm1d + pm1*ssid(i, j, 3)
1299 fz = pm1*ssi(i, j, 3)
1306 fpd(1) = fpd(1) + blk*fxd
1307 fp(1) = fp(1) + fx*blk
1308 fpd(2) = fpd(2) + blk*fyd
1309 fp(2) = fp(2) + fy*blk
1310 fpd(3) = fpd(3) + blk*fzd
1311 fp(3) = fp(3) + fz*blk
1312 mxd = fz*ycd + yc*fzd - fy*zcd - zc*fyd
1314 myd = fx*zcd + zc*fxd - fz*xcd - xc*fzd
1316 mzd = fy*xcd + xc*fyd - fx*ycd - yc*fxd
1318 mpd(1) = mpd(1) + blk*mxd
1319 mp(1) = mp(1) + mx*blk
1320 mpd(2) = mpd(2) + blk*myd
1321 mp(2) = mp(2) + my*blk
1322 mpd(3) = mpd(3) + blk*mzd
1323 mp(3) = mp(3) + mz*blk
1326 xcod =
fourth*(xxd(i, j, 1)+xxd(i+1, j, 1)+xxd(i, j+1, 1)+xxd(i+1&
1328 xco =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
1330 ycod =
fourth*(xxd(i, j, 2)+xxd(i+1, j, 2)+xxd(i, j+1, 2)+xxd(i+1&
1332 yco =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
1334 zcod =
fourth*(xxd(i, j, 3)+xxd(i+1, j, 3)+xxd(i, j+1, 3)+xxd(i+1&
1336 zco =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
1340 cofsumfxd(1) = cofsumfxd(1) + blk*(fx*xcod+xco*fxd)
1341 cofsumfx(1) = cofsumfx(1) + xco*fx*blk
1342 cofsumfxd(2) = cofsumfxd(2) + blk*(fx*ycod+yco*fxd)
1343 cofsumfx(2) = cofsumfx(2) + yco*fx*blk
1344 cofsumfxd(3) = cofsumfxd(3) + blk*(fx*zcod+zco*fxd)
1345 cofsumfx(3) = cofsumfx(3) + zco*fx*blk
1347 cofsumfyd(1) = cofsumfyd(1) + blk*(fy*xcod+xco*fyd)
1348 cofsumfy(1) = cofsumfy(1) + xco*fy*blk
1349 cofsumfyd(2) = cofsumfyd(2) + blk*(fy*ycod+yco*fyd)
1350 cofsumfy(2) = cofsumfy(2) + yco*fy*blk
1351 cofsumfyd(3) = cofsumfyd(3) + blk*(fy*zcod+zco*fyd)
1352 cofsumfy(3) = cofsumfy(3) + zco*fy*blk
1354 cofsumfzd(1) = cofsumfzd(1) + blk*(fz*xcod+xco*fzd)
1355 cofsumfz(1) = cofsumfz(1) + xco*fz*blk
1356 cofsumfzd(2) = cofsumfzd(2) + blk*(fz*ycod+yco*fzd)
1357 cofsumfz(2) = cofsumfz(2) + yco*fz*blk
1358 cofsumfzd(3) = cofsumfzd(3) + blk*(fz*zcod+zco*fzd)
1359 cofsumfz(3) = cofsumfz(3) + zco*fz*blk
1364 rd(1) =
fourth*(xxd(i, j, 1)+xxd(i+1, j, 1)+xxd(i, j+1, 1)+xxd(i+1&
1366 r(1) =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
1367 & , 1)) - axispoints(1, 1)
1368 rd(2) =
fourth*(xxd(i, j, 2)+xxd(i+1, j, 2)+xxd(i, j+1, 2)+xxd(i+1&
1370 r(2) =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
1371 & , 2)) - axispoints(2, 1)
1372 rd(3) =
fourth*(xxd(i, j, 3)+xxd(i+1, j, 3)+xxd(i, j+1, 3)+xxd(i+1&
1374 r(3) =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
1375 & , 3)) - axispoints(3, 1)
1376 arg1 = (axispoints(1, 2)-axispoints(1, 1))**2 + (axispoints(2, 2)-&
1377 & axispoints(2, 1))**2 + (axispoints(3, 2)-axispoints(3, 1))**2
1379 n(1) = (axispoints(1, 2)-axispoints(1, 1))/l
1380 n(2) = (axispoints(2, 2)-axispoints(2, 1))/l
1381 n(3) = (axispoints(3, 2)-axispoints(3, 1))/l
1385 m0xd = fz*rd(2) + r(2)*fzd - fy*rd(3) - r(3)*fyd
1386 m0x = r(2)*fz - r(3)*fy
1387 m0yd = fx*rd(3) + r(3)*fxd - fz*rd(1) - r(1)*fzd
1388 m0y = r(3)*fx - r(1)*fz
1389 m0zd = fy*rd(1) + r(1)*fyd - fx*rd(2) - r(2)*fxd
1390 m0z = r(1)*fy - r(2)*fx
1391 mpaxisd = mpaxisd + blk*(n(1)*m0xd+n(2)*m0yd+n(3)*m0zd)
1392 mpaxis = mpaxis + (m0x*n(1)+m0y*n(2)+m0z*n(3))*blk
1395 bcdata(mm)%fp(i, j, 1) = fx
1397 bcdata(mm)%fp(i, j, 2) = fy
1399 bcdata(mm)%fp(i, j, 3) = fz
1400 arg1d = 2*ssi(i, j, 1)*ssid(i, j, 1) + 2*ssi(i, j, 2)*ssid(i, j, 2&
1401 & ) + 2*ssi(i, j, 3)*ssid(i, j, 3)
1402 arg1 = ssi(i, j, 1)**2 + ssi(i, j, 2)**2 + ssi(i, j, 3)**2
1404 if (arg1 .eq. 0.0_8)
then
1407 cellaread = arg1d/(2.0*temp)
1410 bcdatad(mm)%area(i, j) = cellaread
1411 bcdata(mm)%area(i, j) = cellarea
1413 vd(1) = ww2d(i, j,
ivx)
1414 v(1) = ww2(i, j,
ivx)
1415 vd(2) = ww2d(i, j,
ivy)
1416 v(2) = ww2(i, j,
ivy)
1417 vd(3) = ww2d(i, j,
ivz)
1418 v(3) = ww2(i, j,
ivz)
1419 arg1d = 2*v(1)*vd(1) + 2*v(2)*vd(2) + 2*v(3)*vd(3)
1420 arg1 = v(1)**2 + v(2)**2 + v(3)**2
1422 if (arg1 .eq. 0.0_8)
then
1425 result1d = arg1d/(2.0*temp)
1428 vd = (vd-v*result1d/(result1+1e-16))/(result1+1e-16)
1429 v = v/(result1+1e-16)
1432 temp =
bcdata(mm)%norm(i, j, 1)
1433 temp0 =
bcdata(mm)%norm(i, j, 2)
1434 temp1 =
bcdata(mm)%norm(i, j, 3)
1440 temp1 =
bcdata(mm)%norm(i, j, 1)
1442 & vectdotproductfsnormald
1444 & vectdotproductfsnormal
1445 temp1 =
bcdata(mm)%norm(i, j, 2)
1447 & vectdotproductfsnormald
1449 & vectdotproductfsnormal
1450 temp1 =
bcdata(mm)%norm(i, j, 3)
1452 & vectdotproductfsnormald
1454 & vectdotproductfsnormal
1455 arg1d = 2*vecttangential(1)*vecttangentiald(1) + 2*&
1456 & vecttangential(2)*vecttangentiald(2) + 2*vecttangential(3)*&
1457 & vecttangentiald(3)
1458 arg1 = vecttangential(1)**2 + vecttangential(2)**2 + &
1459 & vecttangential(3)**2
1461 if (arg1 .eq. 0.0_8)
then
1464 result1d = arg1d/(2.0*temp1)
1467 vecttangentiald = (vecttangentiald-vecttangential*result1d/(&
1468 & result1+1e-16))/(result1+1e-16)
1469 vecttangential = vecttangential/(result1+1e-16)
1472 sensord = vecttangential(1)*vd(1) + v(1)*vecttangentiald(1) + &
1473 & vecttangential(2)*vd(2) + v(2)*vecttangentiald(2) + &
1474 & vecttangential(3)*vd(3) + v(3)*vecttangentiald(3)
1475 sensor = v(1)*vecttangential(1) + v(2)*vecttangential(2) + v(3)*&
1479 sensord = -(sensord/temp1)
1485 sepsensorksaread = sepsensorksaread + blk*cellaread
1486 sepsensorksarea = sepsensorksarea + blk*cellarea
1489 temp1 =
one + exp(arg1)
1490 sepsensoraread = blk*
one*(cellaread-cellarea*exp(arg1)*arg1d/&
1491 & temp1)/temp1 + sepsensoraread
1492 sepsensorarea = blk*
one*(cellarea/temp1) + sepsensorarea
1493 sepsensorksd = sepsensorksd + blk*ks_exponentd
1494 sepsensorks = sepsensorks + ks_exponent*blk
1505 temp1 =
one/(
one+exp(arg1))
1506 sensord = -(temp1*exp(arg1)*arg1d/(
one+exp(arg1)))
1509 sensord = blk*(cellarea*sensord+sensor*cellaread)
1510 sensor = sensor*cellarea*blk
1511 sepsensord = sepsensord + sensord
1512 sepsensor = sepsensor + sensor
1515 sepsensoravgd(1) = sepsensoravgd(1) + xco*sensord + sensor*xcod
1516 sepsensoravg(1) = sepsensoravg(1) + sensor*xco
1517 sepsensoravgd(2) = sepsensoravgd(2) + yco*sensord + sensor*ycod
1518 sepsensoravg(2) = sepsensoravg(2) + sensor*yco
1519 sepsensoravgd(3) = sepsensoravgd(3) + zco*sensord + sensor*zcod
1520 sepsensoravg(3) = sepsensoravg(3) + sensor*zco
1522 plocald = pp2d(i, j)
1527 cpd = (plocal-
pinf)*tmpd + tmp*(plocald-
pinfd)
1528 cp = tmp*(plocal-
pinf)
1533 temp1 =
one + exp(arg1)
1535 if (sensor1 .le. 0.0_8 .and. (
cavexponent .eq. 0.0_8 .or. &
1541 sensor1d = (tempd-temp*exp(arg1)*arg1d)/temp1
1543 sensor1d = blk*(cellarea*sensor1d+sensor1*cellaread)
1544 sensor1 = sensor1*cellarea*blk
1545 cavitationd = cavitationd + sensor1d
1546 cavitation = cavitation + sensor1
1549 ks_exponentd = -(exp(temp1)*
cpmin_rho*cpd)
1550 ks_exponent = exp(temp1)
1551 cpmin_ks_sumd = cpmin_ks_sumd + blk*ks_exponentd
1552 cpmin_ks_sum = cpmin_ks_sum + ks_exponent*blk
1576 if (
bcdata(mm)%iblank(i, j) .lt. 0)
then
1579 blk =
bcdata(mm)%iblank(i, j)
1595 temp1 = tauxx*ssi(i, j, 1) + tauxy*ssi(i, j, 2) + tauxz*ssi(i, j&
1597 fxd = -(fact*(
pref*(ssi(i, j, 1)*tauxxd+tauxx*ssid(i, j, 1)+ssi(&
1598 & i, j, 2)*tauxyd+tauxy*ssid(i, j, 2)+ssi(i, j, 3)*tauxzd+tauxz*&
1599 & ssid(i, j, 3))+temp1*
prefd))
1600 fx = -(fact*(temp1*
pref))
1601 temp1 = tauxy*ssi(i, j, 1) + tauyy*ssi(i, j, 2) + tauyz*ssi(i, j&
1603 fyd = -(fact*(
pref*(ssi(i, j, 1)*tauxyd+tauxy*ssid(i, j, 1)+ssi(&
1604 & i, j, 2)*tauyyd+tauyy*ssid(i, j, 2)+ssi(i, j, 3)*tauyzd+tauyz*&
1605 & ssid(i, j, 3))+temp1*
prefd))
1606 fy = -(fact*(temp1*
pref))
1607 temp1 = tauxz*ssi(i, j, 1) + tauyz*ssi(i, j, 2) + tauzz*ssi(i, j&
1609 fzd = -(fact*(
pref*(ssi(i, j, 1)*tauxzd+tauxz*ssid(i, j, 1)+ssi(&
1610 & i, j, 2)*tauyzd+tauyz*ssid(i, j, 2)+ssi(i, j, 3)*tauzzd+tauzz*&
1611 & ssid(i, j, 3))+temp1*
prefd))
1612 fz = -(fact*(temp1*
pref))
1617 xcd =
fourth*(xxd(i, j, 1)+xxd(i+1, j, 1)+xxd(i, j+1, 1)+xxd(i+1&
1618 & , j+1, 1)) - refpointd(1)
1619 xc =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
1620 & , 1)) - refpoint(1)
1621 ycd =
fourth*(xxd(i, j, 2)+xxd(i+1, j, 2)+xxd(i, j+1, 2)+xxd(i+1&
1622 & , j+1, 2)) - refpointd(2)
1623 yc =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
1624 & , 2)) - refpoint(2)
1625 zcd =
fourth*(xxd(i, j, 3)+xxd(i+1, j, 3)+xxd(i, j+1, 3)+xxd(i+1&
1626 & , j+1, 3)) - refpointd(3)
1627 zc =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
1628 & , 3)) - refpoint(3)
1630 fvd(1) = fvd(1) + blk*fxd
1631 fv(1) = fv(1) + fx*blk
1632 fvd(2) = fvd(2) + blk*fyd
1633 fv(2) = fv(2) + fy*blk
1634 fvd(3) = fvd(3) + blk*fzd
1635 fv(3) = fv(3) + fz*blk
1636 mxd = fz*ycd + yc*fzd - fy*zcd - zc*fyd
1638 myd = fx*zcd + zc*fxd - fz*xcd - xc*fzd
1640 mzd = fy*xcd + xc*fyd - fx*ycd - yc*fxd
1642 mvd(1) = mvd(1) + blk*mxd
1643 mv(1) = mv(1) + mx*blk
1644 mvd(2) = mvd(2) + blk*myd
1645 mv(2) = mv(2) + my*blk
1646 mvd(3) = mvd(3) + blk*mzd
1647 mv(3) = mv(3) + mz*blk
1650 xcod =
fourth*(xxd(i, j, 1)+xxd(i+1, j, 1)+xxd(i, j+1, 1)+xxd(i+&
1652 xco =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+&
1654 ycod =
fourth*(xxd(i, j, 2)+xxd(i+1, j, 2)+xxd(i, j+1, 2)+xxd(i+&
1656 yco =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+&
1658 zcod =
fourth*(xxd(i, j, 3)+xxd(i+1, j, 3)+xxd(i, j+1, 3)+xxd(i+&
1660 zco =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+&
1664 cofsumfxd(1) = cofsumfxd(1) + blk*(fx*xcod+xco*fxd)
1665 cofsumfx(1) = cofsumfx(1) + xco*fx*blk
1666 cofsumfxd(2) = cofsumfxd(2) + blk*(fx*ycod+yco*fxd)
1667 cofsumfx(2) = cofsumfx(2) + yco*fx*blk
1668 cofsumfxd(3) = cofsumfxd(3) + blk*(fx*zcod+zco*fxd)
1669 cofsumfx(3) = cofsumfx(3) + zco*fx*blk
1671 cofsumfyd(1) = cofsumfyd(1) + blk*(fy*xcod+xco*fyd)
1672 cofsumfy(1) = cofsumfy(1) + xco*fy*blk
1673 cofsumfyd(2) = cofsumfyd(2) + blk*(fy*ycod+yco*fyd)
1674 cofsumfy(2) = cofsumfy(2) + yco*fy*blk
1675 cofsumfyd(3) = cofsumfyd(3) + blk*(fy*zcod+zco*fyd)
1676 cofsumfy(3) = cofsumfy(3) + zco*fy*blk
1678 cofsumfzd(1) = cofsumfzd(1) + blk*(fz*xcod+xco*fzd)
1679 cofsumfz(1) = cofsumfz(1) + xco*fz*blk
1680 cofsumfzd(2) = cofsumfzd(2) + blk*(fz*ycod+yco*fzd)
1681 cofsumfz(2) = cofsumfz(2) + yco*fz*blk
1682 cofsumfzd(3) = cofsumfzd(3) + blk*(fz*zcod+zco*fzd)
1683 cofsumfz(3) = cofsumfz(3) + zco*fz*blk
1688 rd(1) =
fourth*(xxd(i, j, 1)+xxd(i+1, j, 1)+xxd(i, j+1, 1)+xxd(i&
1690 r(1) =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j&
1691 & +1, 1)) - axispoints(1, 1)
1692 rd(2) =
fourth*(xxd(i, j, 2)+xxd(i+1, j, 2)+xxd(i, j+1, 2)+xxd(i&
1694 r(2) =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j&
1695 & +1, 2)) - axispoints(2, 1)
1696 rd(3) =
fourth*(xxd(i, j, 3)+xxd(i+1, j, 3)+xxd(i, j+1, 3)+xxd(i&
1698 r(3) =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j&
1699 & +1, 3)) - axispoints(3, 1)
1700 arg1 = (axispoints(1, 2)-axispoints(1, 1))**2 + (axispoints(2, 2&
1701 & )-axispoints(2, 1))**2 + (axispoints(3, 2)-axispoints(3, 1))**&
1704 n(1) = (axispoints(1, 2)-axispoints(1, 1))/l
1705 n(2) = (axispoints(2, 2)-axispoints(2, 1))/l
1706 n(3) = (axispoints(3, 2)-axispoints(3, 1))/l
1710 m0xd = fz*rd(2) + r(2)*fzd - fy*rd(3) - r(3)*fyd
1711 m0x = r(2)*fz - r(3)*fy
1712 m0yd = fx*rd(3) + r(3)*fxd - fz*rd(1) - r(1)*fzd
1713 m0y = r(3)*fx - r(1)*fz
1714 m0zd = fy*rd(1) + r(1)*fyd - fx*rd(2) - r(2)*fxd
1715 m0z = r(1)*fy - r(2)*fx
1716 mvaxisd = mvaxisd + blk*(n(1)*m0xd+n(2)*m0yd+n(3)*m0zd)
1717 mvaxis = mvaxis + (m0x*n(1)+m0y*n(2)+m0z*n(3))*blk
1720 bcdata(mm)%fv(i, j, 1) = fx
1722 bcdata(mm)%fv(i, j, 2) = fy
1724 bcdata(mm)%fv(i, j, 3) = fz
1731 fx = tauxx*
bcdata(mm)%norm(i, j, 1) + tauxy*
bcdata(mm)%norm(i, j&
1732 & , 2) + tauxz*
bcdata(mm)%norm(i, j, 3)
1733 fy = tauxy*
bcdata(mm)%norm(i, j, 1) + tauyy*
bcdata(mm)%norm(i, j&
1734 & , 2) + tauyz*
bcdata(mm)%norm(i, j, 3)
1735 fz = tauxz*
bcdata(mm)%norm(i, j, 1) + tauyz*
bcdata(mm)%norm(i, j&
1736 & , 2) + tauzz*
bcdata(mm)%norm(i, j, 3)
1737 fn = fx*
bcdata(mm)%norm(i, j, 1) + fy*
bcdata(mm)%norm(i, j, 2) +&
1738 & fz*
bcdata(mm)%norm(i, j, 3)
1739 fx = fx - fn*
bcdata(mm)%norm(i, j, 1)
1740 fy = fy - fn*
bcdata(mm)%norm(i, j, 2)
1741 fz = fz - fn*
bcdata(mm)%norm(i, j, 3)
1754 localvaluesd(
ifp:
ifp+2) = localvaluesd(
ifp:
ifp+2) + fpd
1756 localvaluesd(
ifv:
ifv+2) = localvaluesd(
ifv:
ifv+2) + fvd
1758 localvaluesd(
imp:
imp+2) = localvaluesd(
imp:
imp+2) + mpd
1760 localvaluesd(
imv:
imv+2) = localvaluesd(
imv:
imv+2) + mvd
1789 localvaluesd(
icpmin) = localvaluesd(
icpmin) + cpmin_ks_sumd
1790 localvalues(
icpmin) = localvalues(
icpmin) + cpmin_ks_sum
1825 real(kind=realtype),
dimension(nlocalvalues),
intent(inout) :: &
1827 integer(kind=inttype) :: mm
1829 real(kind=realtype),
dimension(3) :: fp, fv, mp, mv
1830 real(kind=realtype),
dimension(3) :: cofsumfx, cofsumfy, cofsumfz
1831 real(kind=realtype) :: yplusmax, sepsensorks, sepsensor, &
1832 & sepsensoravg(3), sepsensorarea, cavitation, cpmin_ks_sum, &
1834 integer(kind=inttype) :: i, j, ii, blk
1835 real(kind=realtype) :: pm1, fx, fy, fz, fn
1836 real(kind=realtype) :: vecttangential(3)
1837 real(kind=realtype) :: vectdotproductfsnormal
1838 real(kind=realtype) :: xc, xco, yc, yco, zc, zco, qf(3), r(3), n(3)&
1840 real(kind=realtype) :: fact, rho, mul, yplus, dwall
1841 real(kind=realtype) :: v(3), sensor, sensor1, cp, tmp, plocal, &
1843 real(kind=realtype) :: tauxx, tauyy, tauzz
1844 real(kind=realtype) :: tauxy, tauxz, tauyz
1845 real(kind=realtype),
dimension(3) :: refpoint
1846 real(kind=realtype),
dimension(3, 2) :: axispoints
1847 real(kind=realtype) :: mx, my, mz, cellarea, m0x, m0y, m0z, mvaxis, &
1849 real(kind=realtype) :: cperror, cperror2
1855 real(kind=realtype) :: arg1
1856 real(kind=realtype) :: result1
1887 sepsensorarea =
zero
1888 sepsensorksarea =
zero
1927 cp = (
half*(pp2(i, j)+pp1(i, j))-
pinf)*tmp
1928 cperror = cp -
bcdata(mm)%cptarget(i, j)
1929 cperror2 = cperror2 + cperror*cperror
1930 xc =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1, &
1932 yc =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1, &
1934 zc =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1, &
1936 if (
bcdata(mm)%iblank(i, j) .lt. 0)
then
1939 blk =
bcdata(mm)%iblank(i, j)
1941 fx = pm1*ssi(i, j, 1)
1942 fy = pm1*ssi(i, j, 2)
1943 fz = pm1*ssi(i, j, 3)
1950 fp(1) = fp(1) + fx*blk
1951 fp(2) = fp(2) + fy*blk
1952 fp(3) = fp(3) + fz*blk
1956 mp(1) = mp(1) + mx*blk
1957 mp(2) = mp(2) + my*blk
1958 mp(3) = mp(3) + mz*blk
1961 xco =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
1963 yco =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
1965 zco =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
1969 cofsumfx(1) = cofsumfx(1) + xco*fx*blk
1970 cofsumfx(2) = cofsumfx(2) + yco*fx*blk
1971 cofsumfx(3) = cofsumfx(3) + zco*fx*blk
1973 cofsumfy(1) = cofsumfy(1) + xco*fy*blk
1974 cofsumfy(2) = cofsumfy(2) + yco*fy*blk
1975 cofsumfy(3) = cofsumfy(3) + zco*fy*blk
1977 cofsumfz(1) = cofsumfz(1) + xco*fz*blk
1978 cofsumfz(2) = cofsumfz(2) + yco*fz*blk
1979 cofsumfz(3) = cofsumfz(3) + zco*fz*blk
1984 r(1) =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
1985 & , 1)) - axispoints(1, 1)
1986 r(2) =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
1987 & , 2)) - axispoints(2, 1)
1988 r(3) =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
1989 & , 3)) - axispoints(3, 1)
1990 arg1 = (axispoints(1, 2)-axispoints(1, 1))**2 + (axispoints(2, 2)-&
1991 & axispoints(2, 1))**2 + (axispoints(3, 2)-axispoints(3, 1))**2
1993 n(1) = (axispoints(1, 2)-axispoints(1, 1))/l
1994 n(2) = (axispoints(2, 2)-axispoints(2, 1))/l
1995 n(3) = (axispoints(3, 2)-axispoints(3, 1))/l
1999 m0x = r(2)*fz - r(3)*fy
2000 m0y = r(3)*fx - r(1)*fz
2001 m0z = r(1)*fy - r(2)*fx
2002 mpaxis = mpaxis + (m0x*n(1)+m0y*n(2)+m0z*n(3))*blk
2004 bcdata(mm)%fp(i, j, 1) = fx
2005 bcdata(mm)%fp(i, j, 2) = fy
2006 bcdata(mm)%fp(i, j, 3) = fz
2007 arg1 = ssi(i, j, 1)**2 + ssi(i, j, 2)**2 + ssi(i, j, 3)**2
2008 cellarea = sqrt(arg1)
2009 bcdata(mm)%area(i, j) = cellarea
2011 v(1) = ww2(i, j,
ivx)
2012 v(2) = ww2(i, j,
ivy)
2013 v(3) = ww2(i, j,
ivz)
2014 arg1 = v(1)**2 + v(2)**2 + v(3)**2
2015 result1 = sqrt(arg1)
2016 v = v/(result1+1e-16)
2024 & *
bcdata(mm)%norm(i, j, 1)
2026 & *
bcdata(mm)%norm(i, j, 2)
2028 & *
bcdata(mm)%norm(i, j, 3)
2029 arg1 = vecttangential(1)**2 + vecttangential(2)**2 + &
2030 & vecttangential(3)**2
2031 result1 = sqrt(arg1)
2032 vecttangential = vecttangential/(result1+1e-16)
2035 sensor = v(1)*vecttangential(1) + v(2)*vecttangential(2) + v(3)*&
2043 sepsensorksarea = sepsensorksarea + blk*cellarea
2045 sepsensorarea = cellarea*blk*
one/(
one+exp(arg1)) + sepsensorarea
2046 sepsensorks = sepsensorks + ks_exponent*blk
2053 sensor =
one/(
one+exp(arg1))
2055 sensor = sensor*cellarea*blk
2056 sepsensor = sepsensor + sensor
2059 sepsensoravg(1) = sepsensoravg(1) + sensor*xco
2060 sepsensoravg(2) = sepsensoravg(2) + sensor*yco
2061 sepsensoravg(3) = sepsensoravg(3) + sensor*zco
2065 cp = tmp*(plocal-
pinf)
2069 sensor1 = sensor1*cellarea*blk
2070 cavitation = cavitation + sensor1
2073 cpmin_ks_sum = cpmin_ks_sum + ks_exponent*blk
2095 if (
bcdata(mm)%iblank(i, j) .lt. 0)
then
2098 blk =
bcdata(mm)%iblank(i, j)
2108 fx = -(fact*(tauxx*ssi(i, j, 1)+tauxy*ssi(i, j, 2)+tauxz*ssi(i, &
2110 fy = -(fact*(tauxy*ssi(i, j, 1)+tauyy*ssi(i, j, 2)+tauyz*ssi(i, &
2112 fz = -(fact*(tauxz*ssi(i, j, 1)+tauyz*ssi(i, j, 2)+tauzz*ssi(i, &
2118 xc =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
2119 & , 1)) - refpoint(1)
2120 yc =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
2121 & , 2)) - refpoint(2)
2122 zc =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
2123 & , 3)) - refpoint(3)
2125 fv(1) = fv(1) + fx*blk
2126 fv(2) = fv(2) + fy*blk
2127 fv(3) = fv(3) + fz*blk
2131 mv(1) = mv(1) + mx*blk
2132 mv(2) = mv(2) + my*blk
2133 mv(3) = mv(3) + mz*blk
2136 xco =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+&
2138 yco =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+&
2140 zco =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+&
2144 cofsumfx(1) = cofsumfx(1) + xco*fx*blk
2145 cofsumfx(2) = cofsumfx(2) + yco*fx*blk
2146 cofsumfx(3) = cofsumfx(3) + zco*fx*blk
2148 cofsumfy(1) = cofsumfy(1) + xco*fy*blk
2149 cofsumfy(2) = cofsumfy(2) + yco*fy*blk
2150 cofsumfy(3) = cofsumfy(3) + zco*fy*blk
2152 cofsumfz(1) = cofsumfz(1) + xco*fz*blk
2153 cofsumfz(2) = cofsumfz(2) + yco*fz*blk
2154 cofsumfz(3) = cofsumfz(3) + zco*fz*blk
2159 r(1) =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j&
2160 & +1, 1)) - axispoints(1, 1)
2161 r(2) =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j&
2162 & +1, 2)) - axispoints(2, 1)
2163 r(3) =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j&
2164 & +1, 3)) - axispoints(3, 1)
2165 arg1 = (axispoints(1, 2)-axispoints(1, 1))**2 + (axispoints(2, 2&
2166 & )-axispoints(2, 1))**2 + (axispoints(3, 2)-axispoints(3, 1))**&
2169 n(1) = (axispoints(1, 2)-axispoints(1, 1))/l
2170 n(2) = (axispoints(2, 2)-axispoints(2, 1))/l
2171 n(3) = (axispoints(3, 2)-axispoints(3, 1))/l
2175 m0x = r(2)*fz - r(3)*fy
2176 m0y = r(3)*fx - r(1)*fz
2177 m0z = r(1)*fy - r(2)*fx
2178 mvaxis = mvaxis + (m0x*n(1)+m0y*n(2)+m0z*n(3))*blk
2180 bcdata(mm)%fv(i, j, 1) = fx
2181 bcdata(mm)%fv(i, j, 2) = fy
2182 bcdata(mm)%fv(i, j, 3) = fz
2189 fx = tauxx*
bcdata(mm)%norm(i, j, 1) + tauxy*
bcdata(mm)%norm(i, j&
2190 & , 2) + tauxz*
bcdata(mm)%norm(i, j, 3)
2191 fy = tauxy*
bcdata(mm)%norm(i, j, 1) + tauyy*
bcdata(mm)%norm(i, j&
2192 & , 2) + tauyz*
bcdata(mm)%norm(i, j, 3)
2193 fz = tauxz*
bcdata(mm)%norm(i, j, 1) + tauyz*
bcdata(mm)%norm(i, j&
2194 & , 2) + tauzz*
bcdata(mm)%norm(i, j, 3)
2195 fn = fx*
bcdata(mm)%norm(i, j, 1) + fy*
bcdata(mm)%norm(i, j, 2) +&
2196 & fz*
bcdata(mm)%norm(i, j, 3)
2197 fx = fx - fn*
bcdata(mm)%norm(i, j, 1)
2198 fy = fy - fn*
bcdata(mm)%norm(i, j, 2)
2199 fz = fz - fn*
bcdata(mm)%norm(i, j, 3)
2225 localvalues(
icpmin) = localvalues(
icpmin) + cpmin_ks_sum
2239 real(kind=
realtype),
intent(inout) :: ks_g
2240 real(kind=
realtype),
intent(inout) :: ks_gd
2241 real(kind=
realtype),
intent(in) :: g, max_g, g_rho
2242 real(kind=
realtype),
intent(in) :: gd
2244 ks_gd = exp(g_rho*(g-max_g))*g_rho*gd
2245 ks_g = exp(g_rho*(g-max_g))
2251 real(kind=
realtype),
intent(inout) :: ks_g
2252 real(kind=
realtype),
intent(in) :: g, max_g, g_rho
2254 ks_g = exp(g_rho*(g-max_g))
2277 use bcpointers_d,
only : ssi, ssid, sface, ww1, ww1d, ww2, ww2d, pp1&
2278 & , pp1d, pp2, pp2d, xx, xxd, gamma1, gamma2
2282 logical,
intent(in) :: isinflow
2283 real(kind=realtype),
dimension(nlocalvalues),
intent(inout) :: &
2285 real(kind=realtype),
dimension(nlocalvalues),
intent(inout) :: &
2287 integer(kind=inttype),
intent(in) :: mm
2289 real(kind=realtype) :: massflowrate, mass_ptot, mass_ttot, mass_ps, &
2290 & mass_mn, mass_a, mass_rho, mass_vx, mass_vy, mass_vz, mass_nx, &
2291 & mass_ny, mass_nz, mass_vi
2292 real(kind=realtype) :: massflowrated, mass_ptotd, mass_ttotd, &
2293 & mass_psd, mass_mnd, mass_ad, mass_rhod, mass_vxd, mass_vyd, mass_vzd&
2294 & , mass_nxd, mass_nyd, mass_nzd, mass_vid
2295 real(kind=realtype) :: area_ptot, area_ps
2296 real(kind=realtype) :: area_ptotd, area_psd
2297 real(kind=realtype) :: govgm1, gm1ovg, viconst, vilocal, pratio
2298 real(kind=realtype) :: vilocald, pratiod
2299 real(kind=realtype) :: mredim
2300 real(kind=realtype) :: mredimd
2301 integer(kind=inttype) :: i, j, ii, blk
2302 real(kind=realtype) :: internalflowfact, inflowfact, fact, xc, xco, &
2303 & yc, yco, zc, zco, mx, my, mz
2304 real(kind=realtype) :: xcd, xcod, ycd, ycod, zcd, zcod, mxd, myd, &
2306 real(kind=realtype) :: sf, vmag, vnm, vnmfreestreamref, vxm, vym, &
2307 & vzm, fx, fy, fz, u, v, w
2308 real(kind=realtype) :: vmagd, vnmd, vxmd, vymd, vzmd, fxd, fyd, fzd
2309 real(kind=realtype) :: pm, ptot, ttot, rhom, gammam, am
2310 real(kind=realtype) :: pmd, ptotd, ttotd, rhomd, amd
2311 real(kind=realtype) :: area, cellarea, overcellarea
2312 real(kind=realtype) :: aread, cellaread, overcellaread
2313 real(kind=realtype),
dimension(3) :: fp, mp, fmom, mmom, refpoint, &
2315 real(kind=realtype),
dimension(3) :: fpd, mpd, fmomd, mmomd, &
2316 & refpointd, sfacecoordrefd
2317 real(kind=realtype),
dimension(3) :: cofsumfx, cofsumfy, cofsumfz
2318 real(kind=realtype),
dimension(3) :: cofsumfxd, cofsumfyd, cofsumfzd
2319 real(kind=realtype) :: mnm, massflowratelocal
2320 real(kind=realtype) :: mnmd, massflowratelocald
2325 real(kind=realtype) :: arg1
2326 real(kind=realtype) :: arg1d
2327 real(kind=realtype) :: result1
2328 real(kind=realtype) :: result1d
2329 real(kind=realtype) :: temp
2330 real(kind=realtype) :: tempd
2331 real(kind=realtype) :: temp0
2351 internalflowfact =
one
2354 if (isinflow) inflowfact = -
one
2409 sfacecoordrefd = 0.0_8
2420 massflowrated = 0.0_8
2432 if (
bcdata(mm)%iblank(i, j) .lt. 0)
then
2435 blk =
bcdata(mm)%iblank(i, j)
2437 vxmd =
half*(ww1d(i, j,
ivx)+ww2d(i, j,
ivx))
2439 vymd =
half*(ww1d(i, j,
ivy)+ww2d(i, j,
ivy))
2441 vzmd =
half*(ww1d(i, j,
ivz)+ww2d(i, j,
ivz))
2445 pmd =
half*(pp1d(i, j)+pp2d(i, j))
2446 pm =
half*(pp1(i, j)+pp2(i, j))
2447 gammam =
half*(gamma1(i, j)+gamma2(i, j))
2448 vnmd = ssi(i, j, 1)*vxmd + vxm*ssid(i, j, 1) + ssi(i, j, 2)*vymd +&
2449 & vym*ssid(i, j, 2) + ssi(i, j, 3)*vzmd + vzm*ssid(i, j, 3)
2450 vnm = vxm*ssi(i, j, 1) + vym*ssi(i, j, 2) + vzm*ssi(i, j, 3) - sf
2451 arg1d = 2*vxm*vxmd + 2*vym*vymd + 2*vzm*vzmd
2452 arg1 = vxm**2 + vym**2 + vzm**2
2454 if (arg1 .eq. 0.0_8)
then
2457 result1d = arg1d/(2.0*temp)
2462 arg1d = gammam*(pmd-pm*rhomd/rhom)/rhom
2463 arg1 = gammam*pm/rhom
2465 if (arg1 .eq. 0.0_8)
then
2468 amd = arg1d/(2.0*temp)
2471 mnmd = (vmagd-vmag*amd/am)/am
2473 arg1d = 2*ssi(i, j, 1)*ssid(i, j, 1) + 2*ssi(i, j, 2)*ssid(i, j, 2&
2474 & ) + 2*ssi(i, j, 3)*ssid(i, j, 3)
2475 arg1 = ssi(i, j, 1)**2 + ssi(i, j, 2)**2 + ssi(i, j, 3)**2
2477 if (arg1 .eq. 0.0_8)
then
2480 cellaread = arg1d/(2.0*temp)
2483 aread = aread + blk*cellaread
2484 area = area + cellarea*blk
2485 overcellaread = -(cellaread/cellarea**2)
2486 overcellarea = 1/cellarea
2487 call computeptot_d(rhom, rhomd, vxm, vxmd, vym, vymd, vzm, vzmd, &
2488 & pm, pmd, ptot, ptotd)
2489 call computettot_d(rhom, rhomd, vxm, vxmd, vym, vymd, vzm, vzmd, &
2490 & pm, pmd, ttot, ttotd)
2491 massflowratelocald = blk*fact*(mredim*(vnm*rhomd+rhom*vnmd)+rhom*&
2493 massflowratelocal = rhom*vnm*blk*fact*mredim
2494 massflowrated = massflowrated + massflowratelocald
2495 massflowrate = massflowrate + massflowratelocal
2499 mass_ptotd = mass_ptotd +
pref*(massflowratelocal*ptotd+ptot*&
2500 & massflowratelocald) + ptot*massflowratelocal*
prefd
2501 mass_ptot = mass_ptot + ptot*massflowratelocal*
pref
2502 mass_ttotd = mass_ttotd +
tref*(massflowratelocal*ttotd+ttot*&
2503 & massflowratelocald) + ttot*massflowratelocal*
trefd
2504 mass_ttot = mass_ttot + ttot*massflowratelocal*
tref
2505 mass_rhod = mass_rhod +
rhoref*(massflowratelocal*rhomd+rhom*&
2506 & massflowratelocald) + rhom*massflowratelocal*
rhorefd
2507 mass_rho = mass_rho + rhom*massflowratelocal*
rhoref
2508 mass_ad = mass_ad +
uref*(massflowratelocal*amd+am*&
2509 & massflowratelocald)
2510 mass_a = mass_a + am*massflowratelocal*
uref
2511 mass_psd = mass_psd + massflowratelocal*pmd + pm*&
2512 & massflowratelocald
2513 mass_ps = mass_ps + pm*massflowratelocal
2514 mass_mnd = mass_mnd + massflowratelocal*mnmd + mnm*&
2515 & massflowratelocald
2516 mass_mn = mass_mn + mnm*massflowratelocal
2517 area_ptotd = area_ptotd + blk*(cellarea*(
pref*ptotd+ptot*
prefd)+&
2518 & ptot*
pref*cellaread)
2519 area_ptot = area_ptot + ptot*
pref*cellarea*blk
2520 area_psd = area_psd + blk*(cellarea*pmd+pm*cellaread)
2521 area_ps = area_ps + pm*cellarea*blk
2522 sfacecoordrefd(1) = sf*(overcellarea*ssid(i, j, 1)+ssi(i, j, 1)*&
2524 sfacecoordref(1) = sf*ssi(i, j, 1)*overcellarea
2525 sfacecoordrefd(2) = sf*(overcellarea*ssid(i, j, 2)+ssi(i, j, 2)*&
2527 sfacecoordref(2) = sf*ssi(i, j, 2)*overcellarea
2528 sfacecoordrefd(3) = sf*(overcellarea*ssid(i, j, 3)+ssi(i, j, 3)*&
2530 sfacecoordref(3) = sf*ssi(i, j, 3)*overcellarea
2531 temp =
uref*vxm - sfacecoordref(1)
2532 mass_vxd = mass_vxd + massflowratelocal*(
uref*vxmd-sfacecoordrefd(&
2533 & 1)) + temp*massflowratelocald
2534 mass_vx = mass_vx + temp*massflowratelocal
2535 temp =
uref*vym - sfacecoordref(2)
2536 mass_vyd = mass_vyd + massflowratelocal*(
uref*vymd-sfacecoordrefd(&
2537 & 2)) + temp*massflowratelocald
2538 mass_vy = mass_vy + temp*massflowratelocal
2539 temp =
uref*vzm - sfacecoordref(3)
2540 mass_vzd = mass_vzd + massflowratelocal*(
uref*vzmd-sfacecoordrefd(&
2541 & 3)) + temp*massflowratelocald
2542 mass_vz = mass_vz + temp*massflowratelocal
2546 if (
one .gt.
one/ptot)
then
2547 pratiod = -(
one*ptotd/ptot**2)
2553 temp0 =
one - pratio**gm1ovg
2554 if (pratio .le. 0.0_8 .and. (gm1ovg .eq. 0.0_8 .or. gm1ovg .ne. &
2555 & int(gm1ovg)))
then
2558 tempd = gm1ovg*pratio**(gm1ovg-1)*pratiod
2560 arg1d = viconst*(temp0*(
tref*ttotd+ttot*
trefd)-ttot*
tref*tempd)
2561 arg1 = viconst*(temp0*(ttot*
tref))
2563 if (arg1 .eq. 0.0_8)
then
2566 vilocald = arg1d/(2.0*temp0)
2569 mass_vid = mass_vid + massflowratelocal*vilocald + vilocal*&
2570 & massflowratelocald
2571 mass_vi = mass_vi + vilocal*massflowratelocal
2572 mass_nxd = mass_nxd + overcellarea*massflowratelocal*ssid(i, j, 1)&
2573 & + ssi(i, j, 1)*(massflowratelocal*overcellaread+overcellarea*&
2574 & massflowratelocald)
2575 mass_nx = mass_nx + ssi(i, j, 1)*overcellarea*massflowratelocal
2576 mass_nyd = mass_nyd + overcellarea*massflowratelocal*ssid(i, j, 2)&
2577 & + ssi(i, j, 2)*(massflowratelocal*overcellaread+overcellarea*&
2578 & massflowratelocald)
2579 mass_ny = mass_ny + ssi(i, j, 2)*overcellarea*massflowratelocal
2580 mass_nzd = mass_nzd + overcellarea*massflowratelocal*ssid(i, j, 3)&
2581 & + ssi(i, j, 3)*(massflowratelocal*overcellaread+overcellarea*&
2582 & massflowratelocald)
2583 mass_nz = mass_nz + ssi(i, j, 3)*overcellarea*massflowratelocal
2584 xcd =
fourth*(xxd(i, j, 1)+xxd(i+1, j, 1)+xxd(i, j+1, 1)+xxd(i+1, &
2585 & j+1, 1)) - refpointd(1)
2586 xc =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1, &
2588 ycd =
fourth*(xxd(i, j, 2)+xxd(i+1, j, 2)+xxd(i, j+1, 2)+xxd(i+1, &
2589 & j+1, 2)) - refpointd(2)
2590 yc =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1, &
2592 zcd =
fourth*(xxd(i, j, 3)+xxd(i+1, j, 3)+xxd(i, j+1, 3)+xxd(i+1, &
2593 & j+1, 3)) - refpointd(3)
2594 zc =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1, &
2601 fxd = ssi(i, j, 1)*pmd + pm*ssid(i, j, 1)
2602 fx = pm*ssi(i, j, 1)
2603 fyd = ssi(i, j, 2)*pmd + pm*ssid(i, j, 2)
2604 fy = pm*ssi(i, j, 2)
2605 fzd = ssi(i, j, 3)*pmd + pm*ssid(i, j, 3)
2606 fz = pm*ssi(i, j, 3)
2608 fpd(1) = fpd(1) + fxd
2610 fpd(2) = fpd(2) + fyd
2612 fpd(3) = fpd(3) + fzd
2614 mxd = fz*ycd + yc*fzd - fy*zcd - zc*fyd
2616 myd = fx*zcd + zc*fxd - fz*xcd - xc*fzd
2618 mzd = fy*xcd + xc*fyd - fx*ycd - yc*fxd
2620 mpd(1) = mpd(1) + mxd
2622 mpd(2) = mpd(2) + myd
2624 mpd(3) = mpd(3) + mzd
2628 xcod =
fourth*(xxd(i, j, 1)+xxd(i+1, j, 1)+xxd(i, j+1, 1)+xxd(i+1&
2630 xco =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
2632 ycod =
fourth*(xxd(i, j, 2)+xxd(i+1, j, 2)+xxd(i, j+1, 2)+xxd(i+1&
2634 yco =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
2636 zcod =
fourth*(xxd(i, j, 3)+xxd(i+1, j, 3)+xxd(i, j+1, 3)+xxd(i+1&
2638 zco =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
2644 cofsumfxd(1) = cofsumfxd(1) + fx*xcod + xco*fxd
2645 cofsumfx(1) = cofsumfx(1) + xco*fx
2646 cofsumfxd(2) = cofsumfxd(2) + fx*ycod + yco*fxd
2647 cofsumfx(2) = cofsumfx(2) + yco*fx
2648 cofsumfxd(3) = cofsumfxd(3) + fx*zcod + zco*fxd
2649 cofsumfx(3) = cofsumfx(3) + zco*fx
2651 cofsumfyd(1) = cofsumfyd(1) + fy*xcod + xco*fyd
2652 cofsumfy(1) = cofsumfy(1) + xco*fy
2653 cofsumfyd(2) = cofsumfyd(2) + fy*ycod + yco*fyd
2654 cofsumfy(2) = cofsumfy(2) + yco*fy
2655 cofsumfyd(3) = cofsumfyd(3) + fy*zcod + zco*fyd
2656 cofsumfy(3) = cofsumfy(3) + zco*fy
2658 cofsumfzd(1) = cofsumfzd(1) + fz*xcod + xco*fzd
2659 cofsumfz(1) = cofsumfz(1) + xco*fz
2660 cofsumfzd(2) = cofsumfzd(2) + fz*ycod + yco*fzd
2661 cofsumfz(2) = cofsumfz(2) + yco*fz
2662 cofsumfzd(3) = cofsumfzd(3) + fz*zcod + zco*fzd
2663 cofsumfz(3) = cofsumfz(3) + zco*fz
2668 temp0 = fact*blk*internalflowfact*inflowfact
2669 temp = massflowratelocal/(
timeref*cellarea)
2670 massflowratelocald = temp0*(massflowratelocald-temp*(cellarea*&
2672 massflowratelocal = temp0*temp
2673 fxd = massflowratelocal*vxm*ssid(i, j, 1) + ssi(i, j, 1)*(vxm*&
2674 & massflowratelocald+massflowratelocal*vxmd)
2675 fx = massflowratelocal*ssi(i, j, 1)*vxm
2676 fyd = massflowratelocal*vym*ssid(i, j, 2) + ssi(i, j, 2)*(vym*&
2677 & massflowratelocald+massflowratelocal*vymd)
2678 fy = massflowratelocal*ssi(i, j, 2)*vym
2679 fzd = massflowratelocal*vzm*ssid(i, j, 3) + ssi(i, j, 3)*(vzm*&
2680 & massflowratelocald+massflowratelocal*vzmd)
2681 fz = massflowratelocal*ssi(i, j, 3)*vzm
2682 fmomd(1) = fmomd(1) + fxd
2683 fmom(1) = fmom(1) + fx
2684 fmomd(2) = fmomd(2) + fyd
2685 fmom(2) = fmom(2) + fy
2686 fmomd(3) = fmomd(3) + fzd
2687 fmom(3) = fmom(3) + fz
2688 mxd = fz*ycd + yc*fzd - fy*zcd - zc*fyd
2690 myd = fx*zcd + zc*fxd - fz*xcd - xc*fzd
2692 mzd = fy*xcd + xc*fyd - fx*ycd - yc*fxd
2694 mmomd(1) = mmomd(1) + mxd
2695 mmom(1) = mmom(1) + mx
2696 mmomd(2) = mmomd(2) + myd
2697 mmom(2) = mmom(2) + my
2698 mmomd(3) = mmomd(3) + mzd
2699 mmom(3) = mmom(3) + mz
2704 cofsumfxd(1) = cofsumfxd(1) + fx*xcod + xco*fxd
2705 cofsumfx(1) = cofsumfx(1) + xco*fx
2706 cofsumfxd(2) = cofsumfxd(2) + fx*ycod + yco*fxd
2707 cofsumfx(2) = cofsumfx(2) + yco*fx
2708 cofsumfxd(3) = cofsumfxd(3) + fx*zcod + zco*fxd
2709 cofsumfx(3) = cofsumfx(3) + zco*fx
2711 cofsumfyd(1) = cofsumfyd(1) + fy*xcod + xco*fyd
2712 cofsumfy(1) = cofsumfy(1) + xco*fy
2713 cofsumfyd(2) = cofsumfyd(2) + fy*ycod + yco*fyd
2714 cofsumfy(2) = cofsumfy(2) + yco*fy
2715 cofsumfyd(3) = cofsumfyd(3) + fy*zcod + zco*fyd
2716 cofsumfy(3) = cofsumfy(3) + zco*fy
2718 cofsumfzd(1) = cofsumfzd(1) + fz*xcod + xco*fzd
2719 cofsumfz(1) = cofsumfz(1) + xco*fz
2720 cofsumfzd(2) = cofsumfzd(2) + fz*ycod + yco*fzd
2721 cofsumfz(2) = cofsumfz(2) + yco*fz
2722 cofsumfzd(3) = cofsumfzd(3) + fz*zcod + zco*fzd
2723 cofsumfz(3) = cofsumfz(3) + zco*fz
2728 localvaluesd(
iarea) = localvaluesd(
iarea) + aread
2729 localvalues(
iarea) = localvalues(
iarea) + area
2742 localvaluesd(
ifp:
ifp+2) = localvaluesd(
ifp:
ifp+2) + fpd
2795 use bcpointers_d,
only : ssi, sface, ww1, ww2, pp1, pp2, xx, gamma1,&
2800 logical,
intent(in) :: isinflow
2801 real(kind=realtype),
dimension(nlocalvalues),
intent(inout) :: &
2803 integer(kind=inttype),
intent(in) :: mm
2805 real(kind=realtype) :: massflowrate, mass_ptot, mass_ttot, mass_ps, &
2806 & mass_mn, mass_a, mass_rho, mass_vx, mass_vy, mass_vz, mass_nx, &
2807 & mass_ny, mass_nz, mass_vi
2808 real(kind=realtype) :: area_ptot, area_ps
2809 real(kind=realtype) :: govgm1, gm1ovg, viconst, vilocal, pratio
2810 real(kind=realtype) :: mredim
2811 integer(kind=inttype) :: i, j, ii, blk
2812 real(kind=realtype) :: internalflowfact, inflowfact, fact, xc, xco, &
2813 & yc, yco, zc, zco, mx, my, mz
2814 real(kind=realtype) :: sf, vmag, vnm, vnmfreestreamref, vxm, vym, &
2815 & vzm, fx, fy, fz, u, v, w
2816 real(kind=realtype) :: pm, ptot, ttot, rhom, gammam, am
2817 real(kind=realtype) :: area, cellarea, overcellarea
2818 real(kind=realtype),
dimension(3) :: fp, mp, fmom, mmom, refpoint, &
2820 real(kind=realtype),
dimension(3) :: cofsumfx, cofsumfy, cofsumfz
2821 real(kind=realtype) :: mnm, massflowratelocal
2826 real(kind=realtype) :: arg1
2827 real(kind=realtype) :: result1
2843 internalflowfact =
one
2846 if (isinflow) inflowfact = -
one
2892 if (
bcdata(mm)%iblank(i, j) .lt. 0)
then
2895 blk =
bcdata(mm)%iblank(i, j)
2901 pm =
half*(pp1(i, j)+pp2(i, j))
2902 gammam =
half*(gamma1(i, j)+gamma2(i, j))
2903 vnm = vxm*ssi(i, j, 1) + vym*ssi(i, j, 2) + vzm*ssi(i, j, 3) - sf
2904 arg1 = vxm**2 + vym**2 + vzm**2
2905 result1 = sqrt(arg1)
2907 arg1 = gammam*pm/rhom
2910 arg1 = ssi(i, j, 1)**2 + ssi(i, j, 2)**2 + ssi(i, j, 3)**2
2911 cellarea = sqrt(arg1)
2912 area = area + cellarea*blk
2913 overcellarea = 1/cellarea
2916 massflowratelocal = rhom*vnm*blk*fact*mredim
2917 massflowrate = massflowrate + massflowratelocal
2920 mass_ptot = mass_ptot + ptot*massflowratelocal*
pref
2921 mass_ttot = mass_ttot + ttot*massflowratelocal*
tref
2922 mass_rho = mass_rho + rhom*massflowratelocal*
rhoref
2923 mass_a = mass_a + am*massflowratelocal*
uref
2924 mass_ps = mass_ps + pm*massflowratelocal
2925 mass_mn = mass_mn + mnm*massflowratelocal
2926 area_ptot = area_ptot + ptot*
pref*cellarea*blk
2927 area_ps = area_ps + pm*cellarea*blk
2928 sfacecoordref(1) = sf*ssi(i, j, 1)*overcellarea
2929 sfacecoordref(2) = sf*ssi(i, j, 2)*overcellarea
2930 sfacecoordref(3) = sf*ssi(i, j, 3)*overcellarea
2931 mass_vx = mass_vx + (vxm*
uref-sfacecoordref(1))*massflowratelocal
2932 mass_vy = mass_vy + (vym*
uref-sfacecoordref(2))*massflowratelocal
2933 mass_vz = mass_vz + (vzm*
uref-sfacecoordref(3))*massflowratelocal
2937 if (
one .gt.
one/ptot)
then
2942 arg1 = viconst*(
one-pratio**gm1ovg)*ttot*
tref
2943 vilocal = sqrt(arg1)
2944 mass_vi = mass_vi + vilocal*massflowratelocal
2945 mass_nx = mass_nx + ssi(i, j, 1)*overcellarea*massflowratelocal
2946 mass_ny = mass_ny + ssi(i, j, 2)*overcellarea*massflowratelocal
2947 mass_nz = mass_nz + ssi(i, j, 3)*overcellarea*massflowratelocal
2948 xc =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1, &
2950 yc =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1, &
2952 zc =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1, &
2958 fx = pm*ssi(i, j, 1)
2959 fy = pm*ssi(i, j, 2)
2960 fz = pm*ssi(i, j, 3)
2973 xco =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
2975 yco =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
2977 zco =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
2983 cofsumfx(1) = cofsumfx(1) + xco*fx
2984 cofsumfx(2) = cofsumfx(2) + yco*fx
2985 cofsumfx(3) = cofsumfx(3) + zco*fx
2987 cofsumfy(1) = cofsumfy(1) + xco*fy
2988 cofsumfy(2) = cofsumfy(2) + yco*fy
2989 cofsumfy(3) = cofsumfy(3) + zco*fy
2991 cofsumfz(1) = cofsumfz(1) + xco*fz
2992 cofsumfz(2) = cofsumfz(2) + yco*fz
2993 cofsumfz(3) = cofsumfz(3) + zco*fz
2998 massflowratelocal = massflowratelocal*fact/
timeref*blk/cellarea*&
2999 & internalflowfact*inflowfact
3000 fx = massflowratelocal*ssi(i, j, 1)*vxm
3001 fy = massflowratelocal*ssi(i, j, 2)*vym
3002 fz = massflowratelocal*ssi(i, j, 3)*vzm
3003 fmom(1) = fmom(1) + fx
3004 fmom(2) = fmom(2) + fy
3005 fmom(3) = fmom(3) + fz
3009 mmom(1) = mmom(1) + mx
3010 mmom(2) = mmom(2) + my
3011 mmom(3) = mmom(3) + mz
3016 cofsumfx(1) = cofsumfx(1) + xco*fx
3017 cofsumfx(2) = cofsumfx(2) + yco*fx
3018 cofsumfx(3) = cofsumfx(3) + zco*fx
3020 cofsumfy(1) = cofsumfy(1) + xco*fy
3021 cofsumfy(2) = cofsumfy(2) + yco*fy
3022 cofsumfy(3) = cofsumfy(3) + zco*fy
3024 cofsumfz(1) = cofsumfz(1) + xco*fz
3025 cofsumfz(2) = cofsumfz(2) + yco*fz
3026 cofsumfz(3) = cofsumfz(3) + zco*fz
3030 localvalues(
iarea) = localvalues(
iarea) + area
logical addgridvelocities
integer(kind=inttype) spectralsol
type(viscsubfacetype), dimension(:), pointer viscsubface
type(bcdatatype), dimension(:), pointer bcdatad
integer(kind=inttype), dimension(:), pointer bcfaceid
integer(kind=inttype), dimension(:), pointer bctype
type(viscsubfacetype), dimension(:), pointer viscsubfaced
integer(kind=inttype), dimension(:), pointer inbeg
integer(kind=inttype), parameter costfuncaxismoment
integer(kind=inttype), parameter costfuncmavgptot
integer(kind=inttype), parameter costfuncforceyviscous
integer(kind=inttype), parameter isepavg
integer(kind=inttype), parameter imassvz
integer(kind=inttype), parameter iareaps
real(kind=realtype), parameter degtorad
real(kind=realtype), parameter zero
integer(kind=inttype), parameter costfuncforceycoefviscous
integer(kind=inttype), parameter costfuncforceypressure
integer(kind=inttype), parameter costfunccoforcexx
integer(kind=inttype), parameter imax
integer(kind=inttype), parameter costfuncforcexmomentum
integer(kind=inttype), parameter iflowmp
integer(kind=inttype), parameter imassnx
integer(kind=inttype), parameter kmin
integer(kind=inttype), parameter costfunccoforcexz
integer(kind=inttype), parameter costfuncdragviscous
integer(kind=inttype), parameter imassflow
integer(kind=inttype), parameter jmax
integer(kind=inttype), parameter costfuncforcexcoefpressure
integer(kind=inttype), parameter icoforcez
integer(kind=inttype), parameter costfuncliftcoefpressure
integer(kind=inttype), parameter costfuncdragcoefviscous
integer(kind=inttype), parameter costfuncmdot
integer(kind=inttype), parameter costfuncdragcoef
integer(kind=inttype), parameter costfuncdragcoefmomentum
integer(kind=inttype), parameter costfuncarea
integer(kind=inttype), parameter costfuncforcexpressure
integer(kind=inttype), parameter costfunccoforceyy
integer(kind=inttype), parameter costfunccavitation
integer(kind=inttype), parameter costfuncmomzcoef
integer(kind=inttype), parameter imassptot
integer(kind=inttype), parameter costfuncmavga
integer(kind=inttype), parameter iflowfm
integer(kind=inttype), parameter icperror2
integer(kind=inttype), parameter costfunccperror2
integer(kind=inttype), parameter costfuncliftmomentum
integer(kind=inttype), parameter costfuncforcezcoefviscous
integer(kind=inttype), parameter costfuncaavgps
integer(kind=inttype), parameter costfuncforcexviscous
integer(kind=inttype), parameter costfuncaavgptot
integer(kind=inttype), parameter costfuncflowpower
integer(kind=inttype), parameter costfuncforceymomentum
integer(kind=inttype), parameter costfuncliftviscous
integer(kind=inttype), parameter costfuncforcex
integer(kind=inttype), parameter nswalladiabatic
integer(kind=inttype), parameter costfuncliftpressure
integer(kind=inttype), parameter imassnz
integer(kind=inttype), parameter costfuncforceycoefpressure
integer(kind=inttype), parameter costfuncmomxcoef
integer(kind=inttype), parameter costfuncforcezmomentum
integer(kind=inttype), parameter costfuncforcezcoefmomentum
integer(kind=inttype), parameter imp
integer(kind=inttype), parameter costfuncmomz
integer(kind=inttype), parameter imassa
integer(kind=inttype), parameter ipower
integer(kind=inttype), parameter ifv
integer(kind=inttype), parameter costfuncsepsensorksarea
integer(kind=inttype), parameter imassny
integer(kind=inttype), parameter costfuncmomy
integer(kind=inttype), parameter costfuncmavgvy
integer(kind=inttype), parameter costfuncmomx
integer(kind=inttype), parameter costfuncforcez
integer(kind=inttype), parameter costfuncmavgvx
integer(kind=inttype), parameter costfunccoforcexy
integer(kind=inttype), parameter costfuncdragmomentum
integer(kind=inttype), parameter isepsensorarea
integer(kind=inttype), parameter costfuncforcexcoef
integer(kind=inttype), parameter costfuncmavgvi
integer(kind=inttype), parameter icoforcex
integer(kind=inttype), parameter costfunccoforceyx
real(kind=realtype), parameter one
integer(kind=inttype), parameter costfuncforcexcoefmomentum
integer(kind=inttype), parameter costfuncmavgps
integer(kind=inttype), parameter iflowmm
integer(kind=inttype), parameter imassvy
integer(kind=inttype), parameter costfunccoforceyz
real(kind=realtype), parameter half
integer(kind=inttype), parameter costfunccofliftx
integer(kind=inttype), parameter costfunccoforcezz
integer(kind=inttype), parameter costfunccpmin
integer(kind=inttype), parameter imassvx
integer(kind=inttype), parameter imassrho
integer(kind=inttype), parameter imin
integer(kind=inttype), parameter costfunccoflifty
integer(kind=inttype), parameter imassmn
integer(kind=inttype), parameter costfuncforcezcoefpressure
integer(kind=inttype), parameter costfuncmavgmn
integer(kind=inttype), parameter costfuncforceycoef
integer(kind=inttype), parameter costfuncliftcoefmomentum
integer(kind=inttype), parameter costfuncforcey
integer(kind=inttype), parameter icoforcey
integer(kind=inttype), parameter costfuncdrag
integer(kind=inttype), parameter iarea
integer(kind=inttype), parameter costfunccofliftz
integer(kind=inttype), parameter imassvi
integer(kind=inttype), parameter costfuncforcexcoefviscous
integer(kind=inttype), parameter iaxismoment
real(kind=realtype), parameter two
integer(kind=inttype), parameter costfuncsepsensoravgz
integer(kind=inttype), parameter imv
integer(kind=inttype), parameter costfuncdragcoefpressure
integer(kind=inttype), parameter isepsensorksarea
integer(kind=inttype), parameter imassps
real(kind=realtype), parameter fourth
integer(kind=inttype), parameter isepsensor
integer(kind=inttype), parameter nswallisothermal
integer(kind=inttype), parameter costfunclift
integer(kind=inttype), parameter costfunccoforcezy
integer(kind=inttype), parameter costfuncmavgttot
integer(kind=inttype), parameter costfuncliftcoef
integer(kind=inttype), parameter costfuncmomycoef
integer(kind=inttype), parameter costfuncsepsensoravgy
integer(kind=inttype), parameter costfuncmavgvz
integer(kind=inttype), parameter costfuncliftcoefviscous
integer(kind=inttype), parameter costfuncsepsensoravgx
integer(kind=inttype), parameter icpmin
integer(kind=inttype), parameter costfunccoforcezx
integer(kind=inttype), parameter costfuncforcezpressure
integer(kind=inttype), parameter costfuncforcezviscous
integer(kind=inttype), parameter costfuncmavgrho
integer(kind=inttype), parameter kmax
integer(kind=inttype), parameter costfuncsepsensor
integer(kind=inttype), parameter costfuncsepsensorks
integer(kind=inttype), parameter isepsensorks
integer(kind=inttype), parameter icavitation
integer(kind=inttype), parameter imassttot
integer(kind=inttype), parameter jmin
integer(kind=inttype), parameter costfuncforcezcoef
integer(kind=inttype), parameter internalflow
integer(kind=inttype), parameter ifp
integer(kind=inttype), parameter costfuncdragpressure
integer(kind=inttype), parameter costfuncforceycoefmomentum
integer(kind=inttype), parameter iareaptot
subroutine getdirvector(refdirection, alpha, beta, winddirection, liftindex)
subroutine computeptot(rho, u, v, w, p, ptot)
subroutine computettot_d(rho, rhod, u, ud, v, vd, w, wd, p, pd, ttot, ttotd)
subroutine computeptot_d(rho, rhod, u, ud, v, vd, w, wd, p, pd, ptot, ptotd)
subroutine computettot(rho, u, v, w, p, ttot)
real(kind=realtype) gammainf
real(kind=realtype) rhoinfd
real(kind=realtype) trefd
real(kind=realtype) uinfd
real(kind=realtype) rgasd
real(kind=realtype) prefd
real(kind=realtype) rhoref
real(kind=realtype) urefd
real(kind=realtype) pinfd
real(kind=realtype) rhoinf
real(kind=realtype) rhorefd
real(kind=realtype) timeref
real(kind=realtype) timerefd
integer, parameter realtype
subroutine wallintegrationface(localvalues, mm)
subroutine getcostfunctions(globalvals, funcvalues)
subroutine flowintegrationface(isinflow, localvalues, mm)
subroutine getcostfunctions_d(globalvals, globalvalsd, funcvalues, funcvaluesd)
subroutine wallintegrationface_d(localvalues, localvaluesd, mm)
subroutine flowintegrationface_d(isinflow, localvalues, localvaluesd, mm)
subroutine ksaggregationfunction(g, max_g, g_rho, ks_g)
subroutine ksaggregationfunction_d(g, gd, max_g, g_rho, ks_g, ks_gd)
subroutine computetsderivatives(force, moment, coef0, dcdalpha, dcdalphadot, dcdq, dcdqdot)
real(kind=realtype) function mynorm2(x)