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
8e412233
Commit
8e412233
authored
6 years ago
by
Folkert Nobels
Browse files
Options
Downloads
Patches
Plain Diff
Star of the first part of the starformation law that checks density and temperature
parent
19a9e958
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
+38
-3
38 additions, 3 deletions
src/starformation/schaye08/starformation.h
with
38 additions
and
3 deletions
src/starformation/schaye08/starformation.h
+
38
−
3
View file @
8e412233
...
...
@@ -20,6 +20,13 @@
#ifndef SWIFT_SCHAYE_STARFORMATION_H
#define SWIFT_SCHAYE_STARFORMATION_H
/* Local includes */
#include
"cosmology.h"
#include
"physical_constants.h"
#include
"units.h"
#include
"parser.h"
#include
"equation_of_state.h"
/* Starformation struct */
struct
star_formation
{
...
...
@@ -29,7 +36,7 @@ struct star_formation {
/*! Slope of the KS law */
double
nks
;
/*! Critical density */
/*! Critical
over
density */
double
Delta_crit
;
/*! Critical temperature */
...
...
@@ -53,11 +60,39 @@ struct star_formation {
* @brief Calculate if the gas has the potential of becoming
* a star.
*
* @param starform the star formation law properties to use.
* @param p the gas particles
* @param xp the additional properties of the gas particles
* @param phys_const the physical constants in internal units
* @param cosmo the cosmological parameters and properties
*
* */
static
int
starformation_potential_to_become_star
(
){
return
0
;
const
struct
star_formation
*
starform
,
const
struct
parts
*
p
,
const
struct
xparts
*
xp
,
const
struct
phys_const
*
const
phys_const
,
const
struct
cosmology
*
cosmo
){
/* Read the critical overdensity factor and the critical density of
* the universe to determine the critical density to form stars*/
const
double
rho_crit
=
cosmo
->
critical_density
*
starform
->
Delta_crit
;
/* Calculate the internal energy using the density and entropy */
/* Ask Matthieu about p->entropy vs xp->entropy_full */
const
double
internal_energy
=
gas_internal_energy_from_entropy
(
p
->
rho
,
p
->
entropy
)
/* Calculate the temperature over mu of the gas */
const
double
T_over_mu
=
(
starform
->
gamma
-
1
)
*
phys_const
->
const_proton_mass
/
phys_const
->
const_boltzmann_k
;
/* Deside whether we should form stars or not */
if
((
p
->
rho
>
rho_crit
)
&&
(
tempp
<
starform
->
T_crit
))
{
return
1
;
}
else
{
return
0
;
}
}
/*
...
...
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