-
Notifications
You must be signed in to change notification settings - Fork 196
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
Update spacecraft charging test #4792
Update spacecraft charging test #4792
Conversation
Examples/Physics_applications/spacecraft_charging/PICMI_inputs_rz.py
Outdated
Show resolved
Hide resolved
Er[...] = Er[...]+(q - q_v)*self.normalized_Er[...] | ||
Ez = EzWrapper(include_ghosts=True)[:,:] | ||
Er = ExWrapper(include_ghosts=True) | ||
Er[...] += (q - q_v)*self.normalized_Er[...] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be cleaned up a bit more. Since self.normalized_Er
is an already a numpy array, the [...]
is not needed. And the same for Ez
and phi
below.
Examples/Physics_applications/spacecraft_charging/PICMI_inputs_rz.py
Outdated
Show resolved
Hide resolved
Examples/Physics_applications/spacecraft_charging/PICMI_inputs_rz.py
Outdated
Show resolved
Hide resolved
Examples/Physics_applications/spacecraft_charging/PICMI_inputs_rz.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
I would comment for the record that using MFIter type loops would be better here (since it would avoid global copies and would run on GPU), if there is ever time to update this example.
Yes, agreed. |
The spacecraft charging test was not properly correctly the electric field in the simulation with callback functions.
The purpose of the callback functions here is to correct the electric field, so that the charge on the spacecraft computed using Gauss law (from the electric field) matches the actual charge (calculated from collecting particles on the embedded boundary).
However, the current script corrects a copy of the electric field. The actual electric field in the simulation was not corrected. This can be seen from the
print
statements when the code is running. (Theprint
statements print the charge from Gauss law and the actual charge, and they did not match with the current version of the script.)