diff --git a/documentation/source/cost-models/cost-models.md b/documentation/source/cost-models/cost-models.md index 4b3f0221fa..d985b0c7c5 100644 --- a/documentation/source/cost-models/cost-models.md +++ b/documentation/source/cost-models/cost-models.md @@ -4,7 +4,7 @@ Two cost models are available, determined by the switch `cost_model`. ## 1990 cost model (`cost_model = 0`) -This combines methods[^1] used in the TETRA code [^2] and the Generomak[^3] scheme. The costs are split into accounting categories[^4]. The best references for the algorithms used are[^5], and source file `costs.f90` in the code itself. The majority of the costed items have a unit cost associated with them. These values scale with (for example) power output, volume, component mass etc., and many are available to be changed via the input file. All costs and their algorithms correspond to 1990 dollars. +This combines methods[^1] used in the TETRA code [^2] and the Generomak[^3] scheme. The costs are split into accounting categories[^4]. The best references for the algorithms used are[^5], and source file `costs.py` in the code itself. The majority of the costed items have a unit cost associated with them. These values scale with (for example) power output, volume, component mass etc., and many are available to be changed via the input file. All costs and their algorithms correspond to 1990 dollars. The unit costs of the components of the fusion power core are relevant to "first-of-a-kind" items. That is to say, the items are assumed to be relatively expensive to build as they are effectively prototypes and specialised tools and machines have perhaps been made specially to create them. However, if a "production line" has been set up, and R & D progress has allowed more experience to be gained in constructing the power core components, the cost will be reduced as a result. Variable `fkind` may be used to multiply the raw unit costs of the fusion power core items (by a factor less than one) to simulate this cost reduction for an *Nth*-of-a-kind device. In other systems studies of fusion power plants[^6], values for this multiplier have ranged from 0.5 to 0.8. diff --git a/documentation/source/development/add-vars.md b/documentation/source/development/add-vars.md index 81ff1b49a1..8e6928f257 100644 --- a/documentation/source/development/add-vars.md +++ b/documentation/source/development/add-vars.md @@ -5,9 +5,6 @@ optimisation figure of merit and constraints to the `PROCESS` code. **At all times the [`PROCESS` style guide](../development/standards.md) must be used.** -!!! note - - As the code is quickly converging towards a wholly Python codebase the respective files may change in type from `.f90` to `.py`. ----------------- @@ -15,29 +12,21 @@ optimisation figure of merit and constraints to the `PROCESS` code. To add a `PROCESS` input, please follow below: -1. Choose the most relevant module `XX` and add the variable in the `XX_variables` defined in `XX_variables.f90`. +1. Choose the most relevant module `XX` and add the variable in the `XX_variables` defined in `XX_variables.py`. -2. Add a description of the input variable below the declaration, using the FORD formatting described in the standards section specifying the units. - -3. Specify a sensible default value in the `init_XX_variables()` function within the corresponding model `.py` main file +2. Add a description of the input variable below the declaration, using the formatting described in the standards section specifying the units. + +3. Assign a sensible default initial value, and a type. 4. Add the parameter to the `INPUT_VARIABLES` dictionary in `input.py`. Here is an example of the code to add: -Variable definition example in `tfcoil_variables.f90`: -```fortran - real(dp) :: rho_tf_joints - !! TF joints surfacic resistivity [ohm.m] - !! Feldmetal joints assumed. -``` - -Variable initialization example in `tf_coil.py`: +Variable definition and initial value setting example in `tfcoil_variables.py`: ```python - def init_tfcoil_variables(): - ... - tfv.rho_tf_joints = 2.5e-10 + e_tf_coil_magnetic_stored: float = 0.0 + """Stored magnetic energy in a single TF coil (J)""" ``` Code example in the `input.py` file: @@ -55,10 +44,10 @@ Code example in the `input.py` file: To add a `PROCESS` iteration variable please follow the steps below, in addition to the instructions for adding an input variable: -1. The parameter `ipnvars` in module `numerics` of `numerics.f90` will normally be greater than the actual number of iteration variables, and does not need to be changed. +1. The parameter `ipnvars` in module `numerics` of `numerics.py` will normally be greater than the actual number of iteration variables, and does not need to be changed. 2. Append a new iteration number key to the end of the `ITERATION_VARIABLES` dictionary in `iteration_variables.py`. The associated variable is the corresponding key value. 3. Set the variable origin file and then the associated lower and upper bounds -4. Update the `lablxc` description in `numerics.f90`. +4. Update the `lablxc` description in `numerics.py`. It should be noted that iteration variables must not be reset elsewhere in the code. That is, they may only be assigned new values when originally @@ -115,28 +104,45 @@ After following the instruction to add an input variable, you can make the varia `nsweep` comment example: -```fortran +```python + nsweep: int = None + """Switch denoting quantity to scan: