bluemira.codes.process.template_builder

PROCESS IN.DAT template builder

Classes

PROCESSTemplateBuilder

An API patch to make PROCESS a little easier to work with before

Module Contents

class bluemira.codes.process.template_builder.PROCESSTemplateBuilder

An API patch to make PROCESS a little easier to work with before the PROCESS team write a Python API.

_models: dict[str, bluemira.codes.process.model_mapping.PROCESSModel]
_constraints: list[bluemira.codes.process.equation_variable_mapping.Constraint] = []
values: dict[str, Any]
variables: dict[str, float]
bounds: dict[str, dict[str, str]]
ixc: list[int] = []
f_nd_impurity_electrons: list[float] = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
minmax: int = 0
ioptimiz: int = 0
maxcal: int = 1000
epsvmc: float = 1e-08
neqns: int = 0
set_run_title(run_title: str)

Set the run title

Parameters:

run_title (str)

set_optimisation_algorithm(algorithm_choice: bluemira.codes.process.model_mapping.PROCESSOptimisationAlgorithm)

Set the optimisation algorithm to use

Parameters:

algorithm_choice (bluemira.codes.process.model_mapping.PROCESSOptimisationAlgorithm)

set_optimisation_numerics(maxiter: int = 1000, tolerance: float = 1e-08)

Set optimisation numerics

Parameters:
  • maxiter (int) – maximum number of iteration/calculations in process.

  • tolerance (float) – VMCON tolerance epsvmc

set_number_equality_constraints(num_equality_cons: int = 0)

Set numbert of equality constraints used

Parameters:

num_equality_cons (int) – Number of equality constraints used in process

set_minimisation_objective(objective: bluemira.codes.process.equation_variable_mapping.Objective)

Set the minimisation objective equation to use when running PROCESS

Parameters:

objective (bluemira.codes.process.equation_variable_mapping.Objective)

set_maximisation_objective(objective: bluemira.codes.process.equation_variable_mapping.Objective)

Set the maximisation objective equation to use when running PROCESS

Raises:

ValueError – Objective can only be a minimisation

Parameters:

objective (bluemira.codes.process.equation_variable_mapping.Objective)

set_model(model_choice: bluemira.codes.process.model_mapping.PROCESSModel)

Set a model switch to the PROCESS run

Parameters:

model_choice (bluemira.codes.process.model_mapping.PROCESSModel)

add_constraint(constraint: bluemira.codes.process.equation_variable_mapping.Constraint, *, equality: bool = False)

Add a constraint to the PROCESS run

It must be stated whether the constraint is intended as an equality constraint

Parameters:
add_variable(name: str, value: float | None = None, lower_bound: float | None = None, upper_bound: float | None = None)

Add an iteration variable to the PROCESS run

Raises:

ValueError – Iteration variable not found

Parameters:
  • name (str)

  • value (float | None)

  • lower_bound (float | None)

  • upper_bound (float | None)

adjust_variable(name: str, value: float | None = None, lower_bound: float | None = None, upper_bound: float | None = None)

Adjust an iteration variable in the PROCESS run

Raises:

ValueError – No iteration variable found

Parameters:
  • name (str)

  • value (float | None)

  • lower_bound (float | None)

  • upper_bound (float | None)

add_input_value(name: str, value: float | collections.abc.Iterable[float])

Add a fixed input value to the PROCESS run

Parameters:
  • name (str)

  • value (float | collections.abc.Iterable[float])

add_input_values(mapping: dict[str, Any])

Add a dictionary of fixed input values to the PROCESS run

Parameters:

mapping (dict[str, Any])

add_impurity(impurity: bluemira.codes.process.api.Impurities, value: float)

Add an impurity concentration

Parameters:
_add_to_dict(mapping: dict[str, Any], name: str, value: Any)
Parameters:
  • mapping (dict[str, Any])

  • name (str)

  • value (Any)

_check_model_inputs()

Check the required inputs for models have been provided.

_check_constraint_inputs()

Check the required inputs for the constraints have been provided

_check_missing_inputs(model: bluemira.codes.process.model_mapping.PROCESSModel | bluemira.codes.process.equation_variable_mapping.ConstraintSelection)
Parameters:

model (bluemira.codes.process.model_mapping.PROCESSModel | bluemira.codes.process.equation_variable_mapping.ConstraintSelection)

_check_missing_iteration_variables(constraint: bluemira.codes.process.equation_variable_mapping.ConstraintSelection)
Parameters:

constraint (bluemira.codes.process.equation_variable_mapping.ConstraintSelection)

make_inputs() bluemira.codes.process._inputs.ProcessInputs

Make the ProcessInputs InVariable for the specified template

Return type:

bluemira.codes.process._inputs.ProcessInputs