Robert Elder commited on
Commit
5965ba2
·
1 Parent(s): 053a1c9

adding more solvent viscosities

Browse files
quantity_module/data/solvent-viscosity.xlsx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:64b17f91b472ef9b99721bcc01c233e168e0e2eec883867c17539c5d6865052a
3
- size 16550
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e7e6db2025e749d7cc282fcd5d8e2ae1f96b59d66329aef1555ee5a533ac0eb
3
+ size 18595
quantity_module/quantity.py CHANGED
@@ -55,7 +55,6 @@ def exp_post():
55
  iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = ResolveChemical(chemName, IDtype, get_properties=get_properties)
56
 
57
  if error > 0:
58
- # TODO output more useful info
59
  return render_template('quantity_error.html', message=f'Uh-oh! Something went wrong. We were unable to match your chemical. Please return to the previous page and try a different identifier. <br><br>Error code: {error} <br>Error message: {ERROR_CODES[error]} ')
60
 
61
  #MW = SigFigs(MW, 6)
@@ -108,10 +107,9 @@ def exp_post():
108
  ## extent of swelling, V_swelled/V_unswelled
109
  Swelling_volfrac = Polymer_Density / (Solvent_Density * (1/Swelling_wtfrac-1) + Polymer_Density)
110
  Qv = 1+Swelling_volfrac/(1-Swelling_volfrac)
111
- # TODO check that swelling is physically possible
112
  if Solvent_Volume < Polymer_Volume*(Qv-1):
113
  return render_template('quantity_error.html', message=f'Based on the information provided, the amount of swelling appears physically impossible. Please check the values you entered.')
114
- #return render_template('quantity_error.html', message=f'Based on the swelling weight percent ({Swelling_percent}%), the polymer density ({Polymer_Density} g/cm<sup>3</sup>), and the solvent density ({Solvent_Density} g/cm<sup>3</sup>), the polymer volume ({Polymer_Volume} cm<sup>3</sup>), ')
115
 
116
  if units == 'mg':
117
  mass_units = mass*1e3
@@ -119,7 +117,6 @@ def exp_post():
119
  mass_units = mass*1e6
120
 
121
  polymer = request.form['polymer']
122
- pIndex = np.argmax(polymers == polymer)
123
 
124
  # QRF is implemented for 25-75 C
125
  if polymer == 'Other polymer':
@@ -145,6 +142,7 @@ def exp_post():
145
  M0_pred = get_M_dist(D_dist_swell, M_expt, Polymer_Volume, Surface_Area, Solvent_Volume, Extraction_Time*3600, K_expt=K_expt, Qv=Qv)
146
  else:
147
  ## use categories
 
148
  CHRIS_category = categories[pIndex]
149
  CHRIS_flag = None
150
  if CHRIS_category is None:
 
55
  iupac, cas, smiles, MW, LogP, rho, mp, molImage, error = ResolveChemical(chemName, IDtype, get_properties=get_properties)
56
 
57
  if error > 0:
 
58
  return render_template('quantity_error.html', message=f'Uh-oh! Something went wrong. We were unable to match your chemical. Please return to the previous page and try a different identifier. <br><br>Error code: {error} <br>Error message: {ERROR_CODES[error]} ')
59
 
60
  #MW = SigFigs(MW, 6)
 
107
  ## extent of swelling, V_swelled/V_unswelled
108
  Swelling_volfrac = Polymer_Density / (Solvent_Density * (1/Swelling_wtfrac-1) + Polymer_Density)
109
  Qv = 1+Swelling_volfrac/(1-Swelling_volfrac)
110
+ # check that swelling is physically possible (swollen polymer volume is less than polymer+solvent volume)
111
  if Solvent_Volume < Polymer_Volume*(Qv-1):
112
  return render_template('quantity_error.html', message=f'Based on the information provided, the amount of swelling appears physically impossible. Please check the values you entered.')
 
113
 
114
  if units == 'mg':
115
  mass_units = mass*1e3
 
117
  mass_units = mass*1e6
118
 
119
  polymer = request.form['polymer']
 
120
 
121
  # QRF is implemented for 25-75 C
122
  if polymer == 'Other polymer':
 
