Skip to content

Commit

Permalink
Merge pull request #52 from SECQUOIA/fix-typo
Browse files Browse the repository at this point in the history
Update HDA GDP model
  • Loading branch information
bernalde authored Aug 19, 2024
2 parents d00d572 + 29c0ee5 commit ea65894
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions gdplib/hda/HDA_GDP_gdpopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def HDA_model():
compressor coefficient
compeff : float
compressor efficiency
gam : float
cp_cv_ratio : float
ratio of cp to cv
abseff : float
absorber tray efficiency
Expand Down Expand Up @@ -150,7 +150,7 @@ def HDA_model():

m.alpha = Param(initialize=0.3665, doc="compressor coefficient")
m.compeff = Param(initialize=0.750, doc="compressor efficiency")
m.gam = Param(initialize=1.300, doc="ratio of cp to cv")
m.cp_cv_ratio = Param(initialize=1.300, doc="ratio of cp to cv")
m.abseff = Param(initialize=0.333, doc="absorber tray efficiency")
m.disteff = Param(initialize=0.5000, doc="column tray efficiency")
m.uflow = Param(initialize=50, doc="upper bound - flow logicals")
Expand Down Expand Up @@ -1535,7 +1535,7 @@ def Compelec(_m, comp_):
* m.f[stream]
/ 60.0
* (1.0 / m.compeff)
* (m.gam / (m.gam - 1.0))
* (m.cp_cv_ratio / (m.cp_cv_ratio - 1.0))
for (comp1, stream) in m.icomp
if comp_ == comp1
)
Expand All @@ -1547,9 +1547,13 @@ def Compelec(_m, comp_):

def Ratio(_m, comp_):
if comp == comp_:
return m.presrat[comp_] ** (m.gam / (m.gam - 1.0)) == sum(
return m.presrat[comp_] ** (
m.cp_cv_ratio / (m.cp_cv_ratio - 1.0)
) == sum(
m.p[stream] for (comp1, stream) in m.ocomp if comp_ == comp1
) / sum(m.p[stream] for (comp1, stream) in m.icomp if comp1 == comp_)
) / sum(
m.p[stream] for (comp1, stream) in m.icomp if comp1 == comp_
)
return Constraint.Skip

b.ratio = Constraint(
Expand Down Expand Up @@ -2642,11 +2646,11 @@ def Valcmb(_m, valve, compon):

def Valt(_m, valve):
return sum(
m.t[stream] / (m.p[stream] ** ((m.gam - 1.0) / m.gam))
m.t[stream] / (m.p[stream] ** ((m.cp_cv_ratio - 1.0) / m.cp_cv_ratio))
for (valv, stream) in m.oval
if valv == valve
) == sum(
m.t[stream] / (m.p[stream] ** ((m.gam - 1.0) / m.gam))
m.t[stream] / (m.p[stream] ** ((m.cp_cv_ratio - 1.0) / m.cp_cv_ratio))
for (valv, stream) in m.ival
if valv == valve
)
Expand Down

0 comments on commit ea65894

Please sign in to comment.