Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
I updated all the documentation, but forgot about the README, which is possibly the first place anyone looks.
  • Loading branch information
aefarrell committed Jan 7, 2024
1 parent 1291e91 commit 3ac6ce0
Showing 1 changed file with 28 additions and 35 deletions.
63 changes: 28 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,33 @@ pkg> add GasDispersion

## Example usage

This scenario is adapted from CCPS *Guidelines for Consequence Analysis of
Chemical Releases*, CCPS, pg 47.

Suppose we wish to model the dispersion of gaseous propane from a leak from a storage
tank, where the leak is from a 10 mm hole that is 3.5 m above the ground and the
propane is at 25°C and 4barg. Assume the discharge coefficient $c_{D} = 0.85$

For ambient conditions we assume the atmosphere is dry air at standard conditions
of 1atm and 25°C, with a windspeed of 1.5m/s and class F stability (a "worst case"
atmospheric stability)
Suppose we wish to model the dispersion of gaseous propane from a leak from a storage tank, where the leak is from a 10mm hole that is 3.5m above the ground and the propane is at 25°C and 4barg. Assume the discharge coefficient $c_{D} = 0.85$. This scenario is adapted from CCPS *Guidelines for Consequence Analysis of Chemical Releases*

First we define the scenario

```julia
using GasDispersion

propane = Substance(name = :propane,
gas_density = 9.7505, # kg/m^3, NIST Webbook
liquid_density = 526.13, # kg/m^3, NIST Webbook
reference_temp= 298.15, # K
reference_pressure= 501325, # Pa
boiling_temp = 231.04, # K, NIST Webbook
latent_heat = 425740.0, # J/kg,
gas_heat_capacity = 1678.0, # J/kg/K,
liquid_heat_capacity = 2520.0) # J/kg/K,

scn = scenario_builder(propane, JetSource;
propane = Substance(name="propane",
molar_weight=0.044096, # kg/mol
liquid_density=526.13, # kg/m³
k=1.142,
boiling_temp=231.02, # K
latent_heat=425740, # J/kg
gas_heat_capacity=1678, # J/kg/K
liquid_heat_capacity=2520) # J/kg/K

Patm = 101325 # Pa
P1 = 4e5 + Patm # Pa
T1 = 25 + 273.15 # K

scn = scenario_builder(propane, JetSource;
phase = :gas,
diameter = 0.01, # m
diameter = 0.01, # m
dischargecoef = 0.85,
k = 1.15, # heat capacity ratio, from Crane's
temperature = T1, # K
pressure = P1, # Pa
height = 3.5, # m, height of hole above the ground
duration = 1) # s, duration of release
height = 3.5) # m, height of hole above the ground
```

This generates a `Scenario` defined for a gas jet discharging into dry air
Expand All @@ -66,18 +59,18 @@ concentration at any point downwind of the release point, assuming the release
is a continuous plume, using

```julia
# returns a callable
pl = plume(scn, GaussianPlume)

pl(x,y,z) # gives the concentration in vol fraction at the point x, y, z
p = plume(scn, GaussianPlume)
```
where the coordinate system is such that the release point is at x=0, y=0, z=h

Similarly we could model an instantaneous release, assuming all of the mass was
released during 1 second, using a "puff" model
Where `p` is a callable which returns the concentration (in vol fraction) at any point. For example at 100m downwind and at a height of 2m

```julia
# returns a function
pf = puff(scn, GaussianPuff)
p(100,0,2)

# output

0.0002006455298894473

p(x,y,z,t) # gives the concentration in vol fraction at the point x, y, z and time t
```

See [the documentation](https://aefarrell.github.io/GasDispersion.jl/dev/) for details on the additional plume and puff models and worked examples.

0 comments on commit 3ac6ce0

Please sign in to comment.