Skip to content

Correct constraint 52 docstring #4043

@timothy-nunn

Description

@timothy-nunn

(From #3947 (comment))

Constraint 52's docstring makes reference to models that no longer exist.

PROCESS/process/constraints.py

Lines 1443 to 1462 in 9e5012f

@ConstraintManager.register_constraint(52, "", ">=")
def constraint_equation_52():
"""Equation for tritium breeding ratio lower limit
author: P B Lloyd, CCFE, Culham Science Centre
ftbr: f-value for minimum tritium breeding ratio
tbr: tritium breeding ratio (i_blanket_type=2,3 (KIT HCPB/HCLL))
tbrmin: minimum tritium breeding ratio (If i_blanket_type=1, tbrmin=minimum 5-year time-averaged tritium breeding ratio)
"""
cc = (
1.0
- data_structure.constraint_variables.ftbr
* data_structure.fwbs_variables.tbr
/ data_structure.constraint_variables.tbrmin
)
return ConstraintResult(
cc,
data_structure.constraint_variables.tbrmin * (1.0 - cc),
data_structure.constraint_variables.tbrmin * cc,
)

I believe that fwbs_variables.tbr is now only set by the IFE model. We should:

  • Update the docstring
  • Add a check into the logic that the user is indeed running (the correct type of) IFE.

PROCESS/process/ife.py

Lines 886 to 890 in 9e5012f

fwbs_variables.tbr = (
3.7418
* (1.0 / (1.0 + np.exp(-2.6366 * ife_variables.bldrc)) - 0.5)
* li_frac
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions