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
9037c0a0
Commit
9037c0a0
authored
May 30, 2019
by
Matthieu Schaller
Browse files
Also compute the feedback strength when a star's smoothing length is limited by its softening.
parent
21836158
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/runner.c
View file @
9037c0a0
...
...
@@ -282,7 +282,52 @@ void runner_do_stars_ghost(struct runner *r, struct cell *c, int timer) {
((
sp
->
h
<=
stars_h_min
)
&&
(
f
>
0
.
f
)))
{
stars_reset_feedback
(
sp
);
feedback_reset_feedback
(
sp
,
feedback_props
);
/* Only do feedback if stars have a reasonable birth time */
if
(
feedback_do_feedback
(
sp
))
{
const
integertime_t
ti_step
=
get_integer_timestep
(
sp
->
time_bin
);
const
integertime_t
ti_begin
=
get_integer_time_begin
(
e
->
ti_current
-
1
,
sp
->
time_bin
);
/* Get particle time-step */
double
dt
;
if
(
with_cosmology
)
{
dt
=
cosmology_get_delta_time
(
e
->
cosmology
,
ti_begin
,
ti_begin
+
ti_step
);
}
else
{
dt
=
get_timestep
(
sp
->
time_bin
,
e
->
time_base
);
}
/* Calculate age of the star at current time */
double
star_age_end_of_step
;
if
(
with_cosmology
)
{
star_age_end_of_step
=
cosmology_get_delta_time_from_scale_factors
(
cosmo
,
(
double
)
sp
->
birth_scale_factor
,
cosmo
->
a
);
}
else
{
star_age_end_of_step
=
(
float
)
e
->
time
-
sp
->
birth_time
;
}
/* Has this star been around for a while ? */
if
(
star_age_end_of_step
>
0
.)
{
/* Age of the star at the start of the step */
const
double
star_age_beg_of_step
=
max
(
star_age_end_of_step
-
dt
,
0
.);
/* Compute the stellar evolution */
feedback_evolve_spart
(
sp
,
feedback_props
,
cosmo
,
us
,
star_age_beg_of_step
,
dt
);
}
else
{
/* Reset the feedback fields of the star particle */
feedback_reset_feedback
(
sp
,
feedback_props
);
}
}
else
{
feedback_reset_feedback
(
sp
,
feedback_props
);
}
/* Ok, we are done with this particle */
continue
;
...
...
Matthieu Schaller
@matthieu
mentioned in issue
#580 (closed)
·
Jun 03, 2019
mentioned in issue
#580 (closed)
mentioned in issue #580
Toggle commit list
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