Skip to content

Commit 6edb955

Browse files
committed
small fixes
1 parent 65af678 commit 6edb955

File tree

4 files changed

+44
-81
lines changed

4 files changed

+44
-81
lines changed

.idea/workspace.xml

Lines changed: 37 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sindri/Controllers/AddUNIFACsubgroupController.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def ok_clicked(self):
3131
db.cursor.execute(query, (self.substance_id, self.subgroup_id, self.frequency))
3232
# db.db.commit()
3333
self.edit_db.loadUNIFACsubgroups()
34+
self.edit_db.changes_made = True
3435
self.addSubgroupView.close()
3536

3637
def cancel_clicked(self):

Sindri/EOSMixture.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ def getDewPointTemperature(self, y, P: float, tol=1e3 * DBL_EPSILON, kmax=100):
701701
raise NotImplementedError("gamma-phi not implemented")
702702

703703
def getDewPointTemperature_UNIFAC(
704-
self, y, P: float, tol: float = 1e3 * DBL_EPSILON, kmax: int = 1000
704+
self, y, P: float, tol: float = 1e4 * DBL_EPSILON, kmax: int = 1000
705705
):
706706
assert len(y) == self.n
707707
y = np.atleast_1d(y)
@@ -714,6 +714,7 @@ def getDewPointTemperature_UNIFAC(
714714
psat = self.getPsat(td)
715715
x = self.get_x_eq_12_10(y, gamma, psat, capphi, P)
716716
k = self.get_k_gamma_phi(gamma, psat, P, capphi)
717+
x = x / np.sum(x)
717718

718719
td2 = td
719720
f2 = np.sum(y / k) - 1.0
@@ -726,6 +727,7 @@ def getDewPointTemperature_UNIFAC(
726727
f1 = np.sum(y / k) - 1.0
727728

728729
x = self.get_x_eq_12_10(y, gamma, psat, capphi, P)
730+
x = x / np.sum(x)
729731

730732
err = 100
731733
ite = 0
@@ -749,10 +751,10 @@ def getDewPointTemperature_UNIFAC(
749751
f1 = np.sum(y / k) - 1.0
750752

751753
phivap = self.getPhiVap(y, P, td)
752-
return y, td, phivap, gamma, k, ite
754+
return x, td, phivap, gamma, k, ite
753755

754756
def getDewPointTemperature_phi_phi(
755-
self, y, P: float, tol: float = 1e3 * DBL_EPSILON, kmax: int = 1000
757+
self, y, P: float, tol: float = 1e4 * DBL_EPSILON, kmax: int = 1000
756758
):
757759
assert len(y) == self.n
758760
y = np.atleast_1d(y)

Sindri/db_editSubstanceProperties.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ def deleteUNIFACsubgroup(self):
453453
current_row = self.tableWidget_UNIFACsubgroups.currentRow()
454454
if current_row < 0:
455455
return
456-
self.changes_made = True
457456
try:
458457
subgroup_id = self.getCurrenteUNIFAC_subgroup_id()
459458
query = """delete from substance_unifac_subgroups
@@ -462,12 +461,12 @@ def deleteUNIFACsubgroup(self):
462461
)
463462
db.cursor.execute(query)
464463
# db.db.commit() # todo implement rollback?
464+
self.changes_made = True
465465
self.loadUNIFACsubgroups()
466466
except Exception as e:
467467
pass
468468

469469
def addUNIFACsubgroup(self):
470-
self.changes_made = True
471470
controller = AddUNIFACsubgroupController(self)
472471
try:
473472
controller.createView()

0 commit comments

Comments
 (0)