Re: EntropyToInvGammaPred not integrated in Hydrokick

From: Volker Springel <vspringel_at_MPA-Garching.MPG.DE>
Date: Mon, 26 Apr 2021 15:56:18 +0200

Hi Leonard,
Yes, I will try to arrange this.
Regards,
Volker

> On 24. Apr 2021, at 11:26, Leonard Romano <leonard.romano_at_tum.de> wrote:
>
>
> Hi Volker,
>
> I would sure like to share my patch. Correct me if I am wrong, but I think I will need an invitation from a MPCDF user in order to push my patch.
> So could you please invite me?
>
> Regards,
> Leonard
>
> On 23.04.21 14:30, Volker Springel wrote:
>> Hi Leonard,
>>
>> You are welcome to suggest your patches as changes in master. PRESSURE_ENTROPY_SPH is not really used by us in production, hence it hasn't been tested all that much under more extreme conditions.
>>
>> Regards,
>> Volker
>>
>>> On 23. Apr 2021, at 13:57, Leonard Romano <leonard.romano_at_tum.de> wrote:
>>>
>>>
>>> Hi Volker,
>>>
>>> Thanks for updating the code.
>>>
>>> Actually I have recently been experimenting a bit with PRESSURE_ENTROPY_SPH vs. vanilla SPH and I noticed some other inconsistencies that lead to occasional crashes in some of my simulations with PRESSURE_ENTROPY_SPH.
>>> In particular the sound speed is computed from the PRESSURE_ENTROPY_SPH Pressure and the vanilla SPH density.
>>> This is problematic because for strong shocks I have noticed that the PRESSURE_ENTROPY_SPH density tends to be somewhat larger than the vanilla SPH density. Such an inconsistent density estimate can lead to a high sound speed estimate that leads to shorter timesteps and sometimes even to a crash in the code. This is why I think, that the sound speed should be computed from the thermodynamic estimate of the density if PRESSURE_ENTROPY_SPH is used.
>>> Another thing that I didn't quite understand was, why the "gradient h-factor" in the hydrodynamic force is Taylor expanded rather than computed to all orders as it is for vanilla SPH, considering that it is computed just as easily as for vanilla SPH.
>>> I have made the corresponding changes in my clone of the code and now don't experience any crashes anymore, so I would strongly recommend these changes in the master branch too.
>>>
>>> Regards,
>>> Leonard
>>>
>>> On 23.04.21 13:15, Volker Springel wrote:
>>>> Hi Leonard,
>>>>
>>>> I think you are right that there has been a small inconsistency when PRESSURE_ENTROPY_SPH is used, and REUSE_HYDRO_ACCELERATIONS_FROM_PREVIOUS_STEP is not used (note that the latter is faster and typically just as good in practice). Let me explain this a bit more.
>>>>
>>>> When REUSE_HYDRO_ACCELERATIONS_FROM_PREVIOUS_STEP is not activated, the hydro forces and entropy changes are computed twice per timestep, something like this
>>>>
>>>> [ Ka(dt/2) D(dt) Kb(dt/2) ] [ Ka(dt/2) D(dt) Kb(dt/2) ]
>>>>
>>>> When in sim::hydro_force() (line 559 in src/time_integration/kicks.cc) the variable EntropyPred is set to the new value of Entropy at the end of a timestep (corresponding to the time in between the two steps above), which then forms the new basis for forward predictions in time, then EntropyToInvGammaPred should also be updated - this is what you presumably mean, and I agree with this. Otherwise the next Ka(dt/2) operator still uses the old pressures which were used for the preceeding Kb. The pressure entering Kb is however always correct, as EntropyToInvGammaPred is updated in the drift operator. Neglecting this update corresponds to what the REUSE_HYDRO_ACCELERATIONS_FROM_PREVIOUS_STEP option does, as here Ka and Kb are effectively rolled into one kick operator.
>>>>
>>>> I have made a corresponding change in the code fixing this for the PRESSURE_ENTROPY_SPH option.
>>>>
>>>> Regards,
>>>> Volker
>>>>
>>>>
>>>>> On 19. Apr 2021, at 12:55, Leonard Romano <leonard.romano_at_tum.de> wrote:
>>>>>
>>>>>
>>>>> Dear Gadget list members,
>>>>>
>>>>> I noticed that when one uses PRESSURE_ENTROPY_SPH the variables Entropy and EntropyPred
>>>>> are integrated during the Hydrokick in the function sim::hydro_force(...) but never used.
>>>>> Instead the pressure is computed from EntropyToInvGammaPred. This alone wouldn't be confusing,
>>>>> but at the same time in the function simparticles::drift_particle(...) these two variables
>>>>> are integrated too, and then EntropyToInvGammaPred is updated in order to be consistent with them,
>>>>> so I am wondering if either I don't understand this formulation of SPH well enough or instead
>>>>> there is an update of EntropyToInvGammaPred missing in sim::hydro_force(...).
>>>>>
>>>>> Thank you very much,
>>>>> 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
>>
>>
>>
>> -----------------------------------------------------------
>>
>> 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-04-26 15:56:19

This archive was generated by hypermail 2.3.0 : 2022-09-01 14:03:43 CEST