benchmark_test.go 11 KB

  1. // Copyright (c) 2015 Couchbase, Inc.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. //
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package analysis_test
  15. import (
  16. "testing"
  17. ""
  18. ""
  19. ""
  20. )
  21. func BenchmarkAnalysis(b *testing.B) {
  22. for i := 0; i < b.N; i++ {
  23. cache := registry.NewCache()
  24. analyzer, err := cache.AnalyzerNamed(standard.Name)
  25. if err != nil {
  26. b.Fatal(err)
  27. }
  28. ts := analyzer.Analyze(bleveWikiArticle)
  29. freqs := analysis.TokenFrequency(ts, nil, true)
  30. if len(freqs) != 511 {
  31. b.Errorf("expected %d freqs, got %d", 511, len(freqs))
  32. }
  33. }
  34. }
  35. var bleveWikiArticle = []byte(`Boiling liquid expanding vapor explosion
  36. From Wikipedia, the free encyclopedia
  37. See also: Boiler explosion and Steam explosion
  38. Flames subsequent to a flammable liquid BLEVE from a tanker. BLEVEs do not necessarily involve fire.
  39. This article's tone or style may not reflect the encyclopedic tone used on Wikipedia. See Wikipedia's guide to writing better articles for suggestions. (July 2013)
  40. A boiling liquid expanding vapor explosion (BLEVE, /ˈblɛviː/ blev-ee) is an explosion caused by the rupture of a vessel containing a pressurized liquid above its boiling point.[1]
  41. Contents [hide]
  42. 1 Mechanism
  43. 1.1 Water example
  44. 1.2 BLEVEs without chemical reactions
  45. 2 Fires
  46. 3 Incidents
  47. 4 Safety measures
  48. 5 See also
  49. 6 References
  50. 7 External links
  51. Mechanism[edit]
  52. This section needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. (July 2013)
  53. There are three characteristics of liquids which are relevant to the discussion of a BLEVE:
  54. If a liquid in a sealed container is boiled, the pressure inside the container increases. As the liquid changes to a gas it expands - this expansion in a vented container would cause the gas and liquid to take up more space. In a sealed container the gas and liquid are not able to take up more space and so the pressure rises. Pressurized vessels containing liquids can reach an equilibrium where the liquid stops boiling and the pressure stops rising. This occurs when no more heat is being added to the system (either because it has reached ambient temperature or has had a heat source removed).
  55. The boiling temperature of a liquid is dependent on pressure - high pressures will yield high boiling temperatures, and low pressures will yield low boiling temperatures. A common simple experiment is to place a cup of water in a vacuum chamber, and then reduce the pressure in the chamber until the water boils. By reducing the pressure the water will boil even at room temperature. This works both ways - if the pressure is increased beyond normal atmospheric pressures, the boiling of hot water could be suppressed far beyond normal temperatures. The cooling system of a modern internal combustion engine is a real-world example.
  56. When a liquid boils it turns into a gas. The resulting gas takes up far more space than the liquid did.
  57. Typically, a BLEVE starts with a container of liquid which is held above its normal, atmospheric-pressure boiling temperature. Many substances normally stored as liquids, such as CO2, propane, and other similar industrial gases have boiling temperatures, at atmospheric pressure, far below room temperature. In the case of water, a BLEVE could occur if a pressurized chamber of water is heated far beyond the standard 100 °C (212 °F). That container, because the boiling water pressurizes it, is capable of holding liquid water at very high temperatures.
  58. If the pressurized vessel, containing liquid at high temperature (which may be room temperature, depending on the substance) ruptures, the pressure which prevents the liquid from boiling is lost. If the rupture is catastrophic, where the vessel is immediately incapable of holding any pressure at all, then there suddenly exists a large mass of liquid which is at very high temperature and very low pressure. This causes the entire volume of liquid to instantaneously boil, which in turn causes an extremely rapid expansion. Depending on temperatures, pressures and the substance involved, that expansion may be so rapid that it can be classified as an explosion, fully capable of inflicting severe damage on its surroundings.
  59. Water example[edit]
  60. Imagine, for example, a tank of pressurized liquid water held at 204.4 °C (400 °F). This tank would normally be pressurized to 1.7 MPa (250 psi) above atmospheric ("gauge") pressure. If the tank containing the water were to rupture, there would for a slight moment exist a volume of liquid water which would be
  61. at atmospheric pressure, and
  62. 204.4 °C (400 °F).
  63. At atmospheric pressure the boiling point of water is 100 °C (212 °F) - liquid water at atmospheric pressure cannot exist at temperatures higher than 100 °C (212 °F). At that moment, the water would boil and turn to vapour explosively, and the 204.4 °C (400 °F) liquid water turned to gas would take up a lot more volume than it did as liquid, causing a vapour explosion. Such explosions can happen when the superheated water of a steam engine escapes through a crack in a boiler, causing a boiler explosion.
  64. BLEVEs without chemical reactions[edit]
  65. It is important to note that a BLEVE need not be a chemical explosion—nor does there need to be a fire—however if a flammable substance is subject to a BLEVE it may also be subject to intense heating, either from an external source of heat which may have caused the vessel to rupture in the first place or from an internal source of localized heating such as skin friction. This heating can cause a flammable substance to ignite, adding a secondary explosion caused by the primary BLEVE. While blast effects of any BLEVE can be devastating, a flammable substance such as propane can add significantly to the danger.
  66. Bleve explosion.svg
  67. While the term BLEVE is most often used to describe the results of a container of flammable liquid rupturing due to fire, a BLEVE can occur even with a non-flammable substance such as water,[2] liquid nitrogen,[3] liquid helium or other refrigerants or cryogens, and therefore is not usually considered a type of chemical explosion.
  68. Fires[edit]
  69. BLEVEs can be caused by an external fire near the storage vessel causing heating of the contents and pressure build-up. While tanks are often designed to withstand great pressure, constant heating can cause the metal to weaken and eventually fail. If the tank is being heated in an area where there is no liquid, it may rupture faster without the liquid to absorb the heat. Gas containers are usually equipped with relief valves that vent off excess pressure, but the tank can still fail if the pressure is not released quickly enough.[1] Relief valves are sized to release pressure fast enough to prevent the pressure from increasing beyond the strength of the vessel, but not so fast as to be the cause of an explosion. An appropriately sized relief valve will allow the liquid inside to boil slowly, maintaining a constant pressure in the vessel until all the liquid has boiled and the vessel empties.
  70. If the substance involved is flammable, it is likely that the resulting cloud of the substance will ignite after the BLEVE has occurred, forming a fireball and possibly a fuel-air explosion, also termed a vapor cloud explosion (VCE). If the materials are toxic, a large area will be contaminated.[4]
  71. Incidents[edit]
  72. The term "BLEVE" was coined by three researchers at Factory Mutual, in the analysis of an accident there in 1957 involving a chemical reactor vessel.[5]
  73. In August 1959 the Kansas City Fire Department suffered its largest ever loss of life in the line of duty, when a 25,000 gallon (95,000 litre) gas tank exploded during a fire on Southwest Boulevard killing five firefighters. This was the first time BLEVE was used to describe a burning fuel tank.[citation needed]
  74. Later incidents included the Cheapside Street Whisky Bond Fire in Glasgow, Scotland in 1960; Feyzin, France in 1966; Crescent City, Illinois in 1970; Kingman, Arizona in 1973; a liquid nitrogen tank rupture[6] at Air Products and Chemicals and Mobay Chemical Company at New Martinsville, West Virginia on January 31, 1978 [1];Texas City, Texas in 1978; Murdock, Illinois in 1983; San Juan Ixhuatepec, Mexico City in 1984; and Toronto, Ontario in 2008.
  75. Safety measures[edit]
  76. [icon] This section requires expansion. (July 2013)
  77. Some fire mitigation measures are listed under liquefied petroleum gas.
  78. See also[edit]
  79. Boiler explosion
  80. Expansion ratio
  81. Explosive boiling or phase explosion
  82. Rapid phase transition
  83. Viareggio train derailment
  84. 2008 Toronto explosions
  85. Gas carriers
  86. Los Alfaques Disaster
  87. Lac-Mégantic derailment
  88. References[edit]
  89. ^ Jump up to: a b Kletz, Trevor (March 1990). Critical Aspects of Safety and Loss Prevention. London: Butterworth–Heinemann. pp. 43–45. ISBN 0-408-04429-2.
  90. Jump up ^ "Temperature Pressure Relief Valves on Water Heaters: test, inspect, replace, repair guide". Retrieved 2011-07-12.
  91. Jump up ^ Liquid nitrogen BLEVE demo
  92. Jump up ^ "Chemical Process Safety" (PDF). Retrieved 2011-07-12.
  93. Jump up ^ David F. Peterson, BLEVE: Facts, Risk Factors, and Fallacies, Fire Engineering magazine (2002).
  94. Jump up ^ "STATE EX REL. VAPOR CORP. v. NARICK". Supreme Court of Appeals of West Virginia. 1984-07-12. Retrieved 2014-03-16.
  95. External links[edit]
  96. Look up boiling liquid expanding vapor explosion in Wiktionary, the free dictionary.
  97. Wikimedia Commons has media related to BLEVE.
  98. BLEVE Demo on YouTube — video of a controlled BLEVE demo
  99. huge explosions on YouTube — video of propane and isobutane BLEVEs from a train derailment at Murdock, Illinois (3 September 1983)
  100. Propane BLEVE on YouTube — video of BLEVE from the Toronto propane depot fire
  101. Moscow Ring Road Accident on YouTube - Dozens of LPG tank BLEVEs after a road accident in Moscow
  102. Kingman, AZ BLEVE — An account of the 5 July 1973 explosion in Kingman, with photographs
  103. Propane Tank Explosions — Description of circumstances required to cause a propane tank BLEVE.
  104. Analysis of BLEVE Events at DOE Sites - Details physics and mathematics of BLEVEs.
  105. HID - SAFETY REPORT ASSESSMENT GUIDE: Whisky Maturation Warehouses - The liquor is aged in wooden barrels that can suffer BLEVE.
  106. Categories: ExplosivesFirefightingFireTypes of fireGas technologiesIndustrial fires and explosions`)