CADETProcess.modelBuilder.CompartmentBuilder#

class CADETProcess.modelBuilder.CompartmentBuilder(name, n_compartments)[source]#

Bases: Structure

Class to build complex compartment models of bioreactors.

Attributes:
namestr

Name of the CompartmentBuilder.

n_compartmentsint

Number of compartments in the bioreactor.

add_tracer(compartment_index: int, c: list, t_inj: float, flow_rate: float | None, t_start: float | None = 0, flow_rate_filter: bool | None = True) None[source]#

Add tracer injection to compartment model.

For this purpose, a new inlet source is instantiated and connected to the corresponding compartment. Then, an Event is added which modifies the flow rate of the inlet.

Parameters:
compartment_indexint

Compartment to which tracer is injected.

clist

Tracer concentration.

t_injfloat

Length of injection.

flow_ratefloat

flow rate during injection.

t_startfloat, optional

Time at which injection starts. The default is 0.

flow_rate_filterbool, optional

If True, the compartment volume is kept constant by adding a flow rate filter. The default is True.

Raises:
CADETProcessError

If compartment is not a real compartment.

property binding_model#

BindingBaseClass: binding model parameters of the unit operation.

Raises:
TypeError

If binding_model object is not an instance of BindingBaseClass.

CADETProcessError

If number of components do not match.

property bulk_reaction_model#

BulkReactionBase: Reaction in bulk phase.

Raises:
TypeError

If bulk_reaction_model is not an instance of ReactionBaseClass.

CADETProcessError

If unit does not support bulk reaction model. If number of components do not match.

property cycle_time: float#

float: Cycle time of the process.

property flow_sheet: FlowSheet#

FlowSheet: FlowSheet of the compartment builder.

property init_c: int | float | list | ndarray#

np.array: Initial conditions of compartments.

Parameters:
init_cint, float, list, or np.array

Initial concentration of compartments. If type is float or int, same value is used for all components and concentrations. If type is list, same component concentrations are used for all compartments. If np.array, explicit concentrations for components and compartments are set.

Raises:
ValueError

If init_c does not contain correct shape.

property n_comp: int#

int: Number of components.

n_compartments#

Parameter descriptor for unsigned integer parameters.

name#

Parameter descriptor constrained to string values.

property particle_reaction_model#

ParticleReactionBase: Reaction in particle liquid phase.

Raises:
TypeError

If particle_reaction_model is not an instance of ReactionBaseClass.

CADETProcessError

If unit does not support particle reaction model. If number of components do not match.

property process: Process#

Process: Process of the compartment builder.

validate_flow_rates() None[source]#

Validate that compartment volume is constant.