-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup_blast1D.f
executable file
·72 lines (65 loc) · 2.03 KB
/
setup_blast1D.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
cc----------------------------------------------------
cc A Blast wave is set up as in Colella and Woodward
cc and calculated by Marti et al phys.rev.D 1991
cc Density is constant so particles are equispaced
cc Initidist velocity is zero. Pressure jumps.
cc---------------------------------------------------
SUBROUTINE setup
c
c--include relevant global variables
c
INCLUDE 'COMMONS/dimen_mhd'
INCLUDE 'COMMONS/bound'
INCLUDE 'COMMONS/eos'
INCLUDE 'COMMONS/options'
INCLUDE 'COMMONS/part'
INCLUDE 'COMMONS/part_in'
INCLUDE 'COMMONS/setup_params'
c
c--define local variables
c
REAL dist,xcentre,delta,vxi,term,term2,rhozero,massp,gam1
REAL exx,uuleft,uuright
c REAL xmin,xmax ! local since they are repositioned in initialise
ibound = 2
c nbpts = 10
xmin = -0.5
xmax = 0.5
xcentre = 0.0
gam1 = gamma - 1.
dist = 0.5*psep
rhozero = 1.0
uuright = 0.01/(rhozero*gam1) ! thermal energy on the right
uuleft = 1000./(rhozero*gam1) ! thermal energy on the left
massp = rhozero*psep ! the mass per sph particle
hfact = hfact*massp ! this is so h = hfact/rho (used in sum_density)
npart = 0
c
c--mhd
c
c Bin(:,:) = 0.
i = 1
xin(1) = xmin + 0.5*psep
DO WHILE (xin(i).lt.xmax)
npart = npart + 1
xin(i) = (i-1.)*psep - 0.5
delta = (xin(i) - xcentre)/dist
rhoin(i) = rhozero
IF (delta.gt.20.) THEN
enin(i) = uuright
ELSEIF (delta.lt.-20.) THEN
enin(i) = uuleft
ELSE
exx = exp(delta)
enin(i) = (uuleft + uuright*exx)/(1 + exx)
ENDIF
hhin(i) = hfact/rhozero
velin(:,i) = 0.
uuin(i) = enin(i) - 0.5*DOT_PRODUCT(velin(:,i),velin(:,i))
pmass(i) = massp
i = i + 1
xin(i) = (i-1)*psep - 0.5
ENDDO
ntotal = npart
RETURN
END