bio_rtd.uo.fc_uo

Fully continuous unit operations.

Unit operations that accept and provide constant or box-shaped flow rate profile.

Box-shaped flow rate profile is a profile with constant value with optional trailing zeros at front or at end.

Dilution

class bio_rtd.uo.fc_uo.Dilution(t, dilution_ratio, uo_id, gui_title='Dilution')[source]

Bases: bio_rtd.core.UnitOperation

Process fluid stream dilution by constant ratio.

Parameters
  • t (ndarray) – Simulation time vector. Starts with 0 and has a constant time step.

  • dilution_ratio (float) – Dilution ratio. Must be >= 1.

  • uo_id (str) – Unique identifier.

  • gui_title (str) – Readable title for GUI. Default = “Dilution”.

Variables

c_add_buffer – Concentration of species in dilution buffer.

dilution_ratio: float

Dilution ratio. Must be >= 1.

Dilution ratio of 1.2 means adding 20 % of dilution buffer.

c_add_buffer: _np.ndarray

Concentration of species in dilution buffer.

Default = empty array (= all components are 0).

If defined, it must have a value for each process fluid specie.

evaluate(f_in, c_in)

Evaluate the propagation throughout the unit operation.

Parameters
  • c_in (ndarray) – Inlet concentration profile with shape (n_species, n_time_steps).

  • f_in (array) – Inlet flow rate profile with shape (n_time_steps,).

Return type

Tuple[ndarray, ndarray]

Returns

  • f_out – Outlet flow rate profile.

  • c_out – Outlet concentration profile.

get_result()

Returns existing flow rate and concentration profiles.

Return type

Tuple[ndarray, ndarray]

Returns

  • f_out – Outlet flow rate profile.

  • c_out – Outlet concentration profile.

property log

Reference of the RtdLogger instance.

Setter also plants instance data tree into passed logger.

If logger is requested, but not yet set, then a bio_rtd.logger.DefaultLogger is instantiated.

Return type

RtdLogger

set_logger_from_parent(parent_id, logger)

Inherit logger from parent.

Parameters
  • parent_id (str) – Unique identifier of parent instance.

  • logger (RtdLogger) – Logger from parent instance.

uo_id: str

Unique identifier of the instance

gui_title: str

Readable title for GUI

gui_hidden: bool

Hide the of the unit operation (default False).

discard_inlet_until_t: float

Discard inlet until given time.

discard_inlet_until_min_c: _np.ndarray

Discard inlet until given concentration is reached.

discard_inlet_until_min_c_rel: _np.ndarray

Discard inlet until given concentration relative to is reached.

Specified concentration is relative to the max concentration.

discard_inlet_n_cycles: int

Discard first n cycles of the periodic inlet flow rate profile.

discard_outlet_until_t: float

Discard outlet until given time.

discard_outlet_until_min_c: _np.ndarray

Discard outlet until given concentration is reached.

discard_outlet_until_min_c_rel: _np.ndarray

Discard outlet until given concentration relative to is reached.

Specified concentration is relative to the max concentration.

discard_outlet_n_cycles: int

Discard first n cycles of the periodic outlet flow rate profile.

adj_par_list

List of adjustable parameters exposed to the GUI.

Type

list of bio_rtd.adj_par.AdjustableParameter

Concentration

class bio_rtd.uo.fc_uo.Concentration(t, flow_reduction, uo_id, gui_title='Concentration')[source]

Bases: bio_rtd.core.UnitOperation

Concentrate process fluid stream.

Parameters
  • t (ndarray) – Simulation time vector. Starts with 0 and has a constant time step.

  • flow_reduction (float) – Flow reduction (== volume reduction). Must be > 1.

  • uo_id (str) – Unique identifier.

  • gui_title (str) – Readable title for GUI. Default = “Concentration”.

Variables
flow_reduction: float

Flow reduction (== volume reduction). Must be > 1.

outlet flow rate = inlet flow rate / flow_reduction.

non_retained_species: _typing.Sequence[int]

Indexes of non-retained species. Indexing starts with 0.

relative_losses: float

Relative losses of retained species.

evaluate(f_in, c_in)

Evaluate the propagation throughout the unit operation.

Parameters
  • c_in (ndarray) – Inlet concentration profile with shape (n_species, n_time_steps).

  • f_in (array) – Inlet flow rate profile with shape (n_time_steps,).

Return type

Tuple[ndarray, ndarray]

Returns

  • f_out – Outlet flow rate profile.

  • c_out – Outlet concentration profile.

get_result()

Returns existing flow rate and concentration profiles.

Return type

Tuple[ndarray, ndarray]

Returns

  • f_out – Outlet flow rate profile.

  • c_out – Outlet concentration profile.

property log

