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
10405012
Commit
10405012
authored
Sep 05, 2016
by
Matthieu Schaller
Browse files
Make the cooling compatible with GIZMO as well. Added Stefan and Massimiliano to the author list.
parent
82d4f18f
Changes
3
Hide whitespace changes
Inline
Side-by-side
AUTHORS
View file @
10405012
...
...
@@ -8,3 +8,5 @@ John A. Regan john.a.regan@durham.ac.uk
Angus Lepper angus.lepper@ed.ac.uk
Tom Theuns tom.theuns@durham.ac.uk
Richard G. Bower r.g.bower@durham.ac.uk
Stefan Arridge stefan.arridge@durham.ac.uk
Massimiliano Culpo massimiliano.culpo@googlemail.com
src/cooling/const_lambda/cooling.h
View file @
10405012
...
...
@@ -72,7 +72,7 @@ __attribute__((always_inline)) INLINE static float cooling_rate(
/* Get particle properties */
/* Density */
const
float
rho
=
p
->
rho
;
const
float
rho
=
hydro_get_density
(
p
)
;
/* Get cooling function properties */
const
float
X_H
=
cooling
->
hydrogen_mass_abundance
;
/* lambda should always be set in cgs units */
...
...
src/hydro/Gizmo/hydro.h
View file @
10405012
...
...
@@ -20,6 +20,7 @@
#include
<float.h>
#include
"adiabatic_index.h"
#include
"approx_math.h"
#include
"equation_of_state.h"
#include
"hydro_gradients.h"
#include
"minmax.h"
...
...
@@ -502,3 +503,34 @@ __attribute__((always_inline)) INLINE static float hydro_get_density(
return
p
->
primitives
.
rho
;
}
/**
* @brief Modifies the thermal state of a particle to the imposed internal
* energy
*
* This overrides the current state of the particle but does *not* change its
* time-derivatives
*
* @param p The particle
* @param u The new internal energy
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_set_internal_energy
(
struct
part
*
restrict
p
,
float
u
)
{
p
->
conserved
.
energy
=
u
;
}
/**
* @brief Modifies the thermal state of a particle to the imposed entropy
*
* This overrides the current state of the particle but does *not* change its
* time-derivatives
*
* @param p The particle
* @param S The new entropy
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_set_entropy
(
struct
part
*
restrict
p
,
float
S
)
{
p
->
conserved
.
energy
=
gas_internal_energy_from_entropy
(
p
->
primitives
.
rho
,
S
);
}
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