Skip to content

Commit 704d63b

Browse files
committed
updates docs
1 parent 548c8e9 commit 704d63b

File tree

3 files changed

+59
-96
lines changed

3 files changed

+59
-96
lines changed

docs/tutorial/Phase_equilibrium.ipynb

Lines changed: 18 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,9 @@
486486
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
487487
"\u001b[1;31mInfeasibleRegion\u001b[0m Traceback (most recent call last)",
488488
"Cell \u001b[1;32mIn[16], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m vle(x\u001b[38;5;241m=\u001b[39mnp\u001b[38;5;241m.\u001b[39marray([\u001b[38;5;241m0.2\u001b[39m, \u001b[38;5;241m0.8\u001b[39m]), P\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m101325\u001b[39m)\n\u001b[0;32m 2\u001b[0m vle\n",
489-
"File \u001b[1;32m~\\code\\biosteam\\thermosteam\\thermosteam\\equilibrium\\vle.py:439\u001b[0m, in \u001b[0;36mVLE.__call__\u001b[1;34m(self, T, P, V, H, S, x, y, gas_conversion, liquid_conversion)\u001b[0m\n\u001b[0;32m 437\u001b[0m thermal_condition\u001b[38;5;241m.\u001b[39mP \u001b[38;5;241m=\u001b[39m P\n\u001b[0;32m 438\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m x_spec:\n\u001b[1;32m--> 439\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mset_Px(P, np\u001b[38;5;241m.\u001b[39masarray(x))\n\u001b[0;32m 440\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m: \u001b[38;5;66;03m# y_spec\u001b[39;00m\n\u001b[0;32m 441\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mset_Py(P, np\u001b[38;5;241m.\u001b[39masarray(y))\n",
490-
"File \u001b[1;32m~\\code\\biosteam\\thermosteam\\thermosteam\\equilibrium\\vle.py:653\u001b[0m, in \u001b[0;36mVLE.set_Px\u001b[1;34m(self, P, x)\u001b[0m\n\u001b[0;32m 651\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_N \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m2\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mnumber of species in equilibrium must be 2 to specify x\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m 652\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_thermal_condition\u001b[38;5;241m.\u001b[39mT, y \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_bubble_point\u001b[38;5;241m.\u001b[39msolve_Ty(x, P) \n\u001b[1;32m--> 653\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_lever_rule(x, y)\n",
491-
"File \u001b[1;32m~\\code\\biosteam\\thermosteam\\thermosteam\\equilibrium\\vle.py:635\u001b[0m, in \u001b[0;36mVLE._lever_rule\u001b[1;34m(self, x, y)\u001b[0m\n\u001b[0;32m 633\u001b[0m split_frac \u001b[38;5;241m=\u001b[39m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_z[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m-\u001b[39mx[\u001b[38;5;241m0\u001b[39m])\u001b[38;5;241m/\u001b[39m(y[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m-\u001b[39mx[\u001b[38;5;241m0\u001b[39m])\n\u001b[0;32m 634\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m0.00001\u001b[39m \u001b[38;5;241m<\u001b[39m split_frac \u001b[38;5;241m<\u001b[39m \u001b[38;5;241m1.00001\u001b[39m:\n\u001b[1;32m--> 635\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m InfeasibleRegion(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mphase composition\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m 636\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m split_frac \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[0;32m 637\u001b[0m split_frac \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1\u001b[39m\n",
489+
"File \u001b[1;32m~\\code\\biosteam\\thermosteam\\thermosteam\\equilibrium\\vle.py:450\u001b[0m, in \u001b[0;36mVLE.__call__\u001b[1;34m(self, T, P, V, H, S, Q, B, x, y, gas_conversion, liquid_conversion)\u001b[0m\n\u001b[0;32m 448\u001b[0m thermal_condition\u001b[38;5;241m.\u001b[39mP \u001b[38;5;241m=\u001b[39m P\n\u001b[0;32m 449\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m x_spec:\n\u001b[1;32m--> 450\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mset_Px(P, np\u001b[38;5;241m.\u001b[39masarray(x))\n\u001b[0;32m 451\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m: \u001b[38;5;66;03m# y_spec\u001b[39;00m\n\u001b[0;32m 452\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mset_Py(P, np\u001b[38;5;241m.\u001b[39masarray(y))\n",
490+
"File \u001b[1;32m~\\code\\biosteam\\thermosteam\\thermosteam\\equilibrium\\vle.py:664\u001b[0m, in \u001b[0;36mVLE.set_Px\u001b[1;34m(self, P, x)\u001b[0m\n\u001b[0;32m 662\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_N \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m2\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mnumber of species in equilibrium must be 2 to specify x\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m 663\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_thermal_condition\u001b[38;5;241m.\u001b[39mT, y \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_bubble_point\u001b[38;5;241m.\u001b[39msolve_Ty(x, P) \n\u001b[1;32m--> 664\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_lever_rule(x, y)\n",
491+
"File \u001b[1;32m~\\code\\biosteam\\thermosteam\\thermosteam\\equilibrium\\vle.py:646\u001b[0m, in \u001b[0;36mVLE._lever_rule\u001b[1;34m(self, x, y)\u001b[0m\n\u001b[0;32m 644\u001b[0m split_frac \u001b[38;5;241m=\u001b[39m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_z[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m-\u001b[39mx[\u001b[38;5;241m0\u001b[39m])\u001b[38;5;241m/\u001b[39m(y[\u001b[38;5;241m0\u001b[39m]\u001b[38;5;241m-\u001b[39mx[\u001b[38;5;241m0\u001b[39m])\n\u001b[0;32m 645\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m0.00001\u001b[39m \u001b[38;5;241m<\u001b[39m split_frac \u001b[38;5;241m<\u001b[39m \u001b[38;5;241m1.00001\u001b[39m:\n\u001b[1;32m--> 646\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m InfeasibleRegion(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mphase composition\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m 647\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m split_frac \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[0;32m 648\u001b[0m split_frac \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1\u001b[39m\n",
492492
"\u001b[1;31mInfeasibleRegion\u001b[0m: phase composition is infeasible"
493493
]
494494
}
@@ -514,27 +514,13 @@
514514
},
515515
{
516516
"cell_type": "code",
517-
"execution_count": 17,
517+
"execution_count": null,
518518
"metadata": {
519519
"tags": [
520520
"nbval-skip"
521521
]
522522
},
523-
"outputs": [
524-
{
525-
"data": {
526-
"text/plain": [
527-
"LLE(imol=MolarFlowIndexer(\n",
528-
" L=[('Water', 290.6), ('Octane', 0.02062), ('Butanol', 4.3)],\n",
529-
" l=[('Water', 13.35), ('Octane', 99.98), ('Butanol', 25.7)]),\n",
530-
" thermal_condition=ThermalCondition(T=360.00, P=101325))"
531-
]
532-
},
533-
"execution_count": 17,
534-
"metadata": {},
535-
"output_type": "execute_result"
536-
}
537-
],
523+
"outputs": [],
538524
"source": [
539525
"bst.settings.set_thermo(['Water', 'Octane', 'Butanol'])\n",
540526
"lle = bst.equilibrium.LLE()\n",
@@ -566,7 +552,7 @@
566552
},
567553
{
568554
"cell_type": "code",
569-
"execution_count": 18,
555+
"execution_count": 17,
570556
"metadata": {},
571557
"outputs": [
572558
{
@@ -577,7 +563,7 @@
577563
" thermal_condition=ThermalCondition(T=298.15, P=101325))"
578564
]
579565
},
580-
"execution_count": 18,
566+
"execution_count": 17,
581567
"metadata": {},
582568
"output_type": "execute_result"
583569
}
@@ -610,7 +596,7 @@
610596
},
611597
{
612598
"cell_type": "code",
613-
"execution_count": 19,
599+
"execution_count": 18,
614600
"metadata": {},
615601
"outputs": [
616602
{
@@ -623,7 +609,7 @@
623609
" thermal_condition=ThermalCondition(T=355.00, P=101325))"
624610
]
625611
},
626-
"execution_count": 19,
612+
"execution_count": 18,
627613
"metadata": {},
628614
"output_type": "execute_result"
629615
}
@@ -635,7 +621,7 @@
635621
},
636622
{
637623
"cell_type": "code",
638-
"execution_count": 20,
624+
"execution_count": 19,
639625
"metadata": {},
640626
"outputs": [
641627
{
@@ -648,7 +634,7 @@
648634
" thermal_condition=ThermalCondition(T=355.00, P=101325))"
649635
]
650636
},
651-
"execution_count": 20,
637+
"execution_count": 19,
652638
"metadata": {},
653639
"output_type": "execute_result"
654640
}
@@ -661,19 +647,20 @@
661647
},
662648
{
663649
"cell_type": "code",
664-
"execution_count": 24,
650+
"execution_count": 20,
665651
"metadata": {},
666652
"outputs": [
667653
{
668654
"data": {
669655
"text/plain": [
670-
"VLLE(imol=MolarFlowIndexer(phases=('L', 'g', 'l'),\n",
671-
" L=[('Water', 0.0277), ('Octane', 0.3545), ('Ethanol', 0.006609)],\n",
672-
" g=[('Water', 0.4723), ('Octane', 0.1455), ('Ethanol', 0.09339)]),\n",
673-
" thermal_condition=ThermalCondition(T=352.48, P=101325))"
656+
"VLLE(imol=MolarFlowIndexer(\n",
657+
" L=[('Water', 0.1662), ('Octane', 1.281e-05), ('Ethanol', 0.004298)],\n",
658+
" g=[('Water', 0.3142), ('Octane', 0.1462), ('Ethanol', 0.08958)],\n",
659+
" l=[('Water', 0.01961), ('Octane', 0.3538), ('Ethanol', 0.006125)]),\n",
660+
" thermal_condition=ThermalCondition(T=358.76, P=101325))"
674661
]
675662
},
676-
"execution_count": 24,
663+
"execution_count": 20,
677664
"metadata": {},
678665
"output_type": "execute_result"
679666
}
@@ -682,30 +669,6 @@
682669
"vlle(V=0.5, P=101325)\n",
683670
"vlle"
684671
]
685-
},
686-
{
687-
"cell_type": "code",
688-
"execution_count": 26,
689-
"metadata": {},
690-
"outputs": [
691-
{
692-
"data": {
693-
"text/plain": [
694-
"VLLE(imol=MolarFlowIndexer(phases=('L', 'g', 'l'),\n",
695-
" L=[('Water', 0.02769), ('Octane', 0.3545), ('Ethanol', 0.006608)],\n",
696-
" g=[('Water', 0.4723), ('Octane', 0.1455), ('Ethanol', 0.09339)]),\n",
697-
" thermal_condition=ThermalCondition(T=352.48, P=101323))"
698-
]
699-
},
700-
"execution_count": 26,
701-
"metadata": {},
702-
"output_type": "execute_result"
703-
}
704-
],
705-
"source": [
706-
"vlle(V=0.5, T=352.48)\n",
707-
"vlle"
708-
]
709672
}
710673
],
711674
"metadata": {

docs/tutorial/Property_packages.ipynb

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
{
4646
"cell_type": "code",
47-
"execution_count": 3,
47+
"execution_count": 1,
4848
"metadata": {
4949
"tags": [
5050
"nbval-ignore-output"
@@ -167,7 +167,7 @@
167167
},
168168
{
169169
"cell_type": "code",
170-
"execution_count": 5,
170+
"execution_count": 2,
171171
"metadata": {},
172172
"outputs": [
173173
{
@@ -196,7 +196,7 @@
196196
},
197197
{
198198
"cell_type": "code",
199-
"execution_count": 6,
199+
"execution_count": 3,
200200
"metadata": {},
201201
"outputs": [
202202
{
@@ -205,7 +205,7 @@
205205
"695"
206206
]
207207
},
208-
"execution_count": 6,
208+
"execution_count": 3,
209209
"metadata": {},
210210
"output_type": "execute_result"
211211
}
@@ -219,7 +219,7 @@
219219
},
220220
{
221221
"cell_type": "code",
222-
"execution_count": 7,
222+
"execution_count": 4,
223223
"metadata": {},
224224
"outputs": [
225225
{
@@ -228,7 +228,7 @@
228228
"94"
229229
]
230230
},
231-
"execution_count": 7,
231+
"execution_count": 4,
232232
"metadata": {},
233233
"output_type": "execute_result"
234234
}
@@ -248,7 +248,7 @@
248248
},
249249
{
250250
"cell_type": "code",
251-
"execution_count": 8,
251+
"execution_count": 5,
252252
"metadata": {},
253253
"outputs": [
254254
{
@@ -257,7 +257,7 @@
257257
"172627"
258258
]
259259
},
260-
"execution_count": 8,
260+
"execution_count": 5,
261261
"metadata": {},
262262
"output_type": "execute_result"
263263
}
@@ -279,7 +279,7 @@
279279
},
280280
{
281281
"cell_type": "code",
282-
"execution_count": 9,
282+
"execution_count": 6,
283283
"metadata": {},
284284
"outputs": [
285285
{
@@ -288,7 +288,7 @@
288288
"-4565"
289289
]
290290
},
291-
"execution_count": 9,
291+
"execution_count": 6,
292292
"metadata": {},
293293
"output_type": "execute_result"
294294
}
@@ -303,16 +303,16 @@
303303
},
304304
{
305305
"cell_type": "code",
306-
"execution_count": 10,
306+
"execution_count": 7,
307307
"metadata": {},
308308
"outputs": [
309309
{
310310
"data": {
311311
"text/plain": [
312-
"40"
312+
"35"
313313
]
314314
},
315-
"execution_count": 10,
315+
"execution_count": 7,
316316
"metadata": {},
317317
"output_type": "execute_result"
318318
}
@@ -330,7 +330,7 @@
330330
},
331331
{
332332
"cell_type": "code",
333-
"execution_count": 11,
333+
"execution_count": 8,
334334
"metadata": {},
335335
"outputs": [
336336
{
@@ -357,7 +357,7 @@
357357
" thermosteam.mixture.SRKTranslatedMixture]"
358358
]
359359
},
360-
"execution_count": 11,
360+
"execution_count": 8,
361361
"metadata": {},
362362
"output_type": "execute_result"
363363
}
@@ -389,7 +389,7 @@
389389
},
390390
{
391391
"cell_type": "code",
392-
"execution_count": 12,
392+
"execution_count": 9,
393393
"metadata": {},
394394
"outputs": [
395395
{
@@ -428,7 +428,7 @@
428428
},
429429
{
430430
"cell_type": "code",
431-
"execution_count": 13,
431+
"execution_count": 10,
432432
"metadata": {},
433433
"outputs": [
434434
{
@@ -467,7 +467,7 @@
467467
},
468468
{
469469
"cell_type": "code",
470-
"execution_count": 14,
470+
"execution_count": 11,
471471
"metadata": {},
472472
"outputs": [
473473
{
@@ -496,7 +496,7 @@
496496
" thermosteam.equilibrium.activity_coefficients.SRKMIXTranslaActivityCoefficients]"
497497
]
498498
},
499-
"execution_count": 14,
499+
"execution_count": 11,
500500
"metadata": {},
501501
"output_type": "execute_result"
502502
}
@@ -507,7 +507,7 @@
507507
},
508508
{
509509
"cell_type": "code",
510-
"execution_count": 15,
510+
"execution_count": 12,
511511
"metadata": {},
512512
"outputs": [
513513
{
@@ -533,7 +533,7 @@
533533
" thermosteam.equilibrium.fugacity_coefficients.SRKTranslatedFugacityCoefficients]"
534534
]
535535
},
536-
"execution_count": 15,
536+
"execution_count": 12,
537537
"metadata": {},
538538
"output_type": "execute_result"
539539
}
@@ -544,7 +544,7 @@
544544
},
545545
{
546546
"cell_type": "code",
547-
"execution_count": 16,
547+
"execution_count": 13,
548548
"metadata": {},
549549
"outputs": [
550550
{
@@ -554,7 +554,7 @@
554554
" thermosteam.equilibrium.poyinting_correction_factors.IdealGasPoyintingCorrectionFactors]"
555555
]
556556
},
557-
"execution_count": 16,
557+
"execution_count": 13,
558558
"metadata": {},
559559
"output_type": "execute_result"
560560
}
@@ -579,7 +579,7 @@
579579
},
580580
{
581581
"cell_type": "code",
582-
"execution_count": 17,
582+
"execution_count": 14,
583583
"metadata": {},
584584
"outputs": [
585585
{
@@ -588,7 +588,7 @@
588588
"DewPointValues(T=470.72, P=10000000, IDs=('Butanol', 'CO2'), z=[0.091 0.909], x=[0.997 0.003])"
589589
]
590590
},
591-
"execution_count": 17,
591+
"execution_count": 14,
592592
"metadata": {},
593593
"output_type": "execute_result"
594594
}
@@ -603,7 +603,7 @@
603603
},
604604
{
605605
"cell_type": "code",
606-
"execution_count": 18,
606+
"execution_count": 15,
607607
"metadata": {},
608608
"outputs": [
609609
{
@@ -612,7 +612,7 @@
612612
"DewPointValues(T=458.21, P=10000000, IDs=('Butanol', 'CO2'), z=[0.091 0.909], x=[0.995 0.005])"
613613
]
614614
},
615-
"execution_count": 18,
615+
"execution_count": 15,
616616
"metadata": {},
617617
"output_type": "execute_result"
618618
}
@@ -633,7 +633,7 @@
633633
},
634634
{
635635
"cell_type": "code",
636-
"execution_count": 19,
636+
"execution_count": 16,
637637
"metadata": {},
638638
"outputs": [
639639
{

0 commit comments

Comments
 (0)