142
  M0_pred = get_M_dist(D_dist_swell, M_expt, Polymer_Volume, Surface_Area, Solvent_Volume, Extraction_Time*3600, K_expt=K_expt, Qv=Qv)
143
  else:
144
  ## use categories
145
+ pIndex = np.argmax(polymers == polymer)
146
  CHRIS_category = categories[pIndex]
147
  CHRIS_flag = None
148
  if CHRIS_category is None:
quantity_module/templates/quantity_index.html CHANGED
@@ -130,8 +130,10 @@ please see the <a href="{{url_for('.static', filename='RST.html')}}"> RST inform
130
  <h4 class="modal-title">Polymer Matrix</h4>
131
  </div>
132
  <div class="modal-body">
133
- <p><em>Matrix</em> - Please select your polymer matrix from the list. If your polymer is
134
- not listed below, please select &#34;Other polymer&#34;. For polymer mixtures/blends, co-polymers, or composites (e.g. glass fiber reinforced matrices), the component or phase that is worst-case for exposure, i.e. the softest or least glassy (lowest T<sub>g</sub>) component can be selected if listed (which, in turn, assumes the entire system is composed of the worst-case component or phase). In these scenarios, a justification should be provided for the choice of worst-case component of the polymer system. </p>
 
 
135
  <p><em>Mass</em> - Enter the mass of the polymer matrix in grams.</p>
136
  <p><em>Density</em> - Enter the estimated density of the polymer matrix in grams per cubic centimeter. Note that a rough estimate (e.g. +/- 10%) is acceptable.</p>
137
  <p><em>Glass transition temperature</em> - Enter the T<sub>g</sub> of the polymer matrix in degrees Celsius. Note that the extraction temperature must be higher than T<sub>g</sub> to use this module. </p>
@@ -178,7 +180,7 @@ please see the <a href="{{url_for('.static', filename='RST.html')}}"> RST inform
178
  <p><em>Solvent</em> - Select the extraction solvent from the list.
179
  <p><em>Solvent volume</em> - Enter the volume of solvent used for extraction.
180
  <p><em>Swelling amount</em> - Enter the amount of swelling by the extraction solvent in weight percent (i.e., change in mass divided by initial mass times 100).
181
- Adjust the measured weight percent to account for crystallinity, if any (i.e., divide the measured about by the amorphous fraction).
182
  <p><em>Partition coefficient</em> - If known, enter the polymer/solvent partition coefficient of the extractable.
183
  If not known, the default worst-case value of 10 can be used for typical device polymers, hydrophobic extractables, and semi- or non-polar extraction solvents.
184
  </div>
@@ -192,80 +194,7 @@ please see the <a href="{{url_for('.static', filename='RST.html')}}"> RST inform
192
 
193
  <p><button type="submit">Estimate total quantity</button></p>
194
 
195
- <!--
196
- <h4> Exposure assessment <button type=button class="Info_btn" data-toggle="modal" data-target="#ExposureModal">&#9432;</button> </h4>
197
- Cumulative exposure duration(s):
198
- <input type="checkbox" id="exposure1d" name="exposure1d" value="exposure1d" checked=True, disabled=True>
199
- <label for="exposure1d">1 day</label>
200
- <input type="checkbox" id="exposure30d" name="exposure30d" value="exposure30d" checked=True>
201
- <label for="exposure30d">30 days</label>
202
- <input type="checkbox" id="exposureuser" name="exposureuser" value="exposureuser" checked=True onclick="javascript:exposureuserCheck();">
203
- <label for="exposureuser">Other duration (days)</label>
204
- <span id="exposureuserspan" style="visibility:hidden">
205
- &nbsp; <input name="exposureuserbox" id="exposureuserbox" step="any" min="0.001" max="36500" value="365" type="number" size=5 required><br><br>
206
- </span>
207
- <div id="ExposureModal" class="modal fade" role="dialog">
208
- <div class="modal-dialog">
209
- <div class="modal-content">
210
- <div class="modal-header">
211
- <h4 class="modal-title">Exposure assessment</h4>
212
- </div>
213
- <div class="modal-body">
214
- <p><em>Cumulative exposure duration(s)</em> Check the boxes for the exposure duration(s) to use for cumulative release estimates. 1-day exposure is always calculated.
215
- If the "Other duration" box is checked, enter the desired exposure duration in days (e.g., the maximum use duration of the device).
216
- Note that this calculation assumes a single device is used for the entire duration. If multiple devices are used concurrently or sequentially (e.g., daily replacement), this should be accounted for during toxicological risk assessment.</p>
217
- </div>
218
- <div class="modal-footer">
219
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
220
- </div>
221
- </div>
222
- </div>
223
- </div>
224
- -->
225
-
226
  </form>
