Conversation
…coils aspect ratio variation
…onsistant way a torioidal shape scaling
…e internal variables to be more readable
This reverts commit 1d1cbca.
timothy-nunn
left a comment
There was a problem hiding this comment.
This is just a rough first review. Once these changes have been actioned I can do a more detailed review and get @ym1906 involved (and maybe others).
I notice that there are quite a few style violations. Most of these can be solved by using pre-commit https://ukaea.github.io/PROCESS/development/pre-commit/.
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. |
Description
Main changes:
Checklist
I confirm that I have completed the following checks: