Skip to content

Commit

Permalink
update with newer biosteam
Browse files Browse the repository at this point in the history
  • Loading branch information
yalinli2 committed Jul 12, 2024
1 parent 89a4efb commit ceacacd
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 18 deletions.
5 changes: 5 additions & 0 deletions qsdsan/_sanunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ def __init__(self, ID='', ins=None, outs=(), thermo=None, init_with='WasteStream
#: value.
self.parallel: dict[str, int] = {}

#: Unit design decisions that must be solved to satisfy specifications.
#: While adding responses is optional, simulations benefit from responses
#: by being able to predict better guesses.
self.responses: set[bst.GenericResponse] = set()

if not kwargs.get('skip_property_package_check'):
self._assert_compatible_property_package()

Expand Down
68 changes: 50 additions & 18 deletions qsdsan/sanunits/_heat_exchanging.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,21 @@ class HXprocess(SanUnit, HXP):
_N_ins = HXP._N_ins
_N_outs = HXP._N_outs

def __init__(self, ID='', ins=None, outs=(), thermo=None,
init_with='Stream', F_BM_default=None,
*, U=None, dT=5., T_lim0=None, T_lim1=None,
material="Carbon steel/carbon steel",
heat_exchanger_type="Floating head",
N_shells=2, ft=None,
phase0=None,
phase1=None,
H_lim0=None,
H_lim1=None):
def __init__(
self, ID='', ins=None, outs=(), thermo=None,
init_with='Stream', F_BM_default=None, *,
U=None, dT=5., T_lim0=None, T_lim1=None,
material="Carbon steel/carbon steel",
heat_exchanger_type="Floating head",
N_shells=2, ft=None,
phase0=None,
phase1=None,
H_lim0=None,
H_lim1=None,
inner_fluid_pressure_drop=None,
outer_fluid_pressure_drop=None,
neglect_pressure_drop=True,
):
SanUnit.__init__(self, ID, ins, outs, thermo,
init_with=init_with, F_BM_default=F_BM_default)

Expand Down Expand Up @@ -155,6 +160,15 @@ def __init__(self, ID='', ins=None, outs=(), thermo=None,
self.material = material
self.heat_exchanger_type = heat_exchanger_type
self.reset_streams_at_setup = False

#: Optional[float] Pressure drop along the inner fluid.
self.inner_fluid_pressure_drop = inner_fluid_pressure_drop

#: Optional[float] Pressure drop along the outer fluid.
self.outer_fluid_pressure_drop = outer_fluid_pressure_drop

#: [bool] Whether to assume a negligible pressure drop.
self.neglect_pressure_drop = neglect_pressure_drop


class HXutility(SanUnit, HXU):
Expand All @@ -176,6 +190,7 @@ class HXutility(SanUnit, HXU):

line = HXU.line
_graphics = HXU._graphics

_units = {'Area': 'ft^2',
'Total tube length': 'ft',
'Inner pipe weight': 'kg',
Expand All @@ -190,14 +205,22 @@ class HXutility(SanUnit, HXU):
'Horizontal vessel diameter': (3, 21),
'Vertical vessel length': (12, 40)}

def __init__(self, ID='', ins=None, outs=(), thermo=None,
init_with='Stream', F_BM_default=None,
include_construction=True,
*, T=None, V=None, rigorous=False, U=None, H=None,
heat_exchanger_type="Floating head",
material="Carbon steel/carbon steel",
N_shells=2, ft=None, heat_only=None, cool_only=None,
heat_transfer_efficiency=None):
def __init__(
self, ID='', ins=None, outs=(), thermo=None,
init_with='Stream', F_BM_default=None,
include_construction=True,
T=None, V=None, rigorous=False, U=None, H=None,
heat_exchanger_type="Floating head",
material="Carbon steel/carbon steel",
N_shells=2,
ft=None,
heat_only=None,
cool_only=None,
heat_transfer_efficiency=None,
inner_fluid_pressure_drop=None,
outer_fluid_pressure_drop=None,
neglect_pressure_drop=True,
):
SanUnit.__init__(self, ID, ins, outs, thermo,
init_with=init_with, F_BM_default=F_BM_default,
include_construction=include_construction,)
Expand Down Expand Up @@ -226,6 +249,15 @@ def __init__(self, ID='', ins=None, outs=(), thermo=None,
self.material = material
self.heat_exchanger_type = heat_exchanger_type

#: Optional[float] Pressure drop along the inner fluid.
self.inner_fluid_pressure_drop = inner_fluid_pressure_drop

#: Optional[float] Pressure drop along the outer fluid.
self.outer_fluid_pressure_drop = outer_fluid_pressure_drop

#: [bool] Whether to assume a negligible pressure drop.
self.neglect_pressure_drop = neglect_pressure_drop

#: [bool] User enforced heat transfer efficiency. A value less than 1
#: means that a fraction of heat transferred is lost to the environment.
#: If value is None, it defaults to the heat transfer efficiency of the
Expand Down

0 comments on commit ceacacd

Please sign in to comment.