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
d0ad4a5b
Commit
d0ad4a5b
authored
Dec 18, 2018
by
Folkert Nobels
Browse files
Update stars after rebase
parent
cb40e538
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/runner.c
View file @
d0ad4a5b
...
...
@@ -64,6 +64,7 @@
#include
"task.h"
#include
"timers.h"
#include
"timestep.h"
#include
"tracers.h"
#include
"starformation.h"
#define TASK_LOOP_DENSITY 0
...
...
@@ -496,20 +497,7 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
if
(
star_formation_convert_to_star
(
starform
,
p
,
xp
,
constants
,
cosmo
)
)
{
star_formation_copy_properties
(
e
,
c
,
p
,
xp
,
starform
,
constants
,
cosmo
,
with_cosmology
);
//struct spart *sp = cell_conert_part_to_spart(c, p, ...);
//
//
//
//
// star_formation_copy_properties(p, xp, sp);
}
// MATTHIEU: Temporary star-formation law
// Do not use this at home.
//if (rho > 1.5e7 && e->step > 2) {
// message("Removing particle id=%lld rho=%e", p->id, rho);
// cell_convert_part_to_gpart(e, c, p, xp);
//}
}
}
}
...
...
src/starformation/schaye08/starformation.h
View file @
d0ad4a5b
...
...
@@ -27,6 +27,7 @@
#include
"cosmology.h"
#include
"physical_constants.h"
#include
"units.h"
#include
"engine.h"
#include
"parser.h"
#include
"equation_of_state.h"
#include
"part.h"
...
...
@@ -224,11 +225,15 @@ INLINE static void star_formation_copy_properties(
sp
->
mass
=
p
->
mass
;
sp
->
mass_init
=
p
->
mass
;
if
(
with_cosmology
)
{
sp
->
ag
e
=
cosmo
->
a
;
sp
->
birth_tim
e
=
cosmo
->
a
;
}
else
{
sp
->
age
=
cosmo
->
a
;
sp
->
birth_time
=
e
->
time
;
}
message
(
"Copy Properties"
);
sp
->
chemistry_data
=
p
->
chemistry_data
;
//sp->tracers_data = p->tracers_data;
//sp->birth_density = p->density;
}
...
...
@@ -329,37 +334,12 @@ INLINE static void starformation_init_backend(
"SchayeSF:T_crit"
);
/* Read the gas fraction from the file */
starform
->
fg
=
parser_get_param_double
(
parameter_file
,
starform
->
fg
as
=
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
;
/* Calculate inverse of RAND_MAX */
starform
->
inv_RAND_MAX
=
1
.
f
/
RAND_MAX
;
/* Get the appropriate constant to calculate the
* star formation constant */
const
double
KS_const
=
phys_const
->
const_kennicutt_schmidt_units
;
/* Get the Gravitational constant */
const
double
G_newton
=
phys_const
->
const_newton_G
;
/* Get the surface density unit M_\odot / pc^2 */
const
double
M_per_pc2
=
phys_const
->
const_solar_mass_per_parsec2
;
/* Calculate the SF high density normalization */
starform
->
SF_high_den_normalization
=
starform
->
KS_high_den_normalization
*
pow
(
M_per_pc2
,
-
starform
->
KS_high_den_power_law
)
*
pow
(
hydro_gamma
...
...
src/stars/EAGLE/stars_part.h
View file @
d0ad4a5b
...
...
@@ -25,6 +25,7 @@
/* Read chemistry */
#include
"chemistry_struct.h"
//#include "tracers.h"
/**
* @brief Particle fields for the star particles.
...
...
@@ -57,8 +58,14 @@ struct spart {
/*! Initial star mass */
float
mass_init
;
/*! Stellar age */
float
age
;
/*! Birth time */
float
birth_time
;
/*! Birth density */
float
birth_density
;
/*! Tracer structure */
//struct tracers_xpart_data tracers_data;
/* Particle cutoff radius. */
float
h
;
...
...
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