Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
95543591
Commit
95543591
authored
Feb 04, 2013
by
Matthieu Schaller
Browse files
Updated the Sedov blast IC script to match the test published in arXiv:0808.1844
Former-commit-id: cc4399549b312878aa4c10e535b1696cf1773fcc
parent
6e6033a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/SedovBlast/makeIC.py
View file @
95543591
...
...
@@ -19,6 +19,7 @@
##############################################################################
import
h5py
import
random
from
numpy
import
*
# Generates a swift IC file for the Sedov blast test in a periodic cubic box
...
...
@@ -30,6 +31,7 @@ L = 101 # Number of particles along one axis
rho
=
1.
# Density
P
=
1.e-5
# Pressure
E0
=
1.e5
# Energy of the explosion
pert
=
0.1
gamma
=
5.
/
3.
# Gas adiabatic index
fileName
=
"sedov.hdf5"
...
...
@@ -68,8 +70,12 @@ for i in range(L):
h
[
index
]
=
1.2
*
boxSize
/
L
u
[
index
]
=
internalEnergy
ids
[
index
]
=
index
if
2
*
x
==
boxSize
and
2
*
y
==
boxSize
and
2
*
z
==
boxSize
:
u
[
index
]
=
u
[
index
]
+
E0
if
sqrt
((
x
-
boxSize
/
2.
)
**
2
+
(
y
-
boxSize
/
2.
)
**
2
+
(
z
-
boxSize
/
2.
)
**
2
)
<
2.01
*
boxSize
/
L
:
u
[
index
]
=
u
[
index
]
+
E0
/
33.
coords
[
index
,
0
]
=
x
+
random
.
random
()
*
pert
*
boxSize
/
(
2.
*
L
)
coords
[
index
,
1
]
=
y
+
random
.
random
()
*
pert
*
boxSize
/
(
2.
*
L
)
coords
[
index
,
2
]
=
z
+
random
.
random
()
*
pert
*
boxSize
/
(
2.
*
L
)
#--------------------------------------------------
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment