11 use flowvarrefstate,
only:
pref,
pinf,
rhoref,
pref,
timeref,
lref,
tref,
rgas,
uref,
uinf,
rhoinf,
gammainf
19 logical,
intent(in) :: isInflow
20 integer(kind=intType),
intent(in),
dimension(:, :) :: conn
21 integer(kind=intType),
intent(in),
dimension(:) :: fams
22 real(kind=realtype),
dimension(:, :),
intent(in) :: vars
23 real(kind=realtype),
dimension(nLocalValues),
intent(inout) :: localvalues
24 integer(kind=intType),
dimension(:),
intent(in) :: famList
25 integer(kind=intType),
intent(in) :: sps
26 logical(kind=intType),
dimension(:),
optional,
intent(in) :: ptValid
29 integer(kind=intType) :: i, j
30 real(kind=realtype) :: sf, vmag, vnm, vxm, vym, vzm, fx, fy, fz, u, v, w, vnmfreestreamref
31 real(kind=realtype),
dimension(3) :: fp, mp, fmom, mmom, refpoint, ss, x1, x2, x3, &
33 real(kind=realtype) :: pm, ptot, ttot, rhom, gammam, mnm, massflowratelocal, am
34 real(kind=realtype) :: massflowrate, mass_ptot, mass_ttot, mass_ps, mass_mn, mass_a, mass_rho, &
35 mass_vx, mass_vy, mass_vz, mass_nx, mass_ny, mass_nz, mass_vi
36 real(kind=realtype) :: area, cellarea, overcellarea
37 real(kind=realtype) :: area_ptot, area_ps
38 real(kind=realtype) :: govgm1, gm1ovg, viconst, vilocal, pratio
39 real(kind=realtype) :: mredim
40 real(kind=realtype) :: internalflowfact, inflowfact, xc, xco, yc, yco, zc, zco, mx, my, mz
41 real(kind=realtype),
dimension(3) :: cofsumfx, cofsumfy, cofsumfz
79 internalflowfact =
one
81 internalflowfact = -
one
90 do i = 1,
size(conn, 2)
96 if (
present(ptvalid))
then
98 if ((ptvalid(conn(1, i)) .eqv. .false.) .or. &
99 (ptvalid(conn(2, i)) .eqv. .false.) .or. &
100 (ptvalid(conn(3, i)) .eqv. .false.))
then
105 validtrianlge:
if (triisvalid)
then
111 rhom = rhom + vars(conn(j, i),
irho)
112 vxm = vxm + vars(conn(j, i),
ivx)
113 vym = vym + vars(conn(j, i),
ivy)
114 vzm = vzm + vars(conn(j, i),
ivz)
115 pm = pm + vars(conn(j, i),
irhoe)
126 gammam =
third * gammam
139 vnm = vxm * ss(1) + vym * ss(2) + vzm * ss(3) - sf
141 vmag = sqrt((vxm**2 + vym**2 + vzm**2)) - sf
142 am = sqrt(gammam * pm / rhom)
143 mnm = vmag / sqrt(gammam * pm / rhom)
145 cellarea = sqrt(ss(1)**2 + ss(2)**2 + ss(3)**2)
146 area = area + cellarea
147 overcellarea = 1 / cellarea
149 massflowratelocal = rhom * vnm * mredim
150 massflowrate = massflowrate + massflowratelocal
154 mass_ptot = mass_ptot + ptot * massflowratelocal *
pref
155 mass_ttot = mass_ttot + ttot * massflowratelocal *
tref
156 mass_rho = mass_rho + rhom * massflowratelocal *
rhoref
157 mass_a = mass_a + am * massflowratelocal *
uref
159 mass_ps = mass_ps + pm * massflowratelocal
160 mass_mn = mass_mn + mnm * massflowratelocal
162 area_ptot = area_ptot + ptot *
pref * cellarea
163 area_ps = area_ps + pm * cellarea
165 sfacecoordref(1) = sf * ss(1) * overcellarea
166 sfacecoordref(2) = sf * ss(2) * overcellarea
167 sfacecoordref(3) = sf * ss(3) * overcellarea
169 mass_vx = mass_vx + (vxm *
uref - sfacecoordref(1)) * massflowratelocal
170 mass_vy = mass_vy + (vym *
uref - sfacecoordref(2)) * massflowratelocal
171 mass_vz = mass_vz + (vzm *
uref - sfacecoordref(3)) * massflowratelocal
174 gm1ovg =
one / govgm1
183 pratio = min(
one,
one / ptot)
184 vilocal = sqrt(viconst * (
one - (pratio)**gm1ovg) * ttot *
tref)
185 mass_vi = mass_vi + vilocal * massflowratelocal
187 mass_nx = mass_nx + ss(1) * overcellarea * massflowratelocal
188 mass_ny = mass_ny + ss(2) * overcellarea * massflowratelocal
189 mass_nz = mass_nz + ss(3) * overcellarea * massflowratelocal
207 xc = xco - refpoint(1)
208 yc = yco - refpoint(2)
209 zc = zco - refpoint(3)
221 mx = yc * fz - zc * fy
222 my = zc * fx - xc * fz
223 mz = xc * fy - yc * fx
231 cofsumfx(1) = cofsumfx(1) + xco * fx
232 cofsumfx(2) = cofsumfx(2) + yco * fx
233 cofsumfx(3) = cofsumfx(3) + zco * fx
236 cofsumfy(1) = cofsumfy(1) + xco * fy
237 cofsumfy(2) = cofsumfy(2) + yco * fy
238 cofsumfy(3) = cofsumfy(3) + zco * fy
241 cofsumfz(1) = cofsumfz(1) + xco * fz
242 cofsumfz(2) = cofsumfz(2) + yco * fz
243 cofsumfz(3) = cofsumfz(3) + zco * fz
249 massflowratelocal = massflowratelocal /
timeref * internalflowfact * inflowfact
251 fx = massflowratelocal * ss(1) * vxm
252 fy = massflowratelocal * ss(2) * vym
253 fz = massflowratelocal * ss(3) * vzm
255 fmom(1) = fmom(1) - fx
256 fmom(2) = fmom(2) - fy
257 fmom(3) = fmom(3) - fz
259 mx = yc * fz - zc * fy
260 my = zc * fx - xc * fz
261 mz = xc * fy - yc * fx
263 mmom(1) = mmom(1) + mx
264 mmom(2) = mmom(2) + my
265 mmom(3) = mmom(3) + mz
269 cofsumfx(1) = cofsumfx(1) + xco * fx
270 cofsumfx(2) = cofsumfx(2) + yco * fx
271 cofsumfx(3) = cofsumfx(3) + zco * fx
274 cofsumfy(1) = cofsumfy(1) + xco * fy
275 cofsumfy(2) = cofsumfy(2) + yco * fy
276 cofsumfy(3) = cofsumfy(3) + zco * fy
279 cofsumfz(1) = cofsumfz(1) + xco * fz
280 cofsumfz(2) = cofsumfz(2) + yco * fz
281 cofsumfz(3) = cofsumfz(3) + zco * fz
288 localvalues(
iarea) = localvalues(
iarea) + area
295 localvalues(
ifp:
ifp + 2) = localvalues(
ifp:
ifp + 2) + fp
327 integer(kind=intType),
intent(in),
dimension(:, :) :: conn
328 integer(kind=intType),
intent(in),
dimension(:) :: fams
329 real(kind=realtype),
intent(in),
dimension(:, :) :: vars
330 real(kind=realtype),
intent(inout) :: localvalues(
nlocalvalues)
331 integer(kind=intType),
dimension(:),
intent(in) :: famList
332 integer(kind=intType),
intent(in) :: sps
335 real(kind=realtype),
dimension(3) :: fp, fv, mp, mv
336 real(kind=realtype),
dimension(3) :: cofsumfx, cofsumfy, cofsumfz
338 integer(kind=intType) :: i, j
339 real(kind=realtype),
dimension(3) :: ss, norm, refpoint
340 real(kind=realtype),
dimension(3) :: p1, p2, p3, v1, v2, v3, x1, x2, x3
341 real(kind=realtype) :: fact,
triarea, fx, fy, fz, mx, my, mz, xc, xco, yc, yco, zc, zco
357 do i = 1,
size(conn, 2)
371 xco =
third * (x1(1) + x2(1) + x3(1))
372 yco =
third * (x1(2) + x2(2) + x3(2))
373 zco =
third * (x1(3) + x2(3) + x3(3))
375 xc = xco - refpoint(1)
376 yc = yco - refpoint(2)
377 zc = zco - refpoint(3)
384 fx = (p1(1) + p2(1) + p3(1)) *
triarea
385 fy = (p1(2) + p2(2) + p3(2)) *
triarea
386 fz = (p1(3) + p2(3) + p3(3)) *
triarea
392 mx = yc * fz - zc * fy
393 my = zc * fx - xc * fz
394 mz = xc * fy - yc * fx
403 cofsumfx(1) = cofsumfx(1) + xco * fx
404 cofsumfx(2) = cofsumfx(2) + yco * fx
405 cofsumfx(3) = cofsumfx(3) + zco * fx
408 cofsumfy(1) = cofsumfy(1) + xco * fy
409 cofsumfy(2) = cofsumfy(2) + yco * fy
410 cofsumfy(3) = cofsumfy(3) + zco * fy
413 cofsumfz(1) = cofsumfz(1) + xco * fz
414 cofsumfz(2) = cofsumfz(2) + yco * fz
415 cofsumfz(3) = cofsumfz(3) + zco * fz
422 fx = (v1(1) + v2(1) + v3(1)) *
triarea
423 fy = (v1(2) + v2(2) + v3(2)) *
triarea
424 fz = (v1(3) + v2(3) + v3(3)) *
triarea
431 mx = yc * fz - zc * fy
432 my = zc * fx - xc * fz
433 mz = xc * fy - yc * fx
442 cofsumfx(1) = cofsumfx(1) + xco * fx
443 cofsumfx(2) = cofsumfx(2) + yco * fx
444 cofsumfx(3) = cofsumfx(3) + zco * fx
447 cofsumfy(1) = cofsumfy(1) + xco * fy
448 cofsumfy(2) = cofsumfy(2) + yco * fy
449 cofsumfy(3) = cofsumfy(3) + zco * fy
452 cofsumfz(1) = cofsumfz(1) + xco * fz
453 cofsumfz(2) = cofsumfz(2) + yco * fz
454 cofsumfz(3) = cofsumfz(3) + zco * fz
459 localvalues(
ifp:
ifp + 2) = localvalues(
ifp:
ifp + 2) + fp
460 localvalues(
ifv:
ifv + 2) = localvalues(
ifv:
ifv + 2) + fv
461 localvalues(
imp:
imp + 2) = localvalues(
imp:
imp + 2) + mp
462 localvalues(
imv:
imv + 2) = localvalues(
imv:
imv + 2) + mv
488 real(kind=realtype),
dimension(nLocalValues),
intent(inout) :: localvalues
489 integer(kind=intType),
dimension(:),
intent(in) :: famList
490 integer(kind=intType),
intent(in) :: sps
491 real(kind=realtype),
dimension(:, :),
allocatable :: vars
496 if (zipper%allocated)
then
515 if (zipper%allocated)
then
527 localvalues, famlist, sps)
535 if (zipper%allocated)
then
547 localvalues, famlist, sps)
569 real(kind=realtype),
dimension(nLocalValues),
intent(inout) :: localvalues, localvaluesd
570 integer(kind=intType),
dimension(:),
intent(in) :: famlist
571 integer(kind=intType),
intent(in) :: sps
572 real(kind=realtype),
dimension(:, :),
allocatable :: vars, varsd
576 if (zipper%allocated)
then
588 localvalues, localvaluesd, famlist, sps)
591 deallocate (vars, varsd)
596 if (zipper%allocated)
then
608 localvalues, localvaluesd, famlist, sps)
611 deallocate (vars, varsd)
616 if (zipper%allocated)
then
628 localvalues, localvaluesd, famlist, sps)
631 deallocate (vars, varsd)
650 real(kind=realtype),
dimension(nLocalValues),
intent(inout) :: localvalues, localvaluesd
651 integer(kind=intType),
dimension(:),
intent(in) :: famlist
652 integer(kind=intType),
intent(in) :: sps
653 real(kind=realtype),
dimension(:, :),
allocatable :: vars, varsd
658 if (zipper%allocated)
then
670 localvalues, localvaluesd, famlist, sps)
678 deallocate (vars, varsd)
683 if (zipper%allocated)
then
695 localvalues, localvaluesd, famlist, sps)
703 deallocate (vars, varsd)
708 if (zipper%allocated)
then
720 localvalues, localvaluesd, famlist, sps)
728 deallocate (vars, varsd)
integer(kind=inttype), dimension(:), pointer bctype
integer(kind=inttype), parameter imassvz
integer(kind=inttype), parameter iareaps
real(kind=realtype), parameter zero
integer(kind=inttype), parameter nlocalvalues
integer(kind=inttype), parameter izippflowy
integer(kind=inttype), parameter iflowmp
integer(kind=inttype), parameter imassnx
integer(kind=inttype), parameter imassflow
real(kind=realtype), parameter third
integer(kind=inttype), parameter icoforcez
integer(kind=inttype), parameter imassptot
integer(kind=inttype), parameter iflowfm
integer(kind=inttype), parameter izippwallz
integer(kind=inttype), parameter izippflowx
integer(kind=inttype), parameter imassnz
integer(kind=inttype), parameter imp
integer(kind=inttype), parameter imassa
integer(kind=inttype), parameter ifv
integer(kind=inttype), parameter imassny
integer(kind=inttype), parameter ibcgroupoutflow
integer(kind=inttype), parameter izippflowsface
integer(kind=inttype), parameter icoforcex
real(kind=realtype), parameter one
integer(kind=inttype), parameter iflowmm
integer(kind=inttype), parameter imassvy
real(kind=realtype), parameter half
integer(kind=inttype), parameter imassvx
integer(kind=inttype), parameter imassrho
integer(kind=inttype), parameter izippwalltpz
integer(kind=inttype), parameter imassmn
integer(kind=inttype), parameter icoforcey
integer(kind=inttype), parameter ibcgroupinflow
integer(kind=inttype), parameter iarea
integer(kind=inttype), parameter imassvi
real(kind=realtype), parameter two
integer(kind=inttype), parameter imv
integer(kind=inttype), parameter imassps
integer(kind=inttype), parameter izippwalltvx
integer(kind=inttype), parameter izippflowgamma
integer(kind=inttype), parameter izippwalltvz
integer(kind=inttype), parameter nzippflowcomm
integer(kind=inttype), parameter ibcgroupwalls
integer(kind=inttype), parameter nzippwallcomm
integer(kind=inttype), parameter izippwalltpx
integer(kind=inttype), parameter imassttot
integer(kind=inttype), parameter izippwallx
integer(kind=inttype), parameter internalflow
integer(kind=inttype), parameter ifp
integer(kind=inttype), parameter iareaptot
integer(kind=inttype), parameter izippflowz
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
subroutine wallintegrationzippercomm(vars, sps)
subroutine wallintegrationzippercomm_b(vars, varsd, sps)
subroutine flowintegrationzippercomm_b(isInflow, vars, varsd, sps)
subroutine wallintegrationzippercomm_d(vars, varsd, sps)
subroutine flowintegrationzippercomm_d(isInflow, vars, varsd, sps)
subroutine flowintegrationzippercomm(isInflow, vars, sps)
type(zippermesh), dimension(nfamexchange), target zippermeshes
logical function faminlist(famID, famList)
type(familyexchange), dimension(:, :), allocatable, target bcfamexchange
subroutine cross_prod(a, b, c)
real(kind=realtype) function mynorm2(x)
subroutine flowintegrationzipper_b(isinflow, conn, fams, vars, varsd, localvalues, localvaluesd, famlist, sps, ptvalid)
subroutine wallintegrationzipper_b(conn, fams, vars, varsd, localvalues, localvaluesd, famlist, sps)
subroutine flowintegrationzipper_d(isinflow, conn, fams, vars, varsd, localvalues, localvaluesd, famlist, sps, ptvalid)
subroutine wallintegrationzipper_d(conn, fams, vars, varsd, localvalues, localvaluesd, famlist, sps)
subroutine integratezippers_b(localValues, localValuesd, famList, sps)
subroutine integratezippers_d(localValues, localValuesd, famList, sps)
subroutine integratezippers(localValues, famList, sps)
subroutine flowintegrationzipper(isInflow, conn, fams, vars, localValues, famList, sps, ptValid)
subroutine wallintegrationzipper(conn, fams, vars, localValues, famList, sps)
real(kind=realtype) function triarea(pt1, pt2, pt3)