45 REAL,
PARAMETER :: GN = 1.0
46 REAL,
PARAMETER :: MCENTRAL = 1.0
47 REAL,
PARAMETER :: Sigma0 = 1.0
48 REAL,
PARAMETER :: M = 10.
49 REAL,
PARAMETER :: omega = 0.
51 REAL,
PARAMETER :: P0 = 2.0*pi/1.0
52 REAL,
PARAMETER :: P = 3
53 REAL,
PARAMETER :: t = p*p0
55 REAL,
PARAMETER :: GAMMA = 5./3.
57 REAL,
PARAMETER :: RMIN = 0.5
58 REAL,
PARAMETER :: RMAX = 1.5
60 INTEGER,
PARAMETER :: GravEnergySource = 1
61 INTEGER,
PARAMETER :: XRES = 64
62 INTEGER,
PARAMETER :: YRES = 4*xres
63 INTEGER,
PARAMETER :: ONUM = p * 10
65 CLASS(fosite),
ALLOCATABLE :: Sim
72 CALL initdata(sim%Timedisc, sim%Mesh, sim%Physics, sim%Fluxes)
82 TYPE(Dict_TYP),
POINTER :: config
85 TYPE(Dict_TYP),
POINTER :: mesh,boundary,timedisc,datafile,&
86 sources,fluxes,pmass,physics,damping,vis,pot
91 "units" / geometrical)
96 "variables" / primitive, &
100 "meshtype" / midpoint, &
101 "geometry" / cylindrical, &
112 "decomposition" / (/ 1, -1/), &
113 "output/volume" / 1,&
115 "output/rotation" / 1,&
119 "western" / custom, &
120 "eastern" / custom, &
121 "southern" / periodic, &
122 "northern" / periodic)
125 "gtype" / pointmass, &
126 "potential" / newton, &
143 "grav/stype" / gravity, &
145 "grav/output/accel" / 1, &
146 "grav/pmass" / pmass)
151 "tol_rel" / 1.0e-3, &
152 "tol_abs" / (/ 0., 1.e-3, 1.e-3, 0. /), &
155 "dtlimit" / 1.0e-10, &
156 "maxiter" / 2000000000, &
157 "output/xmomentum" / 1, &
158 "output/ymomentum" / 1, &
159 "output/energy" / 1, &
161 "output/geometrical_sources" / 1, &
162 "output/external_sources" / 1, &
164 "output/fluxes" / 1, &
169 "fileformat" / xdmf, &
170 "filename" /
"keplerianvortex", &
174 "physics" / physics, &
177 "boundary" / boundary, &
178 "sources" / sources, &
179 "timedisc" / timedisc, &
180 "datafile" / datafile)
185 SUBROUTINE initdata(Timedisc,Mesh,Physics,Fluxes)
188 CLASS(timedisc_base),
INTENT(INOUT) :: Timedisc
189 CLASS(mesh_base),
INTENT(IN) :: Mesh
190 CLASS(physics_base),
INTENT(INOUT) :: Physics
191 CLASS(fluxes_base),
INTENT(INOUT) :: Fluxes
194 REAL,
DIMENSION(Mesh%IGMIN:Mesh%IGMAX,Mesh%JGMIN:Mesh%JGMAX,Mesh%KGMIN:Mesh%KGMAX) &
195 :: dvr, dvphi, x, y, phi, r
197 INTEGER :: dir,j,ig,i,k
198 CLASS(sources_base),
POINTER :: sp
199 CLASS(sources_gravity),
POINTER :: gp
201 x = mesh%bccart(:,:,:,1)
202 y = mesh%bccart(:,:,:,2)
204 IF(gravenergysource.EQ.0)
THEN 205 CALL setpotential_euler2dia(physics,mesh,-gn * mcentral / mesh%radius%bcenter)
206 CALL setpotential_euler2dia(physics,mesh,-gn * mcentral / mesh%radius%faces)
212 IF (
ASSOCIATED(sp).EQV..false.)
RETURN 214 CLASS IS(sources_gravity)
221 SELECT TYPE (pvar => timedisc%pvar)
222 CLASS IS(statevector_euler)
223 SELECT TYPE (cvar => timedisc%cvar)
224 CLASS IS(statevector_euler)
225 cvar%density%data3d(:,:,:) = sigma0
226 cvar%momentum%data4d(:,:,:,1:physics%VDIM) = 0.
228 CALL physics%Convert2Primitive(cvar,pvar)
230 pvar%pressure%data3d(:,:,:) = 1./(gamma*m**2)
232 pvar%velocity%data4d(:,:,:,1:physics%VDIM) = &
233 pvar%velocity%data4d(:,:,:,1:physics%VDIM) &
234 + timedisc%GetCentrifugalVelocity(mesh,physics,sim%Fluxes,sim%Sources,(/0.,0.,1./))
241 SELECT TYPE(bwest => timedisc%Boundary%boundary(west)%p)
242 CLASS IS (boundary_custom)
243 CALL bwest%SetCustomBoundaries(mesh,physics, &
244 (/custom_reflect,custom_reflneg,custom_kepler,custom_reflect/))
246 SELECT TYPE(beast => timedisc%Boundary%boundary(east)%p)
247 CLASS IS (boundary_custom)
248 CALL beast%SetCustomBoundaries(mesh,physics, &
249 (/custom_reflect,custom_reflneg,custom_kepler,custom_reflect/))
254 phi = mesh%center(:,:,:,2)
257 r = sqrt(x**2 + y**2)
259 dvr = kappa * exp(-r**2/h**2) * (-y*cos(phi) + x*sin(phi))
260 dvphi = kappa * exp(-r**2/h**2) * ( y*sin(phi) + x*cos(phi))
262 SELECT TYPE (pvar => timedisc%pvar)
263 CLASS IS(statevector_euler)
264 SELECT TYPE (cvar => timedisc%cvar)
265 CLASS IS(statevector_euler)
266 pvar%velocity%data4d(:,:,:,1) = pvar%velocity%data4d(:,:,:,1) + dvr
267 pvar%velocity%data4d(:,:,:,2) = pvar%velocity%data4d(:,:,:,2) + dvphi
271 CALL physics%Convert2Conservative(timedisc%pvar,timedisc%cvar)