32 real(kind=realtype),
dimension(:, :),
intent(in) :: globalvals
33 real(kind=realtype),
dimension(:, :) :: globalvalsd
34 real(kind=realtype),
dimension(:) :: funcvalues
35 real(kind=realtype),
dimension(:) :: funcvaluesd
37 real(kind=realtype) :: fact, factmoment, ovrnts
38 real(kind=realtype) :: factd
39 real(kind=realtype),
dimension(3, ntimeintervalsspectral) :: force, &
40 & forcep, forcev, forcem, moment, cforce, cforcep, cforcev, cforcem, &
41 & cmoment, cofx, cofy, cofz
42 real(kind=realtype),
dimension(3, ntimeintervalsspectral) :: forced&
43 & , forcepd, forcevd, forcemd, momentd, cforced, cforcepd, cforcevd, &
44 & cforcemd, cmomentd, cofxd, cofyd, cofzd
45 real(kind=realtype),
dimension(3) :: vcoordref, vfreestreamref
46 real(kind=realtype) :: mavgptot, mavgttot, mavgrho, mavgps, mflow, &
47 & mavgmn, mavga, mavgvx, mavgvy, mavgvz, garea, mavgvi, fxlift, fylift&
49 real(kind=realtype) :: mavgptotd, mavgttotd, mavgrhod, mavgpsd, &
50 & mflowd, mavgmnd, mavgad, mavgvxd, mavgvyd, mavgvzd, garead, mavgvid&
51 & , fxliftd, fyliftd, fzliftd
52 real(kind=realtype) :: vdotn, mag, u, v, w, ks_comp
53 real(kind=realtype) :: ks_compd
54 integer(kind=inttype) :: sps
55 real(kind=realtype),
dimension(8) :: dcdq, dcdqdot
56 real(kind=realtype),
dimension(8) :: dcdalpha, dcdalphadot
57 real(kind=realtype),
dimension(8) :: coef0
61 real(kind=realtype) :: temp
62 real(kind=realtype) :: temp0
63 real(kind=realtype) :: temp1
64 real(kind=realtype) :: tempd
65 real(kind=realtype) :: tmp
66 real(kind=realtype) :: tmpd
67 real(kind=realtype) :: tmp0
68 real(kind=realtype) :: tmpd0
69 real(kind=realtype) :: tmp1
70 real(kind=realtype) :: tmpd1
71 real(kind=realtype) :: tmp2
72 real(kind=realtype) :: tmpd2
73 real(kind=realtype) :: tmp3
74 real(kind=realtype) :: tmpd3
75 real(kind=realtype) :: tmp4
76 real(kind=realtype) :: tmpd4
77 real(kind=realtype) :: tmp5
78 real(kind=realtype) :: tmpd5
79 real(kind=realtype) :: tmp6
80 real(kind=realtype) :: tmpd6
81 real(kind=realtype) :: tmp7
82 real(kind=realtype) :: tmpd7
83 real(kind=realtype) :: tmp8
84 real(kind=realtype) :: tmpd8
85 real(kind=realtype) :: tmp9
86 real(kind=realtype) :: tmpd9
87 real(kind=realtype) :: tmp10
88 real(kind=realtype) :: tmpd10
89 real(kind=realtype) :: tmp11
90 real(kind=realtype) :: tmpd11
91 real(kind=realtype) :: tmp12
92 real(kind=realtype) :: tmpd12
93 real(kind=realtype) :: tmp13
94 real(kind=realtype) :: tmpd13
95 real(kind=realtype) :: tmp14
96 real(kind=realtype) :: tmpd14
97 real(kind=realtype) :: tmp15
98 real(kind=realtype) :: tmpd15
99 real(kind=realtype) :: tempd0
100 real(kind=realtype) :: tmp16
101 real(kind=realtype) :: tmpd16
102 real(kind=realtype) :: tmp17
103 real(kind=realtype) :: tmpd17
104 real(kind=realtype) :: tempd1
109 force = globalvals(
ifp:
ifp+2, :) + globalvals(
ifv:
ifv+2, :) + &
111 forcep = globalvals(
ifp:
ifp+2, :)
112 forcev = globalvals(
ifv:
ifv+2, :)
117 moment = globalvals(
imp:
imp+2, :) + globalvals(
imv:
imv+2, :) + &
121 cforcep = fact*forcep
122 cforcev = fact*forcev
123 cforcem = fact*forcem
127 cmoment = fact*moment
162 & ovrnts*cforce(1, sps)
164 & ovrnts*cforce(2, sps)
166 & ovrnts*cforce(3, sps)
189 if (force(1, sps) .ne.
zero)
then
190 cofx(:, sps) = cofx(:, sps)/force(1, sps)
194 if (force(2, sps) .ne.
zero)
then
195 cofy(:, sps) = cofy(:, sps)/force(2, sps)
199 if (force(3, sps) .ne.
zero)
then
200 cofz(:, sps) = cofz(:, sps)/force(3, sps)
206 & ovrnts*cofx(1, sps)
208 & ovrnts*cofx(2, sps)
210 & ovrnts*cofx(3, sps)
213 & ovrnts*cofy(1, sps)
215 & ovrnts*cofy(2, sps)
217 & ovrnts*cofy(3, sps)
220 & ovrnts*cofz(1, sps)
222 & ovrnts*cofz(2, sps)
224 & ovrnts*cofz(3, sps)
233 & ovrnts*cmoment(1, sps)
235 & ovrnts*cmoment(2, sps)
237 & ovrnts*cmoment(3, sps)
271 & globalvals(
iarea, sps)
273 & ovrnts*globalvals(
ipower, sps)
278 if (mflow .ne.
zero)
then
279 mavgptot = globalvals(
imassptot, sps)/mflow
280 mavgttot = globalvals(
imassttot, sps)/mflow
281 mavgrho = globalvals(
imassrho, sps)/mflow
282 mavgps = globalvals(
imassps, sps)/mflow
283 mavgmn = globalvals(
imassmn, sps)/mflow
284 mavga = globalvals(
imassa, sps)/mflow
285 mavgvx = globalvals(
imassvx, sps)/mflow
286 mavgvy = globalvals(
imassvy, sps)/mflow
287 mavgvz = globalvals(
imassvz, sps)/mflow
288 mavgvi = globalvals(
imassvi, sps)/mflow
290 & )**2 + globalvals(
imassnz, sps)**2)
304 garea = globalvals(
iarea, sps)
305 if (garea .ne.
zero)
then
308 & ovrnts*globalvals(
iareaptot, sps)/garea
310 & *globalvals(
iareaps, sps)/garea
428 if (fxlift + fylift + fzlift .ne.
zero)
then
439 call pushcontrol1b(0)
441 call pushcontrol1b(1)
447 call popcontrol1b(branch)
448 if (branch .eq. 0)
then
451 tempd = tmpd17/(fxlift+fylift+fzlift)
467 tempd = tmpd16/(fxlift+fylift+fzlift)
483 tempd = tmpd15/(fxlift+fylift+fzlift)
780 if (force(1, sps) .ne.
zero)
then
781 call pushcontrol1b(0)
783 call pushcontrol1b(1)
785 if (force(2, sps) .ne.
zero)
then
786 call pushcontrol1b(0)
788 call pushcontrol1b(1)
790 if (force(3, sps) .ne.
zero)
then
791 call pushcontrol1b(0)
793 call pushcontrol1b(1)
804 call pushcontrol1b(0)
806 call pushcontrol1b(1)
810 call pushcontrol1b(0)
812 call pushcontrol1b(1)
816 if (mflow .ne.
zero)
then
817 call pushcontrol1b(0)
819 call pushcontrol1b(1)
822 garea = globalvals(
iarea, sps)
823 if (garea .ne.
zero)
then
824 call pushcontrol1b(0)
826 call pushcontrol1b(1)
839 call popcontrol1b(branch)
840 if (branch .eq. 0)
then
843 garead = -(globalvals(
iareaps, sps)*tempd/garea)
847 garead = garead - globalvals(
iareaptot, sps)*tempd/garea
851 globalvalsd(
iarea, sps) = globalvalsd(
iarea, sps) + garead
852 call popcontrol1b(branch)
853 if (branch .eq. 0)
then
856 mflowd = mflowd - globalvals(
imassvi, sps)*mavgvid/mflow**2 - &
857 & globalvals(
imassvz, sps)*mavgvzd/mflow**2 - globalvals(&
859 & mavgvxd/mflow**2 - globalvals(
imassa, sps)*mavgad/mflow**2 -&
860 & globalvals(
imassmn, sps)*mavgmnd/mflow**2 - globalvals(&
862 & mavgrhod/mflow**2 - globalvals(
imassttot, sps)*mavgttotd/&
863 & mflow**2 - globalvals(
imassptot, sps)*mavgptotd/mflow**2
870 globalvalsd(
imassa, sps) = globalvalsd(
imassa, sps) + mavgad/&
887 globalvalsd(
ipower, sps) = globalvalsd(
ipower, sps) + ovrnts*&
889 globalvalsd(
iarea, sps) = globalvalsd(
iarea, sps) + ovrnts*&
899 call popcontrol1b(branch)
900 if (branch .eq. 0) globalvalsd(
icpmin, sps) = globalvalsd(
icpmin&
907 call popcontrol1b(branch)
908 if (branch .eq. 0)
then
910 temp0 =
one + exp(temp1)
924 cmomentd(3, sps) = cmomentd(3, sps) + ovrnts*funcvaluesd(&
926 cmomentd(2, sps) = cmomentd(2, sps) + ovrnts*funcvaluesd(&
928 cmomentd(1, sps) = cmomentd(1, sps) + ovrnts*funcvaluesd(&
930 momentd(3, sps) = momentd(3, sps) + ovrnts*funcvaluesd(&
932 momentd(2, sps) = momentd(2, sps) + ovrnts*funcvaluesd(&
934 momentd(1, sps) = momentd(1, sps) + ovrnts*funcvaluesd(&
936 cofzd(3, sps) = cofzd(3, sps) + ovrnts*funcvaluesd(&
938 cofzd(2, sps) = cofzd(2, sps) + ovrnts*funcvaluesd(&
940 cofzd(1, sps) = cofzd(1, sps) + ovrnts*funcvaluesd(&
942 cofyd(3, sps) = cofyd(3, sps) + ovrnts*funcvaluesd(&
944 cofyd(2, sps) = cofyd(2, sps) + ovrnts*funcvaluesd(&
946 cofyd(1, sps) = cofyd(1, sps) + ovrnts*funcvaluesd(&
948 cofxd(3, sps) = cofxd(3, sps) + ovrnts*funcvaluesd(&
950 cofxd(2, sps) = cofxd(2, sps) + ovrnts*funcvaluesd(&
952 cofxd(1, sps) = cofxd(1, sps) + ovrnts*funcvaluesd(&
954 call popcontrol1b(branch)
955 if (branch .eq. 0)
then
956 forced(3, sps) = forced(3, sps) - sum(cofz(:, sps)*cofzd(:, &
957 & sps))/force(3, sps)**2
958 cofzd(:, sps) = cofzd(:, sps)/force(3, sps)
960 cofzd(:, sps) = 0.0_8
962 call popcontrol1b(branch)
963 if (branch .eq. 0)
then
964 forced(2, sps) = forced(2, sps) - sum(cofy(:, sps)*cofyd(:, &
965 & sps))/force(2, sps)**2
966 cofyd(:, sps) = cofyd(:, sps)/force(2, sps)
968 cofyd(:, sps) = 0.0_8
970 call popcontrol1b(branch)
971 if (branch .eq. 0)
then
972 forced(1, sps) = forced(1, sps) - sum(cofx(:, sps)*cofxd(:, &
973 & sps))/force(1, sps)**2
974 cofxd(:, sps) = cofxd(:, sps)/force(1, sps)
976 cofxd(:, sps) = 0.0_8
978 cforcemd(3, sps) = cforcemd(3, sps) + ovrnts*funcvaluesd(&
980 cforcemd(2, sps) = cforcemd(2, sps) + ovrnts*funcvaluesd(&
982 cforcemd(1, sps) = cforcemd(1, sps) + ovrnts*funcvaluesd(&
984 cforcevd(3, sps) = cforcevd(3, sps) + ovrnts*funcvaluesd(&
986 cforcevd(2, sps) = cforcevd(2, sps) + ovrnts*funcvaluesd(&
988 cforcevd(1, sps) = cforcevd(1, sps) + ovrnts*funcvaluesd(&
990 cforcepd(3, sps) = cforcepd(3, sps) + ovrnts*funcvaluesd(&
992 cforcepd(2, sps) = cforcepd(2, sps) + ovrnts*funcvaluesd(&
994 cforcepd(1, sps) = cforcepd(1, sps) + ovrnts*funcvaluesd(&
996 cforced(3, sps) = cforced(3, sps) + ovrnts*funcvaluesd(&
998 cforced(2, sps) = cforced(2, sps) + ovrnts*funcvaluesd(&
1000 cforced(1, sps) = cforced(1, sps) + ovrnts*funcvaluesd(&
1002 forcemd(3, sps) = forcemd(3, sps) + ovrnts*funcvaluesd(&
1004 forcemd(2, sps) = forcemd(2, sps) + ovrnts*funcvaluesd(&
1006 forcemd(1, sps) = forcemd(1, sps) + ovrnts*funcvaluesd(&
1008 forcevd(3, sps) = forcevd(3, sps) + ovrnts*funcvaluesd(&
1010 forcevd(2, sps) = forcevd(2, sps) + ovrnts*funcvaluesd(&
1012 forcevd(1, sps) = forcevd(1, sps) + ovrnts*funcvaluesd(&
1014 forcepd(3, sps) = forcepd(3, sps) + ovrnts*funcvaluesd(&
1016 forcepd(2, sps) = forcepd(2, sps) + ovrnts*funcvaluesd(&
1018 forcepd(1, sps) = forcepd(1, sps) + ovrnts*funcvaluesd(&
1020 forced(3, sps) = forced(3, sps) + ovrnts*funcvaluesd(&
1022 forced(2, sps) = forced(2, sps) + ovrnts*funcvaluesd(&
1024 forced(1, sps) = forced(1, sps) + ovrnts*funcvaluesd(&
1027 factd = sum(moment*cmomentd)
1028 momentd = momentd + fact*cmomentd
1030 factd = factd/(
lengthref*
lref) + sum(forcem*cforcemd) + sum(forcev&
1031 & *cforcevd) + sum(forcep*cforcepd) + sum(force*cforced)
1032 forcemd = forcemd + fact*cforcemd
1033 forcevd = forcevd + fact*cforcevd
1034 forcepd = forcepd + fact*cforcepd
1035 forced = forced + fact*cforced
1038 tempd = -(temp*
two*factd/temp0**2)
1041 globalvalsd(
imp:
imp+2, :) = globalvalsd(
imp:
imp+2, :) + momentd
1042 globalvalsd(
imv:
imv+2, :) = globalvalsd(
imv:
imv+2, :) + momentd
1053 globalvalsd(
ifv:
ifv+2, :) = globalvalsd(
ifv:
ifv+2, :) + forcevd
1054 globalvalsd(
ifp:
ifp+2, :) = globalvalsd(
ifp:
ifp+2, :) + forcepd + &
1056 globalvalsd(
ifv:
ifv+2, :) = globalvalsd(
ifv:
ifv+2, :) + forced
1078 real(kind=realtype),
dimension(:, :),
intent(in) :: globalvals
1079 real(kind=realtype),
dimension(:),
intent(out) :: funcvalues
1081 real(kind=realtype) :: fact, factmoment, ovrnts
1082 real(kind=realtype),
dimension(3, ntimeintervalsspectral) :: force, &
1083 & forcep, forcev, forcem, moment, cforce, cforcep, cforcev, cforcem, &
1084 & cmoment, cofx, cofy, cofz
1085 real(kind=realtype),
dimension(3) :: vcoordref, vfreestreamref
1086 real(kind=realtype) :: mavgptot, mavgttot, mavgrho, mavgps, mflow, &
1087 & mavgmn, mavga, mavgvx, mavgvy, mavgvz, garea, mavgvi, fxlift, fylift&
1089 real(kind=realtype) :: vdotn, mag, u, v, w, ks_comp
1090 integer(kind=inttype) :: sps
1091 real(kind=realtype),
dimension(8) :: dcdq, dcdqdot
1092 real(kind=realtype),
dimension(8) :: dcdalpha, dcdalphadot
1093 real(kind=realtype),
dimension(8) :: coef0
1100 force = globalvals(
ifp:
ifp+2, :) + globalvals(
ifv:
ifv+2, :) + &
1102 forcep = globalvals(
ifp:
ifp+2, :)
1103 forcev = globalvals(
ifv:
ifv+2, :)
1108 moment = globalvals(
imp:
imp+2, :) + globalvals(
imv:
imv+2, :) + &
1112 cforcep = fact*forcep
1113 cforcev = fact*forcev
1114 cforcem = fact*forcem
1117 cmoment = fact*moment
1149 & ovrnts*cforce(1, sps)
1151 & ovrnts*cforce(2, sps)
1153 & ovrnts*cforce(3, sps)
1176 if (force(1, sps) .ne.
zero)
then
1177 cofx(:, sps) = cofx(:, sps)/force(1, sps)
1181 if (force(2, sps) .ne.
zero)
then
1182 cofy(:, sps) = cofy(:, sps)/force(2, sps)
1186 if (force(3, sps) .ne.
zero)
then
1187 cofz(:, sps) = cofz(:, sps)/force(3, sps)
1193 & ovrnts*cofx(1, sps)
1195 & ovrnts*cofx(2, sps)
1197 & ovrnts*cofx(3, sps)
1200 & ovrnts*cofy(1, sps)
1202 & ovrnts*cofy(2, sps)
1204 & ovrnts*cofy(3, sps)
1207 & ovrnts*cofz(1, sps)
1209 & ovrnts*cofz(2, sps)
1211 & ovrnts*cofz(3, sps)
1220 & ovrnts*cmoment(1, sps)
1222 & ovrnts*cmoment(2, sps)
1224 & ovrnts*cmoment(3, sps)
1258 & globalvals(
iarea, sps)
1260 & ovrnts*globalvals(
ipower, sps)
1265 if (mflow .ne.
zero)
then
1266 mavgptot = globalvals(
imassptot, sps)/mflow
1267 mavgttot = globalvals(
imassttot, sps)/mflow
1268 mavgrho = globalvals(
imassrho, sps)/mflow
1269 mavgps = globalvals(
imassps, sps)/mflow
1270 mavgmn = globalvals(
imassmn, sps)/mflow
1271 mavga = globalvals(
imassa, sps)/mflow
1272 mavgvx = globalvals(
imassvx, sps)/mflow
1273 mavgvy = globalvals(
imassvy, sps)/mflow
1274 mavgvz = globalvals(
imassvz, sps)/mflow
1275 mavgvi = globalvals(
imassvi, sps)/mflow
1276 mag = sqrt(globalvals(
imassnx, sps)**2 + globalvals(
imassny, sps&
1277 & )**2 + globalvals(
imassnz, sps)**2)
1291 garea = globalvals(
iarea, sps)
1292 if (garea .ne.
zero)
then
1295 & ovrnts*globalvals(
iareaptot, sps)/garea
1297 & *globalvals(
iareaps, sps)/garea
1393 if (fxlift + fylift + fzlift .ne.
zero)
then
1411 &
'error: tsstabilityderivatives are *broken*. they need to be ', &
1412 &
'completely verifed from scratch'
1455 real(kind=realtype),
dimension(nlocalvalues),
intent(inout) :: &
1457 real(kind=realtype),
dimension(nlocalvalues),
intent(inout) :: &
1459 integer(kind=inttype) :: mm
1461 real(kind=realtype),
dimension(3) :: fp, fv, mp, mv
1462 real(kind=realtype),
dimension(3) :: fpd, fvd, mpd, mvd
1463 real(kind=realtype),
dimension(3) :: cofsumfx, cofsumfy, cofsumfz
1464 real(kind=realtype),
dimension(3) :: cofsumfxd, cofsumfyd, cofsumfzd
1465 real(kind=realtype) :: yplusmax, sepsensorks, sepsensor, &
1466 & sepsensoravg(3), sepsensorarea, cavitation, cpmin_ks_sum, &
1468 real(kind=realtype) :: sepsensorksd, sepsensord, sepsensoravgd(3), &
1469 & sepsensoraread, cavitationd, cpmin_ks_sumd, sepsensorksaread
1470 integer(kind=inttype) :: i, j, ii, blk
1471 real(kind=realtype) :: pm1, fx, fy, fz, fn
1472 real(kind=realtype) :: pm1d, fxd, fyd, fzd
1473 real(kind=realtype) :: vecttangential(3)
1474 real(kind=realtype) :: vecttangentiald(3)
1475 real(kind=realtype) :: vectdotproductfsnormal
1476 real(kind=realtype) :: vectdotproductfsnormald
1477 real(kind=realtype) :: xc, xco, yc, yco, zc, zco, qf(3), r(3), n(3)&
1479 real(kind=realtype) :: xcd, xcod, ycd, ycod, zcd, zcod, rd(3)
1480 real(kind=realtype) :: fact, rho, mul, yplus, dwall
1481 real(kind=realtype) :: v(3), sensor, sensor1, cp, tmp, plocal, &
1483 real(kind=realtype) :: vd(3), sensord, sensor1d, cpd, tmpd, plocald&
1485 real(kind=realtype) :: tauxx, tauyy, tauzz
1486 real(kind=realtype) :: tauxxd, tauyyd, tauzzd
1487 real(kind=realtype) :: tauxy, tauxz, tauyz
1488 real(kind=realtype) :: tauxyd, tauxzd, tauyzd
1489 real(kind=realtype),
dimension(3) :: refpoint
1490 real(kind=realtype),
dimension(3) :: refpointd
1491 real(kind=realtype),
dimension(3, 2) :: axispoints
1492 real(kind=realtype) :: mx, my, mz, cellarea, m0x, m0y, m0z, mvaxis, &
1494 real(kind=realtype) :: mxd, myd, mzd, cellaread, m0xd, m0yd, m0zd, &
1496 real(kind=realtype) :: cperror, cperror2
1497 real(kind=realtype) :: cperrord, cperror2d
1503 real(kind=realtype) :: temp
1504 real(kind=realtype) :: tempd
1505 real(kind=realtype),
dimension(3) :: tmp0
1506 real(kind=realtype),
dimension(3) :: tmpd0
1507 real(kind=realtype) :: temp0
1508 real(kind=realtype),
dimension(3) :: tmp1
1509 real(kind=realtype),
dimension(3) :: tmpd1
1510 real(kind=realtype) :: tempd0
1511 real(kind=realtype) :: temp1
1512 real(kind=realtype) :: tempd1
1534 call pushreal8array(n, 3)
1535 call pushreal8array(r, 3)
1536 call pushreal8array(v, 3)
1537 call pushreal8array(vecttangential, 3)
1570 cp = (
half*(pp2(i, j)+pp1(i, j))-
pinf)*tmp
1571 cperror = cp -
bcdata(mm)%cptarget(i, j)
1572 cperror2 = cperror2 + cperror*cperror
1573 xc =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1, &
1575 yc =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1, &
1577 zc =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1, &
1579 if (
bcdata(mm)%iblank(i, j) .lt. 0)
then
1582 blk =
bcdata(mm)%iblank(i, j)
1584 fx = pm1*ssi(i, j, 1)
1585 fy = pm1*ssi(i, j, 2)
1586 fz = pm1*ssi(i, j, 3)
1593 fp(1) = fp(1) + fx*blk
1594 fp(2) = fp(2) + fy*blk
1595 fp(3) = fp(3) + fz*blk
1599 mp(1) = mp(1) + mx*blk
1600 mp(2) = mp(2) + my*blk
1601 mp(3) = mp(3) + mz*blk
1604 xco =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
1606 yco =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
1608 zco =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
1612 cofsumfx(1) = cofsumfx(1) + xco*fx*blk
1613 cofsumfx(2) = cofsumfx(2) + yco*fx*blk
1614 cofsumfx(3) = cofsumfx(3) + zco*fx*blk
1616 cofsumfy(1) = cofsumfy(1) + xco*fy*blk
1617 cofsumfy(2) = cofsumfy(2) + yco*fy*blk
1618 cofsumfy(3) = cofsumfy(3) + zco*fy*blk
1620 cofsumfz(1) = cofsumfz(1) + xco*fz*blk
1621 cofsumfz(2) = cofsumfz(2) + yco*fz*blk
1622 cofsumfz(3) = cofsumfz(3) + zco*fz*blk
1627 r(1) =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
1628 & , 1)) - axispoints(1, 1)
1629 r(2) =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
1630 & , 2)) - axispoints(2, 1)
1631 r(3) =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
1632 & , 3)) - axispoints(3, 1)
1633 l = sqrt((axispoints(1, 2)-axispoints(1, 1))**2 + (axispoints(2, 2&
1634 & )-axispoints(2, 1))**2 + (axispoints(3, 2)-axispoints(3, 1))**2)
1635 n(1) = (axispoints(1, 2)-axispoints(1, 1))/l
1636 n(2) = (axispoints(2, 2)-axispoints(2, 1))/l
1637 n(3) = (axispoints(3, 2)-axispoints(3, 1))/l
1641 m0x = r(2)*fz - r(3)*fy
1642 m0y = r(3)*fx - r(1)*fz
1643 m0z = r(1)*fy - r(2)*fx
1644 mpaxis = mpaxis + (m0x*n(1)+m0y*n(2)+m0z*n(3))*blk
1646 bcdata(mm)%fp(i, j, 1) = fx
1647 bcdata(mm)%fp(i, j, 2) = fy
1648 bcdata(mm)%fp(i, j, 3) = fz
1649 cellarea = sqrt(ssi(i, j, 1)**2 + ssi(i, j, 2)**2 + ssi(i, j, 3)**&
1651 bcdata(mm)%area(i, j) = cellarea
1653 v(1) = ww2(i, j,
ivx)
1654 v(2) = ww2(i, j,
ivy)
1655 v(3) = ww2(i, j,
ivz)
1656 v = v/(sqrt(v(1)**2+v(2)**2+v(3)**2)+1e-16)
1664 & *
bcdata(mm)%norm(i, j, 1)
1666 & *
bcdata(mm)%norm(i, j, 2)
1668 & *
bcdata(mm)%norm(i, j, 3)
1669 vecttangential = vecttangential/(sqrt(vecttangential(1)**2+&
1670 & vecttangential(2)**2+vecttangential(3)**2)+1e-16)
1673 sensor = v(1)*vecttangential(1) + v(2)*vecttangential(2) + v(3)*&
1681 sepsensorksarea = sepsensorksarea + blk*cellarea
1682 sepsensorarea = cellarea*blk*
one/(
one+exp(-(2*&
1685 sepsensorks = sepsensorks + ks_exponent*blk
1694 sensor = sensor*cellarea*blk
1695 sepsensor = sepsensor + sensor
1698 sepsensoravg(1) = sepsensoravg(1) + sensor*xco
1699 sepsensoravg(2) = sepsensoravg(2) + sensor*yco
1700 sepsensoravg(3) = sepsensoravg(3) + sensor*zco
1704 cp = tmp*(plocal-
pinf)
1708 sensor1 = sensor1*cellarea*blk
1709 cavitation = cavitation + sensor1
1712 cpmin_ks_sum = cpmin_ks_sum + ks_exponent*blk
1721 call pushcontrol1b(0)
1723 call pushcontrol1b(1)
1728 sepsensoravgd = 0.0_8
1730 cpmin_ks_sumd = localvaluesd(
icpmin)
1743 mvd = localvaluesd(
imv:
imv+2)
1745 mpd = localvaluesd(
imp:
imp+2)
1747 fvd = localvaluesd(
ifv:
ifv+2)
1749 fpd = localvaluesd(
ifp:
ifp+2)
1750 call popcontrol1b(branch)
1751 if (branch .eq. 0)
then
1761 if (
bcdata(mm)%iblank(i, j) .lt. 0)
then
1764 blk =
bcdata(mm)%iblank(i, j)
1774 fx = -(fact*(tauxx*ssi(i, j, 1)+tauxy*ssi(i, j, 2)+tauxz*ssi(i, &
1776 fy = -(fact*(tauxy*ssi(i, j, 1)+tauyy*ssi(i, j, 2)+tauyz*ssi(i, &
1778 fz = -(fact*(tauxz*ssi(i, j, 1)+tauyz*ssi(i, j, 2)+tauzz*ssi(i, &
1784 xc =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
1785 & , 1)) - refpoint(1)
1786 yc =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
1787 & , 2)) - refpoint(2)
1788 zc =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
1789 & , 3)) - refpoint(3)
1793 xco =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+&
1795 yco =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+&
1797 zco =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+&
1807 r(1) =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j&
1808 & +1, 1)) - axispoints(1, 1)
1809 r(2) =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j&
1810 & +1, 2)) - axispoints(2, 1)
1811 r(3) =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j&
1812 & +1, 3)) - axispoints(3, 1)
1813 l = sqrt((axispoints(1, 2)-axispoints(1, 1))**2 + (axispoints(2&
1814 & , 2)-axispoints(2, 1))**2 + (axispoints(3, 2)-axispoints(3, 1)&
1816 n(1) = (axispoints(1, 2)-axispoints(1, 1))/l
1817 n(2) = (axispoints(2, 2)-axispoints(2, 1))/l
1818 n(3) = (axispoints(3, 2)-axispoints(3, 1))/l
1834 tempd1 = blk*mvaxisd
1838 fzd =
bcdatad(mm)%fv(i, j, 3) + r(2)*m0xd - r(1)*m0yd + zco*blk*&
1839 & cofsumfzd(3) + yco*blk*cofsumfzd(2) + xco*blk*cofsumfzd(1) + &
1840 & yc*mxd - xc*myd + blk*fvd(3)
1841 bcdatad(mm)%fv(i, j, 3) = 0.0_8
1842 fyd =
bcdatad(mm)%fv(i, j, 2) + r(1)*m0zd + zco*blk*cofsumfyd(3)&
1843 & - r(3)*m0xd + yco*blk*cofsumfyd(2) + xco*blk*cofsumfyd(1) + xc&
1844 & *mzd + blk*fvd(2) - zc*mxd
1845 bcdatad(mm)%fv(i, j, 2) = 0.0_8
1846 fxd =
bcdatad(mm)%fv(i, j, 1) + r(3)*m0yd - r(2)*m0zd + zco*blk*&
1847 & cofsumfxd(3) + yco*blk*cofsumfxd(2) + xco*blk*cofsumfxd(1) + &
1848 & zc*myd - yc*mzd + blk*fvd(1)
1849 bcdatad(mm)%fv(i, j, 1) = 0.0_8
1850 rd(1) = rd(1) + fy*m0zd - fz*m0yd
1851 rd(2) = rd(2) + fz*m0xd - fx*m0zd
1852 rd(3) = rd(3) + fx*m0yd - fy*m0xd
1855 xxd(i, j, 3) = xxd(i, j, 3) + tempd1
1856 xxd(i+1, j, 3) = xxd(i+1, j, 3) + tempd1
1857 xxd(i, j+1, 3) = xxd(i, j+1, 3) + tempd1
1858 xxd(i+1, j+1, 3) = xxd(i+1, j+1, 3) + tempd1
1861 xxd(i, j, 2) = xxd(i, j, 2) + tempd1
1862 xxd(i+1, j, 2) = xxd(i+1, j, 2) + tempd1
1863 xxd(i, j+1, 2) = xxd(i, j+1, 2) + tempd1
1864 xxd(i+1, j+1, 2) = xxd(i+1, j+1, 2) + tempd1
1867 xxd(i, j, 1) = xxd(i, j, 1) + tempd1
1868 xxd(i+1, j, 1) = xxd(i+1, j, 1) + tempd1
1869 xxd(i, j+1, 1) = xxd(i, j+1, 1) + tempd1
1870 xxd(i+1, j+1, 1) = xxd(i+1, j+1, 1) + tempd1
1871 zcod = fz*blk*cofsumfzd(3) + fy*blk*cofsumfyd(3) + fx*blk*&
1873 ycod = fz*blk*cofsumfzd(2) + fy*blk*cofsumfyd(2) + fx*blk*&
1875 xcod = fz*blk*cofsumfzd(1) + fy*blk*cofsumfyd(1) + fx*blk*&
1878 xxd(i, j, 3) = xxd(i, j, 3) + tempd1
1879 xxd(i+1, j, 3) = xxd(i+1, j, 3) + tempd1
1880 xxd(i, j+1, 3) = xxd(i, j+1, 3) + tempd1
1881 xxd(i+1, j+1, 3) = xxd(i+1, j+1, 3) + tempd1
1883 xxd(i, j, 2) = xxd(i, j, 2) + tempd1
1884 xxd(i+1, j, 2) = xxd(i+1, j, 2) + tempd1
1885 xxd(i, j+1, 2) = xxd(i, j+1, 2) + tempd1
1886 xxd(i+1, j+1, 2) = xxd(i+1, j+1, 2) + tempd1
1888 xxd(i, j, 1) = xxd(i, j, 1) + tempd1
1889 xxd(i+1, j, 1) = xxd(i+1, j, 1) + tempd1
1890 xxd(i, j+1, 1) = xxd(i, j+1, 1) + tempd1
1891 xxd(i+1, j+1, 1) = xxd(i+1, j+1, 1) + tempd1
1892 xcd = fy*mzd - fz*myd
1893 ycd = fz*mxd - fx*mzd
1894 zcd = fx*myd - fy*mxd
1896 refpointd(3) = refpointd(3) - zcd
1897 xxd(i, j, 3) = xxd(i, j, 3) + tempd1
1898 xxd(i+1, j, 3) = xxd(i+1, j, 3) + tempd1
1899 xxd(i, j+1, 3) = xxd(i, j+1, 3) + tempd1
1900 xxd(i+1, j+1, 3) = xxd(i+1, j+1, 3) + tempd1
1902 refpointd(2) = refpointd(2) - ycd
1903 xxd(i, j, 2) = xxd(i, j, 2) + tempd1
1904 xxd(i+1, j, 2) = xxd(i+1, j, 2) + tempd1
1905 xxd(i, j+1, 2) = xxd(i, j+1, 2) + tempd1
1906 xxd(i+1, j+1, 2) = xxd(i+1, j+1, 2) + tempd1
1908 refpointd(1) = refpointd(1) - xcd
1909 xxd(i, j, 1) = xxd(i, j, 1) + tempd1
1910 xxd(i+1, j, 1) = xxd(i+1, j, 1) + tempd1
1911 xxd(i, j+1, 1) = xxd(i, j+1, 1) + tempd1
1912 xxd(i+1, j+1, 1) = xxd(i+1, j+1, 1) + tempd1
1913 tempd1 = -(
pref*fact*fzd)
1914 prefd =
prefd - (tauxz*ssi(i, j, 1)+tauyz*ssi(i, j, 2)+tauzz*ssi&
1915 & (i, j, 3))*fact*fzd - (tauxy*ssi(i, j, 1)+tauyy*ssi(i, j, 2)+&
1916 & tauyz*ssi(i, j, 3))*fact*fyd - (tauxx*ssi(i, j, 1)+tauxy*ssi(i&
1917 & , j, 2)+tauxz*ssi(i, j, 3))*fact*fxd
1918 tauxzd = ssi(i, j, 1)*tempd1
1919 ssid(i, j, 1) = ssid(i, j, 1) + tauxz*tempd1
1920 tauyzd = ssi(i, j, 2)*tempd1
1921 ssid(i, j, 2) = ssid(i, j, 2) + tauyz*tempd1
1922 tauzzd = ssi(i, j, 3)*tempd1
1923 ssid(i, j, 3) = ssid(i, j, 3) + tauzz*tempd1
1924 tempd1 = -(
pref*fact*fyd)
1925 tauxyd = ssi(i, j, 1)*tempd1
1926 ssid(i, j, 1) = ssid(i, j, 1) + tauxy*tempd1
1927 tauyyd = ssi(i, j, 2)*tempd1
1928 ssid(i, j, 2) = ssid(i, j, 2) + tauyy*tempd1
1929 tauyzd = tauyzd + ssi(i, j, 3)*tempd1
1930 ssid(i, j, 3) = ssid(i, j, 3) + tauyz*tempd1
1931 tempd1 = -(
pref*fact*fxd)
1932 tauxxd = ssi(i, j, 1)*tempd1
1933 ssid(i, j, 1) = ssid(i, j, 1) + tauxx*tempd1
1934 tauxyd = tauxyd + ssi(i, j, 2)*tempd1
1935 ssid(i, j, 2) = ssid(i, j, 2) + tauxy*tempd1
1936 tauxzd = tauxzd + ssi(i, j, 3)*tempd1
1937 ssid(i, j, 3) = ssid(i, j, 3) + tauxz*tempd1
1957 vecttangentiald = 0.0_8
1958 call popreal8array(vecttangential, 3)
1959 call popreal8array(v, 3)
1960 call popreal8array(r, 3)
1961 call popreal8array(n, 3)
1977 cp = (
half*(pp2(i, j)+pp1(i, j))-
pinf)*tmp
1978 cperror = cp -
bcdata(mm)%cptarget(i, j)
1979 xc =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1, &
1981 yc =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1, &
1983 zc =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1, &
1985 if (
bcdata(mm)%iblank(i, j) .lt. 0)
then
1988 blk =
bcdata(mm)%iblank(i, j)
1990 fx = pm1*ssi(i, j, 1)
1991 fy = pm1*ssi(i, j, 2)
1992 fz = pm1*ssi(i, j, 3)
2001 xco =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
2003 yco =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
2005 zco =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
2015 r(1) =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
2016 & , 1)) - axispoints(1, 1)
2017 r(2) =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
2018 & , 2)) - axispoints(2, 1)
2019 r(3) =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
2020 & , 3)) - axispoints(3, 1)
2021 l = sqrt((axispoints(1, 2)-axispoints(1, 1))**2 + (axispoints(2, 2&
2022 & )-axispoints(2, 1))**2 + (axispoints(3, 2)-axispoints(3, 1))**2)
2023 n(1) = (axispoints(1, 2)-axispoints(1, 1))/l
2024 n(2) = (axispoints(2, 2)-axispoints(2, 1))/l
2025 n(3) = (axispoints(3, 2)-axispoints(3, 1))/l
2030 cellarea = sqrt(ssi(i, j, 1)**2 + ssi(i, j, 2)**2 + ssi(i, j, 3)**&
2033 v(1) = ww2(i, j,
ivx)
2034 v(2) = ww2(i, j,
ivy)
2035 v(3) = ww2(i, j,
ivz)
2036 tmp0 = v/(sqrt(v(1)**2+v(2)**2+v(3)**2)+1e-16)
2037 call pushreal8array(v, 3)
2046 & *
bcdata(mm)%norm(i, j, 1)
2048 & *
bcdata(mm)%norm(i, j, 2)
2050 & *
bcdata(mm)%norm(i, j, 3)
2051 tmp1 = vecttangential/(sqrt(vecttangential(1)**2+vecttangential(&
2052 & 2)**2+vecttangential(3)**2)+1e-16)
2053 call pushreal8array(vecttangential, 3)
2054 vecttangential = tmp1
2057 sensor = v(1)*vecttangential(1) + v(2)*vecttangential(2) + v(3)*&
2063 call pushcontrol1b(0)
2065 call pushcontrol1b(1)
2068 call pushreal8(sensor)
2072 call pushreal8(sensor)
2076 call pushreal8(sensor)
2077 sensor = sensor*cellarea*blk
2083 cp = tmp*(plocal-
pinf)
2085 call pushreal8(sensor1)
2089 sensor1d = cavitationd
2090 cellaread = sensor1*blk*sensor1d
2091 sensor1d = cellarea*blk*sensor1d
2092 call popreal8(sensor1)
2094 temp0 =
one + exp(temp1)
2095 if (sensor1 .le. 0.0_8 .and. (
cavexponent .eq. 0.0_8 .or. &
2104 ks_exponentd = blk*cpmin_ks_sumd
2106 & ks_exponentd) - sensor1d
2107 tmpd = (plocal-
pinf)*cpd
2113 pp2d(i, j) = pp2d(i, j) + plocald
2117 sensord = zco*sepsensoravgd(3) + yco*sepsensoravgd(2) + xco*&
2118 & sepsensoravgd(1) + sepsensord
2119 zcod = sensor*sepsensoravgd(3)
2120 ycod = sensor*sepsensoravgd(2)
2121 xcod = sensor*sepsensoravgd(1)
2122 call popreal8(sensor)
2123 cellaread = cellaread + sensor*blk*sensord
2124 sensord = cellarea*blk*sensord
2125 call popreal8(sensor)
2127 temp0 =
one + exp(temp1)
2129 call popreal8(sensor)
2136 call popcontrol1b(branch)
2137 if (branch .eq. 0)
then
2138 ks_exponentd = blk*sepsensorksd
2140 temp =
one + exp(temp0)
2141 tempd1 = blk*
one*sepsensoraread/temp
2142 cellaread = cellaread + tempd1 + blk*sepsensorksaread
2149 vd(1) = vd(1) + vecttangential(1)*sensord
2150 vecttangentiald(1) = vecttangentiald(1) + v(1)*sensord
2151 vd(2) = vd(2) + vecttangential(2)*sensord
2152 vecttangentiald(2) = vecttangentiald(2) + v(2)*sensord
2153 vd(3) = vd(3) + vecttangential(3)*sensord
2154 vecttangentiald(3) = vecttangentiald(3) + v(3)*sensord
2155 call popreal8array(vecttangential, 3)
2156 tmpd1 = vecttangentiald
2157 temp0 = vecttangential(1)*vecttangential(1) + vecttangential(2)*&
2158 & vecttangential(2) + vecttangential(3)*vecttangential(3)
2160 vecttangentiald = tmpd1/(temp+1e-16)
2161 if (temp0 .eq. 0.0_8)
then
2164 tempd0 = -(sum(vecttangential*tmpd1)/(2.0*temp*(temp+1e-16)**2&
2167 vecttangentiald(1) = vecttangentiald(1) + 2*vecttangential(1)*&
2169 vecttangentiald(2) = vecttangentiald(2) + 2*vecttangential(2)*&
2171 vecttangentiald(3) = vecttangentiald(3) + 2*vecttangential(3)*&
2173 vectdotproductfsnormald = -(
bcdata(mm)%norm(i, j, 3)*&
2174 & vecttangentiald(3)) -
bcdata(mm)%norm(i, j, 2)*vecttangentiald&
2175 & (2) -
bcdata(mm)%norm(i, j, 1)*vecttangentiald(1)
2177 & +
bcdata(mm)%norm(i, j, 3)*vectdotproductfsnormald
2178 vecttangentiald(3) = 0.0_8
2180 & +
bcdata(mm)%norm(i, j, 2)*vectdotproductfsnormald
2181 vecttangentiald(2) = 0.0_8
2183 & +
bcdata(mm)%norm(i, j, 1)*vectdotproductfsnormald
2184 vecttangentiald(1) = 0.0_8
2189 call popreal8array(v, 3)
2191 temp = v(1)*v(1) + v(2)*v(2) + v(3)*v(3)
2193 vd = tmpd0/(temp0+1e-16)
2194 if (temp .eq. 0.0_8)
then
2197 tempd = -(sum(v*tmpd0)/(2.0*temp0*(temp0+1e-16)**2))
2199 vd(1) = vd(1) + 2*v(1)*tempd
2200 vd(2) = vd(2) + 2*v(2)*tempd
2201 vd(3) = vd(3) + 2*v(3)*tempd
2202 ww2d(i, j,
ivz) = ww2d(i, j,
ivz) + vd(3)
2204 ww2d(i, j,
ivy) = ww2d(i, j,
ivy) + vd(2)
2206 ww2d(i, j,
ivx) = ww2d(i, j,
ivx) + vd(1)
2208 cellaread = cellaread +
bcdatad(mm)%area(i, j)
2209 bcdatad(mm)%area(i, j) = 0.0_8
2210 if (ssi(i, j, 1)**2 + ssi(i, j, 2)**2 + ssi(i, j, 3)**2 .eq. 0.0_8&
2214 tempd = cellaread/(2.0*sqrt(ssi(i, j, 1)**2+ssi(i, j, 2)**2+ssi(&
2217 ssid(i, j, 1) = ssid(i, j, 1) + 2*ssi(i, j, 1)*tempd
2218 ssid(i, j, 2) = ssid(i, j, 2) + 2*ssi(i, j, 2)*tempd
2219 ssid(i, j, 3) = ssid(i, j, 3) + 2*ssi(i, j, 3)*tempd
2223 fzd =
bcdatad(mm)%fp(i, j, 3) + r(2)*m0xd - r(1)*m0yd + zco*blk*&
2224 & cofsumfzd(3) + yco*blk*cofsumfzd(2) + xco*blk*cofsumfzd(1) + yc*&
2225 & mxd - xc*myd + blk*fpd(3)
2226 bcdatad(mm)%fp(i, j, 3) = 0.0_8
2228 fyd =
bcdatad(mm)%fp(i, j, 2) + r(1)*m0zd + zco*blk*cofsumfyd(3) -&
2229 & r(3)*m0xd + yco*blk*cofsumfyd(2) + xco*blk*cofsumfyd(1) + xc*mzd&
2230 & + blk*fpd(2) - zc*mxd
2231 bcdatad(mm)%fp(i, j, 2) = 0.0_8
2232 fxd =
bcdatad(mm)%fp(i, j, 1) + r(3)*m0yd - r(2)*m0zd + zco*blk*&
2233 & cofsumfxd(3) + yco*blk*cofsumfxd(2) + xco*blk*cofsumfxd(1) + zc*&
2234 & myd - yc*mzd + blk*fpd(1)
2235 bcdatad(mm)%fp(i, j, 1) = 0.0_8
2236 rd(1) = rd(1) + fy*m0zd - fz*m0yd
2237 rd(2) = rd(2) + fz*m0xd - fx*m0zd
2238 rd(3) = rd(3) + fx*m0yd - fy*m0xd
2241 xxd(i, j, 3) = xxd(i, j, 3) + tempd
2242 xxd(i+1, j, 3) = xxd(i+1, j, 3) + tempd
2243 xxd(i, j+1, 3) = xxd(i, j+1, 3) + tempd
2244 xxd(i+1, j+1, 3) = xxd(i+1, j+1, 3) + tempd
2247 xxd(i, j, 2) = xxd(i, j, 2) + tempd
2248 xxd(i+1, j, 2) = xxd(i+1, j, 2) + tempd
2249 xxd(i, j+1, 2) = xxd(i, j+1, 2) + tempd
2250 xxd(i+1, j+1, 2) = xxd(i+1, j+1, 2) + tempd
2253 xxd(i, j, 1) = xxd(i, j, 1) + tempd
2254 xxd(i+1, j, 1) = xxd(i+1, j, 1) + tempd
2255 xxd(i, j+1, 1) = xxd(i, j+1, 1) + tempd
2256 xxd(i+1, j+1, 1) = xxd(i+1, j+1, 1) + tempd
2257 zcod = zcod + fz*blk*cofsumfzd(3) + fy*blk*cofsumfyd(3) + fx*blk*&
2259 ycod = ycod + fz*blk*cofsumfzd(2) + fy*blk*cofsumfyd(2) + fx*blk*&
2261 xcod = xcod + fz*blk*cofsumfzd(1) + fy*blk*cofsumfyd(1) + fx*blk*&
2264 xxd(i, j, 3) = xxd(i, j, 3) + tempd
2265 xxd(i+1, j, 3) = xxd(i+1, j, 3) + tempd
2266 xxd(i, j+1, 3) = xxd(i, j+1, 3) + tempd
2267 xxd(i+1, j+1, 3) = xxd(i+1, j+1, 3) + tempd
2269 xxd(i, j, 2) = xxd(i, j, 2) + tempd
2270 xxd(i+1, j, 2) = xxd(i+1, j, 2) + tempd
2271 xxd(i, j+1, 2) = xxd(i, j+1, 2) + tempd
2272 xxd(i+1, j+1, 2) = xxd(i+1, j+1, 2) + tempd
2274 xxd(i, j, 1) = xxd(i, j, 1) + tempd
2275 xxd(i+1, j, 1) = xxd(i+1, j, 1) + tempd
2276 xxd(i, j+1, 1) = xxd(i, j+1, 1) + tempd
2277 xxd(i+1, j+1, 1) = xxd(i+1, j+1, 1) + tempd
2278 xcd = fy*mzd - fz*myd
2279 ycd = fz*mxd - fx*mzd
2280 zcd = fx*myd - fy*mxd
2281 pm1d = ssi(i, j, 3)*fzd + ssi(i, j, 2)*fyd + ssi(i, j, 1)*fxd
2282 ssid(i, j, 3) = ssid(i, j, 3) + pm1*fzd
2283 ssid(i, j, 2) = ssid(i, j, 2) + pm1*fyd
2284 ssid(i, j, 1) = ssid(i, j, 1) + pm1*fxd
2286 refpointd(3) = refpointd(3) - zcd
2287 xxd(i, j, 3) = xxd(i, j, 3) + tempd
2288 xxd(i+1, j, 3) = xxd(i+1, j, 3) + tempd
2289 xxd(i, j+1, 3) = xxd(i, j+1, 3) + tempd
2290 xxd(i+1, j+1, 3) = xxd(i+1, j+1, 3) + tempd
2292 refpointd(2) = refpointd(2) - ycd
2293 xxd(i, j, 2) = xxd(i, j, 2) + tempd
2294 xxd(i+1, j, 2) = xxd(i+1, j, 2) + tempd
2295 xxd(i, j+1, 2) = xxd(i, j+1, 2) + tempd
2296 xxd(i+1, j+1, 2) = xxd(i+1, j+1, 2) + tempd
2298 refpointd(1) = refpointd(1) - xcd
2299 xxd(i, j, 1) = xxd(i, j, 1) + tempd
2300 xxd(i+1, j, 1) = xxd(i+1, j, 1) + tempd
2301 xxd(i, j+1, 1) = xxd(i, j+1, 1) + tempd
2302 xxd(i+1, j+1, 1) = xxd(i+1, j+1, 1) + tempd
2303 cperrord = 2*cperror*cperror2d
2306 tmpd = (
half*(pp2(i, j)+pp1(i, j))-
pinf)*cpd
2307 pp2d(i, j) = pp2d(i, j) +
half*tempd
2308 pp1d(i, j) = pp1d(i, j) +
half*tempd
2311 tempd = -(
two*tmpd/temp**2)
2314 tempd =
pref*fact*pm1d
2316 pp2d(i, j) = pp2d(i, j) +
half*tempd
2317 pp1d(i, j) = pp1d(i, j) +
half*tempd
2321 refpointd(3) = 0.0_8
2323 refpointd(2) = 0.0_8
2349 real(kind=realtype),
dimension(nlocalvalues),
intent(inout) :: &
2351 integer(kind=inttype) :: mm
2353 real(kind=realtype),
dimension(3) :: fp, fv, mp, mv
2354 real(kind=realtype),
dimension(3) :: cofsumfx, cofsumfy, cofsumfz
2355 real(kind=realtype) :: yplusmax, sepsensorks, sepsensor, &
2356 & sepsensoravg(3), sepsensorarea, cavitation, cpmin_ks_sum, &
2358 integer(kind=inttype) :: i, j, ii, blk
2359 real(kind=realtype) :: pm1, fx, fy, fz, fn
2360 real(kind=realtype) :: vecttangential(3)
2361 real(kind=realtype) :: vectdotproductfsnormal
2362 real(kind=realtype) :: xc, xco, yc, yco, zc, zco, qf(3), r(3), n(3)&
2364 real(kind=realtype) :: fact, rho, mul, yplus, dwall
2365 real(kind=realtype) :: v(3), sensor, sensor1, cp, tmp, plocal, &
2367 real(kind=realtype) :: tauxx, tauyy, tauzz
2368 real(kind=realtype) :: tauxy, tauxz, tauyz
2369 real(kind=realtype),
dimension(3) :: refpoint
2370 real(kind=realtype),
dimension(3, 2) :: axispoints
2371 real(kind=realtype) :: mx, my, mz, cellarea, m0x, m0y, m0z, mvaxis, &
2373 real(kind=realtype) :: cperror, cperror2
2409 sepsensorarea =
zero
2410 sepsensorksarea =
zero
2449 cp = (
half*(pp2(i, j)+pp1(i, j))-
pinf)*tmp
2450 cperror = cp -
bcdata(mm)%cptarget(i, j)
2451 cperror2 = cperror2 + cperror*cperror
2452 xc =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1, &
2454 yc =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1, &
2456 zc =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1, &
2458 if (
bcdata(mm)%iblank(i, j) .lt. 0)
then
2461 blk =
bcdata(mm)%iblank(i, j)
2463 fx = pm1*ssi(i, j, 1)
2464 fy = pm1*ssi(i, j, 2)
2465 fz = pm1*ssi(i, j, 3)
2472 fp(1) = fp(1) + fx*blk
2473 fp(2) = fp(2) + fy*blk
2474 fp(3) = fp(3) + fz*blk
2478 mp(1) = mp(1) + mx*blk
2479 mp(2) = mp(2) + my*blk
2480 mp(3) = mp(3) + mz*blk
2483 xco =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
2485 yco =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
2487 zco =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
2491 cofsumfx(1) = cofsumfx(1) + xco*fx*blk
2492 cofsumfx(2) = cofsumfx(2) + yco*fx*blk
2493 cofsumfx(3) = cofsumfx(3) + zco*fx*blk
2495 cofsumfy(1) = cofsumfy(1) + xco*fy*blk
2496 cofsumfy(2) = cofsumfy(2) + yco*fy*blk
2497 cofsumfy(3) = cofsumfy(3) + zco*fy*blk
2499 cofsumfz(1) = cofsumfz(1) + xco*fz*blk
2500 cofsumfz(2) = cofsumfz(2) + yco*fz*blk
2501 cofsumfz(3) = cofsumfz(3) + zco*fz*blk
2506 r(1) =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
2507 & , 1)) - axispoints(1, 1)
2508 r(2) =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
2509 & , 2)) - axispoints(2, 1)
2510 r(3) =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
2511 & , 3)) - axispoints(3, 1)
2512 l = sqrt((axispoints(1, 2)-axispoints(1, 1))**2 + (axispoints(2, 2&
2513 & )-axispoints(2, 1))**2 + (axispoints(3, 2)-axispoints(3, 1))**2)
2514 n(1) = (axispoints(1, 2)-axispoints(1, 1))/l
2515 n(2) = (axispoints(2, 2)-axispoints(2, 1))/l
2516 n(3) = (axispoints(3, 2)-axispoints(3, 1))/l
2520 m0x = r(2)*fz - r(3)*fy
2521 m0y = r(3)*fx - r(1)*fz
2522 m0z = r(1)*fy - r(2)*fx
2523 mpaxis = mpaxis + (m0x*n(1)+m0y*n(2)+m0z*n(3))*blk
2525 bcdata(mm)%fp(i, j, 1) = fx
2526 bcdata(mm)%fp(i, j, 2) = fy
2527 bcdata(mm)%fp(i, j, 3) = fz
2528 cellarea = sqrt(ssi(i, j, 1)**2 + ssi(i, j, 2)**2 + ssi(i, j, 3)**&
2530 bcdata(mm)%area(i, j) = cellarea
2532 v(1) = ww2(i, j,
ivx)
2533 v(2) = ww2(i, j,
ivy)
2534 v(3) = ww2(i, j,
ivz)
2535 v = v/(sqrt(v(1)**2+v(2)**2+v(3)**2)+1e-16)
2543 & *
bcdata(mm)%norm(i, j, 1)
2545 & *
bcdata(mm)%norm(i, j, 2)
2547 & *
bcdata(mm)%norm(i, j, 3)
2548 vecttangential = vecttangential/(sqrt(vecttangential(1)**2+&
2549 & vecttangential(2)**2+vecttangential(3)**2)+1e-16)
2552 sensor = v(1)*vecttangential(1) + v(2)*vecttangential(2) + v(3)*&
2560 sepsensorksarea = sepsensorksarea + blk*cellarea
2561 sepsensorarea = cellarea*blk*
one/(
one+exp(-(2*&
2564 sepsensorks = sepsensorks + ks_exponent*blk
2573 sensor = sensor*cellarea*blk
2574 sepsensor = sepsensor + sensor
2577 sepsensoravg(1) = sepsensoravg(1) + sensor*xco
2578 sepsensoravg(2) = sepsensoravg(2) + sensor*yco
2579 sepsensoravg(3) = sepsensoravg(3) + sensor*zco
2583 cp = tmp*(plocal-
pinf)
2587 sensor1 = sensor1*cellarea*blk
2588 cavitation = cavitation + sensor1
2591 cpmin_ks_sum = cpmin_ks_sum + ks_exponent*blk
2613 if (
bcdata(mm)%iblank(i, j) .lt. 0)
then
2616 blk =
bcdata(mm)%iblank(i, j)
2626 fx = -(fact*(tauxx*ssi(i, j, 1)+tauxy*ssi(i, j, 2)+tauxz*ssi(i, &
2628 fy = -(fact*(tauxy*ssi(i, j, 1)+tauyy*ssi(i, j, 2)+tauyz*ssi(i, &
2630 fz = -(fact*(tauxz*ssi(i, j, 1)+tauyz*ssi(i, j, 2)+tauzz*ssi(i, &
2636 xc =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
2637 & , 1)) - refpoint(1)
2638 yc =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
2639 & , 2)) - refpoint(2)
2640 zc =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
2641 & , 3)) - refpoint(3)
2643 fv(1) = fv(1) + fx*blk
2644 fv(2) = fv(2) + fy*blk
2645 fv(3) = fv(3) + fz*blk
2649 mv(1) = mv(1) + mx*blk
2650 mv(2) = mv(2) + my*blk
2651 mv(3) = mv(3) + mz*blk
2654 xco =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+&
2656 yco =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+&
2658 zco =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+&
2662 cofsumfx(1) = cofsumfx(1) + xco*fx*blk
2663 cofsumfx(2) = cofsumfx(2) + yco*fx*blk
2664 cofsumfx(3) = cofsumfx(3) + zco*fx*blk
2666 cofsumfy(1) = cofsumfy(1) + xco*fy*blk
2667 cofsumfy(2) = cofsumfy(2) + yco*fy*blk
2668 cofsumfy(3) = cofsumfy(3) + zco*fy*blk
2670 cofsumfz(1) = cofsumfz(1) + xco*fz*blk
2671 cofsumfz(2) = cofsumfz(2) + yco*fz*blk
2672 cofsumfz(3) = cofsumfz(3) + zco*fz*blk
2677 r(1) =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j&
2678 & +1, 1)) - axispoints(1, 1)
2679 r(2) =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j&
2680 & +1, 2)) - axispoints(2, 1)
2681 r(3) =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j&
2682 & +1, 3)) - axispoints(3, 1)
2683 l = sqrt((axispoints(1, 2)-axispoints(1, 1))**2 + (axispoints(2&
2684 & , 2)-axispoints(2, 1))**2 + (axispoints(3, 2)-axispoints(3, 1)&
2686 n(1) = (axispoints(1, 2)-axispoints(1, 1))/l
2687 n(2) = (axispoints(2, 2)-axispoints(2, 1))/l
2688 n(3) = (axispoints(3, 2)-axispoints(3, 1))/l
2692 m0x = r(2)*fz - r(3)*fy
2693 m0y = r(3)*fx - r(1)*fz
2694 m0z = r(1)*fy - r(2)*fx
2695 mvaxis = mvaxis + (m0x*n(1)+m0y*n(2)+m0z*n(3))*blk
2697 bcdata(mm)%fv(i, j, 1) = fx
2698 bcdata(mm)%fv(i, j, 2) = fy
2699 bcdata(mm)%fv(i, j, 3) = fz
2706 fx = tauxx*
bcdata(mm)%norm(i, j, 1) + tauxy*
bcdata(mm)%norm(i, j&
2707 & , 2) + tauxz*
bcdata(mm)%norm(i, j, 3)
2708 fy = tauxy*
bcdata(mm)%norm(i, j, 1) + tauyy*
bcdata(mm)%norm(i, j&
2709 & , 2) + tauyz*
bcdata(mm)%norm(i, j, 3)
2710 fz = tauxz*
bcdata(mm)%norm(i, j, 1) + tauyz*
bcdata(mm)%norm(i, j&
2711 & , 2) + tauzz*
bcdata(mm)%norm(i, j, 3)
2712 fn = fx*
bcdata(mm)%norm(i, j, 1) + fy*
bcdata(mm)%norm(i, j, 2) +&
2713 & fz*
bcdata(mm)%norm(i, j, 3)
2714 fx = fx - fn*
bcdata(mm)%norm(i, j, 1)
2715 fy = fy - fn*
bcdata(mm)%norm(i, j, 2)
2716 fz = fz - fn*
bcdata(mm)%norm(i, j, 3)
2742 localvalues(
icpmin) = localvalues(
icpmin) + cpmin_ks_sum
2756 real(kind=
realtype),
intent(inout) :: ks_g
2757 real(kind=
realtype),
intent(inout) :: ks_gd
2758 real(kind=
realtype),
intent(in) :: g, max_g, g_rho
2761 gd = gd + g_rho*exp(g_rho*(g-max_g))*ks_gd
2767 real(kind=
realtype),
intent(inout) :: ks_g
2768 real(kind=
realtype),
intent(in) :: g, max_g, g_rho
2770 ks_g = exp(g_rho*(g-max_g))
2794 use bcpointers_b,
only : ssi, ssid, sface, ww1, ww1d, ww2, ww2d, pp1&
2795 & , pp1d, pp2, pp2d, xx, xxd, gamma1, gamma2
2799 logical,
intent(in) :: isinflow
2800 real(kind=realtype),
dimension(nlocalvalues),
intent(inout) :: &
2802 real(kind=realtype),
dimension(nlocalvalues),
intent(inout) :: &
2804 integer(kind=inttype),
intent(in) :: mm
2806 real(kind=realtype) :: massflowrate, mass_ptot, mass_ttot, mass_ps, &
2807 & mass_mn, mass_a, mass_rho, mass_vx, mass_vy, mass_vz, mass_nx, &
2808 & mass_ny, mass_nz, mass_vi
2809 real(kind=realtype) :: massflowrated, mass_ptotd, mass_ttotd, &
2810 & mass_psd, mass_mnd, mass_ad, mass_rhod, mass_vxd, mass_vyd, mass_vzd&
2811 & , mass_nxd, mass_nyd, mass_nzd, mass_vid
2812 real(kind=realtype) :: area_ptot, area_ps
2813 real(kind=realtype) :: area_ptotd, area_psd
2814 real(kind=realtype) :: govgm1, gm1ovg, viconst, vilocal, pratio
2815 real(kind=realtype) :: vilocald, pratiod
2816 real(kind=realtype) :: mredim
2817 real(kind=realtype) :: mredimd
2818 integer(kind=inttype) :: i, j, ii, blk
2819 real(kind=realtype) :: internalflowfact, inflowfact, fact, xc, xco, &
2820 & yc, yco, zc, zco, mx, my, mz
2821 real(kind=realtype) :: xcd, xcod, ycd, ycod, zcd, zcod, mxd, myd, &
2823 real(kind=realtype) :: sf, vmag, vnm, vnmfreestreamref, vxm, vym, &
2824 & vzm, fx, fy, fz, u, v, w
2825 real(kind=realtype) :: vmagd, vnmd, vxmd, vymd, vzmd, fxd, fyd, fzd
2826 real(kind=realtype) :: pm, ptot, ttot, rhom, gammam, am
2827 real(kind=realtype) :: pmd, ptotd, ttotd, rhomd, amd
2828 real(kind=realtype) :: area, cellarea, overcellarea
2829 real(kind=realtype) :: aread, cellaread, overcellaread
2830 real(kind=realtype),
dimension(3) :: fp, mp, fmom, mmom, refpoint, &
2832 real(kind=realtype),
dimension(3) :: fpd, mpd, fmomd, mmomd, &
2833 & refpointd, sfacecoordrefd
2834 real(kind=realtype),
dimension(3) :: cofsumfx, cofsumfy, cofsumfz
2835 real(kind=realtype),
dimension(3) :: cofsumfxd, cofsumfyd, cofsumfzd
2836 real(kind=realtype) :: mnm, massflowratelocal
2837 real(kind=realtype) :: mnmd, massflowratelocald
2842 real(kind=realtype) :: temp
2843 real(kind=realtype) :: tempd
2844 real(kind=realtype) :: tempd0
2861 internalflowfact =
one
2864 if (isinflow) inflowfact = -
one
2875 mass_vid = localvaluesd(
imassvi)
2876 mass_nzd = localvaluesd(
imassnz)
2877 mass_nyd = localvaluesd(
imassny)
2878 mass_nxd = localvaluesd(
imassnx)
2879 mass_vzd = localvaluesd(
imassvz)
2880 mass_vyd = localvaluesd(
imassvy)
2881 mass_vxd = localvaluesd(
imassvx)
2882 area_psd = localvaluesd(
iareaps)
2897 fpd = localvaluesd(
ifp:
ifp+2)
2898 mass_mnd = localvaluesd(
imassmn)
2899 mass_psd = localvaluesd(
imassps)
2902 mass_ad = localvaluesd(
imassa)
2904 aread = localvaluesd(
iarea)
2909 sfacecoordrefd = 0.0_8
2922 if (
bcdata(mm)%iblank(i, j) .lt. 0)
then
2925 blk =
bcdata(mm)%iblank(i, j)
2931 pm =
half*(pp1(i, j)+pp2(i, j))
2932 gammam =
half*(gamma1(i, j)+gamma2(i, j))
2933 vnm = vxm*ssi(i, j, 1) + vym*ssi(i, j, 2) + vzm*ssi(i, j, 3) - sf
2934 vmag = sqrt(vxm**2 + vym**2 + vzm**2) - sf
2935 am = sqrt(gammam*pm/rhom)
2937 cellarea = sqrt(ssi(i, j, 1)**2 + ssi(i, j, 2)**2 + ssi(i, j, 3)**&
2939 overcellarea = 1/cellarea
2942 massflowratelocal = rhom*vnm*blk*fact*mredim
2946 sfacecoordref(1) = sf*ssi(i, j, 1)*overcellarea
2947 sfacecoordref(2) = sf*ssi(i, j, 2)*overcellarea
2948 sfacecoordref(3) = sf*ssi(i, j, 3)*overcellarea
2952 if (
one .gt.
one/ptot)
then
2954 call pushcontrol1b(0)
2956 call pushcontrol1b(1)
2959 vilocal = sqrt(viconst*(
one-pratio**gm1ovg)*ttot*
tref)
2960 xc =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1, &
2962 yc =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1, &
2964 zc =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1, &
2974 xco =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
2976 yco =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
2978 zco =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
2990 call pushreal8(massflowratelocal)
2991 massflowratelocal = massflowratelocal*fact/
timeref*blk/cellarea*&
2992 & internalflowfact*inflowfact
2993 fx = massflowratelocal*ssi(i, j, 1)*vxm
2994 fy = massflowratelocal*ssi(i, j, 2)*vym
2995 fz = massflowratelocal*ssi(i, j, 3)*vzm
3005 zcod = fz*cofsumfzd(3) + fy*cofsumfyd(3) + fx*cofsumfxd(3)
3006 fzd = zco*cofsumfzd(3) + yco*cofsumfzd(2) + xco*cofsumfzd(1) + yc*&
3007 & mxd - xc*myd + fmomd(3)
3008 ycod = fz*cofsumfzd(2) + fy*cofsumfyd(2) + fx*cofsumfxd(2)
3009 xcod = fz*cofsumfzd(1) + fy*cofsumfyd(1) + fx*cofsumfxd(1)
3010 fyd = zco*cofsumfyd(3) + yco*cofsumfyd(2) + xco*cofsumfyd(1) + xc*&
3011 & mzd + fmomd(2) - zc*mxd
3012 fxd = zco*cofsumfxd(3) + yco*cofsumfxd(2) + xco*cofsumfxd(1) + zc*&
3013 & myd - yc*mzd + fmomd(1)
3014 xcd = fy*mzd - fz*myd
3015 ycd = fz*mxd - fx*mzd
3016 zcd = fx*myd - fy*mxd
3017 ssid(i, j, 3) = ssid(i, j, 3) + massflowratelocal*vzm*fzd
3018 tempd0 = ssi(i, j, 3)*fzd
3019 massflowratelocald = vzm*tempd0
3020 vzmd = massflowratelocal*tempd0
3021 ssid(i, j, 2) = ssid(i, j, 2) + massflowratelocal*vym*fyd
3022 tempd0 = ssi(i, j, 2)*fyd
3023 massflowratelocald = massflowratelocald + vym*tempd0
3024 vymd = massflowratelocal*tempd0
3025 ssid(i, j, 1) = ssid(i, j, 1) + massflowratelocal*vxm*fxd
3026 tempd0 = ssi(i, j, 1)*fxd
3027 massflowratelocald = massflowratelocald + vxm*tempd0
3028 vxmd = massflowratelocal*tempd0
3029 call popreal8(massflowratelocal)
3030 tempd0 = fact*blk*internalflowfact*inflowfact*massflowratelocald/(&
3032 massflowratelocald = tempd0
3033 tempd = -(massflowratelocal*tempd0/(
timeref*cellarea))
3036 fz = pm*ssi(i, j, 3)
3037 fy = pm*ssi(i, j, 2)
3038 fx = pm*ssi(i, j, 1)
3039 zcod = zcod + fz*cofsumfzd(3) + fy*cofsumfyd(3) + fx*cofsumfxd(3)
3040 ycod = ycod + fz*cofsumfzd(2) + fy*cofsumfyd(2) + fx*cofsumfxd(2)
3041 xcod = xcod + fz*cofsumfzd(1) + fy*cofsumfyd(1) + fx*cofsumfxd(1)
3043 xxd(i, j, 3) = xxd(i, j, 3) + tempd0
3044 xxd(i+1, j, 3) = xxd(i+1, j, 3) + tempd0
3045 xxd(i, j+1, 3) = xxd(i, j+1, 3) + tempd0
3046 xxd(i+1, j+1, 3) = xxd(i+1, j+1, 3) + tempd0
3048 xxd(i, j, 2) = xxd(i, j, 2) + tempd0
3049 xxd(i+1, j, 2) = xxd(i+1, j, 2) + tempd0
3050 xxd(i, j+1, 2) = xxd(i, j+1, 2) + tempd0
3051 xxd(i+1, j+1, 2) = xxd(i+1, j+1, 2) + tempd0
3053 xxd(i, j, 1) = xxd(i, j, 1) + tempd0
3054 xxd(i+1, j, 1) = xxd(i+1, j, 1) + tempd0
3055 xxd(i, j+1, 1) = xxd(i, j+1, 1) + tempd0
3056 xxd(i+1, j+1, 1) = xxd(i+1, j+1, 1) + tempd0
3059 fxd = zco*cofsumfxd(3) + yco*cofsumfxd(2) + xco*cofsumfxd(1) + zc*&
3060 & myd - yc*mzd + fpd(1)
3062 fzd = zco*cofsumfzd(3) + yco*cofsumfzd(2) + xco*cofsumfzd(1) + yc*&
3063 & mxd - xc*myd + fpd(3)
3064 fyd = zco*cofsumfyd(3) + yco*cofsumfyd(2) + xco*cofsumfyd(1) + xc*&
3065 & mzd + fpd(2) - zc*mxd
3066 xcd = xcd + fy*mzd - fz*myd
3067 ycd = ycd + fz*mxd - fx*mzd
3068 zcd = zcd + fx*myd - fy*mxd
3069 pmd = ssi(i, j, 3)*fzd + ssi(i, j, 2)*fyd + ssi(i, j, 1)*fxd
3070 ssid(i, j, 3) = ssid(i, j, 3) + pm*fzd
3071 ssid(i, j, 2) = ssid(i, j, 2) + pm*fyd
3072 ssid(i, j, 1) = ssid(i, j, 1) + pm*fxd
3074 tempd0 = -(fact*blk*pmd)
3078 refpointd(3) = refpointd(3) - zcd
3079 xxd(i, j, 3) = xxd(i, j, 3) + tempd0
3080 xxd(i+1, j, 3) = xxd(i+1, j, 3) + tempd0
3081 xxd(i, j+1, 3) = xxd(i, j+1, 3) + tempd0
3082 xxd(i+1, j+1, 3) = xxd(i+1, j+1, 3) + tempd0
3084 refpointd(2) = refpointd(2) - ycd
3085 xxd(i, j, 2) = xxd(i, j, 2) + tempd0
3086 xxd(i+1, j, 2) = xxd(i+1, j, 2) + tempd0
3087 xxd(i, j+1, 2) = xxd(i, j+1, 2) + tempd0
3088 xxd(i+1, j+1, 2) = xxd(i+1, j+1, 2) + tempd0
3090 refpointd(1) = refpointd(1) - xcd
3091 xxd(i, j, 1) = xxd(i, j, 1) + tempd0
3092 xxd(i+1, j, 1) = xxd(i+1, j, 1) + tempd0
3093 xxd(i, j+1, 1) = xxd(i, j+1, 1) + tempd0
3094 xxd(i+1, j+1, 1) = xxd(i+1, j+1, 1) + tempd0
3095 ssid(i, j, 3) = ssid(i, j, 3) + overcellarea*massflowratelocal*&
3097 tempd0 = ssi(i, j, 3)*mass_nzd
3098 overcellaread = massflowratelocal*tempd0
3099 massflowratelocald = massflowratelocald + overcellarea*tempd0
3100 ssid(i, j, 2) = ssid(i, j, 2) + overcellarea*massflowratelocal*&
3102 tempd0 = ssi(i, j, 2)*mass_nyd
3103 overcellaread = overcellaread + massflowratelocal*tempd0
3104 massflowratelocald = massflowratelocald + overcellarea*tempd0
3105 ssid(i, j, 1) = ssid(i, j, 1) + overcellarea*massflowratelocal*&
3107 tempd0 = ssi(i, j, 1)*mass_nxd
3108 overcellaread = overcellaread + massflowratelocal*tempd0
3109 massflowratelocald = massflowratelocald + overcellarea*tempd0 + &
3111 vilocald = massflowratelocal*mass_vid
3112 temp =
one - pratio**gm1ovg
3113 if (viconst*(temp*(ttot*
tref)) .eq. 0.0_8)
then
3116 tempd0 = viconst*vilocald/(2.0*sqrt(viconst*(temp*(ttot*
tref))))
3118 if (pratio .le. 0.0_8 .and. (gm1ovg .eq. 0.0_8 .or. gm1ovg .ne. &
3119 & int(gm1ovg)))
then
3122 pratiod = -(gm1ovg*pratio**(gm1ovg-1)*ttot*
tref*tempd0)
3124 ttotd = ttotd +
tref*temp*tempd0
3126 call popcontrol1b(branch)
3127 if (branch .eq. 0) ptotd = ptotd -
one*pratiod/ptot**2
3128 tempd = blk*area_ptotd
3129 vzmd = vzmd +
uref*massflowratelocal*mass_vzd
3130 sfacecoordrefd(3) = sfacecoordrefd(3) - massflowratelocal*mass_vzd
3131 massflowratelocald = massflowratelocald + (
uref*vzm-sfacecoordref(&
3132 & 3))*mass_vzd + (
uref*vym-sfacecoordref(2))*mass_vyd + (
uref*vxm-&
3133 & sfacecoordref(1))*mass_vxd + mnm*mass_mnd + pm*mass_psd + am*&
3134 &
uref*mass_ad + rhom*
rhoref*mass_rhod + ttot*
tref*mass_ttotd + &
3135 & ptot*
pref*mass_ptotd + massflowrated
3136 vymd = vymd +
uref*massflowratelocal*mass_vyd
3137 sfacecoordrefd(2) = sfacecoordrefd(2) - massflowratelocal*mass_vyd
3138 vxmd = vxmd +
uref*massflowratelocal*mass_vxd
3139 sfacecoordrefd(1) = sfacecoordrefd(1) - massflowratelocal*mass_vxd
3140 ssid(i, j, 3) = ssid(i, j, 3) + overcellarea*sf*sfacecoordrefd(3)
3141 overcellaread = overcellaread + ssi(i, j, 3)*sf*sfacecoordrefd(3) &
3142 & + ssi(i, j, 2)*sf*sfacecoordrefd(2) + ssi(i, j, 1)*sf*&
3144 sfacecoordrefd(3) = 0.0_8
3145 ssid(i, j, 2) = ssid(i, j, 2) + overcellarea*sf*sfacecoordrefd(2)
3146 sfacecoordrefd(2) = 0.0_8
3147 ssid(i, j, 1) = ssid(i, j, 1) + overcellarea*sf*sfacecoordrefd(1)
3148 sfacecoordrefd(1) = 0.0_8
3149 pmd = pmd + cellarea*blk*area_psd + massflowratelocal*mass_psd
3150 cellaread = cellaread + pm*blk*area_psd + ptot*
pref*tempd + blk*&
3151 & aread - overcellaread/cellarea**2
3152 ptotd = ptotd +
pref*cellarea*tempd + massflowratelocal*
pref*&
3154 mnmd = massflowratelocal*mass_mnd
3155 amd = massflowratelocal*
uref*mass_ad - vmag*mnmd/am**2
3157 ttotd = ttotd + massflowratelocal*
tref*mass_ttotd
3158 trefd =
trefd + ttot*massflowratelocal*mass_ttotd
3160 prefd =
prefd + ptot*cellarea*tempd + ptot*massflowratelocal*&
3161 & mass_ptotd + pm*pmd
3163 tempd = blk*fact*massflowratelocald
3164 rhomd = massflowratelocal*
rhoref*mass_rhod + vnm*mredim*tempd
3165 vnmd = rhom*mredim*tempd
3166 mredimd = mredimd + rhom*vnm*tempd
3167 call computettot_b(rhom, rhomd, vxm, vxmd, vym, vymd, vzm, vzmd, &
3168 & pm, pmd, ttot, ttotd)
3169 call computeptot_b(rhom, rhomd, vxm, vxmd, vym, vymd, vzm, vzmd, &
3170 & pm, pmd, ptot, ptotd)
3171 if (ssi(i, j, 1)**2 + ssi(i, j, 2)**2 + ssi(i, j, 3)**2 .eq. 0.0_8&
3175 tempd = cellaread/(2.0*sqrt(ssi(i, j, 1)**2+ssi(i, j, 2)**2+ssi(&
3178 ssid(i, j, 3) = ssid(i, j, 3) + 2*ssi(i, j, 3)*tempd + vzm*vnmd
3179 ssid(i, j, 2) = ssid(i, j, 2) + 2*ssi(i, j, 2)*tempd + vym*vnmd
3180 ssid(i, j, 1) = ssid(i, j, 1) + 2*ssi(i, j, 1)*tempd + vxm*vnmd
3182 if (gammam*(pm/rhom) .eq. 0.0_8)
then
3185 tempd = gammam*amd/(rhom*2.0*sqrt(gammam*(pm/rhom)))
3188 rhomd = rhomd - pm*tempd/rhom
3189 if (vxm**2 + vym**2 + vzm**2 .eq. 0.0_8)
then
3192 tempd = vmagd/(2.0*sqrt(vxm**2+vym**2+vzm**2))
3194 vxmd = vxmd + 2*vxm*tempd + ssi(i, j, 1)*vnmd
3195 vymd = vymd + 2*vym*tempd + ssi(i, j, 2)*vnmd
3196 vzmd = vzmd + 2*vzm*tempd + ssi(i, j, 3)*vnmd
3197 pp1d(i, j) = pp1d(i, j) +
half*pmd
3198 pp2d(i, j) = pp2d(i, j) +
half*pmd
3201 ww1d(i, j,
ivz) = ww1d(i, j,
ivz) +
half*vzmd
3202 ww2d(i, j,
ivz) = ww2d(i, j,
ivz) +
half*vzmd
3203 ww1d(i, j,
ivy) = ww1d(i, j,
ivy) +
half*vymd
3204 ww2d(i, j,
ivy) = ww2d(i, j,
ivy) +
half*vymd
3205 ww1d(i, j,
ivx) = ww1d(i, j,
ivx) +
half*vxmd
3206 ww2d(i, j,
ivx) = ww2d(i, j,
ivx) +
half*vxmd
3216 refpointd(3) = 0.0_8
3218 refpointd(2) = 0.0_8
3230 use bcpointers_b,
only : ssi, sface, ww1, ww2, pp1, pp2, xx, gamma1,&
3235 logical,
intent(in) :: isinflow
3236 real(kind=realtype),
dimension(nlocalvalues),
intent(inout) :: &
3238 integer(kind=inttype),
intent(in) :: mm
3240 real(kind=realtype) :: massflowrate, mass_ptot, mass_ttot, mass_ps, &
3241 & mass_mn, mass_a, mass_rho, mass_vx, mass_vy, mass_vz, mass_nx, &
3242 & mass_ny, mass_nz, mass_vi
3243 real(kind=realtype) :: area_ptot, area_ps
3244 real(kind=realtype) :: govgm1, gm1ovg, viconst, vilocal, pratio
3245 real(kind=realtype) :: mredim
3246 integer(kind=inttype) :: i, j, ii, blk
3247 real(kind=realtype) :: internalflowfact, inflowfact, fact, xc, xco, &
3248 & yc, yco, zc, zco, mx, my, mz
3249 real(kind=realtype) :: sf, vmag, vnm, vnmfreestreamref, vxm, vym, &
3250 & vzm, fx, fy, fz, u, v, w
3251 real(kind=realtype) :: pm, ptot, ttot, rhom, gammam, am
3252 real(kind=realtype) :: area, cellarea, overcellarea
3253 real(kind=realtype),
dimension(3) :: fp, mp, fmom, mmom, refpoint, &
3255 real(kind=realtype),
dimension(3) :: cofsumfx, cofsumfy, cofsumfz
3256 real(kind=realtype) :: mnm, massflowratelocal
3276 internalflowfact =
one
3279 if (isinflow) inflowfact = -
one
3325 if (
bcdata(mm)%iblank(i, j) .lt. 0)
then
3328 blk =
bcdata(mm)%iblank(i, j)
3334 pm =
half*(pp1(i, j)+pp2(i, j))
3335 gammam =
half*(gamma1(i, j)+gamma2(i, j))
3336 vnm = vxm*ssi(i, j, 1) + vym*ssi(i, j, 2) + vzm*ssi(i, j, 3) - sf
3337 vmag = sqrt(vxm**2 + vym**2 + vzm**2) - sf
3338 am = sqrt(gammam*pm/rhom)
3340 cellarea = sqrt(ssi(i, j, 1)**2 + ssi(i, j, 2)**2 + ssi(i, j, 3)**&
3342 area = area + cellarea*blk
3343 overcellarea = 1/cellarea
3346 massflowratelocal = rhom*vnm*blk*fact*mredim
3347 massflowrate = massflowrate + massflowratelocal
3350 mass_ptot = mass_ptot + ptot*massflowratelocal*
pref
3351 mass_ttot = mass_ttot + ttot*massflowratelocal*
tref
3352 mass_rho = mass_rho + rhom*massflowratelocal*
rhoref
3353 mass_a = mass_a + am*massflowratelocal*
uref
3354 mass_ps = mass_ps + pm*massflowratelocal
3355 mass_mn = mass_mn + mnm*massflowratelocal
3356 area_ptot = area_ptot + ptot*
pref*cellarea*blk
3357 area_ps = area_ps + pm*cellarea*blk
3358 sfacecoordref(1) = sf*ssi(i, j, 1)*overcellarea
3359 sfacecoordref(2) = sf*ssi(i, j, 2)*overcellarea
3360 sfacecoordref(3) = sf*ssi(i, j, 3)*overcellarea
3361 mass_vx = mass_vx + (vxm*
uref-sfacecoordref(1))*massflowratelocal
3362 mass_vy = mass_vy + (vym*
uref-sfacecoordref(2))*massflowratelocal
3363 mass_vz = mass_vz + (vzm*
uref-sfacecoordref(3))*massflowratelocal
3367 if (
one .gt.
one/ptot)
then
3372 vilocal = sqrt(viconst*(
one-pratio**gm1ovg)*ttot*
tref)
3373 mass_vi = mass_vi + vilocal*massflowratelocal
3374 mass_nx = mass_nx + ssi(i, j, 1)*overcellarea*massflowratelocal
3375 mass_ny = mass_ny + ssi(i, j, 2)*overcellarea*massflowratelocal
3376 mass_nz = mass_nz + ssi(i, j, 3)*overcellarea*massflowratelocal
3377 xc =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1, &
3379 yc =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1, &
3381 zc =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1, &
3387 fx = pm*ssi(i, j, 1)
3388 fy = pm*ssi(i, j, 2)
3389 fz = pm*ssi(i, j, 3)
3402 xco =
fourth*(xx(i, j, 1)+xx(i+1, j, 1)+xx(i, j+1, 1)+xx(i+1, j+1&
3404 yco =
fourth*(xx(i, j, 2)+xx(i+1, j, 2)+xx(i, j+1, 2)+xx(i+1, j+1&
3406 zco =
fourth*(xx(i, j, 3)+xx(i+1, j, 3)+xx(i, j+1, 3)+xx(i+1, j+1&
3412 cofsumfx(1) = cofsumfx(1) + xco*fx
3413 cofsumfx(2) = cofsumfx(2) + yco*fx
3414 cofsumfx(3) = cofsumfx(3) + zco*fx
3416 cofsumfy(1) = cofsumfy(1) + xco*fy
3417 cofsumfy(2) = cofsumfy(2) + yco*fy
3418 cofsumfy(3) = cofsumfy(3) + zco*fy
3420 cofsumfz(1) = cofsumfz(1) + xco*fz
3421 cofsumfz(2) = cofsumfz(2) + yco*fz
3422 cofsumfz(3) = cofsumfz(3) + zco*fz
3427 massflowratelocal = massflowratelocal*fact/
timeref*blk/cellarea*&
3428 & internalflowfact*inflowfact
3429 fx = massflowratelocal*ssi(i, j, 1)*vxm
3430 fy = massflowratelocal*ssi(i, j, 2)*vym
3431 fz = massflowratelocal*ssi(i, j, 3)*vzm
3432 fmom(1) = fmom(1) + fx
3433 fmom(2) = fmom(2) + fy
3434 fmom(3) = fmom(3) + fz
3438 mmom(1) = mmom(1) + mx
3439 mmom(2) = mmom(2) + my
3440 mmom(3) = mmom(3) + mz
3445 cofsumfx(1) = cofsumfx(1) + xco*fx
3446 cofsumfx(2) = cofsumfx(2) + yco*fx
3447 cofsumfx(3) = cofsumfx(3) + zco*fx
3449 cofsumfy(1) = cofsumfy(1) + xco*fy
3450 cofsumfy(2) = cofsumfy(2) + yco*fy
3451 cofsumfy(3) = cofsumfy(3) + zco*fy
3453 cofsumfz(1) = cofsumfz(1) + xco*fz
3454 cofsumfz(2) = cofsumfz(2) + yco*fz
3455 cofsumfz(3) = cofsumfz(3) + zco*fz
3459 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 computeptot(rho, u, v, w, p, ptot)
subroutine computeptot_b(rho, rhod, u, ud, v, vd, w, wd, p, pd, ptot, ptotd)
subroutine getdirvector(refdirection, alpha, beta, winddirection, liftindex)
subroutine computettot(rho, u, v, w, p, ttot)
subroutine computettot_b(rho, rhod, u, ud, v, vd, w, wd, p, pd, ttot, ttotd)
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 getcostfunctions(globalvals, funcvalues)
subroutine wallintegrationface_b(localvalues, localvaluesd, mm)
subroutine ksaggregationfunction_b(g, gd, max_g, g_rho, ks_g, ks_gd)
subroutine wallintegrationface(localvalues, mm)
subroutine getcostfunctions_b(globalvals, globalvalsd, funcvalues, funcvaluesd)
subroutine flowintegrationface(isinflow, localvalues, mm)
subroutine ksaggregationfunction(g, max_g, g_rho, ks_g)
subroutine flowintegrationface_b(isinflow, localvalues, localvaluesd, mm)
real(kind=realtype) function mynorm2(x)
subroutine computetsderivatives(force, moment, coef0, dcdalpha, dcdalphadot, dcdq, dcdqdot)