Re: Do thermodynamic quantities scale correctly in cosmological simulations?

From: Volker Springel <vspringel_at_MPA-Garching.MPG.DE>
Date: Sat, 15 May 2021 17:46:25 +0200

Hi Leonard,

Thanks for checking this, and I agree, the output attributes that are supposed to give hints how this field can be scaled to physical values were not quite right (probably not the only inconsistency in the more rarely used fields, this has unfortunately not been used much by us thus far).

I agree that the A-scaling should be -3*GAMMA. For the h-scaling, I still think this is H=2. This is because P_phys = a^(-3*gamma) P_code, with P_code given in code units. This means in terms of dimensions:

[P_code] = M / (T^2 * L)

To get the value of the physical pressure in cgs units, you therefore need to compute:

  P = P_phys * (UnitMass_in_g / h) / (UnitTime_in_s / h)^2 / (UnitLength_in_cm / h)

So you end up with a h^2 scaling.

Best,
Volker



> On 15. May 2021, at 16:30, Leonard Romano <leonard.romano_at_tum.de> wrote:
>
>
> 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
> ===================================================
>
>
>
>
> -----------------------------------------------------------
> 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
Received on 2021-05-15 17:46:27

This archive was generated by hypermail 2.3.0 : 2023-01-10 10:01:32 CET