Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to merge changes from dev to pass EXPOsan tests #108

Merged
merged 9 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/tutorials/11_Dynamic_Simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"This tutorial was made with qsdsan v1.2.2 and exposan v1.2.3\n"
"This tutorial was made with qsdsan v1.2.5 and exposan v1.2.5\n"
]
}
],
Expand Down
401 changes: 401 additions & 0 deletions docs/source/tutorials/Tutorial_11.ipynb

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions qsdsan/equipments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,16 @@
from ._aeration import *
from ._column import *
from ._electrode import *
from ._encapsulation import *
from ._machine import*
from ._membrane import *
from ._vacuum_pump import *
from ._vertical_mixer import *

from . import (
_aeration,
_column,
_electrode,
_encapsulation,
_machine,
_membrane,
_vacuum_pump,
_vertical_mixer,
)

Expand All @@ -38,9 +34,7 @@
*_aeration.__all__,
*_column.__all__,
*_electrode.__all__,
*_encapsulation.__all__,
*_machine.__all__,
*_membrane.__all__,
*_vacuum_pump.__all__,
*_vertical_mixer.__all__,
)
44 changes: 0 additions & 44 deletions qsdsan/equipments/_encapsulation.py

This file was deleted.

50 changes: 2 additions & 48 deletions qsdsan/equipments/_membrane.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .. import Equipment
# from .utils import auom

__all__ = ('Membrane', 'HollowFiberMembrane')
__all__ = ('Membrane', )


class Membrane(Equipment):
Expand Down Expand Up @@ -80,50 +80,4 @@ def N(self):
return self._N
@N.setter
def N(self, i):
self._N = int(i)


class HollowFiberMembrane(Equipment):

_PermSelect_pricing = {
# model: (area [cm^2], price [USD], min Q_gas [scfm], max Q_gas [scfm])
'PDMSXA-10': (10, 117, 4e-5, 4e-3),
'PDMSXA-1000': (1000, 304, 4e-3, 0.4),
'PDMSXA-7500': (7500, 541, 2e-2, 1.0),
'PDMSXA-2.1': (2.1e4, 1045, 4e-2, 2.0)
}

scfm_to_kmolphr = 0.002641 * 453.59237 * 60 / 1000

def __init__(self, ID='', linked_unit=None,
units=dict(), F_BM=1.15, lifetime=5, lifetime_unit='yr',
material='polydimethylsiloxane'):
Equipment.__init__(self=self, ID=ID, linked_unit=linked_unit, units=units,
F_BM=F_BM, lifetime=lifetime, lifetime_unit=lifetime_unit)
self.material = material

def _design(self):
for ws in self.linked_unit.outs:
if ws.phase == 'g':
Q_mol = ws.F_mol # kmol/hr
break
key = None
N = 0
while not key:
N += 1
Q = Q_mol / N
for md, data in self._PermSelect_pricing.items():
Q_max = data[-1] * self.scfm_to_kmolphr
if Q < Q_max:
key = md
return {'Material': self.material,
'Number of membrane units': N,
'Membrane unit model':key}

def _cost(self):
design = self._design()
N = design['Number of membrane units']
key = design['Membrane unit model']
p = self._PermSelect_pricing[key][1]
return N * p

self._N = int(i)
65 changes: 0 additions & 65 deletions qsdsan/equipments/_vacuum_pump.py

This file was deleted.

4 changes: 2 additions & 2 deletions qsdsan/processes/_adm1.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def rhos_adm1(state_arr, params):
# =============================================================================
class TempState:
def __init__(self):
self.data = []
self.data = {}

# def append(self, value):
# self.data += [value]
Expand Down Expand Up @@ -531,6 +531,7 @@ class ADM1(CompiledProcesses):
('HAc', 'Ac-'), ('HPr', 'Pr-'),
('HBu', 'Bu-'), ('HVa', 'Va-'))
_biogas_IDs = ('S_h2', 'S_ch4', 'S_IC')
_biomass_IDs = ('X_su', 'X_aa', 'X_fa', 'X_c4', 'X_pro', 'X_ac', 'X_h2')

def __new__(cls, components=None, path=None, N_xc=2.686e-3, N_I=4.286e-3, N_aa=7e-3,
f_ch_xc=0.2, f_pr_xc=0.2, f_li_xc=0.3, f_xI_xc=0.2,
Expand Down Expand Up @@ -591,7 +592,6 @@ def __new__(cls, components=None, path=None, N_xc=2.686e-3, N_I=4.286e-3, N_aa=7
Ka_base = np.array([10**(-pKa) for pKa in pKa_base])
Ka_dH = np.array(Ka_dH)
root = TempState()
# root.data = 10**(-7.4655)
dct = self.__dict__
dct.update(kwargs)

Expand Down
3 changes: 0 additions & 3 deletions qsdsan/sanunits/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
from ._crop_application import *
from ._dynamic_influent import *
from ._electrochemical_cell import *
from ._encapsulation_bioreactor import *
from ._excretion import *
from ._heat_exchanging import *
from ._junction import *
Expand Down Expand Up @@ -89,7 +88,6 @@
_distillation,
_dynamic_influent,
_electrochemical_cell,
_encapsulation_bioreactor,
_excretion,
_flash,
_heat_exchanging,
Expand Down Expand Up @@ -133,7 +131,6 @@
*_distillation.__all__,
*_dynamic_influent.__all__,
*_electrochemical_cell.__all__,
*_encapsulation_bioreactor.__all__,
*_excretion.__all__,
*_flash.__all__,
*_heat_exchanging.__all__,
Expand Down
Loading