Conversation
…ly and storage losses. Added their implementation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4089 +/- ##
==========================================
+ Coverage 46.57% 46.64% +0.07%
==========================================
Files 124 124
Lines 29042 29082 +40
==========================================
+ Hits 13526 13566 +40
Misses 15516 15516 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@j-a-foster I've pushed my changes here for your review |
chris-ashe
left a comment
There was a problem hiding this comment.
Noticing quite a few large regression changes. Have made some initial minor comments
Unsurprisingly it has changed the PF power profile, though has it changed the PF current profile diagram in plot_proc?
| This is the standard inductive energy expression: | ||
|
|
||
| $$ | ||
| E = \frac{1}{2} I^T M I |
There was a problem hiding this comment.
What is the superscript T in this case?
There was a problem hiding this comment.
It represents the transpose of the vector of currents
|
|
||
| $$ | ||
| ELoss_{ps,n} = | ||
| \frac{k_{ps}}{2} |
There was a problem hiding this comment.
There was a problem hiding this comment.
|
I'll add @mkovari to review since he made the original issue |
|
Should've fixed all subscripts in docs now. |
timothy-nunn
left a comment
There was a problem hiding this comment.
Mainly comments on index names
| # pfcoil_variables.n_pf_cs_plasma_circuits : total number of PF coils (including Central Solenoid and plasma) | ||
| # plasma is #n_pf_cs_plasma_circuits, and Central Solenoid is #(pfcoil_variables.n_pf_cs_plasma_circuits-1) | ||
| # plasma is #n_pf_cs_plasma_circuits, and Central Solenoid is #(pfcoil_variables.n_pf_cs_plasma_circuits-1) | ||
| # pfcoil_variables.ind_pf_cs_plasma_mutual(i,j) : mutual inductance between coil i and j |
There was a problem hiding this comment.
Can we remove the dead code while we are making edits here
timothy-nunn
left a comment
There was a problem hiding this comment.
Thanks Graeme. Happy with the code, will approve and merge when the others reviewers are happy.
|
Hi Graeme @ym1906 . Could you summarise the changes in the regression tests and in the profile of stored energy and power required? Thanks |
* Add VacuumVessel class and integrate into Caller model * Add calculate_dshaped_vessel_volumes method to VacuumVessel class * Add calculate_elliptical_vessel_volumes method to VacuumVessel class * 🔥 Remove now redundant vacuum calcs from blanket library * Refactor BlanketLibrary: remove vacuum vessel calculations and update tests for elliptical vessel volumes * Add tests for DShaped vessel volume calculations in vacuum module * Add Shield class with calculate_shield_half_height method * Add calculate_dshaped_shield_volumes method to Shield class * Add calculate_dshaped_shield_areas method to Shield class * Add calculate_elliptical_shield_volumes method to Shield class * Add calculate_elliptical_shield_areas method to Shield class * Add Shield model integration to Caller and Models classes * Implement shield area and volume calculations in run method of Shield class * Refactor BlanketLibrary to remove shield component calculations and streamline component handling * Add unit test for elliptical shield volumes calculation * Add unit test for elliptical shield areas calculation * Add unit test for D-shaped shield volumes calculation * Add unit test for D-shaped shield areas calculation * Remove redundant D-shaped component parameters from test cases * Remove redundant EllipticalComponentParam test cases * Post rebase changes * Remove redundant shield surface parameters from ApplyCoverageFactorsParam class * Requested style changes * Add vacuum vessel mass calculation to VacuumVessel class * Add docstring to vacuum vessel volume calculation method * Add output methods for shield and vacuum vessel areas and volumes
* CI cleanup * move tf data to json file * add biome for json formatting and format * general formatting cleanup * add plotting option to tests * add marker to list * fix python selection * add parallelism * move python version to env workflow level * fix CI
* Rename Fw class to FirstWall and update references throughout the codebase * Add methods to calculate first wall geometry and areas in FirstWall class * Add method to calculate elliptical first wall areas in FirstWall class * Add dz_fw_half variable for first wall half-height in fwbs_variables.py * Add method to apply first wall coverage factors in FirstWall class * Refactor first wall geometry calculations into FirstWall class methods * Requested changes * Refactor first wall area calculations to use first_wall_variables and add first_wall_variables.py
* Add average neutron flux variable for plasma surface * Add average neutron flux calculation for plasma surface * Add average neutron flux display in plasma information plot
* Add PlasmaBeta class and integrate into Physics initialization * Refactor beta normalization calculations to use PlasmaBeta class methods * Add static method to PlasmaBeta for calculating normalized beta * Refactor beta information output to PlasmaBeta class for improved organization * Move total normalised beta calc to outside of calculate_plasma_current * Add static method to PlasmaBeta for calculating plasma energy from beta * Refactor plasma energy calculations to use PlasmaBeta methods for improved clarity and maintainability * Refactor fast alpha beta calculation into PlasmaBeta class and remove redundant function from physics_functions.py * Refactor beta limit calculation into PlasmaBeta class and remove redundant function from physics.py * Refactor poloidal beta calculation to use PlasmaBeta class methods and remove redundant function * Refactor thermal beta normalization calculation to use PlasmaBeta class method * Refactor beta norm max calculation to use PlasmaBeta class property for improved maintainability * Refactor beta norm max calculation to use BetaNormMaxModel Enum method and improve error handling * Update plasma beta documentation to include function references for Wesson, Original Scaling, Menard, Tholerus, and Stambaugh relations * Refactor plasma current documentation for clarity and consistency in variable formatting * Refactor plasma beta calculations into a dedicated run method for improved organization and maintainability * Refactor normalized beta calculations into PlasmaBeta class for improved organization and maintainability
* Fixed negativity in sqrt in costs.py by np.clip. * Introduced a local variable sqrt_p_plant_electric_net_mw in the scope of the method coelc to warn in case p_plant_electric_net_mw is negative. Also caught a third place where sqrt_p_plant_electric_net_mw is needed .(missed earlier as it was commented out) * Update process/costs.py Clarified what's the purpose of the calculation inside the warning. Co-authored-by: Timothy <75321887+timothy-nunn@users.noreply.github.com> * Bug fixes so regression test passes - Undid the comment line change (previously over-corrected) --------- Co-authored-by: Timothy <75321887+timothy-nunn@users.noreply.github.com>
* Add PlasmaInductance class and integrate into physics and stellarator models * Refactor internal inductance calculations to use PlasmaInductance class methods and remove redundant static methods * Refactor internal inductance calculation to use IndInternalNormModel and PlasmaInductance class for improved clarity and maintainability * Refactor output of volt-second information into PlasmaInductance class for improved organization and maintainability * Update documentation for PlasmaInductance: add method references to Wesson and Menard relations * Refactor internal inductance calculations: move logic to PlasmaInductance class and streamline execution with run method
* Add method to calculate reduced mass of two particles * Refactor classical distance of closest approach calculation to use reduced mass and relative velocity * Add method to calculate average relative velocity and update usage in detailed physics calculations * ❇️ Add deuteron thermal velocity profile to physics variables * Add deuteron thermal velocity profile calculations to detailed physics * Add electron-deuteron Coulomb logarithm profile to physics variables * Add electron-deuteron Coulomb logarithm calculations and plotting * Add deuteron Larmor frequency profile to physics variables * Add deuteron toroidal Larmor frequency profile calculations and plotting * Add triton thermal velocity profile to physics variables * Add electron-triton Coulomb logarithm profile to physics variables * Add triton Larmor frequency profile to physics variables * Add triton thermal velocity, Larmor frequency, and Coulomb logarithm profiles to physics variables * Add triton velocity, Larmor frequency, and Coulomb logarithm profiles to plotting functions * Update vel_relative parameter to be required in distance calculation method
Hi Michael - the main change in terms of the pf coil power accounting are as follows p_pf_electric_supplies_mw: 1.02 → 3.18 MW (+212%) The PF power profile variables (p_pf_electric_supplies_profile_mw1–4) scale consistently with this change. Do you think this seems reasonable? |
Description
Updates pfpwr equation to account for additional components in pf power management: busbar, power supply and storage system.
Checklist
I confirm that I have completed the following checks: