Thoughts on Self Gravity, Phi, etc...

So…. I was looking at Erica's BE setup and decided to start advecting the stable sphere and ambient - to test the stability/accuracy of self-gravity… First I noticed that occasionally the value of PhiDot would be very large… This was because a root step would finish just before a frame dump - so the code would take a very small time step - this would cause noise or small fluctuations in the potential to generate very large time derivatives… If these large derivatives are then used for a normal size time step - they will produce drastic errors… This is because of the drastic extrapolation in time of the potential. One way to mitigate this is to avoid having to take very small time steps by anticipating such scenarios and taking two half-size steps instead of a full step and a tiny step.

(Errors end up being amplified by the ratio of time steps)

Fortunately we no longer use old time derivatives for subsequent steps (except to set the initial guess for the solution vector which could make converging a bit difficult for visit) - but it does make the value for PhiDot plotted in visit look way off…

The other problem is regridding… As the grid adapts - regions that previously were refined will continue to have a correct fine-grid solution while regions that were not previously refined will have prolongated solutions… If a cell goes from having prolongated to a calculated solution - the time derivative will have a component in it that is just because of changes in the discretization of the grid - which could then be used to set boundary conditions for finer cells etc… Here the solution is to calculate the potential after regridding - before advancing - and then calculate it again after the advance to get a time derivative for the potential that is solely due to gas motions and not regridding effects… It is a little more expensive (though hypre should converge quickly since the initial guess will be fairly accurate) but well worth it in terms of stability etc…

Attachments (1)

Download all attachments as: .zip

Comments

No comments.