-
Notifications
You must be signed in to change notification settings - Fork 7
Add radial plasma profiles for collision calculations #205
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
base: main
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
a46002f to
d297465
Compare
d297465 to
dd8e204
Compare
dd8e204 to
c29edf0
Compare
c29edf0 to
ee5fe8f
Compare
ee5fe8f to
f356d36
Compare
f356d36 to
0bdf3fd
Compare
Add support for radially-varying plasma profiles (density, temperature) enabling realistic collisionality calculations. New features: - profiles module with power_series and two_power profile types - Power series: f(s) = scale * sum(coef(n) * s^n) - Two-power: f(s) = scale * (1 - s^p1)^p2 (non-integer exponents) - Collision coefficients precomputed on s grid and interpolated - Backward compatible: existing simulations work unchanged Files: - src/profiles.f90: New profiles module with namelist parsing - src/collis_alphas.f90: Refactored with profile support - src/simple_main.f90: Initialize profiles before collisions - test/tests/test_profiles.f90: Unit tests for profile evaluation Closes #202
0bdf3fd to
2045e35
Compare
User description
Summary
Add support for radially-varying plasma profiles (density, temperature) enabling realistic collisionality calculations for fusion reactor conditions.
Features
New
profilesmodule with two profile types:f(s) = scale * sum(coef(n) * s^n)- VMEC-compatiblef(s) = scale * (1 - s^p1)^p2- supports non-integer exponentsCollision coefficients precomputed on uniform s grid and interpolated at runtime
Backward compatible: existing simulations without
&profiles_nmlsection work unchangedUsage Example
Test plan
Closes #202
PR Type
Enhancement
Description
Add new
profilesmodule supporting radially-varying plasma profilesf(s) = scale * sum(coef(n) * s^n)f(s) = scale * (1 - s^p1)^p2with non-integer exponentsRefactor collision calculations to precompute coefficients on uniform grid
Implement linear interpolation for runtime coefficient lookup at arbitrary positions
Maintain backward compatibility with existing simulations without profiles
Add comprehensive unit tests for profile evaluation and collision rates
Diagram Walkthrough
File Walkthrough
profiles.f90
New profiles module with power series and two-power supportsrc/profiles.f90
power_seriesandtwo_powerprofiles
get_plasma_paramssubroutine dispatching to appropriateprofile type
collis_alphas.f90
Refactor collision calculations with profile grid supportsrc/collis_alphas.f90
compute_collision_coeffssubroutinecoleff_localaccepting collision coefficients as arguments forflexibility
init_collision_profilesprecomputes coefficients on 101-pointuniform s-grid
get_local_coeffsperforms linear interpolation at arbitrary spositions
stostto use interpolated coefficients when profiles areenabled
Fortran syntax
simple_main.f90
Integrate profile initialization into main simulationsrc/simple_main.f90
read_profiles_configsubroutine callingread_profilesfromprofiles module
sequence
init_collisionsto callinit_collision_profileswhen profilesenabled
collidesubroutine signature to accept inout z parametertest_profiles.f90
Add unit tests for profile evaluation and collision ratestest/tests/test_profiles.f90
functionality
parameters
CMakeLists.txt
Add profiles module to build systemsrc/CMakeLists.txt
profiles.f90to source list beforecollis_alphas.f90for properdependency ordering
CMakeLists.txt
Add profile tests to test suitetest/tests/CMakeLists.txt
test_profiles.xlinking against simplelibrary