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
02bb6dbf
Commit
02bb6dbf
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Correctly initialize the SNIa DTD in the EAGLE feedack model.
parent
2f4d5ccb
No related branches found
No related tags found
1 merge request
!954
Change the EAGLE SNIa DTD to a properly normalized power-law of slope -1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/feedback/EAGLE/feedback.c
+10
-2
10 additions, 2 deletions
src/feedback/EAGLE/feedback.c
src/feedback/EAGLE/feedback_properties.h
+6
-2
6 additions, 2 deletions
src/feedback/EAGLE/feedback_properties.h
with
16 additions
and
4 deletions
src/feedback/EAGLE/feedback.c
+
10
−
2
View file @
02bb6dbf
...
...
@@ -304,8 +304,10 @@ INLINE static void evolve_SNIa(
double
star_age_Gyr
,
const
double
dt_Gyr
,
struct
feedback_spart_data
*
const
feedback_data
)
{
const
double
star_age_end_step_Gyr
=
star_age_Gyr
+
dt_Gyr
;
/* Check if we're outside the mass range for SNIa */
if
(
star_age_
Gyr
+
dt
_Gyr
<
props
->
SNIa_DTD_delay_Gyr
)
return
;
if
(
star_age_
end_step
_Gyr
<
props
->
SNIa_DTD_delay_Gyr
)
return
;
#ifdef SWIFT_DEBUG_CHECKS
if
(
dt_Gyr
<
0
.)
error
(
"Negative time-step length!"
);
...
...
@@ -317,7 +319,7 @@ INLINE static void evolve_SNIa(
/* Compute the number of SNIa */
const
float
num_SNIa
=
eagle_feedback_number_of_SNIa
(
M_init
,
star_age_Gyr
,
star_age_
Gyr
+
dt
_Gyr
,
props
);
M_init
,
star_age_Gyr
,
star_age_
end_step
_Gyr
,
props
);
/* Compute mass of each metal */
for
(
int
i
=
0
;
i
<
chemistry_element_count
;
i
++
)
{
...
...
@@ -967,17 +969,23 @@ void feedback_props_init(struct feedback_props* fp,
if
(
strcmp
(
temp
,
"Exponential"
)
==
0
)
{
fp
->
SNIa_DTD
=
eagle_feedback_SNIa_DTD_exponential
;
/* Read SNIa exponential DTD model parameters */
fp
->
SNIa_DTD_exp_norm
=
parser_get_param_float
(
params
,
"EAGLEFeedback:SNIa_DTD_exp_norm_p_Msun"
);
fp
->
SNIa_DTD_exp_timescale_Gyr
=
parser_get_param_float
(
params
,
"EAGLEFeedback:SNIa_DTD_exp_timescale_Gyr"
);
fp
->
SNIa_DTD_exp_timescale_Gyr_inv
=
1
.
f
/
fp
->
SNIa_DTD_exp_timescale_Gyr
;
}
else
if
(
strcmp
(
temp
,
"PowerLaw"
)
==
0
)
{
fp
->
SNIa_DTD
=
eagle_feedback_SNIa_DTD_power_law
;
/* Read SNIa power-law DTD model parameters */
fp
->
SNIa_DTD_power_law_norm
=
parser_get_param_float
(
params
,
"EAGLEFeedback:SNIa_DTD_power_law_norm_p_Msun"
);
}
else
{
error
(
"Invalid SNIa DTD model: '%s'"
,
temp
);
}
...
...
This diff is collapsed.
Click to expand it.
src/feedback/EAGLE/feedback_properties.h
+
6
−
2
View file @
02bb6dbf
...
...
@@ -75,8 +75,12 @@ struct lifetime_table {
* @brief Functional form of the SNIa delay time distribution.
*/
enum
eagle_feedback_SNIa_DTD
{
eagle_feedback_SNIa_DTD_power_law
,
/*!< Power-law with slope -1 */
eagle_feedback_SNIa_DTD_exponential
/*!< Exponential model (EAGLE default) */
/*! Power-law with slope -1 */
eagle_feedback_SNIa_DTD_power_law
=
1
,
/*! Exponential model (EAGLE default) */
eagle_feedback_SNIa_DTD_exponential
=
2
};
/**
...
...
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