-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Energy conservation #1
Comments
Hi Arash,
Thanks for your interest! It's been a while since I wrote this code..
years, in fact. I'm going to have to remind myself a bit to see if I can
figure out the issue here too, but we have a very, very new newborn right
now so I probably won't be able to check it out for a while.
I would suggest playing with the components to see if the problem is in the
particle pusher or the calculation of the self consistent fields. So, a
simple way to do that is to not update the fields but to use a static field
and see if the energy conservation of the particles still requires such a
small time step.
Please let know if you find anything interesting there so that I might
think other suggestions!
--Calvin
…On Fri, Jan 20, 2023, 2:59 PM aratava ***@***.***> wrote:
Hi Calvin, thanks for the great code. I added a total energy calculation
function (kinetic energy plus the electrostatic). I checked the
conservation of energy in the example of two-stream instability and it was
not very good for the default dt (dt=1.0/omega_theory*0.01). I reduced
the dt to (dt=1.0/omega_theory*0.001) and it was much better. But this
means dt=0.005 in terms of 1/omega_pe. It is strange if such a small dt is
required to keep the energy conserved, so I thought maybe I am doing
something wrong. The total energy is calculated as:
es_energy=0.5*dx*sum((Fields_struct.ion_density.-Fields_struct.electron_density).*Fields_struct.phi)
total_energy = electrons.total_kinetic_energy+ions.total_kinetic_energy+es_energy
Have you calculated this before? What can be the issue?
Thank you, Arash
—
Reply to this email directly, view it on GitHub
<#1>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHD4PWDSBQTWNOBZMKQKXM3WTMYHRANCNFSM6AAAAAAUCC7P4M>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I tried to turn off the self-consistent field calculation and the energy conservation was much better. However, because the field calculation is self-consistent, it does not necessarily mean that there is a problem in the field calculation (The reverse would have been more understandable if it had happened.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Calvin, thanks for the great code. I added a total energy calculation function (kinetic energy plus the electrostatic). I checked the conservation of energy in the example of two-stream instability and it was not very good for the default dt
(dt=1.0/omega_theory*0.01)
. I reduced the dt to(dt=1.0/omega_theory*0.001)
and it was much better. But this means dt=0.01 in terms of 1/omega_pe. It is strange if such a small dt is required to keep the energy conserved, so I thought maybe I am doing something wrong. The total energy is calculated as:Have you calculated this before? What can be the issue?
Thank you, Arash
The text was updated successfully, but these errors were encountered: