42 REAL,
PARAMETER :: tsim = 0.05
43 REAL,
PARAMETER ::
gamma = 1.4
44 REAL,
PARAMETER ::
r = 1.0
46 REAL,
PARAMETER ::
rho0 = 1.0
47 REAL,
PARAMETER :: p0 = 1.0e-05
48 REAL,
PARAMETER :: e1 = 1.0
52 REAL,
PARAMETER ::
r0 = 3.0e-2
55 INTEGER,
PARAMETER :: mgeo = cylindrical
58 INTEGER,
PARAMETER :: xres = 100
59 INTEGER,
PARAMETER :: yres = 30
60 INTEGER,
PARAMETER :: zres = 1
61 REAL,
PARAMETER :: gpar = 0.2
62 REAL,
PARAMETER :: rmax = 0.3
63 REAL,
PARAMETER :: rmin = 0.001
65 INTEGER,
PARAMETER :: onum = 10
66 CHARACTER(LEN=256),
PARAMETER &
68 CHARACTER(LEN=256),
PARAMETER &
71 CLASS(
fosite),
ALLOCATABLE :: sim
73 REAL,
DIMENSION(:),
ALLOCATABLE :: pvar_diff
75 REAL,
DIMENSION(:),
POINTER :: pvar,pvar_all,radius,radius_all
82 ALLOCATE(sim,pvar_diff(1:xres))
85 IF(sim%GetRank().EQ.0) &
90 CALL initdata(sim%Mesh, sim%Physics, sim%Timedisc)
95 ALLOCATE(pvar(sim%Mesh%IMIN:sim%Mesh%IMAX),pvar_all(sim%GetNumProcs()*(sim%Mesh%IMAX-sim%Mesh%IMIN+1)))
96 ALLOCATE(radius(sim%Mesh%IMIN:sim%Mesh%IMAX),radius_all(sim%GetNumProcs()*(sim%Mesh%IMAX-sim%Mesh%IMIN+1)))
97 pvar(:) = sim%Timedisc%pvar%data4d(sim%Mesh%IMIN:sim%Mesh%IMAX,1,1,1)
98 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)
108 IF(sim%GetRank().EQ.0)
THEN 110 pvar_diff(i) = pvar_all(i)-pvar_all(i+1)
112 rshock = radius_all(maxloc(pvar_diff,dim=1))
116 tap_check((
rt.LT.rshock+sim%Mesh%dx).AND.(
rt.GT.rshock-sim%Mesh%dx),
"Shock velocity correct")
121 pvar_diff(i) = sim%Timedisc%pvar%data4d(i,1,1,1)-sim%Timedisc%pvar%data4d(i+1,1,1,1)
123 rshock = sim%Mesh%radius%center(maxloc(pvar_diff,dim=1),1,1)
129 tap_check((
rt.LT.rshock+sim%Mesh%dx).AND.(
rt.GT.rshock-sim%Mesh%dx),
"Shock velocity correct")
132 DEALLOCATE(sim,pvar_diff)
162 TYPE(Dict_TYP),
POINTER :: config
166 TYPE(Dict_TYP),
POINTER :: mesh, physics, boundary, datafile, &
168 REAL :: x1,x2,y1,y2,z1,z2
181 bc(west) = no_gradients
182 bc(east) = no_gradients
183 bc(south) = no_gradients
184 bc(north) = no_gradients
185 bc(bottom)= no_gradients
186 bc(top) = no_gradients
194 bc(west) = reflecting
207 bc(west) = reflecting
208 bc(east) = no_gradients
211 bc(bottom)= no_gradients
212 bc(top) = no_gradients
220 bc(west) = no_gradients
221 bc(east) = no_gradients
224 bc(bottom)= no_gradients
225 bc(top) = no_gradients
254 CALL sim%Physics%Error(
"InitProgram",
"geometry not supported for 3D Sedov explosion")
259 "meshtype" / midpoint, &
274 "western" / bc(west), &
275 "eastern" / bc(east), &
276 "southern" / bc(south), &
277 "northern" / bc(north), &
278 "bottomer" / bc(bottom), &
290 "variables" / primitive, &
296 "method" / modified_euler, &
300 "dtlimit" / 1.0e-13, &
302 "tol_abs" / (/0.0,1e-3,1e-3,0.0/), &
303 "maxiter" / 1000000, &
305 "output/geometrical_sources" / 1 )
309 "fileformat" / vtk, &
310 "filename" / (trim(odir) // trim(ofname)), &
315 "physics" / physics, &
316 "boundary" / boundary, &
318 "timedisc" / timedisc, &
319 "datafile" / datafile )
322 SUBROUTINE initdata(Mesh,Physics,Timedisc)
326 CLASS(physics_base),
INTENT(IN) :: Physics
327 CLASS(mesh_base),
INTENT(IN) :: Mesh
328 CLASS(timedisc_base),
INTENT(INOUT) :: Timedisc
335 SELECT TYPE (phys => physics)
339 p1 = 3.*(phys%gamma - 1.0)*e1 / ((n + 1)*pi*
r0**n)
342 CALL phys%Error(
"InitData",
"physics not supported")
346 timedisc%pvar%data4d(:,:,:,physics%DENSITY) =
rho0 348 timedisc%pvar%data4d(:,:,:,physics%XVELOCITY) = 0.
349 timedisc%pvar%data4d(:,:,:,physics%YVELOCITY) = 0.
351 WHERE (mesh%radius%bcenter(:,:,:).LE.
r0)
353 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p1
356 timedisc%pvar%data4d(:,:,:,physics%PRESSURE) = p0
359 CALL physics%Convert2Conservative(timedisc%pvar,timedisc%cvar)
360 CALL mesh%Info(
" DATA-----> initial condition: 2D Sedov explosion")
program sedov2d
2D Sedov explosion
subroutine initdata(Mesh, Physics, Fluxes, Timedisc)
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