42 REAL,
PARAMETER :: tsim = 0.05
43 REAL,
PARAMETER ::
gamma = 1.4
44 REAL,
PARAMETER ::
r = 1.033
46 REAL,
PARAMETER ::
rho0 = 1.0
47 REAL,
PARAMETER :: p0 = 1.0e-05
48 REAL,
PARAMETER :: e1 = 1.0
52 REAL,
PARAMETER ::
r0 = 5.0e-2
55 INTEGER,
PARAMETER :: mgeo = spherical
57 INTEGER,
PARAMETER :: xres = 50
58 INTEGER,
PARAMETER :: yres = 2
59 INTEGER,
PARAMETER :: zres = 2
60 REAL,
PARAMETER :: rmax = 0.4
61 REAL,
PARAMETER :: gpar = 0.2
63 INTEGER,
PARAMETER :: onum = 10
64 CHARACTER(LEN=256),
PARAMETER &
66 CHARACTER(LEN=256),
PARAMETER &
69 CLASS(
fosite),
ALLOCATABLE :: sim
71 REAL,
DIMENSION(:),
ALLOCATABLE :: pvar_diff
73 REAL,
DIMENSION(:),
POINTER :: pvar,pvar_all,radius,radius_all
79 ALLOCATE(sim,pvar_diff(1:xres))
82 IF(sim%GetRank().EQ.0) &
88 CALL initdata(sim%Mesh, sim%Physics, sim%Timedisc)
93 ALLOCATE(pvar(sim%Mesh%IMIN:sim%Mesh%IMAX),pvar_all(sim%GetNumProcs()*(sim%Mesh%IMAX-sim%Mesh%IMIN+1)))
94 ALLOCATE(radius(sim%Mesh%IMIN:sim%Mesh%IMAX),radius_all(sim%GetNumProcs()*(sim%Mesh%IMAX-sim%Mesh%IMIN+1)))
95 pvar(:) = sim%Timedisc%pvar%data4d(sim%Mesh%IMIN:sim%Mesh%IMAX,1,1,1)
96 radius(:)= sim%Mesh%radius%center(sim%Mesh%IMIN:sim%Mesh%IMAX,1,1)
104 CALL mpi_gather(pvar,int(sim%Mesh%IMAX-sim%Mesh%IMIN+1),mpi_double, &
105 pvar_all, int(sim%Mesh%IMAX-sim%Mesh%IMIN+1),mpi_double,0,mpi_comm_world,err)
106 CALL mpi_gather(radius,int(sim%Mesh%IMAX-sim%Mesh%IMIN+1),mpi_double, &
107 radius_all, int(sim%Mesh%IMAX-sim%Mesh%IMIN+1),mpi_double,0,mpi_comm_world,err)
109 IF(sim%GetRank().EQ.0)
THEN 111 pvar_diff(i) = pvar_all(i)-pvar_all(i+1)
113 rshock = radius_all(maxloc(pvar_diff,dim=1))
119 tap_check((
rt.LT.rshock+sim%Mesh%dx).AND.(
rt.GT.rshock-sim%Mesh%dx),
"Shock velocity correct")
123 pvar_diff(i) = sim%Timedisc%pvar%data4d(i,1,1,1)-sim%Timedisc%pvar%data4d(i+1,1,1,1)
125 rshock = sim%Mesh%radius%center(maxloc(pvar_diff,dim=1),1,1)
130 tap_check((
rt.LT.rshock+sim%Mesh%dx).AND.(
rt.GT.rshock-sim%Mesh%dx),
"Shock velocity correct")
134 DEALLOCATE(sim,pvar_diff)
143 TYPE(Dict_TYP),
POINTER :: config
147 TYPE(Dict_TYP),
POINTER :: mesh, physics, boundary, datafile, &
149 REAL :: x1,x2,y1,y2,z1,z2
162 bc(west) = no_gradients
163 bc(east) = no_gradients
164 bc(south) = no_gradients
165 bc(north) = no_gradients
166 bc(bottom)= no_gradients
167 bc(top) = no_gradients
175 bc(west) = reflecting
176 bc(east) = no_gradients
188 bc(west) = reflecting
189 bc(east) = no_gradients
201 bc(west) = no_gradients
202 bc(east) = no_gradients
203 bc(south) = no_gradients
204 bc(north) = no_gradients
205 bc(bottom)= no_gradients
206 bc(top) = no_gradients
235 CALL sim%Physics%Error(
"InitProgram",
"geometry not supported for 3D Sedov explosion")
240 "meshtype" / midpoint, &
255 "western" / bc(west), &
256 "eastern" / bc(east), &
257 "southern" / bc(south), &
258 "northern" / bc(north), &
259 "bottomer" / bc(bottom), &
271 "variables" / primitive, &
272 "limiter" / superbee)
276 "method" / dormand_prince, &
280 "dtlimit" / 1.0e-13, &
282 "tol_abs" / (/1e-5,1e-5,1e-5,1e-5,1e-5/), &
283 "maxiter" / 1000000 )
287 "fileformat" / vtk, &
288 "filename" / (trim(odir) // trim(ofname)), &
293 "physics" / physics, &
294 "boundary" / boundary, &
296 "timedisc" / timedisc, &
297 "datafile" / datafile )
300 SUBROUTINE initdata(Mesh,Physics,Timedisc)
304 CLASS(physics_base),
INTENT(IN) :: Physics
305 CLASS(mesh_base),
INTENT(IN) :: Mesh
306 CLASS(timedisc_base),
INTENT(INOUT) :: Timedisc
313 SELECT TYPE (phys => physics)
317 p1 = 3.*(phys%gamma - 1.0)*e1 / ((n + 1)*pi*
r0**n)
320 CALL phys%Error(
"InitData",
"physics not supported")
324 timedisc%pvar%data4d(:,:,:,physics%DENSITY) =
rho0 326 timedisc%pvar%data4d(:,:,:,physics%XVELOCITY) = 0.
327 timedisc%pvar%data4d(:,:,:,physics%YVELOCITY) = 0.
328 timedisc%pvar%data4d(:,:,:,physics%ZVELOCITY) = 0.
330 WHERE (mesh%radius%bcenter(:,:,:).LE.
r0)
332 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p1
335 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p0
338 CALL physics%Convert2Conservative(timedisc%pvar,timedisc%cvar)
339 CALL mesh%Info(
" DATA-----> initial condition: 3D Sedov explosion")
subroutine initdata(Mesh, Physics, Fluxes, Timedisc)
program sedov3d
3D Sedov explosion
elemental real function, public asinh(x)
inverse hyperbolic sine function
subroutine makeconfig(Sim, config)
physics module for 1D,2D and 3D non-isothermal Euler equations
elemental real function, public acosh(x)
inverse hyperbolic cosine function