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
4517ef2b
Commit
4517ef2b
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
When converting internal energy to entropy at startup, apply the correct cosmology factor.
parent
1873154b
No related branches found
No related tags found
1 merge request
!516
More cosmology work
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hydro/Gadget2/hydro.h
+9
-4
9 additions, 4 deletions
src/hydro/Gadget2/hydro.h
with
9 additions
and
4 deletions
src/hydro/Gadget2/hydro.h
+
9
−
4
View file @
4517ef2b
...
...
@@ -545,13 +545,18 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
*
* Requires the density to be known
*
* @param p The particle to act upon
* @param p The particle to act upon.
* @param xp The extended data.
* @param cosmo The cosmological model.
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_convert_quantities
(
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
)
{
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
,
const
struct
cosmology
*
cosmo
)
{
/* We read u in the entropy field. We now get S from u */
xp
->
entropy_full
=
gas_entropy_from_internal_energy
(
p
->
rho
,
p
->
entropy
);
/* We read u in the entropy field. We now get (comoving) S from (physical) u
* and (physical) rho. Note that comoving S == physical S */
xp
->
entropy_full
=
gas_entropy_from_internal_energy
(
p
->
rho
*
cosmo
->
a3_inv
,
p
->
entropy
);
p
->
entropy
=
xp
->
entropy_full
;
/* Compute the pressure */
...
...
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