Reference of the RtdLogger instance.

Setter also plants instance data tree into passed logger.

If logger is requested, but not yet set, then a bio_rtd.logger.DefaultLogger is instantiated.

Return type

RtdLogger

set_logger_from_parent(parent_id, logger)

Inherit logger from parent.

Parameters
  • parent_id (str) – Unique identifier of parent instance.

  • logger (RtdLogger) – Logger from parent instance.

uo_id: str

Unique identifier of the instance

gui_title: str

Readable title for GUI

gui_hidden: bool

Hide the of the unit operation (default False).

discard_inlet_until_t: float

Discard inlet until given time.

discard_inlet_until_min_c: _np.ndarray

Discard inlet until given concentration is reached.

discard_inlet_until_min_c_rel: _np.ndarray

Discard inlet until given concentration relative to is reached.

Specified concentration is relative to the max concentration.

discard_inlet_n_cycles: int

Discard first n cycles of the periodic inlet flow rate profile.

discard_outlet_until_t: float

Discard outlet until given time.

discard_outlet_until_min_c: _np.ndarray

Discard outlet until given concentration is reached.

discard_outlet_until_min_c_rel: _np.ndarray

Discard outlet until given concentration relative to is reached.

Specified concentration is relative to the max concentration.

discard_outlet_n_cycles: int

Discard first n cycles of the periodic outlet flow rate profile.

adj_par_list

List of adjustable parameters exposed to the GUI.

Type

list of bio_rtd.adj_par.AdjustableParameter

BufferExchange

class bio_rtd.uo.fc_uo.BufferExchange(t, exchange_ratio, uo_id, gui_title='BufferExchange')[source]

Bases: bio_rtd.core.UnitOperation

Buffer exchange.

Parameters
  • t (ndarray) – Simulation time vector. Starts with 0 and has a constant time step.

  • exchange_ratio (float) – Exchange ratio (== efficiency). Must be > 0 and <= 1.

  • uo_id (str) – Unique identifier.

  • gui_title (str) – Readable title for GUI. Default = “BufferExchange”.

Variables

Notes

Can be combined with Concentration and one of the FlowThrough or FlowThroughWithSwitching steps in order to simulate unit operations such as SPTFF or UFDF

exchange_ratio: float

Exchange ratio (== efficiency). Must be > 0 and <= 1.

Share of exchange buffer in outlet buffer.

non_retained_species: _typing.Sequence[int]

Indexes of non-retained species. Indexing starts with 0.

c_exchange_buffer

Concentration of species in exchange buffer.

Default = empty array (= all components are 0).

If defined, it must have a value for each process fluid specie.

relative_losses: float

Relative losses of retained species during dilution.

evaluate(f_in, c_in)

Evaluate the propagation throughout the unit operation.

Parameters
  • c_in (ndarray) – Inlet concentration profile with shape (n_species, n_time_steps).

  • f_in (array) – Inlet flow rate profile with shape (n_time_steps,).

Return type

Tuple[ndarray, ndarray]

Returns

  • f_out – Outlet flow rate profile.

  • c_out – Outlet concentration profile.

get_result()

Returns existing flow rate and concentration profiles.

Return type

Tuple[ndarray, ndarray]

Returns

  • f_out – Outlet flow rate profile.

  • c_out – Outlet concentration profile.

property log

Reference of the RtdLogger instance.

Setter also plants instance data tree into passed logger.

If logger is requested, but not yet set, then a bio_rtd.logger.DefaultLogger is instantiated.

Return type

RtdLogger

set_logger_from_parent(parent_id, logger)

Inherit logger from parent.

Parameters
  • parent_id (str) – Unique identifier of parent instance.

  • logger (RtdLogger) – Logger from parent instance.

uo_id: str

Unique identifier of the instance

gui_title: str

Readable title for GUI

gui_hidden: bool

Hide the of the unit operation (default False).

discard_inlet_until_t: float

Discard inlet until given time.

discard_inlet_until_min_c: _np.ndarray

Discard inlet until given concentration is reached.

discard_inlet_until_min_c_rel: _np.ndarray

Discard inlet until given concentration relative to is reached.

Specified concentration is relative to the max concentration.

discard_inlet_n_cycles: int

Discard first n cycles of the periodic inlet flow rate profile.

discard_outlet_until_t: float

Discard outlet until given time.

discard_outlet_until_min_c: _np.ndarray

Discard outlet until given concentration is reached.

discard_outlet_until_min_c_rel: _np.ndarray

Discard outlet until given concentration relative to is reached.

Specified concentration is relative to the max concentration.

discard_outlet_n_cycles: int

Discard first n cycles of the periodic outlet flow rate profile.

adj_par_list

List of adjustable parameters exposed to the GUI.

Type