227
 
228
- <!-- Javascript to reveal/hide polymer input box (show/hide Tg)
229
-
230
- <script type="text/javascript">
231
- function polymerCheck() {
232
- if (document.getElementById('polymer').value == 'Other polymer') {
233
- document.getElementById('otherpolymer').style.visibility = 'visible';
234
- } else {
235
- document.getElementById('otherpolymer').style.visibility = 'hidden';
236
- document.getElementById('polytg').value = '';
237
- }
238
- }
239
- $(window).on('pageshow', function() { polymerCheck(); });
240
- </script> -->
241
-
242
- <!-- Javascript to reveal/hide exposure duration input box (limited contact)
243
-
244
- <script type="text/javascript">
245
- function exposureCheck() {
246
- if (document.getElementById('limited').checked) {
247
- document.getElementById('limitedtime').style.visibility = 'visible';
248
- } else {
249
- document.getElementById('limitedtime').style.visibility = 'hidden';
250
- document.getElementById('time').value = '24';
251
- }
252
- }
253
- $(window).on('pageshow', function() { exposureCheck(); });
254
- </script> -->
255
-
256
- <!-- Javascript to reveal/hide cumulative exposure duration box
257
-
258
- <script type="text/javascript">
259
- function exposureuserCheck() {
260
- if (document.getElementById('exposureuser').checked) {
261
- document.getElementById('exposureuserspan').style.visibility = 'visible';
262
- } else {
263
- document.getElementById('exposureuserspan').style.visibility = 'hidden';
264
- document.getElementById('exposureuserspan').value = '365';
265
- }
266
- }
267
- $(window).on('pageshow', function() { exposureuserCheck(); });
268
- </script> -->
269
-
270
  </body>
271
  </html>
 
130
  <h4 class="modal-title">Polymer Matrix</h4>
131
  </div>
132
  <div class="modal-body">
133
+ <p><em>Matrix</em> - Please select your polymer matrix from the list. If your polymer is not listed below, please select &#34;Other polymer&#34;.
134
+ For polymer mixtures/blends, co-polymers, or composites (e.g. glass fiber reinforced matrices), the component or phase that is worst-case for exposure,
135
+ i.e. the softest or least glassy (lowest T<sub>g</sub>) component can be selected if listed (which, in turn, assumes the entire system is composed of the worst-case component or phase).
136
+ In these scenarios, a justification should be provided for the choice of worst-case component of the polymer system. </p>
137
  <p><em>Mass</em> - Enter the mass of the polymer matrix in grams.</p>
138
  <p><em>Density</em> - Enter the estimated density of the polymer matrix in grams per cubic centimeter. Note that a rough estimate (e.g. +/- 10%) is acceptable.</p>
139
  <p><em>Glass transition temperature</em> - Enter the T<sub>g</sub> of the polymer matrix in degrees Celsius. Note that the extraction temperature must be higher than T<sub>g</sub> to use this module. </p>
 
180
  <p><em>Solvent</em> - Select the extraction solvent from the list.
181
  <p><em>Solvent volume</em> - Enter the volume of solvent used for extraction.
182
  <p><em>Swelling amount</em> - Enter the amount of swelling by the extraction solvent in weight percent (i.e., change in mass divided by initial mass times 100).
183
+ Adjust the measured weight percent to account for crystallinity, if any (i.e., divide the weight percent by the amorphous fraction).
184
  <p><em>Partition coefficient</em> - If known, enter the polymer/solvent partition coefficient of the extractable.
185
  If not known, the default worst-case value of 10 can be used for typical device polymers, hydrophobic extractables, and semi- or non-polar extraction solvents.
186
  </div>
 
194
 
195
  <p><button type="submit">Estimate total quantity</button></p>
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  </form>
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  </body>
200
  </html>