55 REAL,
PARAMETER :: tsim = 10.0
56 REAL,
PARAMETER :: dynvis = 0.0
57 REAL,
PARAMETER :: bulkvis = 0.0
61 REAL,
PARAMETER :: rho0 = 2.0
62 REAL,
PARAMETER :: rho1 = 1.0
63 REAL,
PARAMETER :: yacc = 0.2
64 REAL,
PARAMETER :: p0 = 1.2
65 REAL,
PARAMETER :: a0 = 0.02
67 INTEGER,
PARAMETER :: xres = 50
68 INTEGER,
PARAMETER :: yres = 100
69 INTEGER,
PARAMETER :: zres = 1
70 REAL,
PARAMETER :: width = 1.0
71 REAL,
PARAMETER :: height = 2.0
73 INTEGER,
PARAMETER :: onum = 10
74 CHARACTER(LEN=256),
PARAMETER &
76 CHARACTER(LEN=256),
PARAMETER &
79 CLASS(
fosite),
ALLOCATABLE :: sim
89 CALL initdata(sim%Mesh, sim%Physics, sim%Timedisc%pvar, sim%Timedisc%cvar)
104 TYPE(Dict_TYP),
POINTER :: config
106 TYPE(Dict_TYP),
POINTER :: mesh, physics, boundary, datafile, &
107 sources, timedisc, fluxes, caccel, vis
113 "meshtype" / midpoint, &
114 "geometry" / cartesian, &
134 "variables" / conservative, &
135 "limiter" / monocent, &
140 "western" / reflecting, &
141 "eastern" / reflecting, &
142 "southern" / reflecting, &
143 "northern" / reflecting, &
144 "bottomer" / reflecting, &
145 "topper" / reflecting)
155 "stype" / viscosity, &
156 "vismodel" / molecular, &
157 "dynconst" / dynvis, &
158 "bulkconst" / bulkvis)
165 IF ((dynvis.GT.tiny(dynvis)).OR.(bulkvis.GT.tiny(bulkvis))) &
166 CALL setattr(sources,
"vis", vis)
170 "method" / modified_euler, &
174 "dtlimit" / 1.0e-4, &
179 "fileformat" / vtk, &
180 "filename" / (trim(odir) // trim(ofname)), &
186 "physics" / physics, &
187 "boundary" / boundary, &
189 "sources" / sources, &
190 "timedisc" / timedisc, &
191 "datafile" / datafile)
196 SUBROUTINE initdata(Mesh,Physics,pvar,cvar)
199 CLASS(mesh_base),
INTENT(IN) :: Mesh
200 CLASS(physics_base),
INTENT(IN) :: Physics
201 CLASS(marray_compound),
POINTER,
INTENT(INOUT) :: pvar,cvar
204 REAL,
DIMENSION(Mesh%IGMIN:Mesh%IGMAX,Mesh%JGMIN:Mesh%JGMAX,Mesh%KGMIN:Mesh%KGMAX) &
208 y0(:,:,:) = 0.5*mesh%ymax + a0*cos(2*pi*mesh%bcenter(:,:,:,1)/mesh%xmax)
211 SELECT TYPE(p => pvar)
212 TYPE IS(statevector_euler)
213 WHERE (mesh%bcenter(:,:,:,2).GT.y0(:,:,:))
215 p%density%data3d(:,:,:) = rho0
216 p%pressure%data3d(:,:,:) = p0 + yacc * rho0 * (mesh%ymax-mesh%bcenter(:,:,:,2))
219 p%density%data3d(:,:,:) = rho1
220 p%pressure%data3d(:,:,:) = p0 + yacc * (rho1 * (y0(:,:,:)-mesh%bcenter(:,:,:,2)) &
221 + rho0 * (mesh%ymax-y0(:,:,:)))
224 p%velocity%data1d(:) = 0.
226 CALL physics%Error(
"shear::InitData",
"only non-isothermal HD supported")
229 CALL physics%Convert2Conservative(pvar,cvar)
230 CALL mesh%Info(
" DATA-----> initial condition: " // &
231 "Rayleigh–Taylor instability")
subroutine initdata(Mesh, Physics, Fluxes, Timedisc)
subroutine makeconfig(Sim, config)