From ba630e017e06e9be53b8f81275af2ba7ac28e557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schm=C3=B6lder?= Date: Fri, 29 Mar 2024 21:48:16 +0100 Subject: [PATCH] Fix loading flux --- cadet/cadet_dll.py | 11 ++++++++++- tests/test_dll.py | 32 ++++++++++++++++---------------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/cadet/cadet_dll.py b/cadet/cadet_dll.py index a228102..630ec22 100644 --- a/cadet/cadet_dll.py +++ b/cadet/cadet_dll.py @@ -233,7 +233,16 @@ def _process_data( # Example: Outlet [nTime, nPort, nComp] # Bulk [nTime, nAxialCells, nRadialCells, nComp] if 2D model # Bulk [nTime, nAxialCells, nComp] if 1D model - dimensions = ['nTime', 'nPort', 'nAxialCells', 'nRadialCells', 'nParShells', 'nComp', 'nBound'] + dimensions = [ + 'nTime', + 'nPort', + 'nAxialCells', + 'nRadialCells', + 'nParTypes', + 'nParShells', + 'nComp', + 'nBound', + ] for dim in dimensions: if dim in call_outputs and call_outputs[dim].value: shape.append(call_outputs[dim].value) diff --git a/tests/test_dll.py b/tests/test_dll.py index 36dd868..e06985d 100644 --- a/tests/test_dll.py +++ b/tests/test_dll.py @@ -362,13 +362,13 @@ def __repr__(self): 'last_state_y': (404,), 'last_state_ydot': (404,), 'soldot_bulk': (1501, 10, 4), - 'soldot_flux': (1501, 1, 10, 4), + 'soldot_flux': (1501, 10, 1, 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, 1, 10, 4), + 'solution_flux': (1501, 10, 1, 4), 'solution_inlet': (1501, 4), 'solution_outlet': (1501, 4), 'solution_particle': (1501, 10, 4, 4), @@ -402,7 +402,7 @@ def __repr__(self): 'last_state_y': (404,), 'last_state_ydot': (404,), 'soldot_bulk': (1501, 10, 4), - 'soldot_flux': (1501, 1, 10, 4), + 'soldot_flux': (1501, 10, 1, 4), 'soldot_inlet_port_000_comp_000': (1501,), 'soldot_inlet_port_000_comp_001': (1501,), 'soldot_inlet_port_000_comp_002': (1501,), @@ -414,7 +414,7 @@ def __repr__(self): 'soldot_particle': (1501, 10, 4, 4), 'soldot_solid': (1501, 10, 4, 4), 'solution_bulk': (1501, 10, 4), - 'solution_flux': (1501, 1, 10, 4), + 'solution_flux': (1501, 10, 1, 4), 'solution_inlet_port_000_comp_000': (1501,), 'solution_inlet_port_000_comp_001': (1501,), 'solution_inlet_port_000_comp_002': (1501,), @@ -466,13 +466,13 @@ def __repr__(self): 'last_state_y': (404,), 'last_state_ydot': (404,), 'soldot_bulk': (1501, 10, 4), - 'soldot_flux': (1501, 1, 10, 4), + 'soldot_flux': (1501, 10, 1, 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, 1, 10, 4), + 'solution_flux': (1501, 10, 1, 4), 'solution_inlet': (1501, 4), 'solution_outlet': (1501, 4), 'solution_particle': (1501, 10, 4, 4), @@ -488,13 +488,13 @@ def __repr__(self): }, 'sens_param_000_unit_000': { 'sensdot_bulk': (1501, 10, 4), - 'sensdot_flux': (1501, 1, 10, 4), + 'sensdot_flux': (1501, 10, 1, 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, 1, 10, 4), + 'sens_flux': (1501, 10, 1, 4), 'sens_inlet': (1501, 4), 'sens_outlet': (1501, 4), 'sens_particle': (1501, 10, 4, 4), @@ -527,7 +527,7 @@ def __repr__(self): 'last_state_y': (764,), 'last_state_ydot': (764,), 'soldot_bulk': (1501, 10, 4), - 'soldot_flux': (1501, 2, 10, 4), + 'soldot_flux': (1501, 10, 2, 4), 'soldot_inlet': (1501, 4), 'soldot_outlet': (1501, 4), 'soldot_particle_partype_000': (1501, 10, 4, 4), @@ -535,7 +535,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, 2, 10, 4), + 'solution_flux': (1501, 10, 2, 4), 'solution_inlet': (1501, 4), 'solution_outlet': (1501, 4), 'solution_particle_partype_000': (1501, 10, 4, 4), @@ -571,13 +571,13 @@ def __repr__(self): 'last_state_y': (1212,), 'last_state_ydot': (1212,), 'soldot_bulk': (1501, 10, 3, 4), - 'soldot_flux': (1501, 1, 10, 3, 4), + 'soldot_flux': (1501, 10, 3, 1, 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, 1, 10, 3, 4), + 'solution_flux': (1501, 10, 3, 1, 4), 'solution_inlet': (1501, 3, 4), 'solution_outlet': (1501, 3, 4), 'solution_particle': (1501, 10, 3, 4, 4), @@ -612,7 +612,7 @@ def __repr__(self): 'last_state_y': (1212,), 'last_state_ydot': (1212,), 'soldot_bulk': (1501, 10, 3, 4), - 'soldot_flux': (1501, 1, 10, 3, 4), + 'soldot_flux': (1501, 10, 3, 1, 4), 'soldot_inlet_port_000': (1501, 4), 'soldot_inlet_port_001': (1501, 4), 'soldot_inlet_port_002': (1501, 4), @@ -622,7 +622,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, 1, 10, 3, 4), + 'solution_flux': (1501, 10, 3, 1, 4), 'solution_inlet_port_000': (1501, 4), 'solution_inlet_port_001': (1501, 4), 'solution_inlet_port_002': (1501, 4), @@ -661,7 +661,7 @@ def __repr__(self): 'last_state_y': (1212,), 'last_state_ydot': (1212,), 'soldot_bulk': (1501, 10, 3, 4), - 'soldot_flux': (1501, 1, 10, 3, 4), + 'soldot_flux': (1501, 10, 3, 1, 4), 'soldot_inlet_port_000_comp_000': (1501,), 'soldot_inlet_port_000_comp_001': (1501,), 'soldot_inlet_port_000_comp_002': (1501,), @@ -689,7 +689,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, 1, 10, 3, 4), + 'solution_flux': (1501, 10, 3, 1, 4), 'solution_inlet_port_000_comp_000': (1501,), 'solution_inlet_port_000_comp_001': (1501,), 'solution_inlet_port_000_comp_002': (1501,),