Add general plasma functions 1#4004
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4004 +/- ##
==========================================
+ Coverage 46.29% 46.30% +0.01%
==========================================
Files 123 123
Lines 28841 28961 +120
==========================================
+ Hits 13351 13411 +60
- Misses 15490 15550 +60 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3c22809 to
c3ccd3b
Compare
timothy-nunn
left a comment
There was a problem hiding this comment.
Need the docs and formula reviewed still
j-a-foster
left a comment
There was a problem hiding this comment.
Just one question, otherwise happy with equations and docs.
d9f9e73 to
559509c
Compare
timothy-nunn
left a comment
There was a problem hiding this comment.
Just one comment on testing, then its gtg
| self.plasma_profile = plasma_profile | ||
| self.current_drive = current_drive | ||
|
|
||
| def run(self): |
There was a problem hiding this comment.
I think its probably worth adding a simple test with a simple profile (2-4 points) that checks all of the values are correctly set in this model
… DetailedPhysics class
…ics class and plotting functionality
…iledPhysics class
7343c9f to
30dfff3
Compare
30dfff3 to
98bb56d
Compare
timothy-nunn
left a comment
There was a problem hiding this comment.
Only comments about the types and I promise its ready. Please update the types for variables that can be a float or a whole profile (ndarray). Ensure you update the type hints and the types in the docstring
|
|
||
| @staticmethod | ||
| def calculate_debye_length( | ||
| temp_plasma_species_kev: float, |
There was a problem hiding this comment.
The type could be float or profile right (np.ndarray)?
| ) ** 0.5 | ||
|
|
||
| @staticmethod | ||
| def calculate_lorentz_factor(velocity: float) -> float: |
There was a problem hiding this comment.
velocity could be float or profile right (np.ndarray)?
| return 1 / (1 - (velocity / constants.SPEED_LIGHT) ** 2) ** 0.5 | ||
|
|
||
| @staticmethod | ||
| def calculate_relativistic_particle_speed(e_kinetic: float, mass: float) -> float: |
There was a problem hiding this comment.
e_kinetic could be float or profile right (np.ndarray)?
|
|
||
| @staticmethod | ||
| def calculate_plasma_frequency( | ||
| nd_particle: float, m_particle: float, z_particle: float |
There was a problem hiding this comment.
nd_particle could be a float or ndarray
|
|
||
| @staticmethod | ||
| def calculate_larmor_frequency( | ||
| b_field: float, m_particle: float, z_particle: float |
There was a problem hiding this comment.
b_field could be a float or an ndarray
This pull request introduces a new "Detailed Plasma Physics" module, adds supporting constants and data structures, and integrates new profile plotting capabilities for advanced plasma diagnostics. The changes enhance the documentation, codebase, and output visualizations, providing more granular insight into plasma behavior and key physical parameters.
Plasma Physics Module & Documentation
DetailedPhysicsclass and its documentation (detailed_physics.md), including methods for calculating Debye length, relativistic particle speed, Coulomb logarithm, classical distance of closest approach, DeBroglie wavelength, plasma frequency, and Larmor frequency. [1] [2] [3]Data Structures & Constants
physics_variables.py, with initialization and global registration. [1] [2] [3]PLANCK_CONSTANTand updatedSPEED_LIGHTto float inconstants.pyfor more accurate physical calculations.Output & Visualization Enhancements
plot_proc.py, integrating them into the main plotting workflow and output PDF.Integration & Workflow
output.py), ensuring these diagnostics are run and exported at the end of each simulation.Documentation Navigation
🎨 Output
A new plot_proc page for the electron values of the new functions have been added
Checklist
I confirm that I have completed the following checks: