bluemira.codes.plasmod.api._teardown

Defines the ‘Teardown’ stage for the plasmod solver.

Classes

Teardown

Plasmod teardown task.

Module Contents

class bluemira.codes.plasmod.api._teardown.Teardown(params: bluemira.codes.plasmod.params.PlasmodSolverParams, output_file: str, profiles_file: str, run_directory: str, read_directory: str)

Bases: bluemira.codes.interface.CodesTeardown

Inheritance diagram of bluemira.codes.plasmod.api._teardown.Teardown

Plasmod teardown task.

In “RUN” and “READ” mode, this loads in plasmod results files and updates params with the values.

Parameters:
  • params (bluemira.codes.plasmod.params.PlasmodSolverParams) – The bluemira parameters for the task. Note that this task does not apply any mappings to the ParameterFrame, so they should already be set. Most likely by a solver.

  • output_file (str) – The path to the plasmod output file.

  • profiles_file (str) – The path to the plasmod profiles file.

  • run_directory (str)

  • read_directory (str)

params: bluemira.codes.plasmod.params.PlasmodSolverParams
MOCK_JSON_NAME = 'mockPLASMOD.json'
read_directory
run_directory
output_file
profiles_file
run()

Load the plasmod results files and update this object’s params with the read values.

mock()

Update this object’s plasmod params with default values.

read()

Load the plasmod results files and update this object’s params with the read values.

Raises:

CodesError – If any of the plasmod files cannot be opened.

_get_data(output_file: str | pathlib.Path, profiles_file: str | pathlib.Path)

Get data for read or run modes

Raises:

CodesError – Cannot read output file

Parameters:
  • output_file (str | pathlib.Path)

  • profiles_file (str | pathlib.Path)

static _raise_on_plasmod_error_code(exit_code: int)

Check the returned exit code of plasmod.

1: PLASMOD converged successfully:

-1: Max number of iterations achieved:

Equilibrium oscillating, pressure too high, reduce H

0: transport solver crashed:

Abnormal parameters or too large dtmin and/or dtmin

-2: Equilibrium solver crashed:

Pressure too high

Raises:

CodesError – If the exit flag is an error code, or its value is not a known code.

Parameters:

exit_code (int)