Friday, July 12, 2013

Toxics Primer

This post tries to explain how FACET3D handles toxic dispersions and what the various combinations of settings achieve. Toxic results are dependent on a number of settings, primarily found in two places. First, there is the dispersion object itself (Figure 1), which holds the dispersion data imported from PHAST at the core averaging time*. Second, there is the toxic options under the options form analysis tab (Figure 2).


Figure 1


Figure 2
FACET3D calculates two toxic results. First is the toxic concentration variable, which is a direct mapping of the plume concentration at the effect height onto the ground plane contour grid. Second is toxic lethality, either due to cross wind evacuation, stationary evacuation for a specified duration, or shelter in place lethality.
Starting with #2, the lethality calculation, all different types of lethality are calculated using the averaging time specified in the dispersion object form (Figure 1). This averaging time defaults to the PHAST toxic averaging time and is used to transform the dispersion cross section data (in the table) before it goes to the lethality calculations. Therefore, about 5 minutes is usually good since this is on the order of the time needed to evacuate. A larger value may be used if you are doing shelter in place lethality over 1 hour or a stationary evacuation using a duration longer than 5 minutes.
Back to #1, the toxic concentration, which also can use the averaging time in the dispersion form but may instead use the averaging time from the toxic options form (Figure 2) if either the Toxic Conc. Results as Equiv. Conc. checkbox or Concentration Transformation combo box options are selected.
Equivalent concentrations are simply the concentrations at each downwind distance that give the same dose for the supplied reference time as the dose given by the original concentration over the duration of the toxic plume. This feature allows plotting equivalent ERPG values when the release duration is less than 1 hour. If the release duration is >= 1 hour, equivalent and original concentrations will be the same.
Concentration Transformations map the original or equivalent concentrations (ppm) to a common baseline so chemicals with different ERPG values can all be shown on the same contour plot. For example, ERPG[1-3]->1,2,3 option will map a curve of decreasing concentrations in ppm vs. downwind distance to a curve passing through the integer values 1, 2, and 3 vs. downwind distance where the ERPG-1 concentration (ppm) gets mapped to the integer 1, the ERPG-2 concentration (ppm) gets mapped to the integer 2, etc. Then, if we request a contour plot of the value 3, we are effectively contouring through the ERPG-3 concentration for all chemicals.
* Averaging time with respect to dispersions is a way to account for the fact that the wind direction varies and does not blow directly downwind toward a target 100% of the time. A short averaging time (18.75 sec in PHAST) represents a near instantaneous snapshot of the dispersion and the centerline concentrations will be the maximum possible as if the wind was blowing directly toward the target. A higher averaging time will result in lower average centerline concentrations (beyond the passive transition zone) to account for the centerline of the plume only being directly over the target some of the time while at other times the target is slightly off centerline resulting in lower concentrations. Many toxic endpoint criteria (ERPG, IDLH) have an implied reference time (duration of exposure), and the averaging time should be set to match.

Tuesday, May 28, 2013

DPLOT Macros Save Time

Most of us have used DPlot at some point or another. Recently, I had a chance to use the extensive macro capabilities. I had FACET3D dump about 100 per building FN curves for a QRA in DPlot GRF format. Now I needed to add the customer criteria intolerable and acceptable curves, format as log-log, locate a legend, and save a PNG for the appendix. Below is what I came up with. The help file give lots of information on the various commands.

DPlot Macro 1.1a
Criteria
Directory(1)'last open
FileType(1) 'grf
ForFilesIn("*.grf")
  FileType(4) 'csv
  FileAppend("S:\_Projects\PATH to QRA\CLIENTCriteria.csv")
  FileType(1) 'grf
  ManualScale(0.9,,,,)
  Size(1,12,8,1)
  FileSaveAs(1,".grf")
  FileSaveAs("Portable Network Graphics",".png")
  FileClose()
NextFile

Directory(1) sets the working directory to the last file open directory. Just open the first file in the folder and close before running the macro.
ManualScale is nice in that you only need to set the bounds you want to explicitly set. I wanted the Xmin to start at 0.9 since all my data started at 1.

There are many more commands than these, but you can see it is possible to quickly format an folder full of DPlot files and dump images ready for the report. No intern required.

Wednesday, May 15, 2013

Low Reactivity Fuels in BST Method

The Baker-Strehlow-Tang (BST) method uses a low, medium, or high reactivity parameter as part of the flame speed lookup. Reactivity is a function of the laminar burning velocity (LBV) of the fuel. In FACET3D, LBV <= 40 cm/s will be low reactivity and LBV >= 75 cm/s will be high reactivity with values in between being medium reactivity. However, some fuels exhibit low reactivity behavior despite having LBV values above 40 cm/s. These fuels are listed in Woodward's CCPS book "Estimating the Flammable Mass of a Vapor Cloud" and are shown below. FACET3D will (as of 13.5.10) produce a warning if any BST threat references one of these chemicals and the LBV is > 40 cm/s.

Name                        CAS
3-Chloro-1-Propene          107051
Ammonia                     7664417
Bromotrifluoroethylene      598732
Carbon Monoxide             630080
1-Chloro-2,3-EpoxyPropane   106898
Ethanol                     64175
Ethyl Chloride              75003
Methane                     74828
Methanol                    67561
Methyl bromide              74839
Chloromethane               74873
Tetraethyl Lead             78002

Tuesday, May 14, 2013

Archiving CFD Data

Running CFD codes such as FLACS or CEBAM invariably produce a large amount of data files. When the files are ready to be archived, I prefer to compress the files. My requirements are that each file be compressed individually, which makes it easier to uncompress 1 file if you need to look at setup or results. Further, I want the entire process to be done from a command line with options for recursion into subfolders, skip files that have already been compressed, and delete the original after compression. Also, decompression should work via a commandline with the same options.
7Zip is the best out there IMO, but it's command line interface lacks some of the needed features above without resorting to a FOR loop in a batch file. I have been using gzip for windows which supports the requirements. Simply put gzip.exe in your path and use like this.
compress entire folder:  gzip -r *   where -r is recursive into subfolders
decompress entire folder gzip -rd *
Another option is the xz library, which uses LZMA compression (see 7zip) and is about 30% better than gzip compression. It works just like gzip but seems to be missing the -r option.
If you use FreeCommander, you can add either of the above tools to the Favorite Tools menu to get a quick button for archiving/unarchiving folders full of data.