ukaea / ukaea/PROCESS

Constraint 17 temporary fix

Open
#4,409 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
71
Forks
27
Avg merge
2d 18h
Merged PRs (30d)
33

Description

@timothy-nunn and I found that constraint 17 was no longer behaving as expected after #4299. In #4406 a temporary fix has been added to revert constraint 17 back to it's working state:

Reverts constraint 17 to pre-#4299.

The issue is that constraint 17 used to be formatted as

https://github.com/ukaea/PROCESS/blob/a68bb7f9af7774ad4b0cd5663bc9fa576c429ee5/process/core/solver/constraints.py#L594-L605

Importantly, it used pden_plasma_rad_mw. Now, the constraint uses f_p_plasma_separatrix_rad which is calculated as

https://github.com/ukaea/PROCESS/blob/024a2f2e5a9ac750132f6ed010cbe03a34351916/process/models/physics/physics.py#L1037-L1042

However this uses p_plasma_rad_mw which also includes the SOL radiation

https://github.com/ukaea/PROCESS/blob/a68bb7f9af7774ad4b0cd5663bc9fa576c429ee5/process/models/stellarator/stellarator.py#L2170

which is never accounted for in pden_plasma_rad_mw. This changed the constraint, making the problem harder to solve, and led to constant failures when running the stellarator-helias test.

The diffs in the stellarator-helias test should revert it back to this file.

Thanks @clmould for identifying constraint 17 was the problem!

This needs to be investigated by people with stellarator knowledge - was constraint 17 wrong all along? Does something need to change in the stellarator? Or with the new format of constraint 17?

@grmtrkngtn

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare constraint 17 in process/core/solver/constraints.py with its calculation in process/models/physics/physics.py and the radiation terms in process/models/stellarator/stellarator.py. Review the stellarator-helias test and its differences from the referenced MFILE, then determine with stellarator experts whether the constraint or stellarator calculation is correct. Done means the intended behavior is agreed and the test no longer fails under that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.