67 REAL,
PARAMETER :: tsim = 5.0e-3
71 REAL,
PARAMETER :: re = 1.0e+4
72 REAL,
PARAMETER :: ma = 1.0e+2
73 REAL,
PARAMETER :: mdisk = 1.0e-2
75 REAL,
PARAMETER :: rhomin = 1.0e-8
77 INTEGER,
PARAMETER :: vistype = beta
79 REAL,
PARAMETER :: pl_exp = 0.0
80 REAL,
PARAMETER :: tvis = 4./3.*re
81 REAL,
PARAMETER :: tinit = 1.0e-3
85 INTEGER,
PARAMETER :: mgeo = spherical
86 INTEGER,
PARAMETER :: xres = 200
87 INTEGER,
PARAMETER :: yres = 16
88 INTEGER,
PARAMETER :: zres = 6
89 REAL,
PARAMETER :: rmin = 0.1
90 REAL,
PARAMETER :: rmax = 2.0
91 REAL,
PARAMETER :: gpar = 1.0
93 INTEGER,
PARAMETER :: onum = 100
94 CHARACTER(LEN=256),
PARAMETER &
96 CHARACTER(LEN=256),
PARAMETER &
97 :: ofname =
'pringle3d' 99 REAL,
PARAMETER :: csiso = 1./ma
101 CLASS(
fosite),
ALLOCATABLE :: sim
105 CALL sim%InitFosite()
108 CALL initdata(sim,sim%Mesh, sim%Physics, sim%Timedisc)
120 TYPE(Dict_TYP),
POINTER :: config
124 TYPE(Dict_TYP),
POINTER :: mesh, physics, boundary, datafile, &
125 grav, vis, timedisc, fluxes, sources
126 REAL :: x1,x2,y1,y2,z1,z2,cvis
142 bc(west) = no_gradients
143 bc(east) = no_gradients
152 bc(bottom) = reflecting
156 cvis = (xres/1207.0)**1.9
164 bc(west) = no_gradients
165 bc(east) = no_gradients
168 bc(bottom) = no_gradients
169 bc(top) = no_gradients
186 bc(south) = absorbing
187 bc(north) = absorbing
188 bc(bottom) = periodic
192 cvis = (xres/1207.0)**1.9
194 CALL sim%Error(
"pringle::MakeConfig",
"mesh geometry not supported for Pringle disk")
199 "meshtype" / midpoint, &
216 "western" / bc(west), &
217 "eastern" / bc(east), &
218 "southern" / bc(south), &
219 "northern" / bc(north), &
220 "bottomer" / bc(bottom), &
226 "problem" / euler_isotherm, &
227 "units" / geometrical, &
234 "variables" / primitive, &
235 "limiter" / vanleer, &
240 "stype" / viscosity, &
241 "vismodel" / vistype, &
242 "dynconst" / (1./re), &
243 "exponent" / pl_exp, &
249 "pmass/gtype"/ pointmass, &
250 "pmass/mass" / 1.0, &
251 "pmass/outbound" / 0)
261 "stoptime" / (tsim * tvis), &
263 "dtlimit" / (1e-10 * tvis), &
265 "maxiter" / 100000000, &
267 "tol_abs" / (/1e-40,1e-5,1e-8,1e-5/))
278 "filename" / (trim(odir) // trim(ofname)), &
283 "physics" / physics, &
284 "boundary" / boundary, &
286 "sources" / sources, &
287 "timedisc" / timedisc, &
288 "datafile" / datafile)
291 SUBROUTINE initdata(Sim,Mesh,Physics,Timedisc)
295 CLASS(fosite),
INTENT(INOUT) :: Sim
296 CLASS(physics_base),
INTENT(IN) :: Physics
297 CLASS(mesh_base),
INTENT(IN) :: Mesh
298 CLASS(timedisc_base),
INTENT(INOUT) :: Timedisc
301 CLASS(sources_base),
POINTER :: sp
302 CLASS(sources_gravity),
POINTER :: gp
303 CLASS(geometry_base),
ALLOCATABLE :: geo_cyl
304 TYPE(Dict_TYP),
POINTER :: geo_config
309 REAL,
DIMENSION(Mesh%IGMIN:Mesh%IGMAX,Mesh%JGMIN:Mesh%JGMAX,Mesh%KGMIN:Mesh%KGMAX,3) &
311 REAL :: r,z,vr,vphi,sden,mu,height,mass
312 CHARACTER(LEN=64) :: value
314 geo_config =>
dict(
"geometry" / cylindrical)
319 CALL geo_cyl%Convert2Curvilinear(mesh%bccart,bccyl)
322 SELECT TYPE(bwest => timedisc%Boundary%boundary(west)%p)
323 CLASS IS (boundary_custom)
324 CALL bwest%SetCustomBoundaries(mesh,physics, &
325 (/custom_nograd,custom_outflow,custom_kepler,custom_nograd/))
327 SELECT TYPE(beast => timedisc%Boundary%boundary(east)%p)
328 CLASS IS (boundary_custom)
329 CALL beast%SetCustomBoundaries(mesh,physics, &
330 (/custom_nograd,custom_outflow,custom_kepler,custom_nograd/))
336 IF (
ASSOCIATED(sp).EQV..false.)
RETURN 338 CLASS IS(sources_gravity)
344 IF (.NOT.
ASSOCIATED(sp))
CALL physics%Error(
"pringle::InitData",
"no gravity term initialized")
352 CALL timedisc%Error(
"pringle::InitData",
"only pringle and beta viscosity possible")
356 SELECT TYPE(pvar => timedisc%pvar)
357 TYPE IS(statevector_eulerisotherm)
358 DO k=mesh%KGMIN,mesh%KGMAX
359 DO j=mesh%JGMIN,mesh%JGMAX
360 DO i=mesh%IMIN,mesh%IGMAX
366 vphi = r/(r**2+z**2)**0.75
368 height = csiso * sqrt(r**3)
377 pvar%density%data3d(i,j,k) = rhomin + sden / (sqrt(2*pi) * height) &
378 * exp(-0.5*(z/height)**2)
386 mass = sum(mesh%volume%data1d(:)*pvar%density%data1d(:),mask=mesh%without_ghost_zones%mask1d)
389 mesh%comm_cart,ierror)
392 pvar%density%data1d(:) = pvar%density%data1d(:) * mdisk / mass
393 pvar%velocity%data1d(:) = 0.0
394 CALL gp%UpdateGravity(mesh,sim%Physics,sim%Fluxes,pvar,0.0,0.0)
395 pvar%velocity%data4d(:,:,:,1:physics%VDIM) = &
396 timedisc%GetCentrifugalVelocity(mesh,sim%Physics,sim%Fluxes,sim%Sources,(/0.,0.,1./), &
399 CALL timedisc%Error(
"pringle::InitData",
"only isothermal physics possible")
402 IF (
ASSOCIATED(timedisc%solution))
THEN 404 timedisc%solution = timedisc%pvar
408 CALL physics%Convert2Conservative(timedisc%pvar,timedisc%cvar)
410 CALL mesh%Info(
" DATA-----> initial condition: " //
"pringle disk")
411 WRITE(
value,
"(ES9.3)") tvis
412 CALL mesh%Info(
" " //
"viscous timescale: " //trim(
value))
413 WRITE(
value,
"(ES9.3)") re
414 CALL mesh%Info(
" " //
"Reynolds number: " //trim(
value))
415 WRITE(
value,
"(ES9.3)") ma
416 CALL mesh%Info(
" " //
"Mach number: " //trim(
value))
417 WRITE(
value,
"(ES9.3)") mdisk
418 CALL mesh%Info(
" " //
"Disk mass: " //trim(
value))
420 CALL geo_cyl%Finalize()
428 REAL,
INTENT(IN) :: mu,tau,r
429 REAL,
INTENT(OUT) :: Sigma,vr
431 REAL :: lambda,x,r4l,invr4l
434 r4l = r**(0.25/lambda)
435 x = 2*lambda**2 / tau * r**(0.25/lambda)
437 sigma = mdisk/sqrt((4*pi)**3 * tau) * r4l**(1.5-9*lambda) &
438 * exp(-lambda**2/tau*(1.0-r4l)**2)
439 vr = -1.5/re * ((x*tau)/(2*lambda*lambda))**(4*lambda-2.) &
440 * (1.0 - 0.5*x/lambda * (x*tau/(2*lambda*lambda) - 1.0))
447 REAL,
INTENT(IN) :: mu,tau,r
448 REAL,
INTENT(OUT) :: Sigma,vr
453 r4l = r**(0.25/lambda)
454 x = 2*lambda**2 / tau * r4l
455 sigma = mdisk/(4*pi) * (lambda/tau) * r4l**2 * r**(-2.25) &
456 * exp(-lambda**2/tau*(1.0+r4l**2)) &
458 vr = -1.5/re * ((x*tau)/(2*lambda*lambda))**(4*lambda-2.) &
459 * (1.0 - 0.5*x/lambda * (x*tau/(2*lambda*lambda) &
467 REAL,
INTENT(IN) :: nu,x
472 IF (aint(nu).EQ.nu)
THEN 475 inu = fgsl_sf_bessel_icn(n,x)
479 inu = (0.5*x)**nu / fgsl_sf_gamma(1.0+nu) * fgsl_sf_hyperg_0f1(1.0+nu,(0.5*x)**2)
type(dict_typ) function, pointer, public dict(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18, n19, n20)
Construct a new dictionary from several key/value pairs. Together with the Assign subroutine and over...
integer, save default_mpi_real
default real type for MPI
subroutine initdata(Mesh, Physics, Fluxes, Timedisc)
real function modified_bessel_inu(nu, x)
constructor for geometry class
elemental real function, public asinh(x)
inverse hyperbolic sine function
subroutine makeconfig(Sim, config)
subroutine new_geometry(Geometry, config)
recursive subroutine, public deletedict(root)
Delete the dictionary 'root' and all subnodes.
Dictionary for generic data types.
subroutine viscousring_analytic(mu, tau, r, Sigma, vr)
subroutine viscousring_approx(mu, tau, r, Sigma, vr)