Define the viscosity beta as a constant instead of a hardcoded value
Set #define const_viscosity_beta
in const.h
instead of the hardcoded value of 3 in hydro_iact.h
.
Note: default cosmology alpha = 0.8, beta = 3; and planetary alpha = 1.5, beta = 4.
Merge request reports
Activity
added 1 commit
- 1212c95e - Add the defined viscosity beta to gizmo schemes too
I just depends what we want the user input "BETA" to be. I was keeping it BETA = beta/alpha from the original Monaghan/Balsara form of
visc = -alpha * c * mu + beta * mu^2
(1)
We're instead using
visc = -1/2 * alpha * mu * v_sig
(2)
where the 1/2 is because of the two sound speeds in
v_sig = 2 * c - BETA * mu
(3)
So (3) into (2) gives
visc = -alpha * c * mu + 1/2 * alpha * BETA * mu
(4)
Compare with (1) and BETA would = 2 * beta / alpha which is not what we want (unless it is). So to keep the BETA = beta/alpha I added the factor of 2 in (3).It comes down to whether you want the user to input
#define const_viscosity_beta 1.5f
or3.f
From my end, it's nicer to say "beta = 1.5 * alpha". But like you said, anything's fine as long as it's made clear
Edited by Jacob KegerreisThe reference I have been using thus far is my own derivation based on Price+10.
That would be equation (46), (48) and (49) and (52). Sorry about the scale-factors, let's just assume a==1 and H==0.
Do these make sense to you?
and
\Pi_{ij}expands into\alpha (c_i + c_j - \beta \mu_{ij}) \mu_{ij}which means\alpha (c_i + c_j)\mu_{ij} - \alpha\beta \mu_{ij}^2Edited by Matthieu SchallerYep, so just to be extra sure: with the half, your
\beta = 2 \beta / \alphain their Monaghan definitions, right?So we're using Price (2010) eqn 103 instead of 98.
Edited by Jacob KegerreisYes, but the
(c+c)/2compared with\bar{c}issue is only for\alpha, whereas\betasimply doesn't have the 1/2 in (98) but does have it in (103). So the two\alphaare the same but the two\betaare not, right? Sorry if I'm still missing something but I just want to make sure.Edited by Jacob KegerreisRight, good.
So as a final focus on the end point: If someone says they use Monaghan/Balsara viscosity with
\alpha=1.5and\beta=2 \alpha = 3, then in SWIFT they need to setconst_viscosity_beta 4.0f
for the\simsame behaviour.Edited by Jacob KegerreisAgreed.
- alpha_Monaghan == SWIFT_alpha
- beta_Monaghan == (1/2) * SWIFT_alpha * SWIFT_beta
Edited by Matthieu Schalleradded 38 commits
-
c677952f...bfe5e47c - 30 commits from branch
master
- 9f747b8b - Add email to author list
- 4edc5565 - Define the viscosity beta as a constant instead of hard-coded
- e5aa7a68 - Add variable viscosity beta to all 'normal' hydro schemes
- d8c492ec - Set the default cosmology viscosity parameters before merging
- 0266c335 - Add the defined viscosity beta to gizmo schemes too
- cfa8ac1b - Rename viscosity beta
- c89b6aab - Set Balsara as the default for Planetary hydro
- cc7b2b00 - Tweak the viscosity beta definition
Toggle commit list-
c677952f...bfe5e47c - 30 commits from branch
@jwillis can you cross-check that this is fine with the vectorized version?
mentioned in commit 954074a7