diff --git a/cadet/cadet_dll.py b/cadet/cadet_dll.py index 3e18bc0..ae1c36c 100644 --- a/cadet/cadet_dll.py +++ b/cadet/cadet_dll.py @@ -230,15 +230,16 @@ def _process_data( dims = [] # Ordering of multi-dimensional arrays, all possible dimensions: - # Example: Outlet [nTime, nPort, nComp] - # Bulk [nTime, nAxialCells, nRadialCells, nComp] if 2D model - # Bulk [nTime, nAxialCells, nComp] if 1D model + # bulk: 'nTime', ('nAxialCells',) ('nRadialCells' / 'nPorts',) 'nComp' + # particle_liquid: 'nTime', ('nParTypes',) ('nAxialCells',) ('nRadialCells' / 'nPorts',) ('nParShells',) 'nComp' + # particle_solid: 'nTime', ('nParTypes',) ('nAxialCells',) ('nRadialCells' / 'nPorts',) ('nParShells',) 'nComp', 'nBound' + # flux: 'nTime', ('nParTypes',) ('nAxialCells',) ('nRadialCells' / 'nPorts',) 'nComp' dimensions = [ 'nTime', - 'nPort', + 'nParTypes', 'nAxialCells', + 'nPort', 'nRadialCells', - 'nParTypes', 'nParShells', 'nComp', 'nBound', @@ -252,7 +253,7 @@ def _process_data( return if 'data' in call_outputs: - if 'nParShells' in dims: + if 'nParShells' in dims: nParShells = call_outputs['nParShells'].value if nParShells == 1: shape.pop(dims.index('nParShells')) diff --git a/tests/test_dll.py b/tests/test_dll.py index ff992dc..8b689e3 100644 --- a/tests/test_dll.py +++ b/tests/test_dll.py @@ -457,13 +457,13 @@ def __repr__(self): 'last_state_y': (164,), 'last_state_ydot': (164,), 'soldot_bulk': (1501, 10, 4), - 'soldot_flux': (1501, 10, 1, 4), + 'soldot_flux': (1501, 1, 10, 4), 'soldot_inlet': (1501, 4), 'soldot_outlet': (1501, 4), 'soldot_particle': (1501, 10, 4), 'soldot_solid': (1501, 10, 4), 'solution_bulk': (1501, 10, 4), - 'solution_flux': (1501, 10, 1, 4), + 'solution_flux': (1501, 1, 10, 4), 'solution_inlet': (1501, 4), 'solution_outlet': (1501, 4), 'solution_particle': (1501, 10, 4), @@ -498,13 +498,13 @@ def __repr__(self): 'last_state_y': (404,), 'last_state_ydot': (404,), 'soldot_bulk': (1501, 10, 4), - 'soldot_flux': (1501, 10, 1, 4), + 'soldot_flux': (1501, 1, 10, 4), 'soldot_inlet': (1501, 4), 'soldot_outlet': (1501, 4), 'soldot_particle': (1501, 10, 4, 4), 'soldot_solid': (1501, 10, 4, 4), 'solution_bulk': (1501, 10, 4), - 'solution_flux': (1501, 10, 1, 4), + 'solution_flux': (1501, 1, 10, 4), 'solution_inlet': (1501, 4), 'solution_outlet': (1501, 4), 'solution_particle': (1501, 10, 4, 4), @@ -539,7 +539,7 @@ def __repr__(self): 'last_state_y': (404,), 'last_state_ydot': (404,), 'soldot_bulk': (1501, 10, 4), - 'soldot_flux': (1501, 10, 1, 4), + 'soldot_flux': (1501, 1, 10, 4), 'soldot_inlet_port_000_comp_000': (1501,), 'soldot_inlet_port_000_comp_001': (1501,), 'soldot_inlet_port_000_comp_002': (1501,), @@ -551,7 +551,7 @@ def __repr__(self): 'soldot_particle': (1501, 10, 4, 4), 'soldot_solid': (1501, 10, 4, 4), 'solution_bulk': (1501, 10, 4), - 'solution_flux': (1501, 10, 1, 4), + 'solution_flux': (1501, 1, 10, 4), 'solution_inlet_port_000_comp_000': (1501,), 'solution_inlet_port_000_comp_001': (1501,), 'solution_inlet_port_000_comp_002': (1501,), @@ -604,13 +604,13 @@ def __repr__(self): 'last_state_y': (404,), 'last_state_ydot': (404,), 'soldot_bulk': (1501, 10, 4), - 'soldot_flux': (1501, 10, 1, 4), + 'soldot_flux': (1501, 1, 10, 4), 'soldot_inlet': (1501, 4), 'soldot_outlet': (1501, 4), 'soldot_particle': (1501, 10, 4, 4), 'soldot_solid': (1501, 10, 4, 4), 'solution_bulk': (1501, 10, 4), - 'solution_flux': (1501, 10, 1, 4), + 'solution_flux': (1501, 1, 10, 4), 'solution_inlet': (1501, 4), 'solution_outlet': (1501, 4), 'solution_particle': (1501, 10, 4, 4), @@ -626,13 +626,13 @@ def __repr__(self): }, 'sens_param_000_unit_000': { 'sensdot_bulk': (1501, 10, 4), - 'sensdot_flux': (1501, 10, 1, 4), + 'sensdot_flux': (1501, 1, 10, 4), 'sensdot_inlet': (1501, 4), 'sensdot_outlet': (1501, 4), 'sensdot_particle': (1501, 10, 4, 4), 'sensdot_solid': (1501, 10, 4, 4), 'sens_bulk': (1501, 10, 4), - 'sens_flux': (1501, 10, 1, 4), + 'sens_flux': (1501, 1, 10, 4), 'sens_inlet': (1501, 4), 'sens_outlet': (1501, 4), 'sens_particle': (1501, 10, 4, 4), @@ -666,7 +666,7 @@ def __repr__(self): 'last_state_y': (764,), 'last_state_ydot': (764,), 'soldot_bulk': (1501, 10, 4), - 'soldot_flux': (1501, 10, 2, 4), + 'soldot_flux': (1501, 2, 10, 4), 'soldot_inlet': (1501, 4), 'soldot_outlet': (1501, 4), 'soldot_particle_partype_000': (1501, 10, 4, 4), @@ -674,7 +674,7 @@ def __repr__(self): 'soldot_solid_partype_000': (1501, 10, 4, 4), 'soldot_solid_partype_001': (1501, 10, 4, 4), 'solution_bulk': (1501, 10, 4), - 'solution_flux': (1501, 10, 2, 4), + 'solution_flux': (1501, 2, 10, 4), 'solution_inlet': (1501, 4), 'solution_outlet': (1501, 4), 'solution_particle_partype_000': (1501, 10, 4, 4), @@ -711,13 +711,13 @@ def __repr__(self): 'last_state_y': (1212,), 'last_state_ydot': (1212,), 'soldot_bulk': (1501, 10, 3, 4), - 'soldot_flux': (1501, 10, 3, 1, 4), + 'soldot_flux': (1501, 1, 10, 3, 4), 'soldot_inlet': (1501, 3, 4), 'soldot_outlet': (1501, 3, 4), 'soldot_particle': (1501, 10, 3, 4, 4), 'soldot_solid': (1501, 10, 3, 4, 4), 'solution_bulk': (1501, 10, 3, 4), - 'solution_flux': (1501, 10, 3, 1, 4), + 'solution_flux': (1501, 1, 10, 3, 4), 'solution_inlet': (1501, 3, 4), 'solution_outlet': (1501, 3, 4), 'solution_particle': (1501, 10, 3, 4, 4), @@ -753,7 +753,7 @@ def __repr__(self): 'last_state_y': (1212,), 'last_state_ydot': (1212,), 'soldot_bulk': (1501, 10, 3, 4), - 'soldot_flux': (1501, 10, 3, 1, 4), + 'soldot_flux': (1501, 1, 10, 3, 4), 'soldot_inlet_port_000': (1501, 4), 'soldot_inlet_port_001': (1501, 4), 'soldot_inlet_port_002': (1501, 4), @@ -763,7 +763,7 @@ def __repr__(self): 'soldot_particle': (1501, 10, 3, 4, 4), 'soldot_solid': (1501, 10, 3, 4, 4), 'solution_bulk': (1501, 10, 3, 4), - 'solution_flux': (1501, 10, 3, 1, 4), + 'solution_flux': (1501, 1, 10, 3, 4), 'solution_inlet_port_000': (1501, 4), 'solution_inlet_port_001': (1501, 4), 'solution_inlet_port_002': (1501, 4), @@ -803,7 +803,7 @@ def __repr__(self): 'last_state_y': (1212,), 'last_state_ydot': (1212,), 'soldot_bulk': (1501, 10, 3, 4), - 'soldot_flux': (1501, 10, 3, 1, 4), + 'soldot_flux': (1501, 1, 10, 3, 4), 'soldot_inlet_port_000_comp_000': (1501,), 'soldot_inlet_port_000_comp_001': (1501,), 'soldot_inlet_port_000_comp_002': (1501,), @@ -831,7 +831,7 @@ def __repr__(self): 'soldot_particle': (1501, 10, 3, 4, 4), 'soldot_solid': (1501, 10, 3, 4, 4), 'solution_bulk': (1501, 10, 3, 4), - 'solution_flux': (1501, 10, 3, 1, 4), + 'solution_flux': (1501, 1, 10, 3, 4), 'solution_inlet_port_000_comp_000': (1501,), 'solution_inlet_port_000_comp_001': (1501,), 'solution_inlet_port_000_comp_002': (1501,),