Dear Volker,
Thank you very much for fixing this issue. I ran one test with the update. Now it runs fine.
But I have one related question. When ADAPTIVE_HYDRO_SOFTENING is used, we usually expect that the energy will not be well conserved because the softening length may change with time. I found one paper by Iannuzzi and Dolag discussing this problem
https://arxiv.org/abs/1107.2942
(see Fig. 2 and Eq. 8)
They proposed to add a correction term (Eq. 8) to the gravitational acceleration similar to what one usually does for the hydro acceleration. Is there any plan that this correction will be included in a future version of Gadget?
Best,
Xiaolong
> On May 1, 2021, at 5:26 AM, Volker Springel <vspringel_at_MPA-Garching.MPG.DE> wrote:
>
>
> Dear Xiaolong,
>
> Thanks for pointing this out and your clear description of the problem. I agree, the option ADAPTIVE_HYDRO_SOFTENING wasn't working properly because a call of get_softeningtype_for_hydro_particle() for updating the softening class of a particle when its Hsml has changed (in src/sph/density.cc) was lost in a botched clean-up operation of the code. Now readded - let us now if this still gives trouble.
>
> Best regards,
> Volker
>
>> On 26. Apr 2021, at 16:32, Xiaolong Du <xdu_at_carnegiescience.edu> wrote:
>>
>>
>> Dear list members,
>>
>> Recently I ran one SPH simulation with the ADAPTIVE_HYDRO_SOFTENING option. It is said in the documentation that this will make Gadget set the gravitational softening length of gas particles based on their SPH smoothing length. Accordingly, the softening values specified in the parameter file for softening type 0 will be ignored. However, I found that it did not seem to work as it is said. For example, if I simply set
>>
>> SofteningComovingClass0 = 0
>>
>> I will get the following error:
>>
>> Code termination on task=5, function gravity_fmm(), file src/fmm/fmm.cc, line 1703: Particle with ID=144105 of type=0 and softening type=0 was assigned zero softening.
>>
>> Setting a non-zero value for the above parameter gets rid of the error, but then the results seem to depend on the values of SofteningComovingClass0 in the parameter file, which should not be the case.
>>
>> Digging into the source code a bit, I found that the adaptive softening length is calculated by the function get_softeningtype_for_hydro_particle in the file src/data/simparticles.h. But this function is actually never called at any other places. So I am just guessing that even in the case with ADAPTIVE_HYDRO_SOFTENING on, the softening length of gas particle is still set by the parameter SofteningComovingClass0.
>>
>> Best regards,
>> Xiaolong Du
>>
>>
>>
>>
>> -----------------------------------------------------------
>>
>> 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
Received on 2021-05-03 00:24:15