-
Notifications
You must be signed in to change notification settings - Fork 0
/
BFB_spatially_drom.acmf
18272 lines (17791 loc) · 786 KB
/
BFB_spatially_drom.acmf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Version "30.0-0";
Libraries "Modeler.acml", "SystemLibrary.acml";
Parameter SOType Uses StringParameter
Valid as StringSet (["Overflow","Underflow"]);
Value: "Overflow";
End
Parameter SIType Uses StringParameter
Valid as StringSet (["Top","Bottom"]);
Value: "Top";
End
Parameter IPselector Uses StringParameter
Valid as StringSet (["Rigorous","Initial"]);
Value: "Rigorous";
End
Variable loading /* mol/kg solid */
Lower: 1E-3;
Upper: 1E3;
Value: 1.0;
PhysicalQuantity : "mol/kg solid";
// Scale : <scaling value>;
End
Variable conc_mole_solid /* mol/m3 */
Lower: 0;
Upper: 1E6;
Value: 1E2;
PhysicalQuantity : "mol/m3";
End
GlobalTimeScaler AS TimeScalerParameter;
Port SorbPort
F as pos_small;
Fm as flow_mass;
z(componentlist) as molefraction;
T as temperature;
P as Pressure;
End
Port SorbentPort
ionlist as stringset (["H2O", "Bic", "Car"]);
Fm as flow_mass (description:"Mass Flowrate (kg/hr)");
w(ionlist) as loading (description:"Loading (mol/kg)");
T as temperature;
P as pressure;
End
Port Main2Port
F as output flow_mol (Description:"Molar flow rate");
z(componentlist) as output molefraction (Description:"Mole fractions", 1.0/size(componentlist));
T as temperature (Description:"Temperature");
P as pressure (Description:"Pressure");
h as enth_mol (Description:"Molar enthalpy");
End
Model BFB
/*
CCSI Kunii-Levenspiel Model for a Bubbling Fluidized Bed, v0.10.c2 ACM Version (v5.2.2 for NETL internal use)
With respect to version v0.9.c1 the model syntax was updated to reflect the following changes:
- Further revision of energy balances based on paper by Walton and LeVan. A specific enthalpy is now calculated for all solid flows which includes the adsorbed species and heat of reaction.
- Modified solids circulation calculations to better reflect Kunii and Levenspiel’s analysis.
- Added correlation for emulsion phase gas velocity for Group B particles.
- Added calculation of hydraulic diameter to model to account for effects of internal heat exchangers on hydrodynamics, and integrated this with existing correlations.
- Added bubble velocity calculation for slug flow conditions arising due bubbles being limited by hydraulic diameter.
- Modified solid boundary conditions to allow for top and bottom solid inlets.
- Added terms to account for pressure drop and heat transfer resistance in heat exchanger tubes.
- Replaced total gas balance with sum of mole fractions relationship for the bubble phase to address singularity issue in dynamic simulations.
Main model developer: Andrew Lee, March 2012
For a detailed description of the model please refer to:
A. Lee and D.C. Miller, A One-Dimensional (1-D) Three-Region Model for a Bubbling Fluidized-Bed Adsorber, I&ECR, 2013 52(1), 469-484.
Modified by: Mingzhao Yu.
- Organized syntax
- Simplified the model by fixing some gas properties (e.g. gas heat capacity)
- Replaced the Aspen property function with simple regression models
- Introduced new variables to represent the spatial derivative term
- Applied orthogonal collocation on finite elements to discretize the partial derivative terms instead of finite difference (10 finite elements with 3 collocation points in each element)
Last Modification date: September 2014
This Material was produced under the DOE Carbon Capture Simulation Initiative (CCSI), and copyright is held by the software owners: ORISE, LANS,
LLNS, LBL, PNNL, CMU, WVU, et al. The software owners and/or the U.S. Government retain ownership of all rights in the CCSI software and the
copyright and patents subsisting therein. Any distribution or dissemination is governed under the terms and conditions of the CCSI Test and
Evaluation License, CCSI Master Non-Disclosiure Agreement, and the CCSI Intellectual Property Management Plan. No rights are granted except as
expressly recited in one of the aforementioned agreements.
*/
// =======================================================================================================================================================================================================
// Declare Parameters
pi as RealParameter (description:"Circumference to Diameter ratio for a circle", value:2*acos(0));
R as RealParameter (description:"Universal Gas Constant, J/(mol.K)", value:8.314472);
gc as RealParameter (description:"Gravitational Acceleration Constant (m/s^2)", value:9.81);
ND as IntegerParameter (description:"Number of Discretization Points", value:100);
SIType as SIType (description:"Solids Inlet Type (Top or Bottom)");
SOType as SOType (description:"Solids Outlet Type (Overflow or Underflow)");
// Declare Initialization Procedure Selectors
IPselectA as IPselector (description:"Reaction kinetics IP Selector");
IPselectB as IPselector (description:"Hydrodynamics Model IP Selector");
IPselectC as IPselector (description:"Cloud wake Solids Material Balance IP Selector");
IPselectD as IPselector (description:"Emulsion Region Energy Balance IP Selector");
IPselectE as IPselector (description:"Cloud-Wake Region Energy Balance IP Selector");
IPselectF as IPselector (description:"Bubble Region Energy Balance IP Selector");
IPselectZ as IPselector (description:"Emulsion solid mass balance IP Selector");
IPselectG as IPselector (description:"Gas mass balance IP Selector");
// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Declare Distribution Domain
l as Domain (Length : ND-1, SpacingPreference : 1, NumSections : 1, DiscretizationMethod : "BFD1", HighestOrderDerivative: 0);
M as integerparameter (10); // number of finite elements
N as integerparameter (3); // number of collocation points
M_b as integerparameter (10); // number of finite elements in the bottom zone
Lb1 as realparameter (1); // Length of bottom zone
Mset as integerset ([1:M]);
Kset as integerset ([1:4]); // for spatial differential state
Nset as integerset ([1:3]); // for spatial algebraic state
ms as integerset ([1:4]);
ns as integerset ([1:3]);
weightJ(ms,ns) as realparameter; //coefficents for spatial collocation using Lagrange polynomials
weightJ(1,1):-4.13939;
weightJ(1,2):1.73938;
weightJ(1,3):-3;
weightJ(2,1):3.224745;
weightJ(2,2):-3.56784;
weightJ(2,3):5.531973;
weightJ(3,1):1.16784;
weightJ(3,2):0.775255;
weightJ(3,3):-7.53197;
weightJ(4,1):-0.2532;
weightJ(4,2):1.053197;
weightJ(4,3):5;
hi([1:M]) as positive; //length of a finie element
dl as length;
dx as realparameter (0.02);
ne_r(componentlist)(Mset,Nset) as notype;
hse_r(Mset,Nset) as notype;
ht_r(Mset,Nset) as notype;
dThx_r(Mset,Nset) as notype;
// spatial differential variable
P(Mset, Kset) as pressure (description:"Bed Pressure (bar)");
Jc(Mset, Kset) as flux_mass (description:"Cloud-Wake Region Solids Flux (superficial) (kg/m^2.s)");
Je(Mset, Kset) as flux_mass (description:"Emulsion Region Solids Flux (superficial) (kg/m^2.s)");
Phx(Mset, Kset) as pressure (description:"Heat Exchanger Fluid Pressure (bar)");
ebin(Mset, Kset) as positive;
cbin(componentlist)(Mset, Kset) as positive;
ccwin(componentlist)(Mset, Kset) as positive;
ecwin(Mset, Kset) as notype;
cein(componentlist)(Mset, Kset) as positive;
eein(Mset, Kset) as notype;
hxh(Mset, Kset) as enth_mol (description:"Heat Exchanger Fluid Specific Enthalpy (GJ/kmol)");
// spatial algebraic variable
x(Mset,Nset) as length;
sign1(Mset,Nset) as notype;
sign1_0 as notype;
sign2(Mset,Nset) as notype;
Tgb(Mset, Nset) as temperature (description:"Bubble Region Gas Temperature (Celcius)");
Tsc(Mset, Nset) as temperature (description:"Cloud-Wake Region Solids Temperature (Celcius)");
Tse(Mset, Nset) as temperature (description:"Emulsion Region Solids Temperature (Celcius)");
Tgc(Mset, Nset) as temperature (description:"Cloud-Wake Region Gas Temperature (Celcius)");
Tge(Mset, Nset) as temperature (description:"Emulsion Region Gas Temperature (Celcius)");
Gb(Mset, Nset) as flow_mol_vap ;
yb(componentlist)(Mset, Nset) as molefraction;
yc(componentlist)(Mset, Nset) as molefraction;
ye(componentlist)(Mset, Nset) as molefraction;
cb(componentlist)(Mset, Nset) as conc_mole (description:"Bubble Region Gas Concentrations (kmol/m^3)");
cc(componentlist)(Mset, Nset) as conc_mole (description:"Cloud-Wake Region Gas Concentrations (kmol/m^3)");
ce(componentlist)(Mset, Nset) as conc_mole (description:"Emulsion Region Gas Concentrations (kmol/m^3)");
w_H2O(Mset, Nset) as loading (description:"Emulsion Region Solid Sorbent Physisorbed Water Loading (mol/kg)");
w_Bic(Mset, Nset) as loading (description:"Emulsion Region Solid Sorbent Bicarbonate Loading (mol/kg)");
w_Car(Mset, Nset) as loading (description:"Emulsion Region Solid Sorbent Carbamate Loading (mol/kg)");
w_t(Mset, Nset) as loading (description:"Emulsion Region Solid Sorbent Total Loading (mol/kg)");
hsc(Mset, Nset) as notype (description:"Sorbent Specific Enthalpy in Cloud-Wake Region (kJ/kg)");
hse(Mset, Nset) as notype (description:"Sorbent Specific Enthalpy in Emulsion Region (kJ/kg)");
nin(componentlist) as conc_mole_solid (description:"Sorbent Inlet Adsorbed Species Concentrations (mol/m^3)");
nc(componentlist)(Mset, Nset) as conc_mole_solid (description:"Cloud-Wake Region Adsorbed Species Concentrations (mol/m^3)");
ne(componentlist)(Mset, Nset) as conc_mole_solid (description:"Emulsion Region Adsorbed Species Concentrations (mol/m^3)");
vb(Mset, Nset) as velocity (description:"Bubble Velocity (m/s)");
vbr(Mset, Nset) as velocity (description:"Bubble Rise Velocity (m/s)");
ve(Mset, Nset) as velocity (description:"Emulsion Region Gas Velocity (m/s)");
vg(Mset, Nset) as velocity (description:"Superficial Gas Velocity (m/s)");
cbt(Mset, Nset) as dens_mol (description:"Bubble Region Gas Total Concentration (kmol/m^3)");
cct(Mset, Nset) as dens_mol (description:"Cloud-Wake Region Gas Total Concentration (kmol/m^3)");
cet(Mset, Nset) as dens_mol (description:"Emulsion Region Gas Total Concentration (kmol/m^3)");
ed(Mset, Nset) as notype (description:"Voidage of Emulsion Region");
db(Mset, Nset) as length (description:"Bubble Diameter (m)");
Ar(Mset, Nset) as notype (description:"Particle Archimedes Number");
e(Mset, Nset) as notype (description:"Cross-Sectional Average Bed Voidage");
dbe(Mset, Nset) as length (description:"Equilibrium Bubble Diameter (m)");
dbm(Mset, Nset) as length (description:"Maximum Bubble Diameter via Coalescence (m)");
dbu(Mset, Nset) as length (description:"Unconstrained Bubble Diameter (m)");
delta(Mset, Nset) as notype (description:"Volume Fraction of Bubbles in Bed");
g2(Mset, Nset) as notype (description:"Bubble Size Coefficient");
g3(Mset, Nset) as notype (description:"Bubble Size Coefficient");
fc(Mset, Nset) as notype (description:"Cloud to Bubble Region Volume Ratio");
fcw(Mset, Nset) as notype (description:"Cloud-Wake to Bubble Region Volume Ratio");
Hbc(Mset, Nset) as notype (description:"Bubble to Cloud-Wake Gas Heat Transfer Coefficient (kJ/m^3.K.s)");
Hce(Mset, Nset) as notype (description:"Cloud-Wake to Emulsion Gas Heat Transfer Coefficient (kJ/m^3.K.s)");
Hgbulk(Mset, Nset) as notype (description:"as Phase Bulk Flow Heat Transfer (kJ/s)");
Hsbulk(Mset, Nset) as notype (description:"Heat Trasnfer between Cloud-Wake and Emulsion Regions due to Bulk Solids Flow (kJ/s)");
hp(Mset, Nset) as notype (description:"Convective Heat Transfer Coefficient (kJ/m^2.K.s)");
Kbc(componentlist)(Mset, Nset) as notype (description:"Bubble to Cloud-Wake Gas Mass Transfer Coefficient (s^-1)");
Kce(componentlist)(Mset, Nset) as notype (description:"Cloud-Wake to Emulsion Gas Mass Transfer Coefficient (s^-1)");
Kcebs(Mset, Nset) as notype (description:"Cloud-Wake to Emulsion Solids Mass Transfer Coefficient (s^-1)");
Kgbulk(componentlist)(Mset, Nset) as notype (description:"Gas Phase Bulk Flow Mass Transfer (kmol/s)");
Ksbulk(componentlist)(Mset, Nset) as notype (description:"Bulk Flow of Adsorbed Species between Cloud-Wake and Emulsion Regions (mol/s)");
Nup(Mset, Nset) as positive (description:"Particle Nusselt Number");
Red(Mset, Nset) as positive (description:"Particle Reynolds Number in Emulsion Region");
k1c(Mset, Nset) as notype (description:"Rate Constant for Water Physisorption in Cloud-Wake Region (mol/m^3.Pa.s)");
k2c(Mset, Nset) as notype (description:"Rate Constant for Bicarbonate Formation in Cloud-Wake Region (1/Pa.s)");
k3c(Mset, Nset) as notype (description:"Rate Constant for Carbamate Formation in Cloud-Wake Region (1/Pa^m1.s)");
k1e(Mset, Nset) as notype (description:"Rate Constant for Water Physisorption in Emulsion Region (mol/Pa.s)");
k2e(Mset, Nset) as notype (description:"Rate Constant for Bicarbonate Formation in Emulsion Region (1/Pa.s)");
k3e(Mset, Nset) as notype (description:"Rate Constant for Carbamate Formation in Emulsion Region (1/Pa^m1.s)");
Ke1c(Mset, Nset) as notype (description:"Equilibrium Constant for Water Physisorption in Cloud-Wake Region (mol/m^3.Pa)");
Ke2c(Mset, Nset) as notype (description:"Equilibrium Constant for Bicarbonate Formation in Cloud-Wake Region (1/Pa)");
Ke3c(Mset, Nset) as notype (description:"Equilibrium Constant for Carbamate Formation in Cloud-Wake Region (Pa^-m1)");
Ke1e(Mset, Nset) as notype (description:"Equilibrium Constant for Water Physisorption in Emulsion Region (mol/m^3.Pa)");
Ke2e(Mset, Nset) as notype (description:"Equilibrium Constant for Bicarbonate Formation in Emulsion Region (1/Pa)");
Ke3e(Mset, Nset) as notype (description:"Equilibrium Constant for Carbamate Formation in Emulsion Region (Pa^-m1)");
rgc(componentlist)(Mset, Nset) as notype (description:"Cloud-Wake Region Gas Component Reaction Rates (kmol/m^3.s)");
rge(componentlist)(Mset, Nset) as notype (description:"Emulsion Region Gas Component Reaction Rates (kmol/m^3.s)");
rsc(componentlist)(Mset, Nset) as notype (description:"Cloud-Wake Region Adsorbed Species Reaction Rates (mol/m^3.s)");
rse(componentlist)(Mset, Nset) as notype (description:"Emulsion Region Adsorbed Species Reaction Rates (mol/m^3.s)");
r1c(Mset, Nset) as notype (description:"Rate of Water Physisorption in Cloud-Wake Region (mol/m^3.s)");
r2c(Mset, Nset) as notype (description:"Rate of Bicarbonate Formation in Cloud-Wake Region (mol/m^3.s)");
r3c(Mset, Nset) as notype (description:"Rate of Carbamate Formation in Cloud-Wake Region (mol/mol amine.s)");
r1e(Mset, Nset) as notype (description:"Rate of Water Physisorption in Emulsion Region (mol/m^3.s)");
r2e(Mset, Nset) as notype (description:"Rate of Bicarbonate Formation in Emulsion Region (mol/m^3.s)");
r3e(Mset, Nset) as notype (description:"Rate of Carbamate Formation in Emulsion Region (mol/mol amine.s)");
Thx(Mset, Nset) as temperature (description:"Heat Exchanger Fluid Temperature (Celcius)");
Ttube(Mset, Nset) as temperature (description:"Heat Exchanger Tube Wall Temperature (Celcius)");
dThx(Mset, Nset) as temp_diff (description:"Heat Exchanger Temperature Difference (Celcius)");
fb(Mset, Nset) as notype (description:"Fraction of Time during which Heat Exchanger Contacts Emulsion Region");
fn(Mset, Nset) as notype (description:"Fluidisation Number (vg/vmf)");
hd(Mset, Nset) as notype (description:"Heat Transfer Coefficient due to Emulsion (kJ/m^2.K.s)");
hl(Mset, Nset) as notype (description:"Convective Heat Transfer Coefficient due to Bubbles (kJ/m^2.K.s)");
ht(Mset, Nset) as notype (description:"Overall Heat Transfer Coefficient (kJ/m^2.K.s)");
kpa(Mset, Nset) as conductivity (description:"Conductivity of Bed at Minimum Fluidization (J/m.K.s)");
Nuh(Mset, Nset) as notype (description:"Convective Heat Exchange Nusselt Number");
tau(Mset, Nset) as timeSec (description:"Average Residence Time of Emulsion Packets at Heat Exchanger Surface (s)");
D(componentlist)(Mset, Nset) as diffusivity (description:"Component Gas Diffusivities (cm^2/s)");
rhog(Mset, Nset) as dens_mass (description:"Gas Density (kg/m^3)");
// new dummy variable for y's value at x = 0;
Tgb0 as temperature (description:"Bubble Region Gas Temperature (Celcius)");
Tsc0 as temperature (description:"Cloud-Wake Region Solids Temperature (Celcius)");
Tse0 as temperature (description:"Emulsion Region Solids Temperature (Celcius)");
Tgc0 as temperature (description:"Cloud-Wake Region Gas Temperature (Celcius)");
Tge0 as temperature (description:"Emulsion Region Gas Temperature (Celcius)");
Gb0 as flow_mol_vap (description:"Gas Flowrate in Bubbles (kmol/hr)");
yb0(componentlist) as molefraction (description:"Bubble Region Gas Mole Fractions (kmol/kmol)");
yc0(componentlist) as molefraction (description:"Cloud-Wake Region Gas Mole Fractions (kmol/kmol)");
ye0(componentlist) as molefraction (description:"Emulsion Region Gas Mole Fractions (kmol/kmol)");
cb0(componentlist) as conc_mole (description:"Bubble Region Gas Concentrations (kmol/m^3)");
cc0(componentlist) as conc_mole (description:"Cloud-Wake Region Gas Concentrations (kmol/m^3)");
ce0(componentlist) as conc_mole (description:"Emulsion Region Gas Concentrations (kmol/m^3)");
w_H2O0 as loading (description:"Emulsion Region Solid Sorbent Physisorbed Water Loading (mol/kg)");
w_Bic0 as loading (description:"Emulsion Region Solid Sorbent Bicarbonate Loading (mol/kg)");
w_Car0 as loading (description:"Emulsion Region Solid Sorbent Carbamate Loading (mol/kg)");
w_t0 as loading (description:"Emulsion Region Solid Sorbent Total Loading (mol/kg)");
hsc0 as notype (description:"Sorbent Specific Enthalpy in Cloud-Wake Region (kJ/kg)");
hse0 as notype (description:"Sorbent Specific Enthalpy in Emulsion Region (kJ/kg)");
//nin0(componentlist) as conc_mole_solid (description:"Sorbent Inlet Adsorbed Species Concentrations (mol/m^3)");
nc0(componentlist) as conc_mole_solid (description:"Cloud-Wake Region Adsorbed Species Concentrations (mol/m^3)");
ne0(componentlist) as conc_mole_solid (description:"Emulsion Region Adsorbed Species Concentrations (mol/m^3)");
vb0 as velocity (description:"Bubble Velocity (m/s)");
vbr0 as velocity (description:"Bubble Rise Velocity (m/s)");
ve0 as velocity (description:"Emulsion Region Gas Velocity (m/s)");
vg0 as velocity (description:"Superficial Gas Velocity (m/s)");
cbt0 as dens_mol (description:"Bubble Region Gas Total Concentration (kmol/m^3)");
cct0 as dens_mol (description:"Cloud-Wake Region Gas Total Concentration (kmol/m^3)");
cet0 as dens_mol (description:"Emulsion Region Gas Total Concentration (kmol/m^3)");
ed0 as notype (description:"Voidage of Emulsion Region");
db00 as length (description:"Bubble Diameter (m)");
Ar0 as notype (description:"Particle Archimedes Number");
e0 as notype (description:"Cross-Sectional Average Bed Voidage");
dbe0 as length (description:"Equilibrium Bubble Diameter (m)");
dbm0 as length (description:"Maximum Bubble Diameter via Coalescence (m)");
dbu0 as length (description:"Unconstrained Bubble Diameter (m)");
delta0 as notype (description:"Volume Fraction of Bubbles in Bed");
g20 as notype (description:"Bubble Size Coefficient");
g30 as notype (description:"Bubble Size Coefficient");
fc0 as notype (description:"Cloud to Bubble Region Volume Ratio");
fcw0 as notype (description:"Cloud-Wake to Bubble Region Volume Ratio");
Hbc0 as notype (description:"Bubble to Cloud-Wake Gas Heat Transfer Coefficient (kJ/m^3.K.s)");
Hce0 as notype (description:"Cloud-Wake to Emulsion Gas Heat Transfer Coefficient (kJ/m^3.K.s)");
Hgbulk0 as notype (description:"as Phase Bulk Flow Heat Transfer (kJ/s)");
Hsbulk0 as notype (description:"Heat Trasnfer between Cloud-Wake and Emulsion Regions due to Bulk Solids Flow (kJ/s)");
hp0 as notype (description:"Convective Heat Transfer Coefficient (kJ/m^2.K.s)");
Kbc0(componentlist) as notype (description:"Bubble to Cloud-Wake Gas Mass Transfer Coefficient (s^-1)");
Kce0(componentlist) as notype (description:"Cloud-Wake to Emulsion Gas Mass Transfer Coefficient (s^-1)");
Kcebs0 as notype (description:"Cloud-Wake to Emulsion Solids Mass Transfer Coefficient (s^-1)");
Kgbulk0(componentlist) as notype (description:"Gas Phase Bulk Flow Mass Transfer (kmol/s)");
Ksbulk0(componentlist) as notype (description:"Bulk Flow of Adsorbed Species between Cloud-Wake and Emulsion Regions (mol/s)");
Nup0 as positive (description:"Particle Nusselt Number");
Red0 as positive (description:"Particle Reynolds Number in Emulsion Region");
k1c0 as notype (description:"Rate Constant for Water Physisorption in Cloud-Wake Region (mol/m^3.Pa.s)");
k2c0 as notype (description:"Rate Constant for Bicarbonate Formation in Cloud-Wake Region (1/Pa.s)");
k3c0 as notype (description:"Rate Constant for Carbamate Formation in Cloud-Wake Region (1/Pa^m1.s)");
k1e0 as notype (description:"Rate Constant for Water Physisorption in Emulsion Region (mol/Pa.s)");
k2e0 as notype (description:"Rate Constant for Bicarbonate Formation in Emulsion Region (1/Pa.s)");
k3e0 as notype (description:"Rate Constant for Carbamate Formation in Emulsion Region (1/Pa^m1.s)");
Ke1c0 as notype (description:"Equilibrium Constant for Water Physisorption in Cloud-Wake Region (mol/m^3.Pa)");
Ke2c0 as notype (description:"Equilibrium Constant for Bicarbonate Formation in Cloud-Wake Region (1/Pa)");
Ke3c0 as notype (description:"Equilibrium Constant for Carbamate Formation in Cloud-Wake Region (Pa^-m1)");
Ke1e0 as notype (description:"Equilibrium Constant for Water Physisorption in Emulsion Region (mol/m^3.Pa)");
Ke2e0 as notype (description:"Equilibrium Constant for Bicarbonate Formation in Emulsion Region (1/Pa)");
Ke3e0 as notype (description:"Equilibrium Constant for Carbamate Formation in Emulsion Region (Pa^-m1)");
rgc0(componentlist) as notype (description:"Cloud-Wake Region Gas Component Reaction Rates (kmol/m^3.s)");
rge0(componentlist) as notype (description:"Emulsion Region Gas Component Reaction Rates (kmol/m^3.s)");
rsc0(componentlist) as notype (description:"Cloud-Wake Region Adsorbed Species Reaction Rates (mol/m^3.s)");
rse0(componentlist) as notype (description:"Emulsion Region Adsorbed Species Reaction Rates (mol/m^3.s)");
r1c0 as notype (description:"Rate of Water Physisorption in Cloud-Wake Region (mol/m^3.s)");
r2c0 as notype (description:"Rate of Bicarbonate Formation in Cloud-Wake Region (mol/m^3.s)");
r3c0 as notype (description:"Rate of Carbamate Formation in Cloud-Wake Region (mol/mol amine.s)");
r1e0 as notype (description:"Rate of Water Physisorption in Emulsion Region (mol/m^3.s)");
r2e0 as notype (description:"Rate of Bicarbonate Formation in Emulsion Region (mol/m^3.s)");
r3e0 as notype (description:"Rate of Carbamate Formation in Emulsion Region (mol/mol amine.s)");
Thx0 as temperature (description:"Heat Exchanger Fluid Temperature (Celcius)");
Ttube0 as temperature (description:"Heat Exchanger Tube Wall Temperature (Celcius)");
dThx0 as temp_diff (description:"Heat Exchanger Temperature Difference (Celcius)");
fb0 as notype (description:"Fraction of Time during which Heat Exchanger Contacts Emulsion Region");
fn0 as notype (description:"Fluidisation Number (vg/vmf)");
hd0 as notype (description:"Heat Transfer Coefficient due to Emulsion (kJ/m^2.K.s)");
hl0 as notype (description:"Convective Heat Transfer Coefficient due to Bubbles (kJ/m^2.K.s)");
ht0 as notype (description:"Overall Heat Transfer Coefficient (kJ/m^2.K.s)");
kpa0 as conductivity (description:"Conductivity of Bed at Minimum Fluidization (J/m.K.s)");
Nuh0 as notype (description:"Convective Heat Exchange Nusselt Number");
tau0 as timeSec (description:"Average Residence Time of Emulsion Packets at Heat Exchanger Surface (s)");
D0(componentlist) as diffusivity (description:"Component Gas Diffusivities (cm^2/s)");
rhog0 as dens_mass (description:"Gas Density (kg/m^3)");
// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Declare Model Variables
//test as notype;
Ao as area (description:"Area of Distributor Plate per Orifice (m^2/orifice)");
Ax as area (description:"Total Bed Cross-Sectional Area (m^2)");
Dt as length (description:"Single Unit Diameter (m)");
Dte as length (description:"Hydraulic Diameter (m)");
Lb as length (description:"Bed Depth (m)");
nor as notype (description:"Number of Orifices per Square Meter in Distributor Plate (m^-2)");
rhohx as dens_mass (description:"Heat Exchanger Fluid Density (kg/m^3)"); //constant
hsinb as notype (description:"Sorbent Specific Enthalpy in Inlet Solids (Bottom Inlet) (kJ/kg)");
hsint as notype (description:"Sorbent Specific Enthalpy in Inlet Solids (Top Inlet) (kJ/kg)");
cpg_mol_in as cp_mol (description:"Inlet Gas Molar Specific Heat Capacity (kJ/kmol.K)"); //constant
cpgcsb(componentlist) as cp_mol (description:"Gas Phase Pure Component Molar Specific Heat Capacities in Inlet Solids (Bottom) (kJ/kmol.K)"); //constant
cpgcst(componentlist) as cp_mol (description:"Gas Phase Pure Component Molar Specific Heat Capacities in Inlet Solids (Top) (kJ/kmol.K)"); //constant
cpg_mass as cp_mass (description:"Bubble Region Gas Mass Specific Heat Capacity (kJ/kg.K)"); //constant
cpg_mol as cp_mol (description:"Bubble Region Gas Molar Specific Heat Capacity (kJ/kmol.K)"); //constant
cpgcgc(componentlist) as cp_mol (description:"Gas Phase Pure Component Molar Specific Heat Capacities in Cloud-Wake Region (Gas Temp) (kJ/kmol.K)"); //constant
cpgcge(componentlist) as cp_mol (description:"Gas Phase Pure Component Molar Specific Heat Capacities in Emulsion Region (Gas Temp) (kJ/kmol.K)"); //constant
cpgcsc(componentlist) as cp_mol (description:"Gas Phase Pure Component Molar Specific Heat Capacities in Cloud-Wake Region (Solid Temp) (kJ/kmol.K)");//constant
cpgcse(componentlist) as cp_mol (description:"Gas Phase Pure Component Molar Specific Heat Capacities in Emulsion Region (Solid Temp) (kJ/kmol.K)"); //constant
kg as conductivity (description:"Gas Thermal Conductivity (J/m.K.s)"); //constant
mug as notype (description:"Gas Viscosity (kg/m.s)"); //constant
//mug_avr as notype (description:"average Gas Viscosity (kg/m.s)");
// mugcp as Distribution1D(XDomain is l) of viscosity (description:"Gas Viscosity (cP)");
mw as molweight (description:"Average Molecular Weight of Gas (kg/kmol)"); //constant
Pr as notype (description:"Gas Prandtl Number"); // constant
ap as area (description:"Particle Specific Surface Area (m^2/kg)");
cps as cp_mass (description:"Particle Heat Capacity (kJ/kg.K)");
dp as length (description:"Particle Diameter (m)");
//dpd as notype (description:"Dimensionless Particle Size");
emf as fraction (description:"Bed Voidage at Minimum Fluidisation");
F as fraction (description:"Fines Fraction (<45 micron) of Solids");
//geldart as notype (description:"Geldart Group Classification of Solid (A=1, B=2)");
kp as conductivity (description:"Particle Conductivity (J/m.K.s)");
nv as notype (description:"Amine Loading of Sorbent (mol/m^3)");
phis as fraction (description:"Particle Sphericity");
rhos as dens_mass (description:"Particle Density (kg/m^3)");
//vgi as velocity (description:"Superficial Gas Velocity at Inlet Point (m/s)");
//vcr as velocity (description:"Particle Critical Velocity (m/s)");
vmf as velocity (description:"Particle Minimum Fluidisation Velocity (m/s)");
//vt as velocity (description:"Particle Terminal Velocity (m/s)");
//vtr as velocity (description:"Particle Transport Velocity (m/s)");
//eavg as fraction (description:"Overall Average Bed Voidage");
fw as notype (description:"Wake to Bubble Region Volume Ratio");
//taus as timeSec (description:"Solids Residence Time (s)");
db0 as length (description:"Initial Bubble Diameter (m)");
g1 as notype (description:"Bubble Size Coefficient");
K_d as notype (description:"Gas Phase Bulk Flow Coefficient (m^3/s)");
A1 as notype (description:"Arrhenius Constant for Water Physisorption (mol/m^3.Pa.K.s)");
A2 as notype (description:"Arrhenius Constant for Bicarbonate Formation (1/Pa.K.s)");
A3 as notype (description:"Arrhenius Constant for Carbamate Formation (1/Pa^m1.K.s)");
E1 as notype (description:"Activation Energy for Water Physisorption (J/mol)");
E2 as notype (description:"Activation Energy for Bicarbonate Formation (J/mol)");
E3 as notype (description:"Activation Energy for Carbamate Formation (J/mol)");
dH1 as notype (description:"Heat of Reaction for Water Physisorption (J/mol)");
dH2 as notype (description:"Heat of Reaction for Bicarbonate Formation (J/mol)");
dH3 as notype (description:"Heat of Reaction for Carbamate Formation (J/mol)");
dS1 as notype (description:"Reaction Entropy for Water Physisorption (J/mol.K)");
dS2 as notype (description:"Reaction Entropy for Bicarbonate Formation (J/mol.K)");
dS3 as notype (description:"Reaction Entropy for Carbamate Formation (J/mol.K)");
m1 as notype (description:"Non-Ideality Exponent for Carbamate Formation Reaction");
//dx as length (description:"Heat Exchanger Tube Diameter (m)");
lp as length (description:"Heat Exchanger Tube Pitch (m)");
// lhx as length (description:"Heat Exchanger Tube Spacing, Pitch-Diameter (m)");
wthx as length (description:"Heat Exchanger Tube Wall Thickness (m)");
Nx as notype (description:"Heat Exchanger Number of Tubes");
dPhx as press_drop (description:"Heat Exchanger Tube Pressure Drop (bar/m)");
mwhx as molweight (description:"Heat Exchanger Fluid Molecular Weight (kg/kmol)");
ah as notype (description:"Empirical Factor in Heat Transfer Model");
Cr as notype (description:"Average Correction Factor for Heat Exchanger Tubes");
hw as notype (description:"Heat Exchanger Tube Wall Heat Transfer Coefficient (kJ/m^2.K.s)");
//Q as enthflow (description:"Total Heat Duty of Heat Exchanger Tubes (GJ/hr)");
removal as notype (description:"CO2 Removal Fraction");
regeneration as notype (description:"Sorbent Regeneration Fraction");
removal_per as notype (description:"CO2 Removal Percent");
Sit as notype (description:"Solids Flowrate through Top Inlet (kg/s)");
Sib as notype (description:"Solids Flowrate through Bottom Inlet (kg/s)");
Sot as notype (description:"Solids Flowrate through Top Outlet (kg/s)");
Sob as notype (description:"Solids Flowrate through Bottom Outlet (kg/s)");
Tref as temperature (description:"Thermodynamic Reference Temperature (Celcius)");
IM(componentlist)(componentlist) as molefraction (description:"Identiy Matrix");
k1sf as notype ; //description:"Scaling factor", spec:Fixed);
k2sf as notype ; //description:"Scaling factor", spec:Fixed);
k3sf as notype ; //description:"Scaling factor", spec:Fixed);
Ke1sf as notype ; //description:"Scaling factor", spec:Fixed);
Ke2sf as notype ; //(description:"Scaling factor", spec:Fixed);
Ke3sf as notype ; //(description:"Scaling factor", spec:Fixed);
r1csf as notype ; //(description:"Scaling factor", spec:Fixed);
r2csf as notype ; //(description:"Scaling factor", spec:Fixed);
r3csf as notype ; // (description:"Scaling factor", spec:Fixed);
r1esf as notype ; //(description:"Scaling factor", spec:Fixed);
r2esf as notype ; // (description:"Scaling factor", spec:Fixed);
r3esf as notype ; // (description:"Scaling factor", spec:Fixed);
// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
dl = Lb/(ND-1);
// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Declare Ports
GasIn as Input MainPort;
GasOut as Output MainPort;
HXIn as Input MainPort;
HXOut as Output MainPort;
SolidIn as Input SorbentPort;
SolidOut as Output SorbentPort;
// The following block includes changes to solid ports in order to convert them to standard notation with other CCSI models
SorbIn_F as loading;
SorbIn_z(componentlist) as molefraction;
SorbOut_F as loading;
SorbOut_z(componentlist) as molefraction;
SorbIn_F = Sigma(SolidIN.w);
SorbIn_z("CO2") = SolidIN.w("Bic")/SorbIn_F;
SorbIn_z("H2O") = SolidIN.w("H2O")/SorbIn_F;
SorbIn_z("N2") = SolidIN.w("Car")/SorbIn_F;
SorbOUT_z("CO2") = SolidOUT.w("Bic")/SorbOUT_F;
SorbOUT_z("H2O") = SolidOUT.w("H2O")/SorbOUT_F;
SorbOUT_z("N2") = SolidOUT.w("Car")/SorbOUT_F;
//Heat Exchanger Fluid Inlet Variables
HXIn_zv(componentlist) as molefraction (description:"Heat Exchanger Fluid Inlet Gas Composition");
HXIn_zl(componentlist) as molefraction (description:"Heat Exchanger Fluid Inlet Liquid Composition");
HXIn_vf as vapfraction (description:"Heat Exchanger Fluid Inlet Vapour Fraction");
HXIn_hv as enth_mol (description:"Heat Exchanger Fluid Inlet Liquid Enthalpy");
HXIn_hl as enth_mol (description:"Heat Exchanger Fluid Inlet Vapour Enthalpy");
test(componentlist)(Mset,Nset) as notype;
cb("co2")(Mset, Nset): 0.003;
cb("h2o")(Mset, Nset): 0.002;
cb("n2")(Mset, Nset): 0.03;
cbt(Mset, Nset): 0.035;
cc("co2")(Mset, Nset): 0.002;
cc("h2o")(Mset, Nset): 0.002;
cc("n2")(Mset, Nset): 0.04;
cct(Mset, Nset): 0.044;
ce("co2")(Mset, Nset): 0.002;
ce("h2o")(Mset, Nset): 0.002;
ce("n2")(Mset, Nset): 0.04;
cet(Mset, Nset): 0.044;
Gb(Mset,Nset): 9566.93;
yb("co2")(Mset,Nset): 0.13;
yb("h2o")(Mset,Nset): 0.06;
yb("n2")(Mset,Nset): 0.81;
yc("co2")(Mset,Nset): 0.13;
yc("h2o")(Mset,Nset): 0.06;
yc("n2")(Mset,Nset): 0.81;
ye("co2")(Mset,Nset): 0.13;
ye("h2o")(Mset,Nset): 0.06;
ye("n2")(Mset,Nset): 0.81;
// top boundary condition:
Gb0 = GasIn.F;
Tgb0 = GasIn.T;
yb0(componentlist) = GasIn.z(componentlist);
// finite element control
for i in [1:M_b] do
hi(i) = Lb1/M_b;
endfor
for i in [M_b+1:M] do
hi(i) = (Lb-Lb1)/(M-M_b);
endfor
for i in [1] do
// spatial length
x(i,1)=0.155051*hi(i);
x(i,2)=0.644949*hi(i);
x(i,3)=hi(i);
endfor
for i in [2:M] do
// spatial length
x(i,1)=x(i-1,3)+0.155051*hi(i);
x(i,2)=x(i-1,3)+0.644949*hi(i);
x(i,3)=x(i-1,3)+hi(i);
endfor
//continuity equation
for i in [1:M-1] do
aa1: P(i+1,1) = P(i,4);
Jc(i+1,1) = Jc(i,4);
Je(i+1,1) = Je(i,4);
bb1: Phx(i+1,1) = Phx(i,4);
ebin(i+1,1) = ebin(i,4);
cbin(componentlist)(i+1,1) = cbin(componentlist)(i,4);
ccwin(componentlist)(i+1,1) = ccwin(componentlist)(i,4);
ecwin(i+1,1) = ecwin(i,4);
cein(componentlist)(i+1,1) = cein(componentlist)(i,4);
eein(i+1,1) = eein(i,4);
hxh(i+1,1) = hxh(i,4);
endfor
Jc(1,1) = fw*delta0*rhos*(1-ed0)*vb0;
// Je(1,1) = Jc(1,1);
ebin(1,1) = Gb0/3600*cpg_mol*(Tgb0-Tref);
cbin(componentlist)(1,1) = yb0(componentlist)*Gb0/3600;
ccwin(componentlist)(1,1) = Jc(1,1)*nc0(componentlist);
ecwin(1,1) = Jc(1,1)*hsc0;
// backward spatial differential equation for cbin and ebin
for i in [1:M] do
for k in [1:3] do
if ipselectG == "rigorous" then
ccc: $cb(componentlist)(i,k)*delta(i,k)*Ax*1E5*hi(i) = -(weightJ(1,k)*cbin(componentlist)(i,1)+weightJ(2,k)*cbin(componentlist)(i,2)+weightJ(3,k)*cbin(componentlist)(i,3)+weightJ(4,k)*cbin(componentlist)(i,4))*1e5
- Ax*delta(i,k)*Kbc(componentlist)(i,k)*(cb(componentlist)(i,k) - cc(componentlist)(i,k))*1E5*hi(i) + Kgbulk(componentlist)(i,k)*1E5*hi(i)/dl; // inconsistency in term "Kgbulk" // partial term
else
yb(componentlist)(i,k) = GasIn.z(componentlist);
endif
IF IPselectF == "Rigorous" THEN
$Tgb(i,k)*cpg_mol*cbt(i,k)*Ax*delta(i,k)*hi(i) = -(weightJ(1,k)*ebin(i,1)+weightJ(2,k)*ebin(i,2)+weightJ(3,k)*ebin(i,3)+weightJ(4,k)*ebin(i,4)) - Ax*delta(i,k)*Hbc(i,k)*(Tgb(i,k)-Tgc(i,k))*hi(i) + Hgbulk(i,k)*hi(i)/dl; //inconsistency in term Hgbulk and dl // partial term
ELSE
Tgb(i,k) = GasIn.T;
ENDIF
ppp: cbt(i,k)*1E3 = sigma(cb(componentlist)(i,k))*1E3;
aa2: (weightJ(1,k)*P(i,1)+weightJ(2,k)*P(i,2)+weightJ(3,k)*P(i,3)+weightJ(4,k)*P(i,4))*1e5 = - (1-e(i,k))*rhos*gc*hi(i);
endfor
endfor
// backward spatial differential equation for ccwin and ecwin
for i in [1:M] do
for k in [1:3] do
IF IPselectC == "Rigorous" THEN
$nc(componentlist)(i,k)*Ax*fcw(i,k)*delta(i,k)*(1-ed(i,k))*rhos*hi(i) = -(weightJ(1,k)*ccwin(componentlist)(i,1)+weightJ(2,k)*ccwin(componentlist)(i,2)+weightJ(3,k)*ccwin(componentlist)(i,3)+weightJ(4,k)*ccwin(componentlist)(i,4))*Ax
- hi(i)*Ksbulk(componentlist)(i,k)/dl - hi(i)*Ax*delta(i,k)*rhos*Kcebs(i,k)*(nc(componentlist)(i,k)-ne(componentlist)(i,k))
+ hi(i)*Ax*fcw(i,k)*delta(i,k)*(1-ed(i,k))*rsc(componentlist)(i,k);
ELSE
nc(componentlist)(i,k) = SorbIn_F*SorbIn_z(componentlist);
ENDIF
IF IPselectE == "Rigorous" THEN
$Tsc(i,k)*cps*rhos*Ax*fcw(i,k)*delta(i,k)*(1-ed(i,k))*hi(i) = -(weightJ(1,k)*ecwin(i,1)+weightJ(2,k)*ecwin(i,2)+weightJ(3,k)*ecwin(i,3)+weightJ(4,k)*ecwin(i,4))*Ax
- Hsbulk(i,k)*hi(i)/dl - Ax*delta(i,k)*rhos*Kcebs(i,k)*(hsc(i,k) - hse(i,k))*hi(i)
+ Ax*fcw(i,k)*delta(i,k)*(1-ed(i,k))*sigma(rgc(componentlist)(i,k)*cpgcgc(componentlist))*(Tgc(i,k)-Tref)*hi(i)
+ Ax*fcw(i,k)*delta(i,k)*(1-ed(i,k))*rhos*ap*hp(i,k)*(Tgc(i,k)-Tsc(i,k))*hi(i);
ELSE
Tsc(i,k) = SolidIn.T;
ENDIF
endfor
endfor
// boundary condition
if ipselectc == "rigorous" then
//-9*nc0(componentlist) + 10.0488*nc(componentlist)(1,1) -1.3821*nc(componentlist)(1,2) + 0.3333*nc(componentlist)(1,3) = 0;
nc0(componentlist)*Jc(1,1)*Ax = ne0(componentlist)*Je(1,1)*Ax;
//$nc0(componentlist)*dl*Ax*fcw0*delta0*(1-ed0)*rhos= - Jc(1,1)*Ax*nc0(componentlist) - Ksbulk0(componentlist)
// - dl*Ax*delta0*rhos*Kcebs0*(nc0(componentlist)-ne0(componentlist))
// + dl*Ax*fcw0*delta0*(1-ed0)*rsc0(componentlist);
// $nc(componentlist)(M,3)*dl*Ax*fcw(M,3)*delta(M,3)*(1-ed(M,3))*rhos = Jc(M,3)*Ax*nc(componentlist)(M,2) - Ksbulk(componentlist)(M,3)
// - dl*Ax*delta(M,3)*rhos*Kcebs(M,3)*(nc(componentlist)(M,3)-ne(componentlist)(M,3))
// + dl*Ax*fcw(M,3)*delta(M,3)*(1-ed(M,3))*rsc(componentlist)(M,3);
else
nc0("n2")=1.6;
nc0("co2")=0.165;
nc0("h2o")=0.67;
endif
IF IPselectE == "Rigorous" THEN
hsc0*Jc(1,1)*Ax = hse0*Je(1,1)*Ax;
ELSE
Tsc0 = SolidIn.T;
ENDIF
// related variables
for i in [1:M] do
for k in [1:3] do
sign1(i,k)/dl = weightJ(1,k)*Jc(i,1)+weightJ(2,k)*Jc(i,2)+weightJ(3,k)*Jc(i,3)+weightJ(4,k)*Jc(i,4);
IF sign1(i,k)< 0 THEN
Ksbulk(componentlist)(i,k)*hi(i)/dl = -Ax*(weightJ(1,k)*Jc(i,1)+weightJ(2,k)*Jc(i,2)+weightJ(3,k)*Jc(i,3)+weightJ(4,k)*Jc(i,4))*nc(componentlist)(i,k); // if else condition ignored // partial term
Hsbulk(i,k)*hi(i)/dl = -Ax*(weightJ(1,k)*Jc(i,1)+weightJ(2,k)*Jc(i,2)+weightJ(3,k)*Jc(i,3)+weightJ(4,k)*Jc(i,4))*hsc(i,k); // if else condition ignored // partial term
else
Ksbulk(componentlist)(i,k)*hi(i)/dl = -Ax*(weightJ(1,k)*Jc(i,1)+weightJ(2,k)*Jc(i,2)+weightJ(3,k)*Jc(i,3)+weightJ(4,k)*Jc(i,4))*ne(componentlist)(i,k); // if else condition ignored // partial term
Hsbulk(i,k)*hi(i)/dl = -Ax*(weightJ(1,k)*Jc(i,1)+weightJ(2,k)*Jc(i,2)+weightJ(3,k)*Jc(i,3)+weightJ(4,k)*Jc(i,4))*hse(i,k); // if else condition ignored // partial term
endif
endfor
endfor
sign1_0/dl = -9*Jc(1,1)+10.0488*Jc(1,2)-1.3821*Jc(1,3)+0.3333*Jc(1,4);
IF sign1_0< 0 THEN
Ksbulk0(componentlist)*hi(1)/dl = -Ax*(-9*Jc(1,1)+10.0488*Jc(1,2)-1.3821*Jc(1,3)+0.3333*Jc(1,4))*nc0(componentlist); // if else condition ignored // partial term
Hsbulk0*hi(1)/dl = -Ax*(-9*Jc(1,1)+10.0488*Jc(1,2)-1.3821*Jc(1,3)+0.3333*Jc(1,4))*hsc0; // if else condition ignored // partial term
else
Ksbulk0(componentlist)*hi(1)/dl = -Ax*(-9*Jc(1,1)+10.0488*Jc(1,2)-1.3821*Jc(1,3)+0.3333*Jc(1,4))*ne0(componentlist); // if else condition ignored // partial term
Hsbulk0*hi(1)/dl = -Ax*(-9*Jc(1,1)+10.0488*Jc(1,2)-1.3821*Jc(1,3)+0.3333*Jc(1,4))*hse0; // if else condition ignored // partial term
endif
// forward spatial differential equations for cein and eein
IF IPselectz == "Rigorous" THEN
$ne0(componentlist)*Ax*(1-fcw0*delta0-delta0)*(1-ed0)*rhos*hi(1) = (-9*cein(componentlist)(1,1)+ 10.0488101064944*cein(componentlist)(1,2) -1.38214240374537*cein(componentlist)(1,3)+0.333333305331110*cein(componentlist)(1,4))*Ax
+ hi(1)*Ksbulk0(componentlist)/dl + hi(1)*Ax*delta0*rhos*Kcebs0*(nc0(componentlist)-ne0(componentlist))
+ hi(1)*Ax*(1-fcw0*delta0-delta0)*(1-ed0)*rse0(componentlist);
/*
$ne0(componentlist)*Ax*(1-fcw0*delta0-delta0)*(1-ed0)*rhos*hi(i) = Ax*Je(1,1)*(-9*ne0(componentlist) + 10.0488101064944*ne(componentlist)(1,1) - 1.38214240374537*ne(componentlist)(1,2)+0.333333305331110*ne(componentlist)(1,3))
+ hi(i)*Ax*delta0*rhos*Kcebs0*(nc0(componentlist)-ne0(componentlist))
+ hi(i)*Ax*(1-fcw0*delta0-delta0)*(1-ed0)*rse0(componentlist);
*/
ELSE
ne0("n2")=1.6;
ne0("co2")=0.165;
ne0("h2o")=0.67;
//ne0(componentlist) = SorbIn_F*SorbIn_z(componentlist);
ENDIF
IF IPselectD == "Rigorous" THEN
$Tse0*cps*rhos*Ax*(1-fcw0*delta0-delta0)*(1-ed0)*hi(1) = (-9*eein(1,1)+ 10.0488101064944*eein(1,2) -1.38214240374537*eein(1,3)+0.333333305331110*eein(1,4))*Ax
+ hi(1)*Hsbulk0/dl + hi(1)*Ax*delta0*rhos*Kcebs0*(hsc0 - hse0)
+ hi(1)*Ax*(1-fcw0*delta0-delta0)*(1-ed0)*sigma(rge0(componentlist)*cpgcge(componentlist))*(Tge0-Tref)
+ hi(1)*Ax*(1-fcw0*delta0-delta0)*(1-ed0)*rhos*ap*hp0*(Tge0-Tse0) + hi(1)*pi*dx*ht0*dThx0*Nx*Cr;
/*
$Tse0*cps*rhos*Ax*(1-fcw0*delta0-delta0)*(1-ed0)*hi(i) = Je(1,1)*(-9*hse0 + 10.0488101064944*hse(1,1) -1.38214240374537*hse(1,2)+0.333333305331110*hse(1,3))*Ax
+ hi(i)*Ax*delta0*rhos*Kcebs0*(hsc0 - hse0)
+ hi(i)*Ax*(1-fcw0*delta0-delta0)*(1-ed0)*sigma(rge0(componentlist)*cpgcge(componentlist))*(Tge0-Tref)
+ hi(i)*Ax*(1-fcw0*delta0-delta0)*(1-ed0)*rhos*ap*hp0*(Tge0-Tse0) + hi(i)*pi*dx*ht0*dThx0*Nx*Cr;
*/
ELSE
Tse0 = SolidIn.T;
ENDIF
for i in [1:M] do
for k in [1:2] do
IF IPselectz == "Rigorous" THEN
$ne(componentlist)(i,k)*Ax*(1-fcw(i,k)*delta(i,k)-delta(i,k))*(1-ed(i,k))*rhos*hi(i) = (weightJ(1,k)*cein(componentlist)(i,1)+weightJ(2,k)*cein(componentlist)(i,2)+weightJ(3,k)*cein(componentlist)(i,3)+weightJ(4,k)*cein(componentlist)(i,4))*Ax
+ hi(i)*Ksbulk(componentlist)(i,k)/dl + hi(i)*Ax*delta(i,k)*rhos*Kcebs(i,k)*(nc(componentlist)(i,k)-ne(componentlist)(i,k))
+ hi(i)*Ax*(1-fcw(i,k)*delta(i,k)-delta(i,k))*(1-ed(i,k))*rse(componentlist)(i,k);
ELSE
ne(componentlist)(i,k) = SorbIn_F*SorbIn_z(componentlist);
ENDIF
IF IPselectD == "Rigorous" THEN
$Tse(i,k)*cps*rhos*Ax*(1-fcw(i,k)*delta(i,k)-delta(i,k))*(1-ed(i,k))*hi(i) = (weightJ(1,k)*eein(i,1)+weightJ(2,k)*eein(i,2)+weightJ(3,k)*eein(i,3)+weightJ(4,k)*eein(i,4))*Ax
+ hi(i)*Hsbulk(i,k)/dl + hi(i)*Ax*delta(i,k)*rhos*Kcebs(i,k)*(hsc(i,k) - hse(i,k))
+ hi(i)*Ax*(1-fcw(i,k)*delta(i,k)-delta(i,k))*(1-ed(i,k))*sigma(rge(componentlist)(i,k)*cpgcge(componentlist))*(Tge(i,k)-Tref)
+ hi(i)*Ax*(1-fcw(i,k)*delta(i,k)-delta(i,k))*(1-ed(i,k))*rhos*ap*hp(i,k)*(Tge(i,k)-Tse(i,k)) + hi(i)*pi*dx*ht(i,k)*dThx(i,k)*Nx*Cr;
ELSE
Tse(i,k) = SolidIn.T;
ENDIF
endfor
endfor
for i in [1:M-1] do
for k in [3] do
IF IPselectz == "Rigorous" THEN
$ne(componentlist)(i,k)*Ax*(1-fcw(i,k)*delta(i,k)-delta(i,k))*(1-ed(i,k))*rhos*hi(i) = (-9*cein(componentlist)(i+1,1)+10.0488101064944*cein(componentlist)(i+1,2)-1.38214240374537*cein(componentlist)(i+1,3)+0.333333305331110*cein(componentlist)(i+1,4))*Ax
+ hi(i)*Ksbulk(componentlist)(i,k)/dl + hi(i)*Ax*delta(i,k)*rhos*Kcebs(i,k)*(nc(componentlist)(i,k)-ne(componentlist)(i,k))
+ hi(i)*Ax*(1-fcw(i,k)*delta(i,k)-delta(i,k))*(1-ed(i,k))*rse(componentlist)(i,k);
ELSE
ne(componentlist)(i,k) = SorbIn_F*SorbIn_z(componentlist);
ENDIF
IF IPselectD == "Rigorous" THEN
$Tse(i,k)*cps*rhos*Ax*(1-fcw(i,k)*delta(i,k)-delta(i,k))*(1-ed(i,k))*hi(i) = (-9*eein(i+1,1)+10.0488101064944*eein(i+1,2)-1.38214240374537*eein(i+1,3)+0.333333305331110*eein(i+1,4))*Ax
+ hi(i)*Hsbulk(i,k)/dl + hi(i)*Ax*delta(i,k)*rhos*Kcebs(i,k)*(hsc(i,k) - hse(i,k))
+ hi(i)*Ax*(1-fcw(i,k)*delta(i,k)-delta(i,k))*(1-ed(i,k))*sigma(rge(componentlist)(i,k)*cpgcge(componentlist))*(Tge(i,k)-Tref)
+ hi(i)*Ax*(1-fcw(i,k)*delta(i,k)-delta(i,k))*(1-ed(i,k))*rhos*ap*hp(i,k)*(Tge(i,k)-Tse(i,k)) + hi(i)*pi*dx*ht(i,k)*dThx(i,k)*Nx*Cr;
ELSE
Tse(i,k) = Tsc(i,k);
ENDIF
endfor
endfor
if ipselectz == "rigorous" then
// ne(componentlist)(M,3) = SorbIn_F*SorbIn_z(componentlist);
nc(componentlist)(M,3)*Jc(M,4)*Ax + Sit*SorbIn_F*SorbIn_z(componentlist)= ne(componentlist)(M,3)*Je(M,4)*Ax + Sot*SorbOut_F*SorbOut_z(componentlist);
else
// ne(componentlist)(M,3) = SorbIn_F*SorbIn_z(componentlist);
ne("n2")(M,3)=1.6;
ne("co2")(M,3)=0.165;
ne("h2o")(M,3)=0.67;
endif
IF IPselectD == "Rigorous" THEN
hsc(M,3)*Jc(M,4)*Ax + Sit*hsint = hse(M,3)*Je(M,4)*Ax + Sot*hse(M,3);
ELSE
Tse(M,3) = Solidin.T;
ENDIF
//related variables
for i in [1:M] do
for k in [1:3] do
cein(componentlist)(i,k+1)=Je(i,k+1)*ne(componentlist)(i,k);
eein(i,k+1)=Je(i,k+1)*hse(i,k);
endfor
endfor
cein(componentlist)(1,1)= Je(1,1)*ne0(componentlist);
eein(1,1) = Je(1,1)*hse0;
//forward spatial difference for hxh and phx
-9*Phx(1,1)+10.0488*Phx(1,2)-1.3821*Phx(1,3)+0.3333*Phx(1,4) = dPhx*hi(1) + rhohx*1E-5*hi(1);
0 = (HXIn.F/3600)*(-9*hxh(1,1)+10.0488101064944*hxh(1,2)-1.38214240374537*hxh(1,3)+0.333333305331110*hxh(1,4)) - 1E-6*pi*dx*ht0*dThx0*Nx*Cr*hi(1);
for i in [1:M] do
for k in [1:2] do
bb2: weightJ(1,k)*Phx(i,1)+weightJ(2,k)*Phx(i,2)+weightJ(3,k)*Phx(i,3)+weightJ(4,k)*Phx(i,4) = dPhx*hi(i) + rhohx*1E-5*hi(i);
0 = (HXIn.F/3600)*(weightJ(1,k)*hxh(i,1)+weightJ(2,k)*hxh(i,2)+weightJ(3,k)*hxh(i,3)+weightJ(4,k)*hxh(i,4))- 1E-6*pi*dx*ht(i,k)*dThx(i,k)*Nx*Cr*hi(i);
endfor
endfor
for i in [1:M-1] do
for k in [3] do
bb2: -9*Phx(i+1,1)+10.0488*Phx(i+1,2)-1.3821*Phx(i+1,3)+0.3333*Phx(i+1,4) = dPhx*hi(i) + rhohx*1E-5*hi(i);
0 = (HXIn.F/3600)*(-9*hxh(i+1,1)+10.0488101064944*hxh(i+1,2)-1.38214240374537*hxh(i+1,3)+0.333333305331110*hxh(i+1,4))- 1E-6*pi*dx*ht(i,k)*dThx(i,k)*Nx*Cr*hi(i);
endfor
endfor
Phx(M,4) = HXIn.P;
0 = (HXIn.F/3600)*(HXIn.h - hxh(M,4));
vg*Ax*cbt*3600 = Gb;
// Reactor Performance
removal = 1 - GasOut.F*GasOut.z("CO2")/(GasIn.F*GasIn.z("CO2")); //delete
regeneration = 1 - SolidOut.Fm*SorbOut_F*(1-SorbOut_z("H2O"))/(SolidIn.Fm*SorbIn_F*(1-SorbIn_z("H2O"))); //delete
removal_per = removal*100; //delete
// Bubble Region Gas Flow Rate
Gb/3600 = vb*Ax*delta*cbt;
// Solids Flux Calculations
Ar = (dp^3)*rhog*(rhos-rhog)*gc/(mug^2);
// Cross-Sectional Average Voidage Calculation (K-L 2nd Ed., pg. 155, Eqn. 6.20)
(1 - e) = (1 - ed)*(1-delta);
// Calculating Bubble Rise Velocity (K-L 2nd Ed., pg. 116, Eqn. 5.3)
vbr*10 = 0.711*sqrt(gc*db)*10;
// Unconstrained Bubble Diameter Calculations (Horio and Nonaka (1987))
dbe = (Dt/4)*(-g1+g3)^2;
dbm = 2.59*(gc^(-0.2))*((vg-ve)*Ax)^0.4;
g1 = 2.56E-2*sqrt(Dt/gc)/vmf;
g2 = Dt*((g1+g3)^2)/4;
g3 = sqrt(g1^2+4*dbm/Dt);
db0 = 1.38*(gc^(-0.2))*((vg0-ve0)*Ao)^0.4;
fc = 3*(vmf/emf)/(vbr-(vmf/emf));
// Emulsion Solid Loading Calculations
w_H2O = ne("H2O");
w_Bic = ne("CO2");
w_Car = ne("N2");
w_t = w_H2O + w_Bic + w_Car;
// Solid Inter-Region Transfer Coefficient Calculation (K-L 2nd Ed, pg. 217, Eqn. 9.10)
Kcebs = 3*(1-ed)/((1-delta)*ed)*(ve/db);
// Bubble to Cloud-Wake Region Gas Heat Transfer Coefficient (K-L 2nd Ed., pg. 271, Eqn. 11.32, with Sit and Grace Improvement Factor)
Hbc = 1.32*4.5*vmf*cbt*cpg_mol/db + 5.85*sqrt((kg/1000)*cbt*cpg_mol)*(gc^0.25)/(db^(5/4));
// Cloud-Wake to Emulsion Region Gas Heat Transfer Coefficient (Based on K-L 2nd Ed., pg. 252, Eqn. 10.34 modified for heat transfer as per pg. 271)
Hce = 6.78*sqrt(ed*vb*(kg/1000)*cct*cpg_mol/(db^3));
// Convective Heat Transfer Coefficients
Nup*1E4 = 1E4*1000*hp*dp/kg;
// Particle Reynolds Number in Emulsion Region
Red = ve*dp*rhog/mug;
// Particle Nusselt Number in Emulsion Region (K-L 2nd Ed., pg. 269, Eqn. 11.27)
Nup*1E4 = 0.03*(Red^1.3)*1E4;
kpa = (3.58-2.5*ed)*kg*((kp/kg)^(0.46-0.46*ed));
// Fluidization Number
fn = vg/vmf;
// Residence Time of Emulsion Packets at Heat Exchanger Surface (Baskakov et al., Eqn. 6)
tau = 0.44*((dp*gc/((vmf^2)*((fn-ah)^2)))^0.14)*((dp/dx)^0.225);
// Fraction of Time Heat Exchanger Surface is Exposed to Emulsion Packets (Baskakov et al., Eqn. 7)
fb = 0.33*(((vmf^2)*((fn-ah)^2)/(dp*gc))^0.14);
// Dense Region Heat Transfer Coefficient (Mickley and Fairbanks Equation from Chen et al., Eqn. 5)
hd = 2*sqrt((kpa/1000)*rhos*cps*(1-ed)/(pi*tau));
Nuh = 0.009*(Ar^0.5)*(Pr^0.33);
Nuh = 1000*hl*dp/kg;
// Total Heat Transfer Coefficient (Baskakov et al., Eqn. 8)
ht = fb*hd + (1-fb)*hl;
// Heat Exchanger Fluid Inlet Enthalpy
HXIN_hl = -0.2831 - 2.9863e-06*(HXIn.P-1.3)+7.3855e-05*(HXIn.T-60);
HXIn.h = HXIn_hv*HXIn_vf + HXIn_hl*(1-HXIn_vf);
dThx = Ttube - Tse;
// Total Heat Transfer to Heat Exchanger
// Q = HXIn.F*(HXOut.h - HXIn.h); //delete
// Heat Transfer Fluid Inlet and Outlet Connections
HXIn.F = HXOut.F;
HXIn.z = HXOut.z;
HXOut.T = Thx0;
HXOut.P = Phx(1,1);
HXOut.h = hxh(1,1);
// HX Tube Wall Energy Balance
ht*dThx*Cr = hw*(Thx-Ttube);
10*1.75/(phis*emf^3)*(dp*vmf*rhog0/mug)^2 + 10*150*(1-emf)/(phis^2*emf^3)*(dp*vmf*rhog0/mug) = 10*dp^3*rhog0*(rhos-rhog0)*gc/mug^2;
for i in [1:M] do
for k in [1:2] do
ne_r(componentlist)(i,k) = ne(componentlist)(i,k+1);
hse_r(i,k) = hse(i,k+1);
endfor
endfor
for i in [1:M-1] do
ne_r(componentlist)(i,3) = ne(componentlist)(i+1,1);
hse_r(i,3) = hse(i+1,1);
endfor
ne_r(componentlist)(M,3) = ne(componentlist)(M,3);