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
676ed7b4
Commit
676ed7b4
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Better documentation of the initial and minimal temperature setting in the hydro properties.
parent
23a2a124
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hydro_properties.c
+14
-11
14 additions, 11 deletions
src/hydro_properties.c
with
14 additions
and
11 deletions
src/hydro_properties.c
+
14
−
11
View file @
676ed7b4
...
...
@@ -93,7 +93,7 @@ void hydro_props_init(struct hydro_props *p,
p
->
initial_temperature
=
parser_get_opt_param_float
(
params
,
"SPH:initial_temperature"
,
hydro_props_default_init_temp
);
/*
Initi
al temperature */
/*
Minim
al temperature */
p
->
minimal_temperature
=
parser_get_opt_param_float
(
params
,
"SPH:minimal_temperature"
,
hydro_props_default_min_temp
);
...
...
@@ -106,11 +106,12 @@ void hydro_props_init(struct hydro_props *p,
params
,
"SPH:H_mass_fraction"
,
hydro_props_default_H_fraction
);
/* Compute the initial energy (Note the temp. read is in internal units) */
/* u_init = k_B T_init / (mu m_p (gamma - 1)) */
double
u_init
=
phys_const
->
const_boltzmann_k
/
phys_const
->
const_proton_mass
;
u_init
*=
p
->
initial_temperature
;
u_init
*=
hydro_one_over_gamma_minus_one
;
/* Correct for hydrogen mass fraction */
/* Correct for hydrogen mass fraction
(mu)
*/
double
mean_molecular_weight
;
if
(
p
->
initial_temperature
*
units_cgs_conversion_factor
(
us
,
UNIT_CONV_TEMPERATURE
)
>
...
...
@@ -122,11 +123,12 @@ void hydro_props_init(struct hydro_props *p,
p
->
initial_internal_energy
=
u_init
/
mean_molecular_weight
;
/* Compute the minimal energy (Note the temp. read is in internal units) */
/* u_min = k_B T_min / (mu m_p (gamma - 1)) */
double
u_min
=
phys_const
->
const_boltzmann_k
/
phys_const
->
const_proton_mass
;
u_min
*=
p
->
minimal_temperature
;
u_min
*=
hydro_one_over_gamma_minus_one
;
/* Correct for hydrogen mass fraction */
/* Correct for hydrogen mass fraction
(mu)
*/
if
(
p
->
minimal_temperature
*
units_cgs_conversion_factor
(
us
,
UNIT_CONV_TEMPERATURE
)
>
1e4
)
...
...
@@ -135,14 +137,6 @@ void hydro_props_init(struct hydro_props *p,
mean_molecular_weight
=
4
.
/
(
1
.
+
3
.
*
p
->
hydrogen_mass_fraction
);
p
->
minimal_internal_energy
=
u_min
/
mean_molecular_weight
;
#ifdef PLANETARY_SPH
#ifdef PLANETARY_SPH_BALSARA
message
(
"Planetary SPH: Balsara switch enabled"
);
#else
message
(
"Planetary SPH: Balsara switch disabled"
);
#endif // PLANETARY_SPH_BALSARA
#endif // PLANETARY_SPH
}
/**
...
...
@@ -184,6 +178,15 @@ void hydro_props_print(const struct hydro_props *p) {
if
(
p
->
minimal_temperature
!=
hydro_props_default_min_temp
)
message
(
"Minimal gas temperature set to %f"
,
p
->
minimal_temperature
);
// Matthieu: Temporary location for this i/o business.
#ifdef PLANETARY_SPH
#ifdef PLANETARY_SPH_BALSARA
message
(
"Planetary SPH: Balsara switch enabled"
);
#else
message
(
"Planetary SPH: Balsara switch disabled"
);
#endif // PLANETARY_SPH_BALSARA
#endif // PLANETARY_SPH
}
#if defined(HAVE_HDF5)
...
...
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