list of bio_rtd.adj_par.AdjustableParameter

FlowThrough

class bio_rtd.uo.fc_uo.FlowThrough(t, pdf, uo_id, gui_title='FlowThrough')[source]

Bases: bio_rtd.core.UnitOperation

Fully continuous unit operation without life cycle.

FlowThrough has a constant PDF, which depends on flow rate and void volume.

If initial volume < void volume, then the unit operation is first filled up. During the fill-up an ideal mixing is assumed.

Parameters
  • t (ndarray) – Simulation time vector. Starts with 0 and has a constant time step.

  • pdf (PDF) –

    PDF that described propagation of process fluid through the unit operation.

    pdf is updated with void volume and flow rate at runtime.

  • uo_id (str) – Unique identifier.

  • gui_title (str) – Readable title for GUI. Default = “FlowThrough”.

Notes

Attributes with short description:

Void volume (one should be defined):

Initial fill volume (one can be defined, optional):

  • v_init

  • v_init_ratio - init volume = v_init_ratio * void volume

  • If none are defined, then init volume = void volume

Init fill volume concentration (optional):

  • c_init - must have values for each specie

  • In undefined, then all species are 0.

Losses (optional):

Losses species list (required if losses_share is defined):

Examples

A vessel is half-empty at the beginning of the process, then v_init_ratio = 0.5. During simulation, the vessel gets fully filled in first part. Ideal mixing is assumed during the first part. Fully filled vessel serves then as an initial state for the rest of the simulation.

pdf: _core.PDF

Probability distribution function for describing RTD.

PDF that described propagation of process fluid through the unit operation.

pdf is updated with void volume and flow rate at runtime.

v_void: float

Void volume. This is effective void volume.

Either v_void or rt_target should be defined.

rt_target: float

Target residence time.

Used to determine (effective) void volume of the unit operation.

Either rt_target or v_void should be defined.

v_init: float

Initial fill volume.

One of v_init or v_init_ratio may be defined, but not both. If both are undefined, then the init volume is the same as void volume.

v_init_ratio: float

Initial fill volume relative to void volume.

One of v_init or v_init_ratio may be defined, but not both. If both are undefined, then the init volume is the same as void volume.

c_init: _np.ndarray

Buffer composition in initial fill volume.

E.g. equilibration buffer composition.

If undefined (default) then all components are set to 0.

If defined then it has to have a value for each specie.

losses_share: float

Relative losses.

losses_species_list: _typing.Sequence[int]

Indexes of process fluid components affected by losses.

Must be defined if losses_share > 0.

property log

Reference of the RtdLogger instance.

Setter also plants instance data tree into passed logger.

If logger is requested, but not yet set, then a bio_rtd.logger.DefaultLogger is instantiated.

Return type

RtdLogger

evaluate(f_in, c_in)

Evaluate the propagation throughout the unit operation.

Parameters
  • c_in (ndarray) – Inlet concentration profile with shape (n_species, n_time_steps).

  • f_in (array) – Inlet flow rate profile with shape (n_time_steps,).

Return type

Tuple[ndarray, ndarray]

Returns

  • f_out – Outlet flow rate profile.

  • c_out – Outlet concentration profile.

get_result()

Returns existing flow rate and concentration profiles.

Return type

Tuple[ndarray, ndarray]

Returns

  • f_out – Outlet flow rate profile.

  • c_out – Outlet concentration profile.

set_logger_from_parent(parent_id, logger)

Inherit logger from parent.

Parameters
  • parent_id (str) – Unique identifier of parent instance.

  • logger (RtdLogger) – Logger from parent instance.

uo_id: str

Unique identifier of the instance

gui_title: str

Readable title for GUI

gui_hidden: bool

Hide the of the unit operation (default False).

discard_inlet_until_t: float

Discard inlet until given time.

discard_inlet_until_min_c: _np.ndarray

Discard inlet until given concentration is reached.

discard_inlet_until_min_c_rel: _np.ndarray

Discard inlet until given concentration relative to is reached.

Specified concentration is relative to the max concentration.

discard_inlet_n_cycles: int

Discard first n cycles of the periodic inlet flow rate profile.

discard_outlet_until_t: float

Discard outlet until given time.

discard_outlet_until_min_c: _np.ndarray

Discard outlet until given concentration is reached.

discard_outlet_until_min_c_rel: _np.ndarray

Discard outlet until given concentration relative to is reached.

Specified concentration is relative to the max concentration.

discard_outlet_n_cycles: int

Discard first n cycles of the periodic outlet flow rate profile.

adj_par_list

List of adjustable parameters exposed to the GUI.

Type

list of bio_rtd.adj_par.AdjustableParameter

FlowThroughWithSwitching

