@@ -81,16 +81,18 @@ class CPSComponent(Component):
81
81
82
82
"""
83
83
84
- def __init__ (self ,
85
- name = None ,
86
- species = None ,
87
- charge = None ,
88
- molecular_weight = None ,
89
- density = None ,
90
- molecular_volume = None ,
91
- viscosity = None ,
92
- pure_density = None ,
93
- specific_cake_resistance = None ):
84
+ def __init__ (
85
+ self ,
86
+ name = None ,
87
+ species = None ,
88
+ charge = None ,
89
+ molecular_weight = None ,
90
+ density = None ,
91
+ molecular_volume = None ,
92
+ viscosity = None ,
93
+ pure_density = None ,
94
+ specific_cake_resistance = None ,
95
+ ):
94
96
"""Construct CPSComponent."""
95
97
self .name = name
96
98
self ._species = []
@@ -104,7 +106,7 @@ def __init__(self,
104
106
molecular_volume ,
105
107
viscosity ,
106
108
pure_density ,
107
- specific_cake_resistance
109
+ specific_cake_resistance ,
108
110
)
109
111
elif isinstance (species , str ):
110
112
self .add_species (
@@ -115,7 +117,7 @@ def __init__(self,
115
117
molecular_volume ,
116
118
viscosity ,
117
119
pure_density ,
118
- specific_cake_resistance
120
+ specific_cake_resistance ,
119
121
)
120
122
elif isinstance (species , list ):
121
123
if charge is None :
@@ -141,7 +143,7 @@ def __init__(self,
141
143
molecular_volume [i ],
142
144
viscosity [i ],
143
145
pure_density [i ],
144
- specific_cake_resistance [i ]
146
+ specific_cake_resistance [i ],
145
147
)
146
148
else :
147
149
raise CADETPythonSimError ("Could not determine number of species" )
@@ -182,6 +184,7 @@ def specific_cake_resistance(self):
182
184
"""List of float or None: specific cake resistance of the subspecies."""
183
185
return [spec .specific_cake_resistance for spec in self .species ]
184
186
187
+
185
188
class CPSComponentSystem (ComponentSystem ):
186
189
"""
187
190
Component System Class.
@@ -228,16 +231,16 @@ class CPSComponentSystem(ComponentSystem):
228
231
"""
229
232
230
233
def __init__ (
231
- self ,
232
- components = None ,
233
- name = None ,
234
- charges = None ,
235
- molecular_weights = None ,
236
- densities = None ,
237
- molecular_volume = None ,
238
- viscosities = None ,
239
- specific_cake_resistances = None
240
- ):
234
+ self ,
235
+ components = None ,
236
+ name = None ,
237
+ charges = None ,
238
+ molecular_weights = None ,
239
+ densities = None ,
240
+ molecular_volume = None ,
241
+ viscosities = None ,
242
+ specific_cake_resistances = None ,
243
+ ):
241
244
"""
242
245
Initialize the ComponentSystem object.
243
246
@@ -295,7 +298,6 @@ def __init__(
295
298
if specific_cake_resistances is None :
296
299
specific_cake_resistances = n_comp * [None ]
297
300
298
-
299
301
for i , comp in enumerate (components ):
300
302
self .add_component (
301
303
comp ,
@@ -304,7 +306,7 @@ def __init__(
304
306
density = densities [i ],
305
307
molecular_volume = molecular_volume [i ],
306
308
viscosity = viscosities [i ],
307
- specific_cake_resistance = specific_cake_resistances [i ]
309
+ specific_cake_resistance = specific_cake_resistances [i ],
308
310
)
309
311
310
312
@wraps (CPSComponent .__init__ )
@@ -327,8 +329,7 @@ def add_component(self, component, *args, **kwargs):
327
329
328
330
if component .name in self .names :
329
331
raise CADETPythonSimError (
330
- f"Component '{ component .name } ' "
331
- "already exists in ComponentSystem."
332
+ f"Component '{ component .name } ' already exists in ComponentSystem."
332
333
)
333
334
334
335
self ._components .append (component )
@@ -356,7 +357,7 @@ def viscosities(self):
356
357
"""list: List of species viscosity."""
357
358
viscosities = []
358
359
for comp in self .components :
359
- viscosities += comp .viscosity
360
+ viscosities += comp .viscosity
360
361
361
362
return viscosities
362
363
0 commit comments