[Gadget 4] SPH simulation with adaptive softening length

From: Xiaolong Du <xdu_at_carnegiescience.edu>
Date: Mon, 26 Apr 2021 07:32:49 -0700

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
Received on 2021-04-26 16:32:57

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