43 REAL,
PARAMETER :: tsim = 30.0
44 REAL,
PARAMETER :: gamma = 1.4
45 REAL,
PARAMETER :: re = 1.0e+4
47 REAL,
PARAMETER :: rho0 = 1.0
48 REAL,
PARAMETER :: v0 =-0.5
49 REAL,
PARAMETER :: p0 = 2.5
50 REAL,
PARAMETER :: rho1 = 2.0
51 REAL,
PARAMETER :: v1 = 0.5
52 REAL,
PARAMETER :: p1 = p0
54 INTEGER,
PARAMETER :: mgeo = cartesian
55 INTEGER,
PARAMETER :: res = 10
56 REAL,
PARAMETER :: xyzlen= 1.0
58 INTEGER,
PARAMETER :: onum = 10
59 CHARACTER(LEN=256),
PARAMETER &
61 CHARACTER(LEN=256),
PARAMETER &
67 REAL :: sigma_1,sigma_2,sigma_3,sigma_4,sigma_5,sigma_6
68 INTEGER,
DIMENSION(:),
ALLOCATABLE :: seed
69 REAL,
DIMENSION(:,:,:,:),
ALLOCATABLE :: &
70 pvar_xy,pvar_xz,pvar_yx,pvar_yz,pvar_zx,pvar_zy, pvar_temp
72 CLASS(
fosite),
ALLOCATABLE :: sim
77 CALL random_seed(size=n)
84 CALL setattr(sim%config,
"/datafile/filename", (trim(odir) // trim(ofname) //
"_xy"))
87 ALLOCATE(pvar_xy(sim%Mesh%IGMIN:sim%Mesh%IGMAX,sim%Mesh%JGMIN:sim%Mesh%JGMAX,sim%Mesh%KGMIN:sim%Mesh%KGMAX,sim%Physics%VNUM))
88 ALLOCATE(pvar_xz(sim%Mesh%IGMIN:sim%Mesh%IGMAX,sim%Mesh%JGMIN:sim%Mesh%JGMAX,sim%Mesh%KGMIN:sim%Mesh%KGMAX,sim%Physics%VNUM))
89 ALLOCATE(pvar_yx(sim%Mesh%IGMIN:sim%Mesh%IGMAX,sim%Mesh%JGMIN:sim%Mesh%JGMAX,sim%Mesh%KGMIN:sim%Mesh%KGMAX,sim%Physics%VNUM))
90 ALLOCATE(pvar_yz(sim%Mesh%IGMIN:sim%Mesh%IGMAX,sim%Mesh%JGMIN:sim%Mesh%JGMAX,sim%Mesh%KGMIN:sim%Mesh%KGMAX,sim%Physics%VNUM))
91 ALLOCATE(pvar_zx(sim%Mesh%IGMIN:sim%Mesh%IGMAX,sim%Mesh%JGMIN:sim%Mesh%JGMAX,sim%Mesh%KGMIN:sim%Mesh%KGMAX,sim%Physics%VNUM))
92 ALLOCATE(pvar_zy(sim%Mesh%IGMIN:sim%Mesh%IGMAX,sim%Mesh%JGMIN:sim%Mesh%JGMAX,sim%Mesh%KGMIN:sim%Mesh%KGMAX,sim%Physics%VNUM))
93 ALLOCATE(pvar_temp(sim%Mesh%IGMIN:sim%Mesh%IGMAX,sim%Mesh%JGMIN:sim%Mesh%JGMAX,sim%Mesh%KGMIN:sim%Mesh%KGMAX,sim%Physics%VNUM))
94 CALL initdata(sim%Mesh, sim%Physics, sim%Timedisc,
'xy',.false.)
96 pvar_xy(:,:,:,:) = sim%Timedisc%pvar%data4d(:,:,:,:)
97 CALL sim%Finalize(.false.)
102 CALL sim%InitFosite()
104 CALL setattr(sim%config,
"/datafile/filename", (trim(odir) // trim(ofname) //
"_yx"))
106 CALL initdata(sim%Mesh, sim%Physics, sim%Timedisc,
'yx',.true.)
108 pvar_yx(:,:,:,:) = sim%Timedisc%pvar%data4d(:,:,:,:)
109 CALL sim%Finalize(.false.)
114 CALL sim%InitFosite()
116 CALL setattr(sim%config,
"/datafile/filename", (trim(odir) // trim(ofname) //
"_xz"))
118 CALL initdata(sim%Mesh, sim%Physics, sim%Timedisc,
'xz',.true.)
120 pvar_xz(:,:,:,:) = sim%Timedisc%pvar%data4d(:,:,:,:)
121 CALL sim%Finalize(.false.)
125 CALL sim%InitFosite()
127 CALL setattr(sim%config,
"/datafile/filename", (trim(odir) // trim(ofname) //
"_zx"))
129 CALL initdata(sim%Mesh, sim%Physics, sim%Timedisc,
'zx',.true.)
131 pvar_zx(:,:,:,:) = sim%Timedisc%pvar%data4d(:,:,:,:)
132 CALL sim%Finalize(.false.)
136 CALL sim%InitFosite()
138 CALL setattr(sim%config,
"/datafile/filename", (trim(odir) // trim(ofname) //
"_zy"))
140 CALL initdata(sim%Mesh, sim%Physics, sim%Timedisc,
'zy',.true.)
142 pvar_zy(:,:,:,:) = sim%Timedisc%pvar%data4d(:,:,:,:)
143 CALL sim%Finalize(.false.)
147 CALL sim%InitFosite()
149 CALL setattr(sim%config,
"/datafile/filename", (trim(odir) // trim(ofname) //
"_yz"))
151 CALL initdata(sim%Mesh, sim%Physics, sim%Timedisc,
'yz',.true.)
153 pvar_yz(:,:,:,:) = sim%Timedisc%pvar%data4d(:,:,:,:)
155 DO k=sim%Mesh%KGMIN, sim%Mesh%KGMAX
156 pvar_temp(:,:,k,sim%Physics%DENSITY) = transpose(pvar_xy(:,:,k,sim%Physics%DENSITY))
157 pvar_temp(:,:,k,sim%Physics%XVELOCITY) = transpose(pvar_xy(:,:,k,sim%Physics%YVELOCITY))
158 pvar_temp(:,:,k,sim%Physics%YVELOCITY) = transpose(pvar_xy(:,:,k,sim%Physics%XVELOCITY))
159 pvar_temp(:,:,k,sim%Physics%ZVELOCITY) = transpose(pvar_xy(:,:,k,sim%Physics%ZVELOCITY))
160 pvar_temp(:,:,k,sim%Physics%ENERGY) = transpose(pvar_xy(:,:,k,sim%Physics%ENERGY))
162 sigma_1 = sqrt(sum((pvar_temp(:,:,:,:) - pvar_yx(:,:,:,:))**2)/
SIZE(pvar_temp))
164 DO j=sim%Mesh%JGMIN, sim%Mesh%JGMAX
165 pvar_temp(:,j,:,sim%Physics%DENSITY) = transpose(pvar_xz(:,j,:,sim%Physics%DENSITY))
166 pvar_temp(:,j,:,sim%Physics%XVELOCITY) = transpose(pvar_xz(:,j,:,sim%Physics%ZVELOCITY))
167 pvar_temp(:,j,:,sim%Physics%YVELOCITY) = transpose(pvar_xz(:,j,:,sim%Physics%YVELOCITY))
168 pvar_temp(:,j,:,sim%Physics%ZVELOCITY) = transpose(pvar_xz(:,j,:,sim%Physics%XVELOCITY))
169 pvar_temp(:,j,:,sim%Physics%ENERGY) = transpose(pvar_xz(:,j,:,sim%Physics%ENERGY))
171 sigma_2 = sqrt(sum((pvar_temp(:,:,:,:) - pvar_zx(:,:,:,:))**2)/
SIZE(pvar_temp))
173 DO i=sim%Mesh%IGMIN, sim%Mesh%IGMAX
174 pvar_temp(i,:,:,sim%Physics%DENSITY) = transpose(pvar_zy(i,:,:,sim%Physics%DENSITY))
175 pvar_temp(i,:,:,sim%Physics%XVELOCITY) = transpose(pvar_zy(i,:,:,sim%Physics%XVELOCITY))
176 pvar_temp(i,:,:,sim%Physics%YVELOCITY) = transpose(pvar_zy(i,:,:,sim%Physics%ZVELOCITY))
177 pvar_temp(i,:,:,sim%Physics%ZVELOCITY) = transpose(pvar_zy(i,:,:,sim%Physics%YVELOCITY))
178 pvar_temp(i,:,:,sim%Physics%ENERGY) = transpose(pvar_zy(i,:,:,sim%Physics%ENERGY))
180 sigma_3 = sqrt(sum((pvar_temp(:,:,:,:) - pvar_yz(:,:,:,:))**2)/
SIZE(pvar_temp))
182 DO k=sim%Mesh%KGMIN, sim%Mesh%KGMAX
183 pvar_temp(:,:,k,sim%Physics%DENSITY) = transpose(pvar_zx(:,:,k,sim%Physics%DENSITY))
184 pvar_temp(:,:,k,sim%Physics%XVELOCITY) = transpose(pvar_zx(:,:,k,sim%Physics%YVELOCITY))
185 pvar_temp(:,:,k,sim%Physics%YVELOCITY) = transpose(pvar_zx(:,:,k,sim%Physics%XVELOCITY))
186 pvar_temp(:,:,k,sim%Physics%ZVELOCITY) = transpose(pvar_zx(:,:,k,sim%Physics%ZVELOCITY))
187 pvar_temp(:,:,k,sim%Physics%ENERGY) = transpose(pvar_zx(:,:,k,sim%Physics%ENERGY))
189 sigma_4 = sqrt(sum((pvar_temp(:,:,:,:) - pvar_zy(:,:,:,:))**2)/
SIZE(pvar_temp))
191 DO j=sim%Mesh%JGMIN, sim%Mesh%JGMAX
192 pvar_temp(:,j,:,sim%Physics%DENSITY) = transpose(pvar_yx(:,j,:,sim%Physics%DENSITY))
193 pvar_temp(:,j,:,sim%Physics%XVELOCITY) = transpose(pvar_yx(:,j,:,sim%Physics%ZVELOCITY))
194 pvar_temp(:,j,:,sim%Physics%YVELOCITY) = transpose(pvar_yx(:,j,:,sim%Physics%YVELOCITY))
195 pvar_temp(:,j,:,sim%Physics%ZVELOCITY) = transpose(pvar_yx(:,j,:,sim%Physics%XVELOCITY))
196 pvar_temp(:,j,:,sim%Physics%ENERGY) = transpose(pvar_yx(:,j,:,sim%Physics%ENERGY))
198 sigma_5 = sqrt(sum((pvar_temp(:,:,:,:) - pvar_yz(:,:,:,:))**2)/
SIZE(pvar_temp))
200 DO i=sim%Mesh%IGMIN, sim%Mesh%IGMAX
201 pvar_temp(i,:,:,sim%Physics%DENSITY) = transpose(pvar_xy(i,:,:,sim%Physics%DENSITY))
202 pvar_temp(i,:,:,sim%Physics%XVELOCITY) = transpose(pvar_xy(i,:,:,sim%Physics%XVELOCITY))
203 pvar_temp(i,:,:,sim%Physics%YVELOCITY) = transpose(pvar_xy(i,:,:,sim%Physics%ZVELOCITY))
204 pvar_temp(i,:,:,sim%Physics%ZVELOCITY) = transpose(pvar_xy(i,:,:,sim%Physics%YVELOCITY))
205 pvar_temp(i,:,:,sim%Physics%ENERGY) = transpose(pvar_xy(i,:,:,sim%Physics%ENERGY))
207 sigma_6 = sqrt(sum((pvar_temp(:,:,:,:) - pvar_xz(:,:,:,:))**2)/
SIZE(pvar_temp))
209 CALL sim%Finalize(.true.)
210 DEALLOCATE(sim,pvar_xy,pvar_xz,pvar_yx,pvar_yz,pvar_zx,pvar_zy,pvar_temp,seed)
211 tap_check_small(sigma_1,3*epsilon(sigma_1),
"xy-yx symmetry test")
212 tap_check_small(sigma_2,3*epsilon(sigma_2),
"xz-zx symmetry test")
213 tap_check_small(sigma_3,3*epsilon(sigma_3),
"zy-yz symmetry test")
214 tap_check_small(sigma_4,3*epsilon(sigma_4),
"zx-zy symmetry test")
215 tap_check_small(sigma_5,3*epsilon(sigma_5),
"yx-yz symmetry test")
216 tap_check_small(sigma_6,3*epsilon(sigma_6),
"xy-xz symmetry test")
227 TYPE(Dict_TYP),
POINTER :: config
230 TYPE(Dict_TYP),
POINTER :: mesh, physics, boundary, datafile, &
231 sources, timedisc, fluxes
236 "meshtype" / midpoint, &
241 "xmin" / (-0.5*xyzlen), &
242 "xmax" / (0.5*xyzlen), &
243 "ymin" / (-0.5*xyzlen), &
244 "ymax" / (0.5*xyzlen), &
245 "zmin" / (-0.5*xyzlen), &
246 "zmax" / (0.5*xyzlen), &
249 "output/rotation" / 0 &
262 "variables" / conservative, &
263 "limiter" / monocent, &
269 "western" / periodic, &
270 "eastern" / periodic, &
271 "southern" / periodic, &
272 "northern" / periodic, &
273 "bottomer" / periodic, &
274 "topper" / periodic &
281 dynvis = abs(rho0 * xyzlen * (v0-v1) / re)
282 IF (dynvis.GT.tiny(1.0))
THEN 284 "vis/stype" / viscosity, &
285 "vis/vismodel" / molecular, &
286 "vis/dynconst" / dynvis, &
287 "vis/bulkconst" / (-2./3.*dynvis), &
288 "vis/output/dynvis" / 0, &
289 "vis/output/stress" / 0, &
290 "vis/output/kinvis" / 0, &
291 "vis/output/bulkvis" / 0 &
297 "method" / modified_euler, &
301 "dtlimit" / 1.0e-10, &
313 "fileformat" / vtk, &
318 "filename" / (trim(odir) // trim(ofname)), &
324 "physics" / physics, &
325 "boundary" / boundary, &
327 "timedisc" / timedisc, &
329 "datafile" / datafile &
332 IF (
ASSOCIATED(sources)) &
333 CALL setattr(config,
"sources", sources)
339 SUBROUTINE initdata(Mesh,Physics,Timedisc,flow_dir,reuse_random_seed)
342 CLASS(physics_base) :: Physics
343 CLASS(mesh_base) :: Mesh
344 CLASS(timedisc_base) :: Timedisc
345 LOGICAL,
OPTIONAL :: reuse_random_seed
346 CHARACTER(2),
OPTIONAL :: flow_dir
350 REAL,
DIMENSION(Mesh%IGMIN:Mesh%IGMAX,Mesh%JGMIN:Mesh%JGMAX,Mesh%KGMIN:Mesh%KGMAX,3) :: dv,dv_temp
353 INTENT(IN) :: mesh,physics,flow_dir,reuse_random_seed
354 INTENT(INOUT) :: timedisc
357 IF (.NOT.(
PRESENT(reuse_random_seed).AND.reuse_random_seed))
THEN 359 CALL system_clock(count=clock)
360 seed = clock + (timedisc%getrank()+1) * (/(i-1, i=1,n)/)
362 CALL random_seed(put=seed)
363 CALL random_number(dv)
365 IF (
PRESENT(flow_dir).AND.flow_dir.EQ.
'yx')
THEN 367 print *,
"yx-Direction" 369 timedisc%pvar%data4d(:,:,:,physics%XVELOCITY) = 0.
370 timedisc%pvar%data4d(:,:,:,physics%ZVELOCITY) = 0.
372 WHERE ((mesh%bcenter(:,:,:,1).LT.(mesh%xmin+0.25*xyzlen)).OR. &
373 (mesh%bcenter(:,:,:,1).GT.(mesh%xmin+0.75*xyzlen)))
374 timedisc%pvar%data4d(:,:,:,physics%DENSITY) = rho0
375 timedisc%pvar%data4d(:,:,:,physics%YVELOCITY) = v0
376 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p0
378 timedisc%pvar%data4d(:,:,:,physics%DENSITY) = rho1
379 timedisc%pvar%data4d(:,:,:,physics%YVELOCITY) = v1
380 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p1
382 DO k = mesh%KGMIN, mesh%KGMAX
384 timedisc%pvar%data4d(:,:,k,physics%XVELOCITY) = timedisc%pvar%data4d(:,:,k,physics%XVELOCITY) &
385 + transpose(dv(:,:,k,2)-0.5)*0.2
386 timedisc%pvar%data4d(:,:,k,physics%YVELOCITY) = timedisc%pvar%data4d(:,:,k,physics%YVELOCITY) &
387 + transpose(dv(:,:,k,1)-0.5)*0.2
388 timedisc%pvar%data4d(:,:,k,physics%ZVELOCITY) = timedisc%pvar%data4d(:,:,k,physics%ZVELOCITY) &
389 + transpose(dv(:,:,k,3)-0.5)*0.2
392 ELSEIF (
PRESENT(flow_dir).AND.flow_dir.EQ.
'zx')
THEN 394 print *,
"zx-Direction" 396 timedisc%pvar%data4d(:,:,:,physics%XVELOCITY) = 0.
397 timedisc%pvar%data4d(:,:,:,physics%YVELOCITY) = 0.
399 WHERE ((mesh%bcenter(:,:,:,1).LT.(mesh%xmin+0.25*xyzlen)).OR. &
400 (mesh%bcenter(:,:,:,1).GT.(mesh%xmin+0.75*xyzlen)))
401 timedisc%pvar%data4d(:,:,:,physics%DENSITY) = rho0
402 timedisc%pvar%data4d(:,:,:,physics%ZVELOCITY) = v0
403 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p0
405 timedisc%pvar%data4d(:,:,:,physics%DENSITY) = rho1
406 timedisc%pvar%data4d(:,:,:,physics%ZVELOCITY) = v1
407 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p1
409 DO k = mesh%KGMIN,mesh%KGMAX
410 dv_temp(:,:,k,1) = transpose(dv(:,:,k,2))
411 dv_temp(:,:,k,2) = transpose(dv(:,:,k,1))
412 dv_temp(:,:,k,3) = transpose(dv(:,:,k,3))
414 DO i= mesh%IGMIN, mesh%IGMAX
416 timedisc%pvar%data4d(i,:,:,physics%XVELOCITY) = timedisc%pvar%data4d(i,:,:,physics%XVELOCITY) &
417 + transpose(dv_temp(i,:,:,1)-0.5)*0.2
418 timedisc%pvar%data4d(i,:,:,physics%YVELOCITY) = timedisc%pvar%data4d(i,:,:,physics%YVELOCITY) &
419 + transpose(dv_temp(i,:,:,3)-0.5)*0.2
420 timedisc%pvar%data4d(i,:,:,physics%ZVELOCITY) = timedisc%pvar%data4d(i,:,:,physics%ZVELOCITY) &
421 + transpose(dv_temp(i,:,:,2)-0.5)*0.2
423 ELSEIF (
PRESENT(flow_dir).AND.flow_dir.EQ.
'xy')
THEN 425 print *,
"xy-Direction" 427 timedisc%pvar%data4d(:,:,:,physics%YVELOCITY) = 0.
428 timedisc%pvar%data4d(:,:,:,physics%ZVELOCITY) = 0.
429 WHERE ((mesh%bcenter(:,:,:,2).LT.(mesh%ymin+0.25*xyzlen)).OR. &
430 (mesh%bcenter(:,:,:,2).GT.(mesh%ymin+0.75*xyzlen)))
431 timedisc%pvar%data4d(:,:,:,physics%DENSITY) = rho0
432 timedisc%pvar%data4d(:,:,:,physics%XVELOCITY) = v0
433 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p0
435 timedisc%pvar%data4d(:,:,:,physics%DENSITY) = rho1
436 timedisc%pvar%data4d(:,:,:,physics%XVELOCITY) = v1
437 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p1
440 timedisc%pvar%data4d(:,:,:,physics%XVELOCITY) = timedisc%pvar%data4d(:,:,:,physics%XVELOCITY) &
441 + (dv(:,:,:,1)-0.5)*0.2
442 timedisc%pvar%data4d(:,:,:,physics%YVELOCITY) = timedisc%pvar%data4d(:,:,:,physics%YVELOCITY) &
443 + (dv(:,:,:,2)-0.5)*0.2
444 timedisc%pvar%data4d(:,:,:,physics%ZVELOCITY) = timedisc%pvar%data4d(:,:,:,physics%ZVELOCITY) &
445 + (dv(:,:,:,3)-0.5)*0.2
447 ELSEIF (
PRESENT(flow_dir).AND.flow_dir.EQ.
'xz')
THEN 449 print *,
"xz-Direction" 451 timedisc%pvar%data4d(:,:,:,physics%YVELOCITY) = 0.
452 timedisc%pvar%data4d(:,:,:,physics%ZVELOCITY) = 0.
453 WHERE ((mesh%bcenter(:,:,:,3).LT.(mesh%zmin+0.25*xyzlen)).OR. &
454 (mesh%bcenter(:,:,:,3).GT.(mesh%zmin+0.75*xyzlen)))
455 timedisc%pvar%data4d(:,:,:,physics%DENSITY) = rho0
456 timedisc%pvar%data4d(:,:,:,physics%XVELOCITY) = v0
457 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p0
459 timedisc%pvar%data4d(:,:,:,physics%DENSITY) = rho1
460 timedisc%pvar%data4d(:,:,:,physics%XVELOCITY) = v1
461 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p1
463 DO i = mesh%IGMIN, mesh%IGMAX
465 timedisc%pvar%data4d(i,:,:,physics%XVELOCITY) = timedisc%pvar%data4d(i,:,:,physics%XVELOCITY) &
466 + transpose(dv(i,:,:,1)-0.5)*0.2
467 timedisc%pvar%data4d(i,:,:,physics%YVELOCITY) = timedisc%pvar%data4d(i,:,:,physics%YVELOCITY) &
468 + transpose(dv(i,:,:,3)-0.5)*0.2
469 timedisc%pvar%data4d(i,:,:,physics%ZVELOCITY) = timedisc%pvar%data4d(i,:,:,physics%ZVELOCITY) &
470 + transpose(dv(i,:,:,2)-0.5)*0.2
472 ELSEIF (
PRESENT(flow_dir).AND.flow_dir.EQ.
'zy')
THEN 474 print *,
"zy-Direction" 476 timedisc%pvar%data4d(:,:,:,physics%XVELOCITY) = 0.
477 timedisc%pvar%data4d(:,:,:,physics%YVELOCITY) = 0.
478 WHERE ((mesh%bcenter(:,:,:,2).LT.(mesh%ymin+0.25*xyzlen)).OR. &
479 (mesh%bcenter(:,:,:,2).GT.(mesh%ymin+0.75*xyzlen)))
480 timedisc%pvar%data4d(:,:,:,physics%DENSITY) = rho0
481 timedisc%pvar%data4d(:,:,:,physics%ZVELOCITY) = v0
482 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p0
484 timedisc%pvar%data4d(:,:,:,physics%DENSITY) = rho1
485 timedisc%pvar%data4d(:,:,:,physics%ZVELOCITY) = v1
486 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p1
488 DO j = mesh%JGMIN, mesh%JGMAX
490 timedisc%pvar%data4d(:,j,:,physics%XVELOCITY) = timedisc%pvar%data4d(:,j,:,physics%XVELOCITY) &
491 + transpose(dv(:,j,:,3)-0.5)*0.2
492 timedisc%pvar%data4d(:,j,:,physics%YVELOCITY) = timedisc%pvar%data4d(:,j,:,physics%YVELOCITY) &
493 + transpose(dv(:,j,:,2)-0.5)*0.2
494 timedisc%pvar%data4d(:,j,:,physics%ZVELOCITY) = timedisc%pvar%data4d(:,j,:,physics%ZVELOCITY) &
495 + transpose(dv(:,j,:,1)-0.5)*0.2
497 ELSEIF (
PRESENT(flow_dir).AND.flow_dir.EQ.
'yz')
THEN 499 print *,
"yz-Direction" 501 timedisc%pvar%data4d(:,:,:,physics%XVELOCITY) = 0.
502 timedisc%pvar%data4d(:,:,:,physics%ZVELOCITY) = 0.
503 WHERE ((mesh%bcenter(:,:,:,3).LT.(mesh%zmin+0.25*xyzlen)).OR. &
504 (mesh%bcenter(:,:,:,3).GT.(mesh%zmin+0.75*xyzlen)))
505 timedisc%pvar%data4d(:,:,:,physics%DENSITY) = rho0
506 timedisc%pvar%data4d(:,:,:,physics%YVELOCITY) = v0
507 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p0
509 timedisc%pvar%data4d(:,:,:,physics%DENSITY) = rho1
510 timedisc%pvar%data4d(:,:,:,physics%YVELOCITY) = v1
511 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p1
513 DO i = mesh%IGMIN, mesh%IGMAX
514 dv_temp(i,:,:,1) = transpose(dv(i,:,:,1))
515 dv_temp(i,:,:,2) = transpose(dv(i,:,:,3))
516 dv_temp(i,:,:,3) = transpose(dv(i,:,:,2))
518 DO k = mesh%KGMIN, mesh%KGMAX
520 timedisc%pvar%data4d(:,:,k,physics%XVELOCITY) = timedisc%pvar%data4d(:,:,k,physics%XVELOCITY) &
521 + transpose(dv_temp(:,:,k,2)-0.5)*0.2
522 timedisc%pvar%data4d(:,:,k,physics%YVELOCITY) = timedisc%pvar%data4d(:,:,k,physics%YVELOCITY) &
523 + transpose(dv_temp(:,:,k,1)-0.5)*0.2
524 timedisc%pvar%data4d(:,:,k,physics%ZVELOCITY) = timedisc%pvar%data4d(:,:,k,physics%ZVELOCITY) &
525 + transpose(dv_temp(:,:,k,3)-0.5)*0.2
528 CALL mesh%Error(
"KHI INIT",
"Unknown flow direction")
531 CALL physics%Convert2Conservative(timedisc%pvar,timedisc%cvar)
532 CALL mesh%Info(
" DATA-----> initial condition: " // &
533 "Kelvin-Helmholtz instability")
subroutine initdata(Mesh, Physics, Fluxes, Timedisc)
subroutine makeconfig(Sim, config)
program khi
Kelvin-Helmholtz instability.