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
8a20a87f
Commit
8a20a87f
authored
6 years ago
by
Folkert Nobels
Browse files
Options
Downloads
Patches
Plain Diff
Add the Schaye (2004) critical density to form stars in the initialization
parent
e2a6cf76
No related branches found
No related tags found
1 merge request
!705
Star formation following Schaye08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/starformation/schaye08/starformation.h
+55
-0
55 additions, 0 deletions
src/starformation/schaye08/starformation.h
with
55 additions
and
0 deletions
src/starformation/schaye08/starformation.h
+
55
−
0
View file @
8a20a87f
...
...
@@ -59,6 +59,18 @@ struct star_formation {
/*! Inverse of RAND_MAX */
double
inv_RAND_MAX
;
/*! Critical density to form stars */
double
den_crit
;
/*! Scaling metallicity */
double
Z0
;
/*! critical density Metallicity power law */
double
n_Z0
;
/*! Normalization of critical SF density of Schaye (2004) */
double
den_crit_star
;
};
...
...
@@ -220,6 +232,49 @@ static void starformation_init_backend(
starform
->
Astar
=
starform
->
A
*
pow
(
M_per_pc2
,
-
starform
->
nks
)
*
pow
(
starform
->
gamma
*
starform
->
fg
/
G_newton
,
starform
->
nstar
);
/* critical star formation number density parameters */
/* standard variables based on the EAGLE values */
static
const
int
schaye2004_default
=
1
;
static
const
double
norm_ncrit_default
=
0
.
1
;
static
const
double
norm_ncrit_no04_default
=
10
.;
static
const
double
Z0_default
=
0
.
002
;
static
const
double
powerlawZ_default
=
-
0
.
64
;
/* Read what kind of critical density we need to use
* Schaye (2004) is metallicity dependent critical SF density*/
static
const
int
schaye2004
=
parser_get_opt_param_double
(
parameter_file
,
"SchayeSF:Schaye2004"
,
schaye2004_default
);
if
(
!
schaye2004
)
{
/* In the case that we do not use the Schaye (2004) critical
* density to form stars but a constant value */
starform
->
den_crit
=
parser_get_opt_param_double
(
parameter_file
,
"SchayeSF:norm_ncrit"
,
norm_ncrit_no04_default
);
starform
->
Z0
=
Z0_default
;
starform
->
n_Z0
=
0
.
0
;
}
else
{
/* Use the Schaye (2004) metallicity dependent critical density
* to form stars. */
/* Read the normalization of the metallicity dependent critical
* density*/
starform
->
den_crit
=
parser_get_opt_param_double
(
parameter_file
,
"SchayeSF:norm_ncrit"
,
Z0_default
);
/* Read the scale metallicity Z0 */
starform
->
Z0
=
parser_get_opt_param_double
(
parameter_file
,
"SchayeSF:Z0"
,
Z0_default
);
/* Read the power law of the critical density scaling */
staform
->
n_Z0
=
parser_get_opt_param_double
(
parameter_file
,
"SchayeSF:n_Z0"
,
powerlawZ_default
);
}
/* Calculate the prefactor that is always common */
/* !!!DONT FORGET TO DO THE CORRECT UNIT CONVERSION!!!*/
starform
->
den_crit_star
=
starform
->
den_crit
/
pow
(
starform
->
Z0
,
starform
->
n_Z0
);
}
...
...
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