-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-base.html
312 lines (259 loc) · 16.2 KB
/
index-base.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Excel Psychrometrics Compiler</title>
<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-min.js'></script>
<script type='text/javascript' src='psy.js'></script>
<style type="text/css">
.original-input-grid-container {
display: grid;
grid-template-rows: 1fr 1fr;
grid-template-columns: min-content 10em;
align-items: center;
}
.original-input-grid-container>label {
white-space: nowrap;
padding-right: 1em;
}
.property-row {
margin-top: 1em;
margin-bottom: 1em;
}
body {
width: 90%;
margin: 0 auto;
font-family: sans-serif;
color: #1e1e1e;
padding-bottom: 2em;
}
.formula {
font-family: monospace;
}
#header-context {
width: 50em;
margin: 0 auto;
}
#header-context > h1 {
text-align: center;
}
.back-to-top {
font-size: 0.4em;
}
</style>
</head>
<body>
<div id="header-context">
<h1>What's the Point of this Page?</h1>
<p>
The point is this. Implementing portable, add-in functionality to spreadsheets (looking at you Excel) is a pain.
So much time is wasted recreating these formulas in spreadsheets and implementing them in other programming languages.
This page allows you to dynamically adjust input spreadsheet cells or variable names
and get the formulas you need. Never worry about typing in those psychrometric constants again.
Just modify the inputs for your particular spreadsheet and copy/paste the formula in.
</p>
<p>Apologies to the rest of the world - I'll get to implementing SI units at some point.</p>
<p>If you like this and want to help it spread, give it a star on <a href="https://github.com/mitchpaulus/psychrometric-excel-compiler">GitHub</a>!
Also check out:
<ul>
<li><a href="https://neobem.io">Neobem - Programming language for generating EnergyPlus and DOE-2 input files</a></li>
<li><a href="https://psychrochart.com">psychrochart.com - Online dynamic psychrometric chart</a></li>
<li><a href="https://mitchellt.com">mitchellt.com - personal homepage</a> </li>
</ul>
</p>
<p>
Starting with known variables:
<ul>
<li><a href="#dry-bulb-relative-humidity">Dry Bulb and Relative Humidity</a></li>
<li><a href="#dry-bulb-dew-point">Dry Bulb and Dew Point</a></li>
<li><a href="#dry-bulb-wet-bulb">Dry Bulb and Wet Bulb</a></li>
</ul>
</p>
</div>
<h1 id="dry-bulb-relative-humidity">Dry Bulb and Relative Humidity <a href="#header-context" class="back-to-top"> Back to top</a></h1>
<div class="original-input-grid-container">
<label>Dry Bulb Cell (°F)</label><input data-bind="textInput: t_rh.drybulb" />
<label>Relative Humidity Cell (0-1)</label><input data-bind="textInput: t_rh.rh" />
</div>
<div class="property-row">
<div><label>Saturated Partial Pressure in cell?</label><input type="checkbox" data-bind="checked: t_rh.pws.use_cell" /></div>
<div>
<label>Saturated Partial Pressure (psia)</label>
<input data-bind="visible: t_rh.pws.use_cell, textInput: t_rh.pws.cell" />
<span class="formula" data-bind="visible: !t_rh.pws.use_cell(), text: '=' + t_rh.pws.value()"> </span>
</div>
<div><button onclick="copyToClipboard('=' + viewModel.t_rh.pws.value())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Partial Pressure in cell?</label><input type="checkbox" data-bind="checked: t_rh.pw.use_cell" /></div>
<div>
<label>Partial Pressure (psia)</label>
<input data-bind="visible: t_rh.pw.use_cell, textInput: t_rh.pw.cell" />
<span class="formula" data-bind="visible: !t_rh.pw.use_cell(), text: '=' + t_rh.pw.value()"> </span>
</div>
<div><button onclick="copyToClipboard('=' + viewModel.t_rh.pw.value())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Humidity Ratio in cell?</label><input type="checkbox" data-bind="checked: t_rh.w.use_cell" /></div>
<div>
<label>Humidity Ratio (lbm H₂O/lbm d.a.)</label>
<input data-bind="visible: t_rh.w.use_cell, textInput: t_rh.w.cell" />
<span class="formula" data-bind="visible: !t_rh.w.use_cell(), text: '=' + t_rh.w.value()"> </span>
</div>
<div><button onclick="copyToClipboard('=' + viewModel.t_rh.w.value())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Enthalpy (BTU/lbm d.a.)</label><span class="formula" data-bind="text: '=' + t_rh.h()"></span></div>
<div><button onclick="copyToClipboard('=' + viewModel.t_rh.h())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Dew Point Temperature (°F)</label><span class="formula" data-bind="text: '=' + t_rh.tdp()"></span></div>
<div><button onclick="copyToClipboard('=' + viewModel.t_rh.tdp())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Specific Volume (ft³/lbm d.a.)</label><span class="formula" data-bind="text: '=' + t_rh.v()"></span></div>
<div><button onclick="copyToClipboard('=' + viewModel.t_rh.v())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Wet Bulb Temperature</label></div>
<p>If you're looking to calculate wet bulb temperature for many states, basic Excel is not going to
be the best option. You're really going to want an actual programming language for that.
</p>
</div>
<h1 id="dry-bulb-dew-point">Dry Bulb and Dew Point Temperature <a href="#header-context" class="back-to-top"> Back to top</a></h1>
<div class="original-input-grid-container">
<label>Dry Bulb Cell (°F)</label> <input data-bind="textInput: t_tdp.drybulb" />
<label>Dew Point Cell (°F)</label> <input data-bind="textInput: t_tdp.tdp" />
</div>
<div class="property-row">
<div><label>Partial Pressure in cell?</label><input type="checkbox" data-bind="checked: t_tdp.pw.use_cell" /></div>
<div>
<label>Partial Pressure (psia)</label>
<input data-bind="visible: t_tdp.pw.use_cell, textInput: t_tdp.pw.cell" />
<span class="formula" data-bind="visible: !t_tdp.pw.use_cell(), text: '=' + t_tdp.pw.value()"> </span>
</div>
<div><button onclick="copyToClipboard('=' + viewModel.t_tdp.pw.value())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Saturated Partial Pressure in cell?</label><input type="checkbox" data-bind="checked: t_tdp.pws.use_cell" /></div>
<div>
<label>Saturated Partial Pressure (psia)</label>
<input data-bind="visible: t_tdp.pws.use_cell, textInput: t_tdp.pws.cell" />
<span class="formula" data-bind="visible: !t_tdp.pws.use_cell(), text: '=' + t_tdp.pws.value()"> </span>
</div>
<div><button onclick="copyToClipboard('=' + viewModel.t_tdp.pws.value())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Humidity Ratio in cell?</label><input type="checkbox" data-bind="checked: t_tdp.w.use_cell" /></div>
<div>
<label>Humidity Ratio (lbm H₂O/lbm d.a.)</label>
<input data-bind="visible: t_tdp.w.use_cell, textInput: t_tdp.w.cell" />
<span class="formula" data-bind="visible: !t_tdp.w.use_cell(), text: '=' + t_tdp.w.value()"> </span>
</div>
<div><button onclick="copyToClipboard('=' + viewModel.t_tdp.w.value())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Relative Humidity (0-1)</label><span class="formula" data-bind="text: '=' + t_tdp.rh()"></span></div>
<div><button onclick="copyToClipboard('=' + viewModel.t_tdp.rh())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Enthalpy (BTU/lbm d.a.)</label><span class="formula" data-bind="text: '=' + t_tdp.h()"></span></div>
<div><button onclick="copyToClipboard('=' + viewModel.t_tdp.h())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Specific Volume (ft³/lbm d.a.)</label><span class="formula" data-bind="text: '=' + t_tdp.v()"></span></div>
<div><button onclick="copyToClipboard('=' + viewModel.t_tdp.v())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Wet Bulb Temperature</label></div>
<p>If you're looking to calculate wet bulb temperature for many states, basic Excel is not going to
be the best option. You're really going to want an actual programming language for that.
</p>
</div>
<h1 id="dry-bulb-wet-bulb">Dry Bulb and Wet Bulb Temperature <a href="#header-context" class="back-to-top"> Back to top</a></h1>
<div class="original-input-grid-container">
<label>Dry Bulb Cell (°F)</label> <input data-bind="textInput: t_twb.drybulb" />
<label>Wet Bulb Cell (°F)</label> <input data-bind="textInput: t_twb.twb" />
</div>
<div class="property-row">
<div><label>Absolute Wet Bulb Temperature in cell?</label><input type="checkbox" data-bind="checked: t_twb.twb_abs.use_cell" /></div>
<div>
<label>Absolute Wet Bulb Temperature (°R)</label>
<input data-bind="visible: t_twb.twb_abs.use_cell, textInput: t_twb.twb_abs.cell" />
<span class="formula" data-bind="visible: !t_twb.twb_abs.use_cell(), text: '=' + t_twb.twb_abs.value()"> </span>
</div>
<div><button onclick="copyToClipboard('=' + viewModel.t_twb.twb_abs.value())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>pws* Saturated Partial Pressure at Wet Bulb Temperature in cell?</label><input type="checkbox" data-bind="checked: t_twb.pws_star.use_cell" /></div>
<div>
<label>pws* Saturated Partial Pressure at Wet Bulb Temperature (psia)</label>
<input data-bind="visible: t_twb.pws_star.use_cell, textInput: t_twb.pws_star.cell" />
<span class="formula" data-bind="visible: !t_twb.pws_star.use_cell(), text: '=' + t_twb.pws_star.value()"> </span>
</div>
<div><button onclick="copyToClipboard('=' + viewModel.t_twb.pws_star.value())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>ω*, Saturated Humidity Ratio at Wet Bulb Temperature in cell?</label><input type="checkbox" data-bind="checked: t_twb.w_sat_twb.use_cell" /></div>
<div>
<label>ω*, Saturated Humidity Ratio at Wet Bulb Temperature (lbm H₂O/lbm d.a.)</label>
<input data-bind="visible: t_twb.w_sat_twb.use_cell, textInput: t_twb.w_sat_twb.cell" />
<span class="formula" data-bind="visible: !t_twb.w_sat_twb.use_cell(), text: '=' + t_twb.w_sat_twb.value()"> </span>
</div>
<div><button onclick="copyToClipboard('=' + viewModel.t_twb.w_sat_twb.value())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Humidity Ratio in cell?</label><input type="checkbox" data-bind="checked: t_twb.w.use_cell" /></div>
<div>
<label>Humidity Ratio (lbm H₂O/lbm d.a.)</label>
<input data-bind="visible: t_twb.w.use_cell, textInput: t_twb.w.cell" />
<span class="formula" data-bind="visible: !t_twb.w.use_cell(), text: '=' + t_twb.w.value()"> </span>
</div>
<div><button onclick="copyToClipboard('=' + viewModel.t_twb.w.value())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Absolute Dry Bulb Temperature in cell?</label><input type="checkbox" data-bind="checked: t_twb.drybulb_abs.use_cell" /></div>
<div>
<label>Absolute Dry Bulb Temperature (°R)</label>
<input data-bind="visible: t_twb.drybulb_abs.use_cell, textInput: t_twb.drybulb_abs.cell" />
<span class="formula" data-bind="visible: !t_twb.drybulb_abs.use_cell(), text: '=' + t_twb.drybulb_abs.value()"> </span>
</div>
<div><button onclick="copyToClipboard('=' + viewModel.t_twb.drybulb_abs.value())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Saturated Partial Pressure in cell?</label><input type="checkbox" data-bind="checked: t_twb.pws.use_cell" /></div>
<div>
<label>Saturated Partial Pressure (psia)</label>
<input data-bind="visible: t_twb.pws.use_cell, textInput: t_twb.pws.cell" />
<span class="formula" data-bind="visible: !t_twb.pws.use_cell(), text: '=' + t_twb.pws.value()"> </span>
</div>
<div><button onclick="copyToClipboard('=' + viewModel.t_twb.pws.value())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Partial Pressure in cell?</label><input type="checkbox" data-bind="checked: t_twb.pw.use_cell" /></div>
<div>
<label>Partial Pressure (psia)</label>
<input data-bind="visible: t_twb.pw.use_cell, textInput: t_twb.pw.cell" />
<span class="formula" data-bind="visible: !t_twb.pw.use_cell(), text: '=' + t_twb.pw.value()"> </span>
</div>
<div><button onclick="copyToClipboard('=' + viewModel.t_twb.pw.value())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Relative Humidity (0-1)</label><span class="formula" data-bind="text: '=' + t_twb.rh()"></span></div>
<div><button onclick="copyToClipboard('=' + viewModel.t_twb.rh())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Enthalpy (BTU/lbm d.a.)</label><span class="formula" data-bind="text: '=' + t_twb.h()"></span></div>
<div><button onclick="copyToClipboard('=' + viewModel.t_twb.h())">Copy to Clipboard</button></div>
</div>
<div class="property-row">
<div><label>Specific Volume (ft³/lbm d.a.)</label><span class="formula" data-bind="text: '=' + t_twb.v()"></span></div>
<div><button onclick="copyToClipboard('=' + viewModel.t_twb.v())">Copy to Clipboard</button></div>
</div>
<div data-bind="visible: !t_twb.pw.use_cell()"><span style="font-style: italic; color: red">Not going to show the dew point temperature until the partial pressure cell is specified.</span></div>
<div data-bind="visible: t_twb.pw.use_cell()" class="property-row">
<div><label>Dew Point Temperature (°F)</label><span class="formula" data-bind="text: '=' + t_twb.tdp()"></span></div>
<div><button onclick="copyToClipboard('=' + viewModel.t_twb.tdp())">Copy to Clipboard</button></div>
</div>
</body>
</html>