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
1a81e823
Commit
1a81e823
authored
6 years ago
by
Josh Borrow
Browse files
Options
Downloads
Patches
Plain Diff
Added hydro_convert_quantities for u conversion in cosmological runs
parent
d65cb17c
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!611
Cosmology pressure energy
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hydro/PressureEnergy/hydro.h
+22
-1
22 additions, 1 deletion
src/hydro/PressureEnergy/hydro.h
with
22 additions
and
1 deletion
src/hydro/PressureEnergy/hydro.h
+
22
−
1
View file @
1a81e823
...
...
@@ -609,10 +609,31 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
*
* @param p The particle to act upon
* @param xp The extended particle to act upon
* @param cosmo The cosmological model.
* @param hydro_props The constants used in the scheme.
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_convert_quantities
(
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
,
const
struct
cosmology
*
cosmo
,
const
struct
hydro_props
*
hydro_props
)
{}
const
struct
cosmology
*
cosmo
,
const
struct
hydro_props
*
hydro_props
)
{
/* Convert the physcial internal energy to the comoving one. */
/* u' = a^(3(g-1)) u */
const
float
factor
=
1
.
f
/
cosmo
->
a_factor_internal_energy
;
p
->
u
*=
factor
;
xp
->
u_full
=
p
->
u
;
/* Apply the minimal energy limit */
const
float
min_energy
=
hydro_props
->
minimal_internal_energy
/
cosmo
->
a_factor_internal_energy
;
if
(
xp
->
u_full
<
min_energy
)
{
xp
->
u_full
=
min_energy
;
p
->
u
=
min_energy
;
p
->
u_dt
=
0
.
f
;
}
/* Note that unlike Minimal the pressure and sound speed cannot be calculated
* here because they are smoothed properties in this scheme. */
}
/**
* @brief Initialises the particles for the first time
...
...
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