Conversation
…coils aspect ratio variation
…onsistant way a torioidal shape scaling
…e internal variables to be more readable
timothy-nunn
left a comment
There was a problem hiding this comment.
A couple of other things I have noticed.
|
When you have actioned all of the comments please do click the 🔄 icon in the reviewer section to tell me you are ready for the next review. You might also want to consider adding in a test case to our |
|
process/stellarator/coils/coils.py:70:23: RUF052 Local dummy variable |
|
process/stellarator/coils/quench.py
Outdated
|
|
||
| def calculate_vv_max_force_density_from_W7X_scaling(rad_vv: float) -> float: | ||
| """Actual VV force density from scaling [MN/m^3] | ||
| Based on reference values from W-7X.""" |
There was a problem hiding this comment.
| Based on reference values from W-7X.""" | |
| Based on reference values from W-7X. | |
| """ |
|
|
||
| f_a: float = None | ||
| f_st_i_total: float = None | ||
| """Actual totail coil current to reference value from stella_config file""" |
There was a problem hiding this comment.
| """Actual totail coil current to reference value from stella_config file""" | |
| """Actual total coil current to reference value from stella_config file""" |
process/stellarator/build.py
Outdated
| # This is the old version, left for now for comparison. | ||
| # build_variables.available_radial_space = stellarator_variables.f_r * ( | ||
| # stellarator_configuration.stella_config_derivative_min_lcfs_coils_dist | ||
| # * stellarator_configuration.stella_config_rminor_ref | ||
| # * (1 / stellarator_variables.f_aspect - 1) | ||
| # + stellarator_configuration.stella_config_min_plasma_coil_distance | ||
| # ) |
There was a problem hiding this comment.
| # This is the old version, left for now for comparison. | |
| # build_variables.available_radial_space = stellarator_variables.f_r * ( | |
| # stellarator_configuration.stella_config_derivative_min_lcfs_coils_dist | |
| # * stellarator_configuration.stella_config_rminor_ref | |
| # * (1 / stellarator_variables.f_aspect - 1) | |
| # + stellarator_configuration.stella_config_min_plasma_coil_distance | |
| # ) | |
process/stellarator/build.py
Outdated
| # po.write(self.outfile,10) | ||
| # 10 format(t43,'Thickness (m)',t60,'Radius (m)') |
There was a problem hiding this comment.
| # po.write(self.outfile,10) | |
| # 10 format(t43,'Thickness (m)',t60,'Radius (m)') |
process/stellarator/heating.py
Outdated
| + current_drive_variables.p_hcd_injected_electrons_mw | ||
| ) / current_drive_variables.eta_hcd_primary_injector_wall_plug | ||
| else: | ||
| logger.error(f"isthtr {stellarator_variables.isthtr} \n") |
There was a problem hiding this comment.
| logger.error(f"isthtr {stellarator_variables.isthtr} \n") | |
| logger.error(f"isthtr {stellarator_variables.isthtr}") |
process/stellarator/stellarator.py
Outdated
| # stellarator_variables.f_coil_aspect = ( | ||
| # (physics_variables.rmajor / stellarator_variables.r_coil_minor) / | ||
| # (stellarator_configuration.stella_config_rmajor_ref / | ||
| # stellarator_configuration.stella_config_coil_rminor) | ||
| # ) |
There was a problem hiding this comment.
| # stellarator_variables.f_coil_aspect = ( | |
| # (physics_variables.rmajor / stellarator_variables.r_coil_minor) / | |
| # (stellarator_configuration.stella_config_rmajor_ref / | |
| # stellarator_configuration.stella_config_coil_rminor) | |
| # ) | |
process/stellarator/stellarator.py
Outdated
| surfaces with Fourier coefficients') | ||
| """ | ||
| physics_variables.vol_plasma = ( | ||
| # stellarator_variables.f_r * stellarator_variables.f_a**2 * stellarator_configuration.stella_config_plasma_volume |
There was a problem hiding this comment.
| # stellarator_variables.f_r * stellarator_variables.f_a**2 * stellarator_configuration.stella_config_plasma_volume |
process/stellarator/stellarator.py
Outdated
| # heat_transport_variables.ipowerflow | ||
|
|
||
| # fwbs_variables.blktmodel |
There was a problem hiding this comment.
| # heat_transport_variables.ipowerflow | |
| # fwbs_variables.blktmodel |
process/stellarator/stellarator.py
Outdated
| physics_variables.p_plasma_rad_mw = ( | ||
| physics_variables.p_plasma_rad_mw + physics_variables.psolradmw | ||
| ) | ||
| # pden_plasma_rad_mw = physics_variables.p_plasma_rad_mw / physics_variables.vol_plasma # this line OVERWRITES the original definition of pden_plasma_rad_mw, probably shouldn't be defined like that as the core does not lose SOL power. |
There was a problem hiding this comment.
| # pden_plasma_rad_mw = physics_variables.p_plasma_rad_mw / physics_variables.vol_plasma # this line OVERWRITES the original definition of pden_plasma_rad_mw, probably shouldn't be defined like that as the core does not lose SOL power. |
process/stellarator/stellarator.py
Outdated
| # Calculate physics_variables.beta limit. Does nothing atm so commented out | ||
| # call stblim(physics_variables.beta_vol_avg_max) |
There was a problem hiding this comment.
| # Calculate physics_variables.beta limit. Does nothing atm so commented out | |
| # call stblim(physics_variables.beta_vol_avg_max) |
|
Please also ensure the unit test failures are fixed and that the regression tests stop failing with an error |
I solved most issues with units test, but with regression tests it will be more complicated. |
The coil minor radius now scales with major radius via a coil-aspect factor rather than directly with plasma minor radius as before. Could you just explain the motivation for this change?
Do we have a reference for the W7-X values used? Even if it's an internal document or similar, would be useful to note. |
|
Who created test: tests/unit/test_stellarator.py::test_stbild ? |
https://doi.org/10.1088/1741-4326/ac2dbf This is the best I can do. I got the correct values by email, there is no official document. |
You need to fit plasma-coil distance (which is changing) to blanket thickness (which is constant). If you don't change coil radius, you are not able to really scale down the design with fixed aspect ratio (because the only way to change the plasma-coil distance is by changing major radius). I am preparing a paper where I explain it in more detail. |
|
I corrected the unit tests - probably against the style guidelines, but at least work now. It seems that there was also error in calculation of the nu_star in my code, probably created during some merge. (I am not sure if nu_star is actually used in any way now in stellarator) |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4082 +/- ##
==========================================
+ Coverage 46.47% 46.58% +0.10%
==========================================
Files 123 135 +12
Lines 28902 29068 +166
==========================================
+ Hits 13432 13540 +108
- Misses 15470 15528 +58 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
timothy-nunn
left a comment
There was a problem hiding this comment.
The pre-commit quality jobs are failing again. You can install pre-commit as a hook by following our guide here https://ukaea.github.io/PROCESS/development/pre-commit/. This will flag any non-compliant code and automatically update it to follow the style guide (in most cases)
There was a problem hiding this comment.
I am happy with these changes to the unit test file provided you and your team are happy that the numbers have changed for a legitimate reason.
I believe this was an automatic test. When we converted PROCESS from Fortran to Python, we ran regression tests and scraped data from functions we were converting. This allowed us to test that we hadn't changed the codes' behaviour between Fortran and Python |
Just to clarify that your regression tests don't need to pass, there are several failure mechanisms that a regression test my experience:
|
I think it would be best to create new regression test (input+stella_config). I will deal with this after my vacation. |
Hey @jjwalkowiak happy with this solution... as long as the stellarator is well tested I am happy for files to be updated or for new ones to be made. |
Description
Main changes:
Checklist
I confirm that I have completed the following checks: