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
be563ef1
Commit
be563ef1
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Also consider the BHs when looking for a position to reposition to.
parent
de0c518c
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!876
Black holes repositioning
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/black_holes/EAGLE/black_holes_iact.h
+33
-5
33 additions, 5 deletions
src/black_holes/EAGLE/black_holes_iact.h
src/runner.c
+1
-1
1 addition, 1 deletion
src/runner.c
with
34 additions
and
6 deletions
src/black_holes/EAGLE/black_holes_iact.h
+
33
−
5
View file @
be563ef1
...
...
@@ -229,7 +229,7 @@ runner_iact_nonsym_bh_gas_swallow(
__attribute__
((
always_inline
))
INLINE
static
void
runner_iact_nonsym_bh_bh_swallow
(
const
float
r2
,
const
float
*
dx
,
const
float
hi
,
const
float
hj
,
const
struct
bpart
*
restrict
bi
,
struct
bpart
*
restrict
bi
,
struct
bpart
*
restrict
bj
,
const
struct
cosmology
*
cosmo
,
const
struct
gravity_props
*
grav_props
,
...
...
@@ -244,6 +244,33 @@ runner_iact_nonsym_bh_bh_swallow(const float r2, const float *dx,
const
float
v2_pec
=
v2
*
cosmo
->
a2_inv
;
/* Note the factor 9 is taken from EAGLE. Will be turned into a parameter */
const
float
max_dist_repos2
=
kernel_gravity_softening_plummer_equivalent_inv
*
kernel_gravity_softening_plummer_equivalent_inv
*
9
.
f
*
grav_props
->
epsilon_cur2
;
/* This gas neighbour is close enough that we can consider it's potential
for repositioning */
if
(
r2
<
max_dist_repos2
)
{
/* Check the velocity criterion */
if
(
v2_pec
<
0
.
25
f
*
bi
->
sound_speed_gas
*
bi
->
sound_speed_gas
)
{
const
float
potential
=
gravity_get_comoving_potential
(
bj
->
gpart
);
/* Is the potential lower? */
if
(
potential
<
bi
->
reposition
.
min_potential
)
{
/* Store this as our new best */
bi
->
reposition
.
min_potential
=
potential
;
bi
->
reposition
.
x
[
0
]
=
bj
->
x
[
0
];
bi
->
reposition
.
x
[
1
]
=
bj
->
x
[
1
];
bi
->
reposition
.
x
[
2
]
=
bj
->
x
[
2
];
}
}
}
/* Find the most massive of the two BHs */
float
M
=
bi
->
subgrid_mass
;
float
h
=
hi
;
...
...
@@ -253,9 +280,10 @@ runner_iact_nonsym_bh_bh_swallow(const float r2, const float *dx,
}
/* Note the factor 9 is taken from EAGLE. Will be turned into a parameter */
const
float
max_distance2
=
kernel_gravity_softening_plummer_equivalent_inv
*
kernel_gravity_softening_plummer_equivalent_inv
*
9
.
f
*
grav_props
->
epsilon_cur2
;
const
float
max_dist_merge2
=
kernel_gravity_softening_plummer_equivalent_inv
*
kernel_gravity_softening_plummer_equivalent_inv
*
9
.
f
*
grav_props
->
epsilon_cur2
;
const
float
G_Newton
=
grav_props
->
G_Newton
;
...
...
@@ -269,7 +297,7 @@ runner_iact_nonsym_bh_bh_swallow(const float r2, const float *dx,
/* Merge if gravitationally bound AND if within max distance
* Note that we use the kernel support here as the size and not just the
* smoothing length */
if
(
v2_pec
<
G_Newton
*
M
/
(
kernel_gamma
*
h
)
&&
(
r2
<
max_dist
anc
e2
))
{
if
(
v2_pec
<
G_Newton
*
M
/
(
kernel_gamma
*
h
)
&&
(
r2
<
max_dist
_merg
e2
))
{
/* This particle is swallowed by the BH with the largest ID of all the
* candidates wanting to swallow it */
...
...
This diff is collapsed.
Click to expand it.
src/runner.c
+
1
−
1
View file @
be563ef1
...
...
@@ -907,7 +907,7 @@ void runner_do_black_holes_swallow_ghost(struct runner *r, struct cell *c,
/* Compute the final operations for repositioning of this BH */
black_holes_end_reposition
(
bp
,
e
->
black_holes_properties
,
e
->
physical_constants
,
e
->
cosmology
);
e
->
physical_constants
,
e
->
cosmology
);
/* Get particle time-step */
double
dt
;
...
...
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