gandalfcode / gandalf

GANDALF (Graphical Astrophysics code for N-body Dynamics And Lagrangian Fluids)
GNU General Public License v2.0
44 stars 12 forks source link

Fixed error in energy integration with SPH and self-gravity #67

Closed rbooth200 closed 7 years ago

rbooth200 commented 7 years ago

This is the missing energy fix

giovanni-rosotti commented 7 years ago

This is fine. Just a quick question before merging: had we really not implemented the change already? Could it be that we have the similar commit in another branch we haven't merged yet?

rbooth200 commented 7 years ago

I think there might be another fix in papertests, you could use that one instead if you prefer.

giovanni-rosotti commented 7 years ago

Do you mean 008cc7f? Do I understand correctly that the extra 0.5 you added here is actually commented out in that commit, and is added directly only to the dudt of artificial viscosity? Because if yes, when we will merge everything we will get it two times...

rbooth200 commented 7 years ago

Yep I've just checked and that appears to be correct. Lets just forget this and try to merge papertests asap? I've checked with the evrard test in paper tests and the energy conservation seems fine,

giovanni-rosotti commented 7 years ago

ok agreed, let's do as you suggest. but i'll leave the pull request open until i've fixed papertests to remind me that i should action it quickly

rbooth200 commented 7 years ago

I've tidied up the fix so it's like the one in paper tests and checked that the energy conservation is good in both cases. I think this can be merged now that we are going to use papertests2