-
Notifications
You must be signed in to change notification settings - Fork 17
Stellarator module update #4082
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
…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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| """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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # 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. |
Description
Main changes:
Checklist
I confirm that I have completed the following checks: