78 REAL,
PARAMETER :: gn = 1.0
81 INTEGER,
PARAMETER :: shearsheet_direction = 1
83 REAL,
PARAMETER ::
omega = 1.0
84 REAL,
PARAMETER :: sigma0 = 1.0
85 REAL,
PARAMETER :: delsigma = sigma0*5.0e-4
86 REAL,
PARAMETER :: tsim = 4.54845485/
omega 87 REAL,
PARAMETER :: gamma = 2.0
88 REAL,
PARAMETER :: q = 1.5
93 REAL,
PARAMETER :: soundspeed = pi*gn*sigma0/
omega 95 INTEGER,
PARAMETER :: mgeo = cartesian
96 INTEGER,
PARAMETER :: xres = 128
97 INTEGER,
PARAMETER :: yres = 128
98 INTEGER,
PARAMETER :: zres = 1
99 REAL :: domainx = 40.0
100 REAL :: domainy = 40.0
102 INTEGER,
PARAMETER :: onum = 10
104 CHARACTER(LEN=256),
PARAMETER :: odir =
"./" 105 CHARACTER(LEN=256),
PARAMETER :: ofname =
"sblintheo" 107 CLASS(
fosite),
ALLOCATABLE :: sim
115 CALL sim%InitFosite()
118 CALL initdata(sim%Mesh, sim%Physics, sim%Timedisc%pvar, sim%Timedisc%cvar)
122 maximum = maxval(sim%Timedisc%pvar%data4d(:,:,:,sim%Physics%DENSITY)) - sigma0
127 tap_check_close(maximum, 0.02395931, 0.0003,
"First max. < 3e-4 deviation")
137 TYPE(Dict_TYP),
POINTER :: config
139 TYPE(Dict_TYP),
POINTER :: mesh,physics,fluxes,&
140 grav,sources,timedisc,shearingbox,&
142 REAL :: XMIN,XMAX,YMIN,YMAX,ZMIN,ZMAX
155 "problem" / euler_isotherm, &
157 "units" / geometrical &
162 "meshtype" / midpoint, &
164 "shear_dir" / shearsheet_direction, &
175 "decomposition"/ (/ 1, -1, 1/), &
176 "output/rotation" / 0, &
177 "output/volume" / 0, &
187 "variables" / primitive, &
188 "limiter" / vanleer &
194 "self/gtype" / sboxspectral, &
196 "self/output/phi" / 0, &
197 "self/output/accel_x" / 0, &
198 "self/output/accel_y" / 0 &
202 shearingbox => dict(&
208 "shearing" / shearingbox, &
214 "method" / dormand_prince, &
217 "dtlimit" / 1.0e-40, &
219 "maxiter" / 100000000)
223 "fileformat" / vtk, &
224 "filename" / (trim(odir) // trim(ofname)), &
230 "physics" / physics, &
232 "sources" / sources, &
233 "timedisc" / timedisc, &
234 "datafile" / datafile &
240 SUBROUTINE initdata(Mesh,Physics,pvar,cvar)
243 CLASS(mesh_base),
INTENT(IN) :: Mesh
244 CLASS(physics_base),
INTENT(IN) :: Physics
245 CLASS(marray_compound),
POINTER,
INTENT(INOUT) :: pvar,cvar
252 kx = -2*(2*pi/domainx)
256 SELECT TYPE(p => pvar)
257 TYPE IS(statevector_eulerisotherm)
258 IF(mesh%shear_dir.EQ.2)
THEN 259 p%density%data3d(:,:,:) = sigma0 &
260 + delsigma*cos(kx*mesh%bcenter(:,:,:,1) + ky*mesh%bcenter(:,:,:,2))
261 p%velocity%data2d(:,1) = 0.0
262 p%velocity%data4d(:,:,:,2) = -q*
omega*mesh%bcenter(:,:,:,1)
263 ELSE IF(mesh%shear_dir.EQ.1)
THEN 264 p%density%data3d(:,:,:) = sigma0 &
265 + delsigma*cos(kx*mesh%bcenter(:,:,:,2) - ky*mesh%bcenter(:,:,:,1))
266 p%velocity%data4d(:,:,:,1) = q*
omega*mesh%bcenter(:,:,:,2)
267 p%velocity%data2d(:,2) = 0.0
269 TYPE IS(statevector_euler)
270 IF(mesh%shear_dir.EQ.2)
THEN 271 p%density%data3d(:,:,:) = sigma0 &
272 + delsigma*cos(kx*mesh%bcenter(:,:,:,1) + ky*mesh%bcenter(:,:,:,2))
273 p%velocity%data2d(:,1) = 0.0
274 p%velocity%data4d(:,:,:,2) = -q*
omega*mesh%bcenter(:,:,:,1)
275 ELSE IF(mesh%shear_dir.EQ.1)
THEN 276 p%density%data3d(:,:,:) = sigma0 &
277 + delsigma*cos(kx*mesh%bcenter(:,:,:,2) - ky*mesh%bcenter(:,:,:,1))
278 p%velocity%data4d(:,:,:,1) = q*
omega*mesh%bcenter(:,:,:,2)
279 p%velocity%data2d(:,2) = 0.0
281 p%pressure%data3d(:,:,:) = soundspeed**2 * sigma0 / gamma
283 CALL physics%Error(
"shear::InitData",
"only (non-)isothermal HD supported")
286 CALL physics%Convert2Conservative(pvar,cvar)
290 CALL mesh%Info(
" DATA-----> initial condition: " // &
291 "Linear Theory Test - Shearingsheet")
pure real function, dimension(size(ephir%data2d, dim=1)) omega(ephir, velocity)
subroutine initdata(Mesh, Physics, Fluxes, Timedisc)
subroutine makeconfig(Sim, config)