Hello Volker,
Thank you for the clarification! After reading your answer, I carefully
went through the SPH part of the code and I think there really is no
inconsistency.
I did find one small inconsistency in the function
"init_basic(simparticles *Sp_ptr)" in "snap_io.cc". If OUTPUT_PRESSURE
is enabled, an output field for pressure is initialised. This field
scales incorrectly with a and h. Instead of A=-3 and H=2 it should be
-3*GAMMA and 2*GAMMA right?
While this is not really problematic for the functionality of the code
itself, it might cause problems with automated analysis scripts that
directly use the header information of each field.
Best,
Leonard
On 15.05.21 15:35, Volker Springel wrote:
> Hi Leonard,
>
> Note that it is fairly arbitrary what power of "a" one assigns for code quantities in relation to the corresponding physical variable. But one obviously needs to be consistent. Gadget defines
>
> rho_code = a^3 * rho_physical
> A_code = A_physical
> P_code = A_code * rho_code^gamma = a^(3*gamma) P_physical
> c_code = sqrt(gamma * P_code/rho_code) = a^(3*(gamma-1)/2) * c_physical
>
> Note that c_code is not added directly to velocities for this reason, there are conversion factors like fac_mu or cf_afac3 to correct for the a^(3*(gamma-1)/2) where needed. So your assumption of cs_code = a^-1 cs_physical is not really true for gadget, and there (hopefully) shouldn't be an inconsistency.
>
> Best,
> Volker
>
>
>> On 15. May 2021, at 14:40, Leonard Romano <leonard.romano_at_tum.de> wrote:
>>
>>
>> Dear gadget-list,
>>
>> I keep wondering, whether or not there is an inconsistency with how certain thermodynamic quantities like pressure, entropy and the sound speed scale in cosmological simulations with the scale factor. In particular, expressions where sound speed and velocity both contribute as a sum, like artificial viscosity it seems obvious that the sound speed has to scale like a velocity, i.e. "cs_code = a^-1 cs_physical". In order for this to be the case, the pressure would need to scale as P_code = a P_physical since cs² ~ P / rho. However since entropy seems to be set not to scale at all, pressure scales as P_code = a^(3*GAMMA) P_physical, potentially causing an inconsistency.
>> Is this a misunderstanding on my side, or is there indeed an inconsistency?
>>
>> Best regards,
>> Leonard
>>
>> --
>> ===================================================
>> Leonard Romano, B.Sc.(レオナルド・ロマノ)
>> Physics Department
>> Technical University of Munich (TUM), Germany
>> Theoretical Astrophysics Group
>> Department of Earth and Space Science
>> Graduate School of Science, Osaka University, Japan
>> he / him / his
>> ===================================================
>>
>>
>>
>>
>> -----------------------------------------------------------
>> If you wish to unsubscribe from this mailing, send mail to
>> minimalist_at_MPA-Garching.MPG.de with a subject of: unsubscribe gadget-list
>> A web-archive of this mailing list is available here:
>> http://www.mpa-garching.mpg.de/gadget/gadget-list
>
>
>
> -----------------------------------------------------------
>
> If you wish to unsubscribe from this mailing, send mail to
> minimalist_at_MPA-Garching.MPG.de with a subject of: unsubscribe gadget-list
> A web-archive of this mailing list is available here:
> http://www.mpa-garching.mpg.de/gadget/gadget-list
--
===================================================
Leonard Romano, B.Sc.(レオナルド・ロマノ)
Physics Department
Technical University of Munich (TUM), Germany
Theoretical Astrophysics Group
Department of Earth and Space Science
Graduate School of Science, Osaka University, Japan
he / him / his
===================================================
Received on 2021-05-15 16:30:21