Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
fa1f61b1
Commit
fa1f61b1
authored
3 months ago
by
nickishch
Browse files
Options
Downloads
Patches
Plain Diff
cut outer halo, improved spin parameter determination
parent
edac5aaa
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/MHDTests/CoolingHaloWithSpin_MHD/cooling_halo.yml
+1
-1
1 addition, 1 deletion
examples/MHDTests/CoolingHaloWithSpin_MHD/cooling_halo.yml
examples/MHDTests/CoolingHaloWithSpin_MHD/makeIC.py
+9
-9
9 additions, 9 deletions
examples/MHDTests/CoolingHaloWithSpin_MHD/makeIC.py
with
10 additions
and
10 deletions
examples/MHDTests/CoolingHaloWithSpin_MHD/cooling_halo.yml
+
1
−
1
View file @
fa1f61b1
...
...
@@ -43,7 +43,7 @@ MHD:
monopole_subtraction
:
1.0
artificial_diffusion
:
0.0
hyperbolic_dedner
:
1.0
#1.0
hyperbolic_dedner_divv
:
0.
0
hyperbolic_dedner_divv
:
0.
5
parabolic_dedner
:
1.0
resistive_eta
:
0.0
...
...
This diff is collapsed.
Click to expand it.
examples/MHDTests/CoolingHaloWithSpin_MHD/makeIC.py
+
9
−
9
View file @
fa1f61b1
...
...
@@ -51,7 +51,7 @@ f_b = 0.17 # baryon fraction
c_200
=
7.2
# concentration parameter
# Set the magnitude of the uniform seed magnetic field
B0_Gaussian_Units
=
1e-9
# 1e-6 # 1 micro Gauss
B0_Gaussian_Units
=
0.0
#
1e-9 # 1e-6 # 1 micro Gauss
B0_cgs
=
np
.
sqrt
(
CONST_MU0_CGS
/
(
4.0
*
np
.
pi
))
*
B0_Gaussian_Units
# SPH
...
...
@@ -59,7 +59,7 @@ eta = 1.595 # kernel smoothing
# Additional options
spin_lambda_choice
=
(
"
Bullock
"
#
"Peebles"
"
Peebles
"
)
# which definition of spin parameter to use (Peebles or Bullock)
save_to_vtk
=
False
plot_v_distribution
=
False
...
...
@@ -196,10 +196,10 @@ coords -= 0.5
# cut a sphere
r_uni
=
np
.
linalg
.
norm
(
coords
,
axis
=
1
)
coords
=
coords
[
r_uni
<=
0.5
]
coords
*=
boxSize
#boxSize * np.sqrt(3)
coords
*=
boxSize
/
10
#boxSize * np.sqrt(3)
# calculate max distance from the center (units of r_200)
R_max
=
boxSize
/
2
#np.sqrt(3) * (boxSize / 2)
R_max
=
boxSize
/
20
#
boxSize/2 #np.sqrt(3) * (boxSize / 2)
r_s
=
1
/
c_200
# calculate distances to the center
r_uni
=
np
.
linalg
.
norm
(
coords
,
axis
=
1
)
...
...
@@ -442,8 +442,8 @@ for i in range(N):
# select particles inside R_200
mask_r_200
=
radius
<=
1
Lp_tot
=
np
.
sum
(
l
[
mask_r_200
],
axis
=
0
)
Lp_tot_abs
=
np
.
linalg
.
norm
(
Lp_tot
)
jsp
=
Lp_tot_abs
/
f_b
Lp_tot_abs
=
np
.
linalg
.
norm
(
Lp_tot
)
jsp
=
Lp_tot_abs
/
gas_mass
normV
=
np
.
linalg
.
norm
(
v
,
axis
=
1
)
if
spin_lambda_choice
==
"
Peebles
"
:
...
...
@@ -455,10 +455,10 @@ if spin_lambda_choice == "Peebles":
/
(
const_unit_velocity_in_cgs
**
2
)
)
Ep_tot
=
np
.
sum
(
Ep_kin
[
mask_r_200
]
+
Ep_pot
[
mask_r_200
])
calc_spin_par
_P
=
(
Lp_tot_abs
*
np
.
sqrt
(
np
.
abs
(
Ep_tot
))
/
const_G
/
(
f_b
*
1
)
**
(
5
/
2
)
jsp
_P
=
(
const_G
*
(
gas_mass
)
**
(
3
/
2
)
/
np
.
sqrt
(
np
.
abs
(
Ep_tot
)
)
)
v
*=
sp
in_lambda
/
calc_spin_par_P
v
*=
j
sp
_P
/
jsp
elif
spin_lambda_choice
==
"
Bullock
"
:
# Normalize to Bullock
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment