Merged
Conversation
This commit addresses issue google-deepmind#529 by integrating ICRH minority species with the plasma composition system, ensuring physical consistency across all plasma calculations. Changes: - Add optional 'minority_species' parameter to IonCyclotronSourceConfig that allows specifying which species in plasma_composition to use as the ICRH minority (e.g., 'He3', 'D', 'T') - Add _get_minority_concentration_from_composition() helper function that extracts minority concentration from plasma composition, supporting: * Minority species in main ions (for hydrogenic species) * Minority species in impurities (for helium species) * All three impurity modes: fractions, n_e_ratios, n_e_ratios_Z_eff - Update icrh_model_func() to read minority concentration from plasma_composition when minority_species is set - Maintain backward compatibility: existing configs using minority_concentration parameter continue to work Testing: - Add test_source_with_minority_species_from_composition() to verify new functionality with He3 minority in impurities - All existing ICRH tests pass (backward compatibility confirmed) - All 651 source tests pass (no regressions) This implementation completes the first task in issue google-deepmind#529: "Map ICRH minority to either main-ion (if hydrogenic) or impurity (if He)"
This reverts commit be41516. Signed-off-by: RONAK <codeitronak226277@gmail.com>
…ate-neoclassical-axis-values PiperOrigin-RevId: 851341944
…-deepmind#1826 PiperOrigin-RevId: 851350556
…-actions-node24 PiperOrigin-RevId: 851353853
Refactor numerics: rename minimum_temperature_eV to T_minimum_eV, update checks and tests minor:resolving conflict minor fix: updated LowtemperatureCollapseTest Fixing : low temperature collapse test Fixing : low temperature collapse test Fixing: Code duplication Remove __init__.py from orchestration/tests Add low-temperature collapse detection and error handling - Add T_minimum_eV config parameter (default 50 eV) to numerics - Implement low_temperature_below() method in CoreProfiles - Add LOW_TEMPERATURE_COLLAPSE error state to SimError enum - Refactor check_for_errors() as SimulationStepFn class method - Add mock-based test for low-temperature collapse detection - Remove empty __init__.py from orchestration/tests
Calculate j_total on the cell grid from finite differences of Ip_profile face. This significantly improves smoothness particularly towards the boundaries. Minor differences in some integration test cases on order of O(1e-3) due to different ohmic heating. PiperOrigin-RevId: 852211436
…map. Previously the info on the `Contribution process` was not visible in readthedocs PiperOrigin-RevId: 852278231
…emperature-exit PiperOrigin-RevId: 852282855
This fixes an API breaking issue that was introduced when extending to parallel and toroidal current outputs. The toroidal bootstrap current (profiles.j_bootstrap) is now only on the cell grid, whereas before it was on the extended cell+boundary grid, as the parallel bootstrap current is. Regenerated sim tests due to new shape of profiles.j_bootstrap PiperOrigin-RevId: 853165571
PiperOrigin-RevId: 853168641
…urrent conversions. Present value was too large and led to unnecessary extrapolation in idx=1 values with a 25 point grid. Minor O(1e-4) sim test differences due to slightly different Ohmic power. PiperOrigin-RevId: 853172258
Co-Authored-By: Paras Chinchalkar <paras.chinchalkar@gmail.com>
…s everywhere needed
If all of the change directions are negative, then the step size will be less than the min_delta, and the Newton step will fail incorrectly PiperOrigin-RevId: 853801540
…si_from_imas_core_profiles_to_time_varying_array PiperOrigin-RevId: 854121720
…_grid`. I'm not sure of the exact behaviour but it's possible we're overriding the properties by doing this at the moment. PiperOrigin-RevId: 854125011
PiperOrigin-RevId: 859317072
PiperOrigin-RevId: 859320706
…n-uniform grid. PiperOrigin-RevId: 859324335
PiperOrigin-RevId: 859627943
PiperOrigin-RevId: 859828494
First in a series of PRs introducing a new feature extending CombinedTransportModel. Presently we simply sum the outputs of all sub-models within their radial ranges. However we sometimes want a specific model to act as the sole authority for a specific transport coefficient in a specific region, overriding both previous and subsequent models in the sequence of combined transport model. This change introduces a `MergeMode` enum (`ADD` or `OVERWRITE`) to toggle between these options. Additionally, `enable_chi_i`, `enable_chi_e`, `enable_D_e`, and `enable_V_e` flags are added to each transport model to control which transport coefficients are overwritten and which remain unaffected. This provides fine-grained control over transport coefficient combinations enabling more simulation workflows. Validation is added to `CombinedTransportModel` to ensure that only one model can use `OVERWRITE` mode for any given channel, for core and pedestal transport models separately. This PR focuses on the API and config validation. Next PRs will introduce the actual logic in transport_model.py and combined.py. PiperOrigin-RevId: 860191913
This change introduces a mechanism to selectively disable specific transport channels (chi_i, chi_e, D_e, V_e) within any TransportModel by setting the corresponding `disable_*` flags in the runtime parameters. PiperOrigin-RevId: 860209756
The default sawtooth crash time was too large to safely satisfy the timescale separation assumption for all cases. The existence of this assumption is now documented. sawtooth sim_test updated. O(1e-5) relative changes. PiperOrigin-RevId: 861087364
This slightly changes the behaviour of the existing hires grid to np.linspace(0,1,n_rho*hires_factor+1) so that inner faces remain aligned. E.g [0, 0.25, 0.5, 0.75, 1.0] x2-> [0, 0.125, 0.25, 0.375, ..., 0.875, 1.0] PiperOrigin-RevId: 861119191
…enters. - Modify `Grid1D` to be constructed by `face_centers` too. - Regen sim because of O(1e-16) changes in grid coordinates. PiperOrigin-RevId: 861177860
Using functools.cached_property can cause issues with JAX transformations like jax.lax.cond, as it modifies the object's internal state upon first access, potentially leading to UnexpectedTracerError. Switching to standard properties avoids these side effects within JAX contexts. This unfortunately means that we won't be able to benefit from using `cached_properties` in CellVariable. The operations to get these properties are simple, so the impact to performance should be negligible. I added a unittest that exposed the tracer leak to prevent regression in the future. PiperOrigin-RevId: 861257087
Drive-by: fixed a bug where previously sub-channels (like chi_bohm_e) were leaking outside their configured radial domain in combined_transport_model. The combined transport model now supports two merge modes for combining coefficients from multiple sub-models: ADD and OVERWRITE. OVERWRITE mode replaces existing coefficients in the model's active domain and locks those regions, preventing subsequent ADD models from contributing. Disabled channels in an OVERWRITE model are transparent and do not affect the accumulated coefficients. The implementation uses an accumulator and lock system within a new _accumulate helper function. PiperOrigin-RevId: 861360878
…sport model. PiperOrigin-RevId: 861368574
Drive-by: avoid explicitly writing out sub-channels elsewhere and use CHANNEL_CONFIG_STRUCT for iterations. Will help with subsequent additions to optional transport coefficients. bohmgyrobohm test updated due to the bohm and gyrobohm transport coefficient outputs being different in the pedestal region due to the now correct domain restriction. No impact on actual results (since these coefficients were not actually used directly) PiperOrigin-RevId: 861375273
Old config files are saved with the `nx` field which upon reloading now throws an error. Add a before validator so that old file inputs are sanitised before construction. PiperOrigin-RevId: 861379513
Drive-by fix of division by zero in Gamma_E calculation. PiperOrigin-RevId: 861388176
PiperOrigin-RevId: 861591200
PiperOrigin-RevId: 861635052
This change introduces several new outputs related to non-inductive current: total non-inductive current density (toroidal and parallel), total external current, total non-inductive current, and the non-inductive current fraction. These are derived from existing bootstrap and external current sources. A new test case is added to verify these calculations, and the output documentation is updated. Sim tests are regenerated due to the new outputs. PiperOrigin-RevId: 861670420
This should fix issues with tracer leaks with the TGLFNN-UKAEA model while still allowing the use of cached_properties. This fixes issue google-deepmind#1939 PiperOrigin-RevId: 862230735
Changed `rotation_multiplier` from `pydantic.PositiveFloat` to `pydantic.NonNegativeFloat` to permit a value of 0.0. PiperOrigin-RevId: 862241806
We found a better solution (google-deepmind#1945) to the tracer leak that will allow us to use cached_properties. Given that solution, we can revert this change. This change is related to issue google-deepmind#1939 PiperOrigin-RevId: 862260116
The validation checks the shapes of keys related to the edge model. Keys like 'r_OMP' and 'Bp_OMP' are validated to have a shape matching the number of time points. Other edge model keys, such as 'z_div' and 'Lpar_target', are validated to have shapes consistent with either one or two edge directions. Tests are added to cover valid and invalid shapes for these optional inputs, including scalar cases when the number of time points is one. PiperOrigin-RevId: 862270108
PiperOrigin-RevId: 862299595
PiperOrigin-RevId: 862310309
PiperOrigin-RevId: 862316111
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.