36 REAL,
PARAMETER :: gn = 1.0
37 INTEGER,
PARAMETER :: units = geometrical
40 INTEGER,
PARAMETER :: shearsheet_direction = 2
42 REAL,
PARAMETER :: csiso = &
46 REAL,
PARAMETER ::
omega = 1.0
47 REAL,
PARAMETER :: sigma0 = 1.0
48 REAL,
PARAMETER :: tsim = 10./
omega 49 REAL,
PARAMETER :: gamma = 2.0
50 REAL,
PARAMETER :: q = 1.5
52 INTEGER,
PARAMETER :: mgeo = cartesian
53 INTEGER,
PARAMETER :: xres = 128
54 INTEGER,
PARAMETER :: yres = 128
55 INTEGER,
PARAMETER :: zres = 1
56 REAL :: domainx = 320.0
57 REAL :: domainy = 320.0
59 INTEGER,
PARAMETER :: onum = 10
61 CHARACTER(LEN=256),
PARAMETER :: odir =
"./" 62 CHARACTER(LEN=256),
PARAMETER :: ofname =
"sbox" 64 CLASS(
fosite),
ALLOCATABLE :: sim
65 CLASS(marray_compound),
POINTER :: pvar,pvar_init
75 CALL initdata(sim%Mesh, sim%Physics, sim%Timedisc%pvar, sim%Timedisc%cvar)
77 CALL sim%Physics%new_statevector(pvar_init,primitive)
78 CALL rotatedata(sim%Mesh,sim%Timedisc%pvar,pvar_init,
"xy")
81 CALL sim%Physics%new_statevector(pvar,primitive)
82 CALL rotatedata(sim%Mesh,sim%Timedisc%pvar,pvar,
"xy")
91 CALL setattr(sim%config,
"/datafile/filename", (trim(odir) // trim(ofname) //
"_rotate"))
92 CALL setattr(sim%config,
"mesh/shear_dir", 1)
94 sim%Timedisc%pvar%data1d(:) = pvar_init%data1d(:)
95 CALL sim%Physics%Convert2Conservative(sim%Timedisc%pvar,sim%Timedisc%cvar)
99 sigma = sqrt(sum((sim%Timedisc%pvar%data4d(:,:,:,:)-pvar%data4d(:,:,:,:))**2)/ &
100 SIZE(pvar%data4d(:,:,:,:)))
106 tap_check_small(sigma,1e-13,
"Shear x-y symmetry test")
116 TYPE(Dict_TYP),
POINTER :: config
118 TYPE(Dict_TYP),
POINTER :: mesh, physics, datafile, &
119 sources, timedisc, fluxes, shear
122 REAL :: XMIN,XMAX,YMIN,YMAX,ZMIN,ZMAX
135 "meshtype" / midpoint, &
137 "shear_dir" / shearsheet_direction, &
148 "output/rotation" / 0, &
149 "output/volume" / 0, &
155 IF (csiso.GT.tiny(csiso))
THEN 156 physics => dict(
"problem" / euler_isotherm, &
160 physics => dict(
"problem" / euler, &
169 "variables" / primitive, &
170 "limiter" / vanleer &
177 "variables" / primitive, &
178 "limiter" / vanleer &
183 "stype" / shearbox, &
184 "output/accel_x" / 0, &
185 "output/accel_y" / 0 &
189 sources => dict(
"shear" / shear)
193 "method" / modified_euler, &
197 "dtlimit" / 1.0e-40, &
199 "output/external_sources" / 1, &
200 "maxiter" / 100000000)
204 "fileformat" / vtk, &
205 "filename" / (trim(odir) // trim(ofname)), &
211 "physics" / physics, &
213 "sources" / sources, &
214 "timedisc" / timedisc, &
215 "datafile" / datafile)
220 SUBROUTINE initdata(Mesh,Physics,pvar,cvar)
223 CLASS(mesh_base),
INTENT(IN) :: Mesh
224 CLASS(physics_base),
INTENT(IN) :: Physics
225 CLASS(marray_compound),
POINTER,
INTENT(INOUT) :: pvar,cvar
229 SELECT TYPE(p => pvar)
230 TYPE IS(statevector_eulerisotherm)
231 WHERE ((abs(mesh%bcenter(:,:,:,1)).LT.0.15*domainx.AND. &
232 abs(mesh%bcenter(:,:,:,2)).LT.0.15*domainy))
233 p%density%data3d(:,:,:) = sigma0
235 p%density%data3d(:,:,:) = sigma0*1e-2
237 p%velocity%data2d(:,1) = 0.0
238 p%velocity%data4d(:,:,:,2) = -mesh%Q*mesh%bcenter(:,:,:,1)*mesh%Omega
239 TYPE IS(statevector_euler)
240 WHERE ((abs(mesh%bcenter(:,:,:,1)).LT.0.15*domainx.AND. &
241 abs(mesh%bcenter(:,:,:,2)).LT.0.15*domainy))
242 p%density%data3d(:,:,:) = sigma0
244 p%density%data3d(:,:,:) = sigma0*1e-2
246 p%velocity%data2d(:,1) = 0.0
247 p%velocity%data4d(:,:,:,2) = -mesh%Q*mesh%bcenter(:,:,:,1)*mesh%Omega
248 p%pressure%data1d(:) = 1e-1
250 CALL physics%Error(
"shear::InitData",
"only non-isothermal HD supported")
253 CALL physics%Convert2Conservative(pvar,cvar)
254 CALL mesh%Info(
" DATA-----> initial condition: " // &
259 SUBROUTINE rotatedata(Mesh,pvar_in,pvar_out,dir)
262 CLASS(mesh_base),
INTENT(IN) :: Mesh
263 CLASS(marray_compound),
INTENT(INOUT) :: pvar_in,pvar_out
264 CHARACTER(LEN=2),
INTENT(IN) :: dir
268 SELECT TYPE(pin => pvar_in)
269 TYPE IS(statevector_euler)
270 SELECT TYPE(pout => pvar_out)
271 TYPE IS(statevector_euler)
275 DO k = mesh%KGMIN,mesh%KGMAX
276 DO j = mesh%JGMIN,mesh%JGMAX
277 DO i = mesh%IGMIN,mesh%IGMAX
278 pout%density%data3d(i,j,k) = pin%density%data3d(mesh%IGMAX-mesh%IGMIN-j-2,i,k)
279 pout%pressure%data3d(i,j,k) = pin%pressure%data3d(mesh%IGMAX-mesh%IGMIN-j-2,i,k)
280 pout%velocity%data4d(i,j,k,1) = pin%velocity%data4d(mesh%IGMAX-mesh%IGMIN-j-2,i,k,2)
281 pout%velocity%data4d(i,j,k,2) = pin%velocity%data4d(mesh%IGMAX-mesh%IGMIN-j-2,i,k,1)
286 CALL mesh%Error(
"shear::RotateData",
"directions must be one of 'xy','xz' or 'yz'")
pure real function, dimension(size(ephir%data2d, dim=1)) omega(ephir, velocity)
subroutine rotatedata(Mesh, pvar_in, pvar_out, dir)
subroutine initdata(Mesh, Physics, Fluxes, Timedisc)
subroutine makeconfig(Sim, config)