failed to converge in neighbour iteration in density()

From: Sander Valcke <Sander.Valcke_at_UGent.be>
Date: Mon, 04 May 2009 10:25:47 +0200

Dear gadget list,

I recently had a problem with the smoothing length update for SPH
particles: for a certain (SPH-only) setup there are some particles for
which the smoothing length updater does not converge. Some relevant
output (the lines with (0) were added to the code manually, showing some
variables of an erroneous particle):

(0) ngb: 61.5331 h: 0.149935 left: 0 right: 0
ngb iteration 1: need to repeat for 0008918068 particles.
(0) ngb: 47.4712 h: 0.118996 left: 0 right: 0.149935
ngb iteration 2: need to repeat for 0002706616 particles.
(0) ngb: 39.3642 h: 0.0731442 left: 0 right: 0.118996
ngb iteration 3: need to repeat for 0000786578 particles.
(0) ngb: 0 h: 0 left: 0 right: 0.0731442
ngb iteration 4: need to repeat for 0000246135 particles.
(0) ngb: 0 h: 0 left: 0 right: 0.0731442
ngb iteration 5: need to repeat for 0000005784 particles.
(0) ngb: 0 h: 0 left: 0 right: 0.0731442
ngb iteration 6: need to repeat for 0000001390 particles.
(0) ngb: 0 h: 0 left: 0 right: 0.0731442
ngb iteration 7: need to repeat for 0000000290 particles.
(0) ngb: 0 h: 0 left: 0 right: 0.0731442
ngb iteration 8: need to repeat for 0000000032 particles.
(0) ngb: 0 h: 0 left: 0 right: 0.0731442

You can see that this particle is assigned an h of 0 which, together
with left being zero and right having the value it has, results in
Gadget using "SphP[i].Hsml /= 1.26;" to update h, remaining at 0.

Why did h become zero? Because of a large value of DhsmlDensityFactor in

SphP[i].Hsml *=
                1 - (SphP[i].NumNgb -
                     All.DesNumNgb) / (NUMDIMS * SphP[i].NumNgb) *
SphP[i].DhsmlDensityFactor;

h actually became negative, it is then reset to 0 using

if(SphP[i].Hsml < All.MinGasHsml)
            SphP[i].Hsml = All.MinGasHsml;

What works for me is to set MinGasHsmlFractional to a non-zero
(arbitrarily small) value in the parameterfile. What I have not looked
into is why SphP[i].DhsmlDensityFactor is larger than it is supposed to,
it is probably due to having a/some very close neighbour(s).

Just thought I'd mention this in case someone had the same problem
occur, or in case I'm missing something here.

kind regards,

Sander

-- 
Sander Valcke
Sterrenkundig Observatorium
Universiteit Gent
Krijgslaan 281 S9
B-9000  Gent, Belgium
Eagles may soar, but weasels don't get sucked into jet engines.
Received on 2009-05-04 10:47:26

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