Skip to content

Commit e8bf252

Browse files
committed
Version 2_1_2
1 parent fd0fa5d commit e8bf252

17 files changed

+10319
-0
lines changed

05252017_simulator_backup

+591
Large diffs are not rendered by default.

HPLC_model_copy.js

+161
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
function conv_ParticleSize(particleSize) {
2+
//this function converts microns to centimeters
3+
return particleSize / 10000;
4+
}
5+
6+
function calculateLength(particleSize) {
7+
//this function calculates the v value associated with
8+
//set values of velocity, then uses v to find h, which
9+
//is used to find H.
10+
//V = (velocity * particleSize) / (0.00001)
11+
//h = 1+(5/V)+(0.05*V)
12+
//H = h * particleSize
13+
var plateHeights = []
14+
var Ue_values = [0.01,0.1,0.25,0.5,0.75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3];
15+
16+
for (var i = 0; i < Ue_values.length; i++) {
17+
var V = (Ue_values[i] * particleSize) / 0.00001 ;
18+
var h = (1 + (5 / V) + (0.05 * V));
19+
plateHeights[i] = h * particleSize;
20+
21+
}
22+
23+
//this part of the function returns the value of the length
24+
//corresponding to constant plate number values
25+
//Length = plateNumber * plateHeight
26+
var Plate_Length = [];
27+
var plateNumbers = [1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,15000,20000,25000,30000];
28+
for (var i = 0; i < plateNumbers.length; i++){
29+
Plate_Length[i] = []
30+
for (var j = 0; j < plateHeights.length; j++){
31+
Plate_Length[i][j] = (plateNumbers[i] * plateHeights[j]);
32+
}
33+
}
34+
35+
//this part solves for the length values corresponding
36+
//with each Ue (velocity) value at 600 and 1000 bar pressure
37+
//Length = (Pressure * particleSize) / (500 * Ue)
38+
39+
var Ue_values = [0.01,0.1,0.25,0.5,0.75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3];
40+
var L_600P = [];
41+
var L_1000P = [];
42+
43+
for (var i = 0; i < Ue_values.length; i++) {
44+
L_600P[i] = (600 * particleSize * particleSize * 10000 * 10000) / (500 * Ue_values[i]);
45+
L_1000P[i] = (1000 * particleSize * particleSize * 10000 * 10000) / (500 * Ue_values[i]);
46+
}
47+
48+
//this will produce constant time lines
49+
50+
var Ue_values = [0.01,0.1,0.25,0.5,0.75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3];
51+
52+
var Length_t_1s = []
53+
var Length_t_2s = []
54+
var Length_t_5s = []
55+
var Length_t_10s = []
56+
var Length_t_20s = []
57+
var Length_t_40s = []
58+
var Length_t_80s = []
59+
60+
for (var i = 0; i < Ue_values.length; i++) {
61+
Length_t_1s[i] = Ue_values[i];
62+
Length_t_2s[i] = 2 * Ue_values[i];
63+
Length_t_5s[i] = 5 * Ue_values[i];
64+
Length_t_10s[i] = 10 * Ue_values[i];
65+
Length_t_20s[i] = 20 * Ue_values[i];
66+
Length_t_40s[i] = 40 * Ue_values[i];
67+
Length_t_80s[i] = 80 * Ue_values[i];
68+
}
69+
70+
var Time_Lengths = [Length_t_1s,Length_t_2s,Length_t_5s,Length_t_10s,Length_t_20s,Length_t_40s,Length_t_80s];
71+
72+
//var x_values = Ue_values;
73+
//var y_values = [Length_from_N,Pressure_Lengths_A,Pressure_Lengths_B,Time_Lengths]
74+
75+
var hex = ["#FF0000","#FF5900","#FF7100","#FFB100","#D7EC0C","#58D76E","#58D76E","#58D76E","#58D76E","#58D76E","#1646B5","#9508B3","#CC061D","#CC061D"]
76+
var traces = []
77+
for (var i = 0; i < plateNumbers.length; i++) {
78+
traces[i] = {
79+
x: Ue_values,
80+
y: Plate_Length[i],
81+
mode: 'lines',
82+
line: {
83+
color: hex[i],
84+
dash: 'solid',
85+
shape: 'spline'
86+
},
87+
hoverinfo: 'none'
88+
}
89+
}
90+
traces[plateNumbers.length] = {
91+
x: Ue_values,
92+
y: L_600P,
93+
mode: 'lines',
94+
line: {
95+
color: '#000000',
96+
dash: 'solid',
97+
shape: 'spline'
98+
},
99+
hoverinfo: 'none'
100+
}
101+
102+
traces[plateNumbers.length + 1] = {
103+
x: Ue_values,
104+
y: L_1000P,
105+
mode: 'lines',
106+
line: {
107+
color: '#000000',
108+
dash: 'solid',
109+
shape: 'spline'
110+
},
111+
hoverinfo: 'none'
112+
}
113+
114+
for (i = 0; i < Time_Lengths.length; i++) {
115+
traces[plateNumbers.length + 2 + i] = {
116+
x: Ue_values,
117+
y: Time_Lengths[i],
118+
mode: 'lines',
119+
line: {
120+
color: '#000000',
121+
dash: 'dot',
122+
shape: 'spline'
123+
},
124+
hoverinfo: 'none'
125+
}
126+
127+
}
128+
129+
var layout = {
130+
title: 'Title of Graph',
131+
xaxis: {
132+
range: [0, 3],
133+
autorange: false,
134+
title: 'Interstitial Velocity (cm/s)'
135+
},
136+
yaxis: {
137+
range: [0, 15],
138+
autorange: false,
139+
title: 'Length (cm)'
140+
},
141+
showlegend: false
142+
};
143+
144+
Plotly.newPlot('graph', traces, layout)
145+
146+
}
147+
148+
function main(particleSize) {
149+
calculateLength(conv_ParticleSize(particleSize));
150+
}
151+
152+
153+
154+
155+
156+
157+
158+
159+
160+
161+

LCGC Index.txt

+1
Large diffs are not rendered by default.
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
var debugLog = true;
2+
var logGeneral = true;
3+
var logCalculations = true;
4+
var logInputValues = true;
5+
var logReturnValues = true;
6+
var logIntermediateValues = true;
7+
8+
function log(type, msg){
9+
var logEnabled = false;
10+
if(debugLog && logGeneral && type == "gen"){
11+
logEnabled = true;
12+
}
13+
if(debugLog && logCalculations && type == "cal"){
14+
logEnabled = true;
15+
}
16+
if(debugLog && logInputValues && type == "inp"){
17+
logEnabled = true;
18+
}
19+
if(debugLog && logReturnValues && type == "ret"){
20+
logEnabled = true;
21+
}
22+
if(debugLog && logIntermediateValues && type == "int"){
23+
logEnabled = true;
24+
}
25+
26+
if(logEnabled){
27+
var logCache = "";
28+
var t = getCurrentTime();
29+
logCache += logCounter + ") " + t + " -\n\t" + msg;
30+
logCache += "\n--------------------------------------------------------------------------------\n";
31+
console.log(logCache);
32+
logCounter++;
33+
}
34+
}
35+
36+
log("gen", "");
37+
log("cal", "");
38+
log("inp", "");
39+
log("ret", "");
40+
log("int", "");

0 commit comments

Comments
 (0)