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
4edc5565
Commit
4edc5565
authored
6 years ago
by
Jacob Kegerreis
Browse files
Options
Downloads
Patches
Plain Diff
Define the viscosity beta as a constant instead of hard-coded
parent
9f747b8b
No related branches found
No related tags found
1 merge request
!627
Define the viscosity beta as a constant instead of a hardcoded value
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/const.h
+4
-1
4 additions, 1 deletion
src/const.h
src/hydro/Planetary/hydro_iact.h
+2
-2
2 additions, 2 deletions
src/hydro/Planetary/hydro_iact.h
with
6 additions
and
3 deletions
src/const.h
+
4
−
1
View file @
4edc5565
...
...
@@ -21,7 +21,10 @@
#define SWIFT_CONST_H
/* SPH Viscosity constants. */
#define const_viscosity_alpha 0.8f
/* Cosmology defaults: a=0.8, b=1.5a. Planetary defaults: a=1.5, b=2.0a */
#define const_viscosity_alpha 1.5f
#define const_viscosity_beta_over_alpha 2.0f
#define const_viscosity_alpha_min \
0.1f
/* Values taken from (Price,2004), not used in legacy gadget mode */
#define const_viscosity_alpha_max \
...
...
This diff is collapsed.
Click to expand it.
src/hydro/Planetary/hydro_iact.h
+
2
−
2
View file @
4edc5565
...
...
@@ -189,7 +189,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
/* Compute sound speeds and signal velocity */
const
float
ci
=
pi
->
force
.
soundspeed
;
const
float
cj
=
pj
->
force
.
soundspeed
;
const
float
v_sig
=
ci
+
cj
-
3
.
f
*
mu_ij
;
const
float
v_sig
=
ci
+
cj
-
2
.
f
*
const_viscosity_beta_over_alpha
*
mu_ij
;
/* Now construct the full viscosity term */
const
float
rho_ij
=
0
.
5
f
*
(
rhoi
+
rhoj
);
...
...
@@ -315,7 +315,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
const
float
cj
=
pj
->
force
.
soundspeed
;
/* Signal velocity */
const
float
v_sig
=
ci
+
cj
-
3
.
f
*
mu_ij
;
const
float
v_sig
=
ci
+
cj
-
2
.
f
*
const_viscosity_beta_over_alpha
*
mu_ij
;
/* Construct the full viscosity term */
const
float
rho_ij
=
0
.
5
f
*
(
rhoi
+
rhoj
);
...
...
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