class bio_rtd.uo.fc_uo.FlowThroughWithSwitching(t, pdf, uo_id, gui_title='FlowThroughWithSwitching')[source]

Bases: bio_rtd.uo.fc_uo.FlowThrough

Fully continuous unit operation with inline switching.

FlowThroughWithSwitching has a constant PDF, which depends on flow rate and void volume.

First cycle starts when the inlet flow rate is turned on. Cycle duration might represent a flow-through column lifetime.

If initial volume < void volume, then the unit operation is first filled up. During the fill-up an ideal mixing is assumed.

Parameters
  • t (ndarray) – Simulation time vector. Starts with 0 and has a constant time step.

  • pdf (_core.PDF) –

    PDF that described propagation of process fluid through the unit operation.

    pdf is updated with void volume and flow rate at runtime.

  • uo_id (str) – Unique identifier.

  • gui_title (str) – Readable title for GUI. Default = “FlowThroughWithSwitching”.

Notes

Cycle duration (e.g. column lifetime) should be defined by one of the following attributes:

evaluate(f_in, c_in)

Evaluate the propagation throughout the unit operation.

Parameters
  • c_in (ndarray) – Inlet concentration profile with shape (n_species, n_time_steps).

  • f_in (array) – Inlet flow rate profile with shape (n_time_steps,).

Return type

Tuple[ndarray, ndarray]

Returns

  • f_out – Outlet flow rate profile.

  • c_out – Outlet concentration profile.

get_result()

Returns existing flow rate and concentration profiles.

Return type

Tuple[ndarray, ndarray]

Returns

  • f_out – Outlet flow rate profile.

  • c_out – Outlet concentration profile.

property log

Reference of the RtdLogger instance.

Setter also plants instance data tree into passed logger.

If logger is requested, but not yet set, then a bio_rtd.logger.DefaultLogger is instantiated.

Return type

RtdLogger

set_logger_from_parent(parent_id, logger)

Inherit logger from parent.

Parameters
  • parent_id (str) – Unique identifier of parent instance.

  • logger (RtdLogger) – Logger from parent instance.

uo_id: str

Unique identifier of the instance

gui_title: str

Readable title for GUI

gui_hidden: bool

Hide the of the unit operation (default False).

discard_inlet_until_t: float

Discard inlet until given time.

discard_inlet_until_min_c: _np.ndarray

Discard inlet until given concentration is reached.

discard_inlet_until_min_c_rel: _np.ndarray

Discard inlet until given concentration relative to is reached.

Specified concentration is relative to the max concentration.

discard_inlet_n_cycles: int

Discard first n cycles of the periodic inlet flow rate profile.

discard_outlet_until_t: float

Discard outlet until given time.

discard_outlet_until_min_c: _np.ndarray

Discard outlet until given concentration is reached.

discard_outlet_until_min_c_rel: _np.ndarray

Discard outlet until given concentration relative to is reached.

Specified concentration is relative to the max concentration.

discard_outlet_n_cycles: int

Discard first n cycles of the periodic outlet flow rate profile.

pdf: _core.PDF

Probability distribution function for describing RTD.

PDF that described propagation of process fluid through the unit operation.

pdf is updated with void volume and flow rate at runtime.

v_void: float

Void volume. This is effective void volume.

Either v_void or rt_target should be defined.

rt_target: float

Target residence time.

Used to determine (effective) void volume of the unit operation.

Either rt_target or v_void should be defined.

v_init: float

Initial fill volume.

One of v_init or v_init_ratio may be defined, but not both. If both are undefined, then the init volume is the same as void volume.

v_init_ratio: float

Initial fill volume relative to void volume.

One of v_init or v_init_ratio may be defined, but not both. If both are undefined, then the init volume is the same as void volume.

c_init: _np.ndarray

Buffer composition in initial fill volume.

E.g. equilibration buffer composition.

If undefined (default) then all components are set to 0.

If defined then it has to have a value for each specie.

losses_share: float

Relative losses.

losses_species_list: _typing.Sequence[int]

Indexes of process fluid components affected by losses.

Must be defined if losses_share > 0.

adj_par_list

List of adjustable parameters exposed to the GUI.

Type

list of bio_rtd.adj_par.AdjustableParameter

t_cycle: float

Cycle duration (time).

E.g. lifecycle of flow-through column.

Only one cycle duration definition is expected. Available:

v_cycle: float

Cycle duration (volume).

Cycle duration (time) = v_cycle / inlet flow rate.

E.g. lifecycle of flow-through column.

Only one cycle duration definition is expected. Available:

v_cycle_relative: float

Cycle duration (relative volume).

Cycle duration (time) = v_cycle_relative * void volume / inlet flow rate.

E.g. lifecycle of flow-through column.

Only one cycle duration definition is expected. Available: