21 real(kind=realtype),
intent(in),
dimension(:, :) :: globalvals
22 real(Kind=realtype),
intent(out),
dimension(:) :: funcvalues
25 real(kind=realtype) :: fact, factmoment, ovrnts
26 real(kind=realtype),
dimension(3, nTimeIntervalsSpectral) :: force, forcep, forcev, forcem, &
27 moment, cforce, cforcep, cforcev, cforcem, &
28 cmoment, cofx, cofy, cofz
29 real(kind=realtype),
dimension(3) :: vcoordref, vfreestreamref
30 real(kind=realtype) :: mavgptot, mavgttot, mavgrho, mavgps, mflow, mavgmn, mavga, &
31 mavgvx, mavgvy, mavgvz, garea, mavgvi, fxlift, fylift, fzlift
33 real(kind=realtype) :: vdotn, mag, u, v, w, ks_comp
34 integer(kind=intType) :: sps
35 real(kind=realtype),
dimension(8) :: dcdq, dcdqdot
36 real(kind=realtype),
dimension(8) :: dcdalpha, dcdalphadot
37 real(kind=realtype),
dimension(8) :: coef0
44 forcep = globalvals(
ifp:
ifp + 2, :)
45 forcev = globalvals(
ifv:
ifv + 2, :)
57 cforcep = fact * forcep
58 cforcev = fact * forcev
59 cforcem = fact * forcem
63 cmoment = fact * moment
110 if (force(1, sps) /=
zero)
then
111 cofx(:, sps) = cofx(:, sps) / force(1, sps)
116 if (force(2, sps) /=
zero)
then
117 cofy(:, sps) = cofy(:, sps) / force(2, sps)
122 if (force(3, sps) /=
zero)
then
123 cofz(:, sps) = cofz(:, sps) / force(3, sps)
184 ovrnts * globalvals(
isepavg + 1, sps)
186 ovrnts * globalvals(
isepavg + 2, sps)
194 if (mflow /=
zero)
then
195 mavgptot = globalvals(
imassptot, sps) / mflow
196 mavgttot = globalvals(
imassttot, sps) / mflow
197 mavgrho = globalvals(
imassrho, sps) / mflow
198 mavgps = globalvals(
imassps, sps) / mflow
199 mavgmn = globalvals(
imassmn, sps) / mflow
200 mavga = globalvals(
imassa, sps) / mflow
202 mavgvx = globalvals(
imassvx, sps) / mflow
203 mavgvy = globalvals(
imassvy, sps) / mflow
204 mavgvz = globalvals(
imassvz, sps) / mflow
206 mavgvi = (globalvals(
imassvi, sps) / mflow)
208 mag = sqrt(globalvals(
imassnx, sps)**2 + &
209 globalvals(
imassny, sps)**2 + &
227 garea = globalvals(
iarea, sps)
228 if (garea /=
zero)
then
231 ovrnts * globalvals(
iareaptot, sps) / garea
233 ovrnts * globalvals(
iareaps, sps) / garea
349 if ((fxlift + fylift + fzlift) /=
zero)
then
353 (fxlift + fylift + fzlift)
357 (fxlift + fylift + fzlift)
361 (fxlift + fylift + fzlift)
371 print *,
'Error: TSStabilityDerivatives are *BROKEN*. They need to be '&
372 &
'completely verifed from scratch'
376 dcdalphadot, dcdq, dcdqdot)
429 real(kind=realtype),
dimension(nLocalValues),
intent(inout) :: localvalues
430 integer(kind=intType) :: mm
433 real(kind=realtype),
dimension(3) :: fp, fv, mp, mv
434 real(kind=realtype),
dimension(3) :: cofsumfx, cofsumfy, cofsumfz
435 real(kind=realtype) :: yplusmax, sepsensorks, sepsensor, sepsensoravg(3), &
436 sepsensorarea, cavitation, cpmin_ks_sum, sepsensorksarea
437 integer(kind=intType) :: i, j, ii, blk
439 real(kind=realtype) :: pm1, fx, fy, fz, fn
440 real(kind=realtype) :: vecttangential(3)
441 real(kind=realtype) :: vectdotproductfsnormal
442 real(kind=realtype) :: xc, xco, yc, yco, zc, zco, qf(3), r(3), n(3), l
443 real(kind=realtype) :: fact, rho, mul, yplus, dwall
444 real(kind=realtype) :: v(3), sensor, sensor1, cp, tmp, plocal, ks_exponent
445 real(kind=realtype) :: tauxx, tauyy, tauzz
446 real(kind=realtype) :: tauxy, tauxz, tauyz
448 real(kind=realtype),
dimension(3) :: refpoint
449 real(kind=realtype),
dimension(3, 2) :: axispoints
450 real(kind=realtype) :: mx, my, mz, cellarea, m0x, m0y, m0z, mvaxis, mpaxis
451 real(kind=realtype) :: cperror, cperror2
485 sepsensorksarea =
zero
527 cperror = (cp -
bcdata(mm)%CpTarget(i, j))
528 cperror2 = cperror2 + cperror * cperror
530 xc =
fourth * (
xx(i, j, 1) +
xx(i + 1, j, 1) &
531 +
xx(i, j + 1, 1) +
xx(i + 1, j + 1, 1)) - refpoint(1)
532 yc =
fourth * (
xx(i, j, 2) +
xx(i + 1, j, 2) &
533 +
xx(i, j + 1, 2) +
xx(i + 1, j + 1, 2)) - refpoint(2)
534 zc =
fourth * (
xx(i, j, 3) +
xx(i + 1, j, 3) &
535 +
xx(i, j + 1, 3) +
xx(i + 1, j + 1, 3)) - refpoint(3)
538 blk = max(
bcdata(mm)%iblank(i, j), 0)
539 fx = pm1 *
ssi(i, j, 1)
540 fy = pm1 *
ssi(i, j, 2)
541 fz = pm1 *
ssi(i, j, 3)
550 fp(1) = fp(1) + fx * blk
551 fp(2) = fp(2) + fy * blk
552 fp(3) = fp(3) + fz * blk
554 mx = yc * fz - zc * fy
555 my = zc * fx - xc * fz
556 mz = xc * fy - yc * fx
558 mp(1) = mp(1) + mx * blk
559 mp(2) = mp(2) + my * blk
560 mp(3) = mp(3) + mz * blk
564 xco =
fourth * (
xx(i, j, 1) +
xx(i + 1, j, 1) &
565 +
xx(i, j + 1, 1) +
xx(i + 1, j + 1, 1))
566 yco =
fourth * (
xx(i, j, 2) +
xx(i + 1, j, 2) &
567 +
xx(i, j + 1, 2) +
xx(i + 1, j + 1, 2))
568 zco =
fourth * (
xx(i, j, 3) +
xx(i + 1, j, 3) &
569 +
xx(i, j + 1, 3) +
xx(i + 1, j + 1, 3))
574 cofsumfx(1) = cofsumfx(1) + xco * fx * blk
575 cofsumfx(2) = cofsumfx(2) + yco * fx * blk
576 cofsumfx(3) = cofsumfx(3) + zco * fx * blk
579 cofsumfy(1) = cofsumfy(1) + xco * fy * blk
580 cofsumfy(2) = cofsumfy(2) + yco * fy * blk
581 cofsumfy(3) = cofsumfy(3) + zco * fy * blk
584 cofsumfz(1) = cofsumfz(1) + xco * fz * blk
585 cofsumfz(2) = cofsumfz(2) + yco * fz * blk
586 cofsumfz(3) = cofsumfz(3) + zco * fz * blk
592 r(1) =
fourth * (
xx(i, j, 1) +
xx(i + 1, j, 1) &
593 +
xx(i, j + 1, 1) +
xx(i + 1, j + 1, 1)) - axispoints(1, 1)
594 r(2) =
fourth * (
xx(i, j, 2) +
xx(i + 1, j, 2) &
595 +
xx(i, j + 1, 2) +
xx(i + 1, j + 1, 2)) - axispoints(2, 1)
596 r(3) =
fourth * (
xx(i, j, 3) +
xx(i + 1, j, 3) &
597 +
xx(i, j + 1, 3) +
xx(i + 1, j + 1, 3)) - axispoints(3, 1)
599 l = sqrt((axispoints(1, 2) - axispoints(1, 1))**2 &
600 + (axispoints(2, 2) - axispoints(2, 1))**2 &
601 + (axispoints(3, 2) - axispoints(3, 1))**2)
603 n(1) = (axispoints(1, 2) - axispoints(1, 1)) / l
604 n(2) = (axispoints(2, 2) - axispoints(2, 1)) / l
605 n(3) = (axispoints(3, 2) - axispoints(3, 1)) / l
610 m0x = r(2) * fz - r(3) * fy
611 m0y = r(3) * fx - r(1) * fz
612 m0z = r(1) * fy - r(2) * fx
613 mpaxis = mpaxis + (m0x * n(1) + m0y * n(2) + m0z * n(3)) * blk
616 bcdata(mm)%Fp(i, j, 1) = fx
617 bcdata(mm)%Fp(i, j, 2) = fy
618 bcdata(mm)%Fp(i, j, 3) = fz
619 cellarea = sqrt(
ssi(i, j, 1)**2 +
ssi(i, j, 2)**2 +
ssi(i, j, 3)**2)
621 bcdata(mm)%area(i, j) = cellarea
627 v = v / (sqrt(v(1)**2 + v(2)**2 + v(3)**2) + 1e-16)
639 vecttangential = vecttangential / (sqrt(vecttangential(1)**2 + vecttangential(2)**2 + &
640 vecttangential(3)**2) + 1e-16)
644 sensor = (v(1) * vecttangential(1) + v(2) * vecttangential(2) + &
645 v(3) * vecttangential(3))
654 sepsensorksarea = sepsensorksarea + blk * cellarea
658 sepsensorks = sepsensorks + ks_exponent * blk
670 sensor = sensor * cellarea * blk
671 sepsensor = sepsensor + sensor
675 sepsensoravg(1) = sepsensoravg(1) + sensor * xco
676 sepsensoravg(2) = sepsensoravg(2) + sensor * yco
677 sepsensoravg(3) = sepsensoravg(3) + sensor * zco
682 cp = tmp * (plocal -
pinf)
685 sensor1 = sensor1 * cellarea * blk
686 cavitation = cavitation + sensor1
690 cpmin_ks_sum = cpmin_ks_sum + ks_exponent * blk
716 blk = max(
bcdata(mm)%iblank(i, j), 0)
728 fx = -fact * (tauxx *
ssi(i, j, 1) + tauxy *
ssi(i, j, 2) &
730 fy = -fact * (tauxy *
ssi(i, j, 1) + tauyy *
ssi(i, j, 2) &
732 fz = -fact * (tauxz *
ssi(i, j, 1) + tauyz *
ssi(i, j, 2) &
740 xc =
fourth * (
xx(i, j, 1) +
xx(i + 1, j, 1) &
741 +
xx(i, j + 1, 1) +
xx(i + 1, j + 1, 1)) - refpoint(1)
742 yc =
fourth * (
xx(i, j, 2) +
xx(i + 1, j, 2) &
743 +
xx(i, j + 1, 2) +
xx(i + 1, j + 1, 2)) - refpoint(2)
744 zc =
fourth * (
xx(i, j, 3) +
xx(i + 1, j, 3) &
745 +
xx(i, j + 1, 3) +
xx(i + 1, j + 1, 3)) - refpoint(3)
749 fv(1) = fv(1) + fx * blk
750 fv(2) = fv(2) + fy * blk
751 fv(3) = fv(3) + fz * blk
753 mx = yc * fz - zc * fy
754 my = zc * fx - xc * fz
755 mz = xc * fy - yc * fx
757 mv(1) = mv(1) + mx * blk
758 mv(2) = mv(2) + my * blk
759 mv(3) = mv(3) + mz * blk
763 xco =
fourth * (
xx(i, j, 1) +
xx(i + 1, j, 1) &
764 +
xx(i, j + 1, 1) +
xx(i + 1, j + 1, 1))
765 yco =
fourth * (
xx(i, j, 2) +
xx(i + 1, j, 2) &
766 +
xx(i, j + 1, 2) +
xx(i + 1, j + 1, 2))
767 zco =
fourth * (
xx(i, j, 3) +
xx(i + 1, j, 3) &
768 +
xx(i, j + 1, 3) +
xx(i + 1, j + 1, 3))
773 cofsumfx(1) = cofsumfx(1) + xco * fx * blk
774 cofsumfx(2) = cofsumfx(2) + yco * fx * blk
775 cofsumfx(3) = cofsumfx(3) + zco * fx * blk
778 cofsumfy(1) = cofsumfy(1) + xco * fy * blk
779 cofsumfy(2) = cofsumfy(2) + yco * fy * blk
780 cofsumfy(3) = cofsumfy(3) + zco * fy * blk
783 cofsumfz(1) = cofsumfz(1) + xco * fz * blk
784 cofsumfz(2) = cofsumfz(2) + yco * fz * blk
785 cofsumfz(3) = cofsumfz(3) + zco * fz * blk
791 r(1) =
fourth * (
xx(i, j, 1) +
xx(i + 1, j, 1) &
792 +
xx(i, j + 1, 1) +
xx(i + 1, j + 1, 1)) - axispoints(1, 1)
793 r(2) =
fourth * (
xx(i, j, 2) +
xx(i + 1, j, 2) &
794 +
xx(i, j + 1, 2) +
xx(i + 1, j + 1, 2)) - axispoints(2, 1)
795 r(3) =
fourth * (
xx(i, j, 3) +
xx(i + 1, j, 3) &
796 +
xx(i, j + 1, 3) +
xx(i + 1, j + 1, 3)) - axispoints(3, 1)
798 l = sqrt((axispoints(1, 2) - axispoints(1, 1))**2 &
799 + (axispoints(2, 2) - axispoints(2, 1))**2 &
800 + (axispoints(3, 2) - axispoints(3, 1))**2)
802 n(1) = (axispoints(1, 2) - axispoints(1, 1)) / l
803 n(2) = (axispoints(2, 2) - axispoints(2, 1)) / l
804 n(3) = (axispoints(3, 2) - axispoints(3, 1)) / l
809 m0x = r(2) * fz - r(3) * fy
810 m0y = r(3) * fx - r(1) * fz
811 m0z = r(1) * fy - r(2) * fx
812 mvaxis = mvaxis + (m0x * n(1) + m0y * n(2) + m0z * n(3)) * blk
815 bcdata(mm)%Fv(i, j, 1) = fx
816 bcdata(mm)%Fv(i, j, 2) = fy
817 bcdata(mm)%Fv(i, j, 3) = fz
826 fx = tauxx *
bcdata(mm)%norm(i, j, 1) + tauxy *
bcdata(mm)%norm(i, j, 2) &
827 + tauxz *
bcdata(mm)%norm(i, j, 3)
828 fy = tauxy *
bcdata(mm)%norm(i, j, 1) + tauyy *
bcdata(mm)%norm(i, j, 2) &
829 + tauyz *
bcdata(mm)%norm(i, j, 3)
830 fz = tauxz *
bcdata(mm)%norm(i, j, 1) + tauyz *
bcdata(mm)%norm(i, j, 2) &
831 + tauzz *
bcdata(mm)%norm(i, j, 3)
833 fn = fx *
bcdata(mm)%norm(i, j, 1) + fy *
bcdata(mm)%norm(i, j, 2) + fz *
bcdata(mm)%norm(i, j, 3)
835 fx = fx - fn *
bcdata(mm)%norm(i, j, 1)
836 fy = fy - fn *
bcdata(mm)%norm(i, j, 2)
837 fz = fz - fn *
bcdata(mm)%norm(i, j, 3)
846 yplus = sqrt(rho * sqrt(fx * fx + fy * fy + fz * fz)) * dwall / mul
851 yplusmax = max(yplusmax, yplus * blk)
861 localvalues(
ifp:
ifp + 2) = localvalues(
ifp:
ifp + 2) + fp
862 localvalues(
ifv:
ifv + 2) = localvalues(
ifv:
ifv + 2) + fv
863 localvalues(
imp:
imp + 2) = localvalues(
imp:
imp + 2) + mp
864 localvalues(
imv:
imv + 2) = localvalues(
imv:
imv + 2) + mv
873 localvalues(
icpmin) = localvalues(
icpmin) + cpmin_ks_sum
879 localvalues(
iyplus) = max(localvalues(
iyplus), yplusmax)
887 real(kind=
realtype),
intent(inout) :: ks_g
888 real(kind=
realtype),
intent(in) :: g, max_g, g_rho
890 ks_g = exp(g_rho * (g - max_g))
898 use flowvarrefstate,
only:
pref,
pinf,
rhoref,
timeref,
lref,
tref,
rgas,
uref,
uinf,
rhoinf,
gammainf
906 logical,
intent(in) :: isInflow
907 real(kind=realtype),
dimension(nLocalValues),
intent(inout) :: localvalues
908 integer(kind=intType),
intent(in) :: mm
911 real(kind=realtype) :: massflowrate, mass_ptot, mass_ttot, mass_ps, mass_mn, mass_a, mass_rho, &
912 mass_vx, mass_vy, mass_vz, mass_nx, mass_ny, mass_nz, mass_vi
913 real(kind=realtype) :: area_ptot, area_ps
914 real(kind=realtype) :: govgm1, gm1ovg, viconst, vilocal, pratio
915 real(kind=realtype) :: mredim
916 integer(kind=intType) :: i, j, ii, blk
917 real(kind=realtype) :: internalflowfact, inflowfact, fact, xc, xco, yc, yco, zc, zco, mx, my, mz
918 real(kind=realtype) :: sf, vmag, vnm, vnmfreestreamref, vxm, vym, vzm, fx, fy, fz, u, v, w
919 real(kind=realtype) :: pm, ptot, ttot, rhom, gammam, am
920 real(kind=realtype) :: area, cellarea, overcellarea
921 real(kind=realtype),
dimension(3) :: fp, mp, fmom, mmom, refpoint, sfacecoordref
922 real(kind=realtype),
dimension(3) :: cofsumfx, cofsumfy, cofsumfz
923 real(kind=realtype) :: mnm, massflowratelocal
942 internalflowfact =
one
944 internalflowfact = -
one
1004 blk = max(
bcdata(mm)%iblank(i, j), 0)
1013 vnm = vxm *
ssi(i, j, 1) + vym *
ssi(i, j, 2) + vzm *
ssi(i, j, 3) - sf
1014 vmag = sqrt((vxm**2 + vym**2 + vzm**2)) - sf
1015 am = sqrt(gammam * pm / rhom)
1018 cellarea = sqrt(
ssi(i, j, 1)**2 +
ssi(i, j, 2)**2 +
ssi(i, j, 3)**2)
1019 area = area + cellarea * blk
1020 overcellarea = 1 / cellarea
1025 massflowratelocal = rhom * vnm * blk * fact * mredim
1027 massflowrate = massflowrate + massflowratelocal
1032 mass_ptot = mass_ptot + ptot * massflowratelocal *
pref
1033 mass_ttot = mass_ttot + ttot * massflowratelocal *
tref
1034 mass_rho = mass_rho + rhom * massflowratelocal *
rhoref
1035 mass_a = mass_a + am * massflowratelocal *
uref
1037 mass_ps = mass_ps + pm * massflowratelocal
1038 mass_mn = mass_mn + mnm * massflowratelocal
1040 area_ptot = area_ptot + ptot *
pref * cellarea * blk
1041 area_ps = area_ps + pm * cellarea * blk
1043 sfacecoordref(1) = sf *
ssi(i, j, 1) * overcellarea
1044 sfacecoordref(2) = sf *
ssi(i, j, 2) * overcellarea
1045 sfacecoordref(3) = sf *
ssi(i, j, 3) * overcellarea
1047 mass_vx = mass_vx + (vxm *
uref - sfacecoordref(1)) * massflowratelocal
1048 mass_vy = mass_vy + (vym *
uref - sfacecoordref(2)) * massflowratelocal
1049 mass_vz = mass_vz + (vzm *
uref - sfacecoordref(3)) * massflowratelocal
1052 gm1ovg =
one / govgm1
1061 pratio = min(
one,
one / ptot)
1062 vilocal = sqrt(viconst * (
one - (pratio)**gm1ovg) * ttot *
tref)
1063 mass_vi = mass_vi + vilocal * massflowratelocal
1065 mass_nx = mass_nx +
ssi(i, j, 1) * overcellarea * massflowratelocal
1066 mass_ny = mass_ny +
ssi(i, j, 2) * overcellarea * massflowratelocal
1067 mass_nz = mass_nz +
ssi(i, j, 3) * overcellarea * massflowratelocal
1069 xc =
fourth * (
xx(i, j, 1) +
xx(i + 1, j, 1) &
1070 +
xx(i, j + 1, 1) +
xx(i + 1, j + 1, 1)) - refpoint(1)
1071 yc =
fourth * (
xx(i, j, 2) +
xx(i + 1, j, 2) &
1072 +
xx(i, j + 1, 2) +
xx(i + 1, j + 1, 2)) - refpoint(2)
1073 zc =
fourth * (
xx(i, j, 3) +
xx(i + 1, j, 3) &
1074 +
xx(i, j + 1, 3) +
xx(i + 1, j + 1, 3)) - refpoint(3)
1079 pm = -(pm -
pinf *
pref) * fact * blk
1081 fx = pm *
ssi(i, j, 1)
1082 fy = pm *
ssi(i, j, 2)
1083 fz = pm *
ssi(i, j, 3)
1090 mx = yc * fz - zc * fy
1091 my = zc * fx - xc * fz
1092 mz = xc * fy - yc * fx
1100 xco =
fourth * (
xx(i, j, 1) +
xx(i + 1, j, 1) &
1101 +
xx(i, j + 1, 1) +
xx(i + 1, j + 1, 1))
1102 yco =
fourth * (
xx(i, j, 2) +
xx(i + 1, j, 2) &
1103 +
xx(i, j + 1, 2) +
xx(i + 1, j + 1, 2))
1104 zco =
fourth * (
xx(i, j, 3) +
xx(i + 1, j, 3) &
1105 +
xx(i, j + 1, 3) +
xx(i + 1, j + 1, 3))
1112 cofsumfx(1) = cofsumfx(1) + xco * fx
1113 cofsumfx(2) = cofsumfx(2) + yco * fx
1114 cofsumfx(3) = cofsumfx(3) + zco * fx
1117 cofsumfy(1) = cofsumfy(1) + xco * fy
1118 cofsumfy(2) = cofsumfy(2) + yco * fy
1119 cofsumfy(3) = cofsumfy(3) + zco * fy
1122 cofsumfz(1) = cofsumfz(1) + xco * fz
1123 cofsumfz(2) = cofsumfz(2) + yco * fz
1124 cofsumfz(3) = cofsumfz(3) + zco * fz
1131 massflowratelocal = massflowratelocal * fact /
timeref * blk / cellarea * internalflowfact * inflowfact
1133 fx = massflowratelocal *
ssi(i, j, 1) * vxm
1134 fy = massflowratelocal *
ssi(i, j, 2) * vym
1135 fz = massflowratelocal *
ssi(i, j, 3) * vzm
1137 fmom(1) = fmom(1) + fx
1138 fmom(2) = fmom(2) + fy
1139 fmom(3) = fmom(3) + fz
1141 mx = yc * fz - zc * fy
1142 my = zc * fx - xc * fz
1143 mz = xc * fy - yc * fx
1145 mmom(1) = mmom(1) + mx
1146 mmom(2) = mmom(2) + my
1147 mmom(3) = mmom(3) + mz
1154 cofsumfx(1) = cofsumfx(1) + xco * fx
1155 cofsumfx(2) = cofsumfx(2) + yco * fx
1156 cofsumfx(3) = cofsumfx(3) + zco * fx
1159 cofsumfy(1) = cofsumfy(1) + xco * fy
1160 cofsumfy(2) = cofsumfy(2) + yco * fy
1161 cofsumfy(3) = cofsumfy(3) + zco * fy
1164 cofsumfz(1) = cofsumfz(1) + xco * fz
1165 cofsumfz(2) = cofsumfz(2) + yco * fz
1166 cofsumfz(3) = cofsumfz(3) + zco * fz
1172 localvalues(
iarea) = localvalues(
iarea) + area
1179 localvalues(
ifp:
ifp + 2) = localvalues(
ifp:
ifp + 2) + fp
1208 #ifndef USE_TAPENADE
1216 integer(kind=intType) :: nGroups, nCost, nFamMax
1217 integer(kind=intType),
dimension(nGroups, nFamMax) :: famLists
1218 real(kind=realtype),
dimension(nCost, nGroups),
intent(out) :: funcvalues
1243 integer(kind=intType),
dimension(:, :),
intent(in),
target :: famLists
1244 real(kind=realtype),
dimension(:, :),
intent(out) :: funcvalues
1245 real(kind=realtype),
optional,
intent(out),
dimension(:, :, :) :: globalvalues
1248 real(kind=realtype),
dimension(nLocalValues, nTimeIntervalsSpectral) :: localval, globalval
1249 integer(kind=intType) :: nn, sps, ierr, iGroup, nFam
1250 integer(kind=intType),
dimension(:),
pointer :: famList
1253 grouploop:
do igroup = 1,
size(famlists, 1)
1256 nfam = famlists(igroup, 1)
1257 famlist => famlists(igroup, 2:2 + nfam - 1)
1258 funcvalues(:, igroup) =
zero
1291 call echk(ierr, __file__, __line__)
1297 if (
present(globalvalues))
then
1298 globalvalues(:, :, igroup) = globalval
1328 real(kind=realtype),
dimension(nLocalValues),
intent(inout) :: localvalues
1329 integer(kind=intType),
dimension(:),
intent(in) :: famList
1332 integer(kind=intType) :: mm
1356 end if isinflowoutflow
1378 integer(kind=intType),
dimension(:),
intent(in) :: famList
1379 integer(kind=intType) :: mm, nn, sps
1380 integer(kind=intType) :: i, j, ii, blk, ierr
1381 real(kind=realtype) :: cp, plocal, tmp, cpmin_local
1392 cpmin_local = 10000.0_realtype
1415 if (
bcdata(mm)%iblank(i, j) .eq.
one)
then
1420 cp = tmp * (plocal -
pinf)
1423 cpmin_local = min(cpmin_local, cp)
1432 call mpi_allreduce(cpmin_local,
cpmin_family(sps), 1, mpi_double, &
1434 call echk(ierr, __file__, __line__)
1455 integer(kind=intType),
dimension(:),
intent(in) :: famList
1456 integer(kind=intType) :: mm, nn, sps
1457 integer(kind=intType) :: i, j, ii, blk, ierr
1458 real(kind=realtype) :: sepsensor_local
1459 real(kind=realtype) :: vecttangential(3), v(3)
1460 real(kind=realtype) :: vectdotproductfsnormal, sensor
1471 sepsensor_local = -10000.0_realtype
1494 if (
bcdata(mm)%iblank(i, j) .eq.
one)
then
1499 v = v / (sqrt(v(1)**2 + v(2)**2 + v(3)**2) + 1e-16)
1506 vectdotproductfsnormal *
bcdata(mm)%norm(i, j, 1)
1508 vectdotproductfsnormal *
bcdata(mm)%norm(i, j, 2)
1510 vectdotproductfsnormal *
bcdata(mm)%norm(i, j, 3)
1512 vecttangential = vecttangential / &
1513 (sqrt(vecttangential(1)**2 + vecttangential(2)**2 + &
1514 vecttangential(3)**2) + 1e-16)
1518 sensor = (v(1) * vecttangential(1) + v(2) * vecttangential(2) + &
1519 v(3) * vecttangential(3))
1526 sepsensor_local = max(sepsensor_local, sensor)
1537 call mpi_allreduce(sepsensor_local,
sepsenmaxfamily(sps), 1, mpi_double, &
1539 call echk(ierr, __file__, __line__)
1559 real(kind=realtype),
dimension(nLocalValues),
intent(inout) :: localvalues, localvaluesd
1560 integer(kind=intType),
dimension(:),
intent(in) :: famList
1563 integer(kind=intType) :: mm
1588 end if isinflowoutflow
1607 real(kind=realtype),
dimension(nLocalValues),
intent(inout) :: localvalues, localvaluesd
1608 integer(kind=intType),
dimension(:),
intent(in) :: famList
1610 integer(kind=intType) :: mm
1633 end if isinflowoutflow
1657 integer(kind=intType),
dimension(:, :),
target,
intent(in) :: famLists
1658 real(kind=realtype),
dimension(:, :),
intent(out) :: funcvalues, funcvaluesd
1661 real(kind=realtype),
dimension(nLocalValues, nTimeIntervalsSpectral) :: localval, globalval
1662 real(kind=realtype),
dimension(nLocalValues, nTimeIntervalsSpectral) :: localvald, globalvald
1663 integer(kind=intType) :: nn, sps, ierr, iGroup, nFam
1664 integer(kind=intType),
dimension(:),
pointer :: famList
1666 grouploop:
do igroup = 1,
size(famlists, 1)
1669 nfam = famlists(igroup, 1)
1670 famlist => famlists(igroup, 2:2 + nfam - 1)
1704 call echk(ierr, __file__, __line__)
1709 call echk(ierr, __file__, __line__)
1714 call getcostfunctions_d(globalval, globalvald, funcvalues(:, igroup), funcvaluesd(:, igroup))
1744 integer(kind=intType),
dimension(:, :),
target,
intent(in) :: famLists
1745 real(kind=realtype),
dimension(:, :) :: funcvalues, funcvaluesd
1748 real(kind=realtype),
dimension(nLocalValues, nTimeIntervalsSpectral) :: localval, globalval
1749 real(kind=realtype),
dimension(nLocalValues, nTimeIntervalsSpectral) :: localvald, globalvald
1750 real(kind=realtype),
dimension(nLocalValues, nTimeIntervalsSpectral, size(famLists, 1)) :: globalvalues
1751 integer(kind=intType) :: nn, sps, ierr, iGroup, nFam
1752 integer(kind=intType),
dimension(:),
pointer :: famList
1754 call getsolution(famlists, funcvalues, globalvalues)
1756 grouploop:
do igroup = 1,
size(famlists, 1)
1759 nfam = famlists(igroup, 1)
1760 famlist => famlists(igroup, 2:2 + nfam - 1)
1776 globalval = globalvalues(:, :, igroup)
1779 call getcostfunctions_b(globalval, globalvald, funcvalues(:, igroup), funcvaluesd(:, igroup))
1780 localvald = globalvald
1786 call echk(ierr, __file__, __line__)
subroutine integrateactuatorregions_d(localValues, localValuesd, famList, sps)
subroutine integrateactuatorregions_b(localValues, localValuesd, famList, sps)
subroutine integrateactuatorregions(localValues, famList, sps)
real(kind=realtype), dimension(:, :), pointer rlv2
real(kind=realtype), dimension(:, :), pointer gamma2
real(kind=realtype), dimension(:, :), pointer dd2wall
real(kind=realtype), dimension(:, :), pointer rlv1
real(kind=realtype), dimension(:, :), pointer pp1
real(kind=realtype), dimension(:, :), pointer sface
real(kind=realtype), dimension(:, :, :), pointer ww1
real(kind=realtype), dimension(:, :), pointer pp2
real(kind=realtype), dimension(:, :, :), pointer xx
real(kind=realtype), dimension(:, :), pointer gamma1
real(kind=realtype), dimension(:, :, :), pointer ww2
real(kind=realtype), dimension(:, :, :), pointer ssi
real(kind=realtype), dimension(:, :, :), pointer sfacek
real(kind=realtype), dimension(:, :, :), pointer gamma
logical addgridvelocities
integer(kind=inttype) spectralsol
real(kind=realtype), dimension(:, :, :), pointer p
real(kind=realtype), dimension(:, :, :), pointer sfacei
type(viscsubfacetype), dimension(:), pointer viscsubface
type(bcdatatype), dimension(:), pointer bcdatad
real(kind=realtype), dimension(:, :, :), pointer rlv
integer(kind=inttype), dimension(:), pointer bcfaceid
real(kind=realtype), dimension(:, :, :, :), pointer si
integer(kind=inttype) nbocos
real(kind=realtype), dimension(:, :, :, :), pointer sj
real(kind=realtype), dimension(:, :, :), pointer rev
integer(kind=inttype), dimension(:), pointer bctype
real(kind=realtype), dimension(:, :, :, :), pointer sk
real(kind=realtype), dimension(:, :, :), pointer sfacej
real(kind=realtype), dimension(:, :, :, :), pointer x
integer adflow_comm_world
integer(kind=inttype), parameter costfuncaxismoment
integer(kind=inttype), parameter costfunccfyqdot
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 nlocalvalues
integer(kind=inttype), parameter costfunccmzqdot
integer(kind=inttype), parameter costfuncforceypressure
integer(kind=inttype), parameter costfunccoforcexx
integer(kind=inttype), parameter imax
integer(kind=inttype), parameter costfuncclalpha
integer(kind=inttype), parameter supersonicinflow
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 costfunccmzalpha
integer(kind=inttype), parameter costfuncmdot
integer(kind=inttype), parameter costfuncdragcoef
integer(kind=inttype), parameter costfuncdragcoefmomentum
integer(kind=inttype), parameter supersonicoutflow
integer(kind=inttype), parameter costfunccd0
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 costfunccmzalphadot
integer(kind=inttype), parameter costfuncforceymomentum
integer(kind=inttype), parameter costfuncliftviscous
integer(kind=inttype), parameter costfuncclalphadot
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 costfunccdalphadot
integer(kind=inttype), parameter ipower
integer(kind=inttype), parameter ifv
integer(kind=inttype), parameter costfuncsepsensorksarea
integer(kind=inttype), parameter costfunccdq
integer(kind=inttype), parameter subsonicoutflow
integer(kind=inttype), parameter iyplus
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 costfunccfyq
integer(kind=inttype), parameter costfuncmavgps
integer(kind=inttype), parameter costfunccm0
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 costfunccdalpha
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 costfunccfyalpha
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 costfunccl0
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 costfunccdqdot
integer(kind=inttype), parameter costfunccmzq
integer(kind=inttype), parameter costfunclift
integer(kind=inttype), parameter costfunccoforcezy
integer(kind=inttype), parameter costfuncmavgttot
integer(kind=inttype), parameter costfuncliftcoef
integer(kind=inttype), parameter costfunccfyalphadot
integer(kind=inttype), parameter subsonicinflow
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 costfuncclqdot
integer(kind=inttype), parameter costfuncsepsensor
integer(kind=inttype), parameter costfuncsepsensorks
integer(kind=inttype), parameter costfuncclq
integer(kind=inttype), parameter isepsensorks
integer(kind=inttype), parameter icavitation
integer(kind=inttype), parameter ransequations
integer(kind=inttype), parameter imassttot
integer(kind=inttype), parameter jmin
integer(kind=inttype), parameter costfuncforcezcoef
integer(kind=inttype), parameter costfunccfy0
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 computettot(rho, u, v, w, p, Ttot)
subroutine computeptot(rho, u, v, w, p, ptot)
real(kind=realtype) gammainf
real(kind=realtype) rhoref
real(kind=realtype) rhoinf
real(kind=realtype) timeref
integer, parameter realtype
logical function faminlist(famID, famList)
subroutine wallintegrationface_b(localvalues, localvaluesd, mm)
subroutine getcostfunctions_b(globalvals, globalvalsd, funcvalues, funcvaluesd)
subroutine flowintegrationface_b(isinflow, localvalues, localvaluesd, mm)
subroutine getcostfunctions_d(globalvals, globalvalsd, funcvalues, funcvaluesd)
subroutine wallintegrationface_d(localvalues, localvaluesd, mm)
subroutine flowintegrationface_d(isinflow, localvalues, localvaluesd, mm)
subroutine getsolution_b(famLists, funcValues, funcValuesd)
subroutine ksaggregationfunction(g, max_g, g_rho, ks_g)
subroutine getsolutionwrap(famLists, funcValues, nCost, nGroups, nFamMax)
subroutine integratesurfaces_b(localValues, localValuesd, famList)
subroutine getcostfunctions(globalVals, funcValues)
subroutine getsolution_d(famLists, funcValues, funcValuesd)
subroutine integratesurfaces_d(localValues, localValuesd, famList)
subroutine computecpminfamily(famList)
subroutine integratesurfaces(localValues, famList)
subroutine wallintegrationface(localValues, mm)
subroutine computesepsenmaxfamily(famList)
subroutine getsolution(famLists, funcValues, globalValues)
subroutine flowintegrationface(isInflow, localValues, mm)
subroutine integrateusersurfaces_d(localValues, localValuesd, famList, sps)
subroutine integrateusersurfaces(localValues, famList, sps)
subroutine integrateusersurfaces_b(localValues, localValuesd, famList, sps)
logical function iswalltype(bType)
subroutine setbcpointers(nn, spatialPointers)
subroutine setpointers_d(nn, level, sps)
real(kind=realtype) function mynorm2(x)
subroutine computetsderivatives(force, moment, coef0, dcdalpha, dcdalphadot, dcdq, dcdqdot)
subroutine setbcpointers_d(nn, spatialpointers)
subroutine echk(errorcode, file, line)
subroutine setpointers_b(nn, level, sps)
subroutine setpointers(nn, mm, ll)
subroutine integratezippers_b(localValues, localValuesd, famList, sps)
subroutine integratezippers_d(localValues, localValuesd, famList, sps)
subroutine integratezippers(localValues, famList, sps)