Skip to content

Commit

Permalink
Change Dimension Hirarchy for Exchange Matrix in Unit Operation
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahlanzrath committed Jun 26, 2024
1 parent 8a48ecb commit cbea571
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions CADETProcess/processModel/unitOperation.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class UnitBaseClass(Structure):
name : String
name of the unit operation.
has_ports : bool
flag if unit has ports. Default to false
flag if unit has ports. Default to false
binding_model : BindingBaseClass
binding behavior of the unit. Defaults to NoBinding.
solution_recorder : IORecorder
Expand All @@ -83,7 +83,7 @@ class UnitBaseClass(Structure):
_parameters = []
_section_dependent_parameters = []
_initial_state = []

has_ports = False
supports_binding = False
supports_bulk_reaction = False
Expand Down Expand Up @@ -163,11 +163,11 @@ def discretization(self, discretization):
@property
def n_comp(self):
return self.component_system.n_comp

@property
def ports(self):
return [None]

@property
def n_ports(self):
return 1
Expand Down Expand Up @@ -1204,7 +1204,7 @@ class MCT(UnitBaseClass):
axial_dispersion = UnsignedFloat() #TODO: Axial dipersion needs multiplexing to enable dependency on nchannel.
flow_direction = Switch(valid=[-1, 1], default=1) #TODO: Flow direction needs multiplexing to enable dependency on nchannel.

exchange_matrix = SizedNdArray(size=('n_comp','nchannel', 'nchannel'))
exchange_matrix = SizedNdArray(size=('nchannel', 'nchannel','n_comp'))

_parameters = [
'length',
Expand Down Expand Up @@ -1241,15 +1241,15 @@ def __init__(self, *args, nchannel, **kwargs):
def nchannel(self):
"""int: Proxy for `discretization.nchannel`."""
return self.discretization.nchannel

@nchannel.setter
def nchannel(self, nchannel):
self.discretization.nchannel = nchannel

@property
def ports(self):
return [f"channel_{i}" for i in range(self.nchannel)]

@property
def n_ports(self):
return self.nchannel
Expand Down

0 comments on commit cbea571

Please sign in to comment.