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
2c32b1e7
Commit
2c32b1e7
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Extended the modifications to the other schemes.
parent
23f1178d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!307
Fix cooling bug
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/CoolingHaloWithSpin/cooling_halo.yml
+3
-3
3 additions, 3 deletions
examples/CoolingHaloWithSpin/cooling_halo.yml
src/hydro/Minimal/hydro.h
+4
-2
4 additions, 2 deletions
src/hydro/Minimal/hydro.h
src/hydro/PressureEntropy/hydro.h
+4
-5
4 additions, 5 deletions
src/hydro/PressureEntropy/hydro.h
with
11 additions
and
10 deletions
examples/CoolingHaloWithSpin/cooling_halo.yml
+
3
−
3
View file @
2c32b1e7
...
@@ -9,8 +9,8 @@ InternalUnitSystem:
...
@@ -9,8 +9,8 @@ InternalUnitSystem:
# Parameters governing the time integration
# Parameters governing the time integration
TimeIntegration
:
TimeIntegration
:
time_begin
:
0.
# The starting time of the simulation (in internal units).
time_begin
:
0.
# The starting time of the simulation (in internal units).
time_end
:
10.
# The end time of the simulation (in internal units).
time_end
:
10.
# The end time of the simulation (in internal units).
dt_min
:
1e-
8
# The minimal time-step size of the simulation (in internal units).
dt_min
:
1e-
5
# The minimal time-step size of the simulation (in internal units).
dt_max
:
1e-1
# The maximal time-step size of the simulation (in internal units).
dt_max
:
1e-1
# The maximal time-step size of the simulation (in internal units).
# Parameters governing the conserved quantities statistics
# Parameters governing the conserved quantities statistics
...
@@ -40,7 +40,7 @@ IsothermalPotential:
...
@@ -40,7 +40,7 @@ IsothermalPotential:
position_z
:
0.
position_z
:
0.
vrot
:
200.
# Rotation speed of isothermal potential in internal units
vrot
:
200.
# Rotation speed of isothermal potential in internal units
timestep_mult
:
0.03
# Controls time step
timestep_mult
:
0.03
# Controls time step
epsilon
:
0.1
# Softening for the isothermal potential
epsilon
:
1.0
# Softening for the isothermal potential
# Cooling parameters
# Cooling parameters
LambdaCooling
:
LambdaCooling
:
...
...
This diff is collapsed.
Click to expand it.
src/hydro/Minimal/hydro.h
+
4
−
2
View file @
2c32b1e7
...
@@ -360,8 +360,10 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
...
@@ -360,8 +360,10 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
,
float
dt
)
{
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
,
float
dt
)
{
/* Do not decrease the energy by more than a factor of 2*/
/* Do not decrease the energy by more than a factor of 2*/
const
float
u_change
=
p
->
u_dt
*
dt
;
if
(
p
->
u_dt
<
-
0
.
5
f
*
xp
->
u_full
/
dt
)
{
xp
->
u_full
=
max
(
xp
->
u_full
+
u_change
,
0
.
5
f
*
xp
->
u_full
);
p
->
u_dt
=
-
0
.
5
f
*
xp
->
u_full
/
dt
;
}
xp
->
u_full
+=
p
->
u_dt
*
dt
;
/* Compute the pressure */
/* Compute the pressure */
const
float
pressure
=
gas_pressure_from_internal_energy
(
p
->
rho
,
xp
->
u_full
);
const
float
pressure
=
gas_pressure_from_internal_energy
(
p
->
rho
,
xp
->
u_full
);
...
...
This diff is collapsed.
Click to expand it.
src/hydro/PressureEntropy/hydro.h
+
4
−
5
View file @
2c32b1e7
...
@@ -394,11 +394,10 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
...
@@ -394,11 +394,10 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
,
float
dt
)
{
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
,
float
dt
)
{
/* Do not decrease the entropy (temperature) by more than a factor of 2*/
/* Do not decrease the entropy (temperature) by more than a factor of 2*/
const
float
entropy_change
=
p
->
entropy_dt
*
dt
;
if
(
p
->
entropy_dt
<
-
0
.
5
f
*
xp
->
entropy_full
/
dt
)
{
if
(
entropy_change
>
-
0
.
5
f
*
xp
->
entropy_full
)
p
->
entropy_dt
=
-
0
.
5
f
*
xp
->
entropy_full
/
dt
;
xp
->
entropy_full
+=
entropy_change
;
}
else
xp
->
entropy_full
+=
p
->
entropy_dt
*
dt
;
xp
->
entropy_full
*=
0
.
5
f
;
/* Compute the pressure */
/* Compute the pressure */
const
float
pressure
=
const
float
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