-
Notifications
You must be signed in to change notification settings - Fork 0
/
Globals.js
96 lines (96 loc) · 2.91 KB
/
Globals.js
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
let RGERG;
let NcGERG = 21;
let MaxFlds = 21;
let MaxMdl = 10;
let MaxTrmM = 12;
let MaxTrmP= 24;
let Epsilon = 0.000000000000001; //1d-15
let coik=zeros([MaxFlds, MaxTrmP]);
let doik=zeros([MaxFlds, MaxTrmP]);
let dijk=zeros([MaxMdl, MaxTrmM]);
let mNumb=zeros([MaxFlds, MaxFlds]);
let kpol=Array(MaxFlds+1).fill(0);
let kexp=Array(MaxFlds+1).fill(0);
let kpolij=Array(MaxMdl+1).fill(0);
let kexpij=Array(MaxMdl+1).fill(0);
let Drold=0;
let Trold=0;
let Told;
let Trold2;
let xold=Array(MaxFlds+1).fill(0);
let Dc=Array(MaxFlds+1).fill(0);
let Tc=Array(MaxFlds+1).fill(0);
let MMiGERG=Array(MaxFlds+1).fill(0);
let Vc3=Array(MaxFlds+1).fill(0);
let Tc2=Array(MaxFlds+1).fill(0);
let cijk=zeros([MaxMdl, MaxTrmM]);
let noik=zeros([MaxFlds, MaxTrmP]);
let toik=zeros([MaxFlds, MaxTrmP]);
let eijk=zeros([MaxMdl, MaxTrmM]);
let gijk=zeros([MaxMdl, MaxTrmM]);
let nijk=zeros([MaxMdl, MaxTrmM]);
let tijk=zeros([MaxMdl, MaxTrmM]);
let btij=zeros([MaxFlds, MaxFlds]);
let bvij=zeros([MaxFlds, MaxFlds]);
let gtij=zeros([MaxFlds, MaxFlds]);
let gvij=zeros([MaxFlds, MaxFlds]);
let fij=zeros([MaxFlds, MaxFlds]);
let th0i=zeros([MaxFlds, 7]);
let n0i=zeros([MaxFlds, 7]);
let taup=zeros([MaxFlds, MaxTrmP]);
let taupijk=zeros([MaxFlds, MaxTrmM]);
let dPdDsave; //Calculated in the PressureGERG subroutine, but not included as an argument since it is only used internally in the density algorithm.
let RGross=0;
let NcGross = 21;
let RDetail;
const NcDetail = 21;
let NTerms = 58;
let fn=Array(NTerms+1).fill(0);
let gn=Array(NTerms+1).fill(0);
let qn=Array(NTerms+1).fill(0);
let an=Array(NTerms+1).fill(0);
let bn=Array(NTerms+1).fill(0);
let kn=Array(NTerms+1).fill(0);
let un=Array(NTerms+1).fill(0);
let Bsnij2=zeros([MaxFlds, MaxFlds,18]);
let Bs=Array(18+1).fill(0);
let Csn=Array(NTerms+1).fill(0);
let Fi=Array(MaxFlds+1).fill(0);
let Gi=Array(MaxFlds+1).fill(0);
let Qi=Array(MaxFlds+1).fill(0);
let Ki25=Array(MaxFlds+1).fill(0);
let Ei25=Array(MaxFlds+1).fill(0);
let Kij5=zeros([MaxFlds, MaxFlds]);
let Uij5=zeros([MaxFlds, MaxFlds]);
let Gij5=zeros([MaxFlds, MaxFlds]);
let Tun=Array(NTerms+1).fill(0);
let MMiDetail=Array(MaxFlds+1).fill(0);
let K3=0;
let mN2=0;
let mCO2=0;
let xHN=Array(MaxFlds+1).fill(0);
let MMiGross=Array(MaxFlds+1).fill(0);
let b0=zeros([3, 3]);
let b1=zeros([3, 3]);
let b2=zeros([3, 3]);
let bCHx=zeros([2, 2]);
let cCHx=zeros([2, 2]);
let c0=zeros([3, 3, 3]);
let c1=zeros([3, 3, 3]);
let c2=zeros([3, 3, 3]);
let x=Array(22).fill(0);
let InputFromXLS=null;
function zeros(dimensions) {
var array = [];
for (var i = 0; i <= dimensions[0]; ++i) {
array.push(dimensions.length == 1 ? 0 : zeros(dimensions.slice(1)));
}
return array;
}
function zeros2( DimensionA, DimensionB){
let array = Array(DimensionA);
for (let i = 0; i < DimensionA; ++i){
array[i] = Array(DimensionB).fill(0);
}
return array;
}