Skip to content

Commit

Permalink
Clean-ups to multiphase class to match mixture
Browse files Browse the repository at this point in the history
  • Loading branch information
jgostick committed May 6, 2019
1 parent 654a839 commit a7580d7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions openpnm/phases/Multiphase.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def __init__(self, phases=[], settings={}, **kwargs):
})
self.settings.update(settings)

logger.warning('Multiphases are a beta feature and functionality ' +
'may change in future versions')

self['pore.occupancy.all'] = np.zeros(self.Np, dtype=float)
self['throat.occupancy.all'] = np.zeros(self.Nt, dtype=float)

Expand Down Expand Up @@ -86,7 +89,8 @@ def _update_occupancy(self):
self['throat.occupancy.all'] = np.sum(dict_, axis=0)

def _get_phases(self):
phases = [self.project[item] for item in self.settings['phases']]
phases = {self.project[item].name: self.project[item]
for item in self.settings['phases']}
return phases

phases = property(fget=_get_phases)
Expand Down Expand Up @@ -119,7 +123,7 @@ def interleave_data(self, prop):
element + 's')
vals = np.zeros([self._count(element=element)], dtype=float)
try:
for phase in self.phases:
for phase in self.phases.values():
vals += phase[prop]*self[element + '.occupancy.' + phase.name]
except KeyError:
vals = super().interleave_data(prop)
Expand Down

0 comments on commit a7580d7

Please sign in to comment.