dirtybomb
Version:
A dirty bomb model
1,637 lines (1,636 loc) • 271 kB
JSON
{
"type": "Program",
"body": [
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"local": {
"type": "Identifier",
"name": "GaussianPlume",
"range": [
52,
65
],
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 20
}
}
},
"range": [
52,
65
],
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 20
}
}
}
],
"source": {
"type": "Literal",
"value": "./GaussianPlume",
"raw": "'./GaussianPlume'",
"range": [
71,
88
],
"loc": {
"start": {
"line": 5,
"column": 26
},
"end": {
"line": 5,
"column": 43
}
}
},
"range": [
45,
89
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 44
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Created by austin on 6/8/16.\n ",
"range": [
0,
39
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 3
}
}
}
]
},
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportSpecifier",
"local": {
"type": "Identifier",
"name": "integrate",
"range": [
98,
107
],
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 17
}
}
},
"imported": {
"type": "Identifier",
"name": "integrate",
"range": [
98,
107
],
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 17
}
}
},
"range": [
98,
107
],
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 17
}
}
}
],
"source": {
"type": "Literal",
"value": "./utils",
"raw": "'./utils'",
"range": [
114,
123
],
"loc": {
"start": {
"line": 6,
"column": 24
},
"end": {
"line": 6,
"column": 33
}
}
},
"range": [
90,
124
],
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 34
}
},
"trailingComments": [
{
"type": "Line",
"value": "const GAS_CONSTANT = 8.3144598;",
"range": [
127,
160
],
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 9,
"column": 33
}
}
},
{
"type": "Block",
"value": "*\n * Models a discrete release for constant atmospheric\n * http://www.cerc.co.uk/environmental-software/assets/data/doc_techspec/CERC_ADMS5_P10_01_P12_01.pdf pg 17\n * http://www.sciencedirect.com/science/article/pii/S0093641303000247\n ",
"range": [
162,
401
],
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 15,
"column": 3
}
}
}
]
},
{
"type": "Identifier",
"id": {
"type": "Identifier",
"name": "GaussianPuff",
"range": [
408,
420
],
"loc": {
"start": {
"line": 16,
"column": 6
},
"end": {
"line": 16,
"column": 18
}
}
},
"superClass": {
"type": "Identifier",
"name": "GaussianPlume",
"range": [
429,
442
],
"loc": {
"start": {
"line": 16,
"column": 27
},
"end": {
"line": 16,
"column": 40
}
}
},
"body": {
"type": "ClassBody",
"body": [
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "constructor",
"range": [
577,
588
],
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 24,
"column": 15
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "atmosphere",
"range": [
589,
599
],
"loc": {
"start": {
"line": 24,
"column": 16
},
"end": {
"line": 24,
"column": 26
}
}
},
{
"type": "Identifier",
"name": "source",
"range": [
601,
607
],
"loc": {
"start": {
"line": 24,
"column": 28
},
"end": {
"line": 24,
"column": 34
}
}
},
{
"type": "Identifier",
"name": "massReleased",
"range": [
609,
621
],
"loc": {
"start": {
"line": 24,
"column": 36
},
"end": {
"line": 24,
"column": 48
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Super",
"range": [
633,
638
],
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 13
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "atmosphere",
"range": [
639,
649
],
"loc": {
"start": {
"line": 25,
"column": 14
},
"end": {
"line": 25,
"column": 24
}
}
},
{
"type": "Identifier",
"name": "source",
"range": [
651,
657
],
"loc": {
"start": {
"line": 25,
"column": 26
},
"end": {
"line": 25,
"column": 32
}
}
}
],
"range": [
633,
658
],
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 33
}
}
},
"range": [
633,
659
],
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 34
}
},
"trailingComments": [
{
"type": "Block",
"value": "*\n * @type {number}\n * @private\n ",
"range": [
668,
729
],
"loc": {
"start": {
"line": 26,
"column": 8
},
"end": {
"line": 29,
"column": 11
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
738,
742
],
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "_massReleased",
"range": [
743,
756
],
"loc": {
"start": {
"line": 30,
"column": 13
},
"end": {
"line": 30,
"column": 26
}
}
},
"range": [
738,
756
],
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 26
}
}
},
"right": {
"type": "Identifier",
"name": "massReleased",
"range": [
759,
771
],
"loc": {
"start": {
"line": 30,
"column": 29
},
"end": {
"line": 30,
"column": 41
}
}
},
"range": [
738,
771
],
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 41
}
}
},
"range": [
738,
772
],
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 42
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * @type {number}\n * @private\n ",
"range": [
668,
729
],
"loc": {
"start": {
"line": 26,
"column": 8
},
"end": {
"line": 29,
"column": 11
}
}
}
]
}
],
"range": [
623,
778
],
"loc": {
"start": {
"line": 24,
"column": 50
},
"end": {
"line": 31,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
588,
778
],
"loc": {
"start": {
"line": 24,
"column": 15
},
"end": {
"line": 31,
"column": 5
}
}
},
"kind": "constructor",
"computed": false,
"range": [
577,
778
],
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 31,
"column": 5
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n *\n * @param {Atmosphere} atmosphere\n * @param {Source} source\n * @param {number} massReleased\n ",
"range": [
450,
572
],
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 23,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n *\n * @returns {number}\n ",
"range": [
784,
827
],
"loc": {
"start": {
"line": 33,
"column": 4
},
"end": {
"line": 36,
"column": 7
}
}
}
],
"static": false
},
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "massReleased",
"range": [
836,
848
],
"loc": {
"start": {
"line": 37,
"column": 8
},
"end": {
"line": 37,
"column": 20
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
868,
872
],
"loc": {
"start": {
"line": 38,
"column": 15
},
"end": {
"line": 38,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "_massReleased",
"range": [
873,
886
],
"loc": {
"start": {
"line": 38,
"column": 20
},
"end": {
"line": 38,
"column": 33
}
}
},
"range": [
868,
886
],
"loc": {
"start": {
"line": 38,
"column": 15
},
"end": {
"line": 38,
"column": 33
}
}
},
"range": [
861,
887
],
"loc": {
"start": {
"line": 38,
"column": 8
},
"end": {
"line": 38,
"column": 34
}
}
}
],
"range": [
851,
893
],
"loc": {
"start": {
"line": 37,
"column": 23
},
"end": {
"line": 39,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
848,
893
],
"loc": {
"start": {
"line": 37,
"column": 20
},
"end": {
"line": 39,
"column": 5
}
}
},
"kind": "get",
"computed": false,
"range": [
832,
893
],
"loc": {
"start": {
"line": 37,
"column": 4
},
"end": {
"line": 39,
"column": 5
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n *\n * @returns {number}\n ",
"range": [
784,
827
],
"loc": {
"start": {
"line": 33,
"column": 4
},
"end": {
"line": 36,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": " /!**\n * Could potentially move this to the General Gaussian Plume\n * Not necessarily specific to the Puff\n * @see https://en.wikipedia.org/wiki/Root-mean-square_speed\n * @returns {number} m/s\n *!/\n getRms() {\n return Math.sqrt(\n (3 * this.getAtmosphere().getTemperature() * GAS_CONSTANT) / this.getMolarMass()\n );\n }",
"range": [
896,
1271
],
"loc": {
"start": {
"line": 42,
"column": 0
},
"end": {
"line": 52,
"column": 7
}
}
},
{
"type": "Block",
"value": "*\n * The center at x meters downstream after t seconds\n * @param {number} t - seconds after release\n * @returns {number} - meters downwind\n ",
"range": [
1277,
1437
],
"loc": {
"start": {
"line": 54,
"column": 4
},
"end": {
"line": 58,
"column": 7
}
}
}
],
"static": false
},
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "getCenterX",
"range": [
1442,
1452
],
"loc": {
"start": {
"line": 59,
"column": 4
},
"end": {
"line": 59,
"column": 14
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "t",
"range": [
1453,
1454
],
"loc": {
"start": {
"line": 59,
"column": 15
},
"end": {
"line": 59,
"column": 16
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "windAtSource",
"range": [
1470,
1482
],
"loc": {
"start": {
"line": 60,
"column": 12
},
"end": {
"line": 60,
"column": 24
}
}
},
"init": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
1485,
1489
],
"loc": {
"start": {
"line": 60,
"column": 27
},
"end": {
"line": 60,
"column": 31
}
}
},
"property": {
"type": "Identifier",
"name": "windSpeedAtSourceHeight",
"range": [
1490,
1513
],
"loc": {
"start": {
"line": 60,
"column": 32
},
"end": {
"line": 60,
"column": 55
}
}
},
"range": [
1485,
1513
],
"loc": {
"start": {
"line": 60,
"column": 27
},
"end": {
"line": 60,
"column": 55
}
}
},
"range": [
1470,
1513
],
"loc": {
"start": {
"line": 60,
"column": 12
},
"end": {
"line": 60,
"column": 55
}
}
}
],
"kind": "let",
"range": [
1466,
1514
],
"loc": {
"start": {
"line": 60,
"column": 8
},
"end": {
"line": 60,
"column": 56
}
}
},
{
"type": "ReturnStatement",
"argument": {
"type": "BinaryExpression",
"operator": "*",
"left": {
"type": "Identifier",
"name": "windAtSource",
"range": [
1530,
1542
],
"loc": {
"start": {
"line": 61,
"column": 15
},
"end": {
"line": 61,
"column": 27
}
}
},
"right": {
"type": "Identifier",
"name": "t",
"range": [
1545,
1546
],
"loc": {
"start": {
"line": 61,
"column": 30
},
"end": {
"line": 61,
"column": 31
}
}
},
"range": [
1530,
1546
],
"loc": {
"start": {
"line": 61,
"column": 15
},
"end": {
"line": 61,
"column": 31
}
}
},
"range": [
1523,
1547
],
"loc": {
"start": {
"line": 61,
"column": 8
},
"end": {
"line": 61,
"column": 32
}
},
"trailingComments": [
{
"type": "Block",
"value": "return integrate(0, t, () => {\n return windAtSource;\n });",
"range": [
1556,
1635
],
"loc": {
"start": {
"line": 62,
"column": 8
},
"end": {
"line": 64,
"column": 13
}
}
}
]
}
],
"range": [
1456,
1641
],
"loc": {
"start": {
"line": 59,
"column": 18
},
"end": {
"line": 65,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
1452,
1641
],
"loc": {
"start": {
"line": 59,
"column": 14
},
"end": {
"line": 65,
"column": 5
}
}
},
"kind": "method",
"computed": false,
"range": [
1442,
1641
],
"loc": {
"start": {
"line": 59,
"column": 4
},
"end": {
"line": 65,
"column": 5
}
},
"leadingComments": [
{
"type": "Block",
"value": " /!**\n * Could potentially move this to the General Gaussian Plume\n * Not necessarily specific to the Puff\n * @see https://en.wikipedia.org/wiki/Root-mean-square_speed\n * @returns {number} m/s\n *!/\n getRms() {\n return Math.sqrt(\n (3 * this.getAtmosphere().getTemperature() * GAS_CONSTANT) / this.getMolarMass()\n );\n }",
"range": [
896,
1271
],
"loc": {
"start": {
"line": 42,
"column": 0
},
"end": {
"line": 52,
"column": 7
}
}
},
{
"type": "Block",
"value": "*\n * The center at x meters downstream after t seconds\n * @param {number} t - seconds after release\n * @returns {number} - meters downwind\n ",
"range": [
1277,
1437
],
"loc": {
"start": {
"line": 54,
"column": 4
},
"end": {
"line": 58,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n * @see http://www.sciencedirect.com/science/article/pii/S0093641303000247 Section 3.2, equation 14\n * @override\n * @param {number} x - downwind (m)\n * @param {number} y - crosswind (m)\n * @param {number} z - height (m)\n * @param {number} t - seconds from start\n * @returns {number}\n ",
"range": [
1647,
1969
],
"loc": {
"start": {
"line": 67,
"column": 4
},
"end": {
"line": 75,
"column": 7
}
}
}
],
"static": false
},
{
"type": "MethodDefinition",
"key": {
"type": "Identifier",
"name": "getConcentration",
"range": [
1974,
1990
],
"loc": {
"start": {
"line": 76,
"column": 4
},
"end": {
"line": 76,
"column": 20
}
}
},
"value": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "x",
"range": [
1991,
1992
],
"loc": {
"start": {
"line": 76,
"column": 21
},
"end": {
"line": 76,
"column": 22
}
}
},
{
"type": "Identifier",
"name": "y",
"range": [
1994,
1995
],
"loc": {
"start": {
"line": 76,
"column": 24
},
"end": {
"line": 76,
"column": 25
}
}
},
{
"type": "Identifier",
"name": "z",
"range": [
1997,
1998
],
"loc": {
"start": {
"line": 76,
"column": 27
},
"end": {
"line": 76,
"column": 28
}
}
},
{
"type": "Identifier",
"name": "t",
"range": [
2000,
2001
],
"loc": {
"start": {
"line": 76,
"column": 30
},
"end": {
"line": 76,
"column": 31
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "deltaD",
"range": [
2017,
2023
],
"loc": {
"start": {
"line": 77,
"column": 12
},
"end": {
"line": 77,
"column": 18
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
2026,
2030
],
"loc": {
"start": {
"line": 77,
"column": 21
},
"end": {
"line": 77,
"column": 25
}
}
},
"property": {
"type": "Identifier",
"name": "getCenterX",
"range": [
2031,
2041
],
"loc": {
"start": {
"line": 77,
"column": 26
},
"end": {
"line": 77,
"column": 36
}
}
},
"range": [
2026,
2041
],
"loc": {
"start": {
"line": 77,
"column": 21
},
"end": {
"line": 77,
"column": 36
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "t",
"range": [
2042,
2043
],
"loc": {
"start": {
"line": 77,
"column": 37
},
"end": {
"line": 77,
"column": 38
}
}
}
],
"range": [
2026,
2044
],
"loc": {
"start": {
"line": 77,
"column": 21
},
"end": {
"line": 77,
"column": 39
}
}
},
"range": [
2017,
2044
],
"loc": {
"start": {
"line": 77,
"column": 12
},
"end": {
"line": 77,
"column": 39
}
}
}
],
"kind": "let",
"range": [
2013,
2045
],
"loc": {
"start": {
"line": 77,
"column": 8
},
"end": {
"line": 77,
"column": 40
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "stdY",
"range": [
2058,
2062
],
"loc": {
"start": {
"line": 78,
"column": 12
},
"end": {
"line": 78,
"column": 16
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
2065,
2069
],
"loc": {
"start": {
"line": 78,
"column": 19
},
"end": {
"line": 78,
"column": 23
}
}
},
"property": {
"type": "Identifier",
"name": "getStdY",
"range": [
2070,
2077
],
"loc": {
"start": {
"line": 78,
"column": 24
},
"end": {
"line": 78,
"column": 31
}
}
},
"range": [
2065,
2077
],
"loc": {
"start": {
"line": 78,
"column": 19
},
"end": {
"line": 78,
"column": 31
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "deltaD",
"range": [
2078,
2084
],
"loc": {
"start": {
"line": 78,
"column": 32
},
"end": {
"line": 78,
"column": 38
}
}
}
],
"range": [
2065,
2085
],
"loc": {
"start": {
"line": 78,
"column": 19
},
"end": {
"line": 78,
"column": 39
}
}
},
"range": [
2058,
2085
],
"loc": {
"start": {
"line": 78,
"column": 12
},
"end": {
"line": 78,
"column": 39
}
}
}
],
"kind": "let",
"range": [
2054,
2086
],
"loc": {
"start": {
"line": 78,
"column": 8
},
"end": {
"line": 78,
"column": 40
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "stdZ",
"range": [
2099,
2103
],