Current drive fractions do not add to 1
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 71
- Forks
- 27
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 33
Description
In GitLab by @mkovari on May 18, 2023, 11:53
This code falsifies the current drive fractions so they do not add to 1. No error message appears in the output file.
EDIT: the variable names have been changed. The code is now as follows.
current_drive_variables.f_c_plasma_internal = (
current_drive_variables.f_c_plasma_bootstrap
+ current_drive_variables.f_c_plasma_diamagnetic
+ current_drive_variables.f_c_plasma_pfirsch_schluter
)
# Plasma driven current fraction (Bootstrap + Diamagnetic
# + Pfirsch-Schlüter) constrained to be less than
# or equal to the total fraction of the plasma current
# produced by non-inductive means (which also includes
# the current drive proportion)
physics_module.err243 = 0
if (
current_drive_variables.f_c_plasma_internal
> physics_variables.f_c_plasma_non_inductive
):
current_drive_variables.f_c_plasma_internal = min(
current_drive_variables.f_c_plasma_internal,
physics_variables.f_c_plasma_non_inductive,
)
This variable is only used in one place:
# Fraction of plasma current produced by auxiliary current drive
physics_variables.f_c_plasma_auxiliary = (
physics_variables.f_c_plasma_non_inductive
- current_drive_variables.f_c_plasma_internal
)
This is needed because f_c_plasma_non_inductive can be an iteration variable, so we need to be able to calculate things from it.
Although negative auxiliary current drive is physically possible, we don't have any way of handling it in PROCESS.
As far as I can see, f_c_plasma_auxiliary is only used in one place:
# Calculate the injected power for the primary heating method
current_drive_variables.p_hcd_primary_injected_mw = (
1.0e-6
* (
physics_variables.f_c_plasma_auxiliary
- current_drive_variables.f_c_plasma_hcd_secondary
)
* physics_variables.plasma_current
/ current_drive_variables.eta_cd_hcd_primary
)
@stuartmuldrew ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the assignments and uses of current_drive_variables.f_c_plasma_internal, physics_variables.f_c_plasma_auxiliary, and current_drive_variables.p_hcd_primary_injected_mw. Reproduce the reported output and trace how the current-drive fractions are calculated, including the iteration-variable case. Done means the fractions are handled consistently and the relevant error condition is visible in the output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100