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
321b2362
Commit
321b2362
authored
6 years ago
by
Folkert Nobels
Browse files
Options
Downloads
Patches
Plain Diff
Largely make the starformation_init_backend
parent
7216e72f
Branches
Branches containing commit
Tags
Tags containing commit
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
+57
-15
57 additions, 15 deletions
src/starformation/schaye08/starformation.h
with
57 additions
and
15 deletions
src/starformation/schaye08/starformation.h
+
57
−
15
View file @
321b2362
...
...
@@ -23,53 +23,95 @@
/* Starformation struct */
struct
star_formation
{
/* Normalization of the KS star formation law */
/*
!
Normalization of the KS star formation law */
double
A
;
/* Slope of the KS law */
/*
!
Slope of the KS law */
double
nks
;
/* Critical density */
double
rho
_crit
;
/*
!
Critical density */
double
Delta
_crit
;
/* Critical temperature */
/*
!
Critical temperature */
double
T_crit
;
/* Ratio of the specific heats */
/*
!
Ratio of the specific heats */
double
gamma
;
/* gas fraction */
/*
!
gas fraction */
double
fg
;
/* Star formation law slope */
/*
!
Star formation law slope */
double
nstar
;
/* star formation normalization of schaye+08 */
/*
!
star formation normalization of schaye+08 */
double
Astar
;
};
/* Brief initialization of the star formation law
*
/*
* Brief initialization of the star formation law
*
* @param parameter_file The parsed parameter file
* @param phys_const Physical constants in internal units
* @param us The current internal system of units
* @param starform the star formation law properties to initialize
*
* */
static
void
starformation_init_backend
(
)
{
struct
swift_params
*
parameter_file
,
const
struct
phys_const
*
phys_const
,
const
struct
unit_system
*
us
,
const
struct
space
*
s
,
const
struct
star_formation
*
starform
)
{
/* Default values for the normalization and the power law */
static
const
double
normalization_default
=
2.5e-4
;
static
const
double
KS_power_law
=
1
.
4
;
static
const
double
KS_power_law_default
=
1
.
4
;
/* Default value for the heat capacity ratio gamma */
static
const
double
gamma_default
=
5
.
f
/
3
.
f
;
/* Read the critical density contrast from the parameter file*/
starform
->
Delta_crit
=
parser_get_param_double
(
parameter_file
,
"SchayeSF:Delta_crit"
);
/* Read the critical temperature from the parameter file */
starform
->
T_crit
=
parser_get_param_double
(
parameter_file
,
"SchayeSF:T_crit"
);
/* Read the gas fraction from the file */
starform
->
fg
=
parser_get_param_double
(
parameter_file
,
"SchayeSF:fg"
);
/* Read the normalization */
const
double
normalization
=
parser_get_opt_param_double
(
parameter_file
,
"SchayeSF:A"
,
normalization_default
);
/* Read the Kennicutt-Schmidt power law exponent */
starform
->
nks
=
parser_get_opt_param_double
(
parameter_file
,
"SchayeSF:nks"
,
KS_power_law_default
);
/* Read the heat capacity ratio gamma */
starform
->
gamma
=
parser_get_opt_param_double
(
parameter_file
,
"SchayeSF:gamma"
,
gamma_default
);
/* Calculate the power law of the star formation */
starform
->
nstar
=
(
starform
->
nks
-
1
.
f
)
/
2
.
f
;
/* Get the appropriate constant to calculate the
* star formation constant */
const
double
G_newton
=
phys_const
->
const_newton_G
;
}
/* @brief Prints the used parameters of the star formation law
*
* @param starform the star formation law properties.
* */
static
void
starformation_print_backend
(
const
struct
star_formation
*
starform
){
){
message
(
"Star formation law is Schaye and Dalla Vecchia (2008)"
" with properties, normalization = %e, slope of the Kennicutt"
"-Schmidt law = %e, gamma = %e, gas fraction = %e, critical "
...
...
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