Add radial plasma profiles for collision calculations#205
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
0bdf3fd to
2045e35
Compare
2045e35 to
feb92b1
Compare
feb92b1 to
f9af713
Compare
f9af713 to
624104b
Compare
624104b to
719f0f8
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
719f0f8 to
cfa66d3
Compare
Risk tier
Correctness contract
Intended behavior change
Add radially varying plasma profiles for collision calculations. The branch adds a
profilesmodule, reads&profiles_nml, precomputes collision coefficients on a uniformsgrid, and interpolates local coefficients during stochastic collision steps.Behavior that must not change
Inputs without
&profiles_nmlkeep the existing scalar collision behavior. Flat profiles must reproduce the scalar collision coefficients within the stated tolerance.Coordinate / unit conventions
Profiles are functions of VMEC-like radial coordinate
s. Temperatures, densities, and collision coefficients keep the existing units used by the collision module.Numerical invariants
Flat radial profiles match scalar parameters. Peaked profiles produce larger core collision rates than edge collision rates. Non-integer two-power exponents evaluate without domain errors over the tested
sinterval.Tests added
test_profiles.f90test_profilesCTest targetGolden-record impact
Failure modes considered
Manual validation
Focused profile/collision coefficient tests passed after rebasing on current
main.Verification