39 REAL,
PARAMETER :: tsim = 30.0
40 REAL,
PARAMETER :: gamma = 1.4
41 REAL,
PARAMETER :: csiso = &
46 REAL,
PARAMETER :: rhoinf = 1.
47 REAL,
PARAMETER :: pinf = 1.
48 REAL,
PARAMETER :: vstr = 5.0
49 REAL,
PARAMETER :: uinf = 0.0
50 REAL,
PARAMETER :: vinf = 0.0
51 REAL,
PARAMETER :: winf = 0.0
52 REAL,
PARAMETER :: x0 = 0.0
53 REAL,
PARAMETER :: y0 = 0.0
54 REAL,
PARAMETER :: z0 = 0.0
55 REAL,
PARAMETER :: r0 = 1.0
56 REAL,
PARAMETER ::
omega = 0.0
59 INTEGER,
PARAMETER :: mgeo = cylindrical
60 INTEGER,
PARAMETER :: xres = 40
61 INTEGER,
PARAMETER :: yres = 40
62 INTEGER,
PARAMETER :: zres = 1
63 REAL,
PARAMETER :: rmin = 1.0e-2
64 REAL,
PARAMETER :: rmax = 5.0
65 REAL,
PARAMETER :: zmin = -1.0
66 REAL,
PARAMETER :: zmax = 1.0
67 REAL,
PARAMETER :: gpar = 1.0
70 LOGICAL,
PARAMETER :: with_iar = .false.
73 INTEGER,
PARAMETER :: onum = 10
74 CHARACTER(LEN=256),
PARAMETER &
76 CHARACTER(LEN=256),
PARAMETER &
77 :: ofname =
'vortex3d' 79 CLASS(
fosite),
ALLOCATABLE :: sim
80 CLASS(marray_compound),
POINTER :: pvar_init
90 CALL initdata(sim%Mesh, sim%Physics, sim%Timedisc)
91 CALL sim%Physics%new_statevector(pvar_init,primitive)
92 pvar_init = sim%Timedisc%pvar
95 sigma = sqrt(sum((sim%Timedisc%pvar%data1d(:)-pvar_init%data1d(:))**2)/
SIZE(pvar_init%data1d))
97 CALL pvar_init%Destroy()
98 DEALLOCATE(sim,pvar_init)
99 tap_check_small(sigma,3.8e-2,
"vortex3d")
109 TYPE(Dict_TYP),
POINTER :: config
113 TYPE(Dict_TYP),
POINTER :: mesh, physics, boundary, datafile, &
114 timedisc, fluxes, sources, rotframe
115 REAL :: x1,x2,y1,y2,z1,z2
126 bc(west) = no_gradients
127 bc(east) = no_gradients
128 bc(south) = no_gradients
129 bc(north) = no_gradients
130 bc(bottom) = no_gradients
131 bc(top) = no_gradients
137 bc(west) = no_gradients
138 bc(east) = no_gradients
141 bc(bottom) = no_gradients
142 bc(top) = no_gradients
144 CALL sim%Error(
"vortex3d::MakeConfig",
"geometry currently not supported")
156 "meshtype" / midpoint, &
172 "western" / bc(west), &
173 "eastern" / bc(east), &
174 "southern" / bc(south), &
175 "northern" / bc(north), &
176 "bottomer" / bc(bottom), &
180 IF (csiso.GT.tiny(csiso))
THEN 181 physics => dict(
"problem" / euler_isotherm, &
194 physics => dict(
"problem" / euler, &
204 "variables" / primitive, &
205 "limiter" / vanleer, &
212 rotframe => dict(
"stype" / rotating_frame, &
215 sources => dict(
"rotframe" / rotframe)
220 "method" / modified_euler, &
224 "dtlimit" / 1.0e-4, &
225 "maxiter" / 1000000, &
227 "output/iangularmomentum" / 1, &
228 "output/rothalpy" / 1 )
232 "fileformat" / vtk, &
233 "filename" / (trim(odir) // trim(ofname)), &
236 config => dict(
"mesh" / mesh, &
237 "physics" / physics, &
238 "boundary" / boundary, &
240 "timedisc" / timedisc, &
241 "datafile" / datafile )
244 IF (
ASSOCIATED(sources)) &
245 CALL setattr(config,
"sources", sources)
250 SUBROUTINE initdata(Mesh,Physics,Timedisc)
253 CLASS(physics_base),
INTENT(IN) :: Physics
254 CLASS(mesh_base),
INTENT(IN) :: Mesh
255 CLASS(timedisc_base),
INTENT(INOUT):: Timedisc
259 REAL,
DIMENSION(Mesh%IGMIN:Mesh%IGMAX,Mesh%JGMIN:Mesh%JGMAX,Mesh%KGMIN:Mesh%KGMAX) &
260 :: radius,dist_axis,domega
261 REAL,
DIMENSION(Mesh%IGMIN:Mesh%IGMAX,Mesh%JGMIN:Mesh%JGMAX,Mesh%KGMIN:Mesh%KGMAX,3) &
265 IF (abs(x0).LE.tiny(x0).AND.abs(y0).LE.tiny(y0).AND.abs(z0).LE.tiny(z0))
THEN 267 radius(:,:,:) = mesh%radius%bcenter(:,:,:)
268 posvec(:,:,:,:) = mesh%posvec%bcenter(:,:,:,:)
275 posvec(:,:,:,3) = 0.0
276 CALL mesh%geometry%Convert2Curvilinear(mesh%bcenter,posvec,posvec)
280 posvec(:,:,:,:) = mesh%posvec%bcenter(:,:,:,:) - posvec(:,:,:,:)
282 radius(:,:,:) = sqrt(posvec(:,:,:,1)**2+posvec(:,:,:,2)**2+posvec(:,:,:,3)**2)
285 dist_axis(:,:,:) = sqrt(posvec(:,:,:,1)**2+posvec(:,:,:,2)**2)
292 ephi(:,:,:,1) = -posvec(:,:,:,2)/radius(:,:,:)
293 ephi(:,:,:,2) = posvec(:,:,:,1)/radius(:,:,:)
298 domega(:,:,:) = 0.5*vstr/pi*exp(0.5*(1.-(dist_axis(:,:,:)/r0)**2))
299 SELECT TYPE(pvar => timedisc%pvar)
300 TYPE IS(statevector_eulerisotherm)
302 pvar%density%data3d(:,:,:) = rhoinf * exp(-0.5*(r0*domega(:,:,:)/csiso)**2)
305 pvar%velocity%data4d(:,:,:,n) = domega(:,:,:)*dist_axis(:,:,:)*ephi(:,:,:,n)
307 TYPE IS(statevector_euler)
308 csinf = sqrt(gamma*pinf/rhoinf)
312 pvar%density%data3d(:,:,:) = rhoinf * (1.0 - &
313 0.5*(gamma-1.0)*(r0*domega/csinf)**2 )**(1./(gamma-1.))
315 pvar%pressure%data1d(:) = pinf * (pvar%density%data1d(:)/rhoinf)**gamma
318 pvar%velocity%data4d(:,:,:,n) = domega(:,:,:)*dist_axis(:,:,:)*ephi(:,:,:,n)
322 CALL physics%Convert2Conservative(timedisc%pvar,timedisc%cvar)
336 CALL mesh%Info(
" DATA-----> initial condition: 3D vortex")
pure real function, dimension(size(ephir%data2d, dim=1)) omega(ephir, velocity)
subroutine initdata(Mesh, Physics, Fluxes, Timedisc)
elemental real function, public asinh(x)
inverse hyperbolic sine function
subroutine makeconfig(Sim, config)