floodmodeller-api 0.4.2__py3-none-any.whl → 0.4.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- floodmodeller_api/__init__.py +8 -9
- floodmodeller_api/_base.py +184 -176
- floodmodeller_api/backup.py +273 -273
- floodmodeller_api/dat.py +909 -838
- floodmodeller_api/diff.py +136 -119
- floodmodeller_api/ied.py +307 -311
- floodmodeller_api/ief.py +647 -646
- floodmodeller_api/ief_flags.py +253 -253
- floodmodeller_api/inp.py +266 -268
- floodmodeller_api/libs/libifcoremd.dll +0 -0
- floodmodeller_api/libs/libifcoremt.so.5 +0 -0
- floodmodeller_api/libs/libifport.so.5 +0 -0
- floodmodeller_api/{libmmd.dll → libs/libimf.so} +0 -0
- floodmodeller_api/libs/libintlc.so.5 +0 -0
- floodmodeller_api/libs/libmmd.dll +0 -0
- floodmodeller_api/libs/libsvml.so +0 -0
- floodmodeller_api/libs/libzzn_read.so +0 -0
- floodmodeller_api/libs/zzn_read.dll +0 -0
- floodmodeller_api/logs/__init__.py +2 -2
- floodmodeller_api/logs/lf.py +320 -314
- floodmodeller_api/logs/lf_helpers.py +354 -346
- floodmodeller_api/logs/lf_params.py +643 -529
- floodmodeller_api/mapping.py +84 -0
- floodmodeller_api/test/__init__.py +4 -4
- floodmodeller_api/test/conftest.py +9 -8
- floodmodeller_api/test/test_backup.py +117 -117
- floodmodeller_api/test/test_dat.py +221 -92
- floodmodeller_api/test/test_data/All Units 4_6.DAT +1081 -1081
- floodmodeller_api/test/test_data/All Units 4_6.feb +1081 -1081
- floodmodeller_api/test/test_data/BRIDGE.DAT +926 -926
- floodmodeller_api/test/test_data/Culvert_Inlet_Outlet.dat +36 -36
- floodmodeller_api/test/test_data/Culvert_Inlet_Outlet.feb +36 -36
- floodmodeller_api/test/test_data/DamBreakADI.xml +52 -52
- floodmodeller_api/test/test_data/DamBreakFAST.xml +58 -58
- floodmodeller_api/test/test_data/DamBreakFAST_dy.xml +53 -53
- floodmodeller_api/test/test_data/DamBreakTVD.xml +55 -55
- floodmodeller_api/test/test_data/DefenceBreach.xml +53 -53
- floodmodeller_api/test/test_data/DefenceBreachFAST.xml +60 -60
- floodmodeller_api/test/test_data/DefenceBreachFAST_dy.xml +55 -55
- floodmodeller_api/test/test_data/Domain1+2_QH.xml +76 -76
- floodmodeller_api/test/test_data/Domain1_H.xml +41 -41
- floodmodeller_api/test/test_data/Domain1_Q.xml +41 -41
- floodmodeller_api/test/test_data/Domain1_Q_FAST.xml +48 -48
- floodmodeller_api/test/test_data/Domain1_Q_FAST_dy.xml +48 -48
- floodmodeller_api/test/test_data/Domain1_Q_xml_expected.json +263 -0
- floodmodeller_api/test/test_data/Domain1_W.xml +41 -41
- floodmodeller_api/test/test_data/EX1.DAT +321 -321
- floodmodeller_api/test/test_data/EX1.ext +107 -107
- floodmodeller_api/test/test_data/EX1.feb +320 -320
- floodmodeller_api/test/test_data/EX1.gxy +107 -107
- floodmodeller_api/test/test_data/EX17.DAT +421 -422
- floodmodeller_api/test/test_data/EX17.ext +213 -213
- floodmodeller_api/test/test_data/EX17.feb +422 -422
- floodmodeller_api/test/test_data/EX18.DAT +375 -375
- floodmodeller_api/test/test_data/EX18_DAT_expected.json +3876 -0
- floodmodeller_api/test/test_data/EX2.DAT +302 -302
- floodmodeller_api/test/test_data/EX3.DAT +926 -926
- floodmodeller_api/test/test_data/EX3_DAT_expected.json +16235 -0
- floodmodeller_api/test/test_data/EX3_IEF_expected.json +61 -0
- floodmodeller_api/test/test_data/EX6.DAT +2084 -2084
- floodmodeller_api/test/test_data/EX6.ext +532 -532
- floodmodeller_api/test/test_data/EX6.feb +2084 -2084
- floodmodeller_api/test/test_data/EX6_DAT_expected.json +31647 -0
- floodmodeller_api/test/test_data/Event Data Example.DAT +336 -336
- floodmodeller_api/test/test_data/Event Data Example.ext +107 -107
- floodmodeller_api/test/test_data/Event Data Example.feb +336 -336
- floodmodeller_api/test/test_data/Linked1D2D.xml +52 -52
- floodmodeller_api/test/test_data/Linked1D2DFAST.xml +53 -53
- floodmodeller_api/test/test_data/Linked1D2DFAST_dy.xml +48 -48
- floodmodeller_api/test/test_data/Linked1D2D_xml_expected.json +313 -0
- floodmodeller_api/test/test_data/blockage.dat +50 -50
- floodmodeller_api/test/test_data/blockage.ext +45 -45
- floodmodeller_api/test/test_data/blockage.feb +9 -9
- floodmodeller_api/test/test_data/blockage.gxy +71 -71
- floodmodeller_api/test/test_data/defaultUnits.dat +127 -127
- floodmodeller_api/test/test_data/defaultUnits.ext +45 -45
- floodmodeller_api/test/test_data/defaultUnits.feb +9 -9
- floodmodeller_api/test/test_data/defaultUnits.fmpx +58 -58
- floodmodeller_api/test/test_data/defaultUnits.gxy +85 -85
- floodmodeller_api/test/test_data/ex3.ief +20 -20
- floodmodeller_api/test/test_data/ex3.lf1 +2800 -2800
- floodmodeller_api/test/test_data/ex4.DAT +1374 -1374
- floodmodeller_api/test/test_data/ex4_changed.DAT +1374 -1374
- floodmodeller_api/test/test_data/example1.inp +329 -329
- floodmodeller_api/test/test_data/example2.inp +158 -158
- floodmodeller_api/test/test_data/example3.inp +297 -297
- floodmodeller_api/test/test_data/example4.inp +388 -388
- floodmodeller_api/test/test_data/example5.inp +147 -147
- floodmodeller_api/test/test_data/example6.inp +154 -154
- floodmodeller_api/test/test_data/jump.dat +176 -176
- floodmodeller_api/test/test_data/network.dat +1374 -1374
- floodmodeller_api/test/test_data/network.ext +45 -45
- floodmodeller_api/test/test_data/network.exy +1 -1
- floodmodeller_api/test/test_data/network.feb +45 -45
- floodmodeller_api/test/test_data/network.ied +45 -45
- floodmodeller_api/test/test_data/network.ief +20 -20
- floodmodeller_api/test/test_data/network.inp +147 -147
- floodmodeller_api/test/test_data/network.pxy +57 -57
- floodmodeller_api/test/test_data/network.zzd +122 -122
- floodmodeller_api/test/test_data/network_dat_expected.json +21837 -0
- floodmodeller_api/test/test_data/network_from_tabularCSV.csv +87 -87
- floodmodeller_api/test/test_data/network_ied_expected.json +287 -0
- floodmodeller_api/test/test_data/rnweir.dat +9 -9
- floodmodeller_api/test/test_data/rnweir.ext +45 -45
- floodmodeller_api/test/test_data/rnweir.feb +9 -9
- floodmodeller_api/test/test_data/rnweir.gxy +45 -45
- floodmodeller_api/test/test_data/rnweir_default.dat +74 -74
- floodmodeller_api/test/test_data/rnweir_default.ext +45 -45
- floodmodeller_api/test/test_data/rnweir_default.feb +9 -9
- floodmodeller_api/test/test_data/rnweir_default.fmpx +58 -58
- floodmodeller_api/test/test_data/rnweir_default.gxy +53 -53
- floodmodeller_api/test/test_data/unit checks.dat +16 -16
- floodmodeller_api/test/test_ied.py +29 -29
- floodmodeller_api/test/test_ief.py +125 -24
- floodmodeller_api/test/test_inp.py +47 -48
- floodmodeller_api/test/test_json.py +114 -0
- floodmodeller_api/test/test_logs_lf.py +48 -51
- floodmodeller_api/test/test_tool.py +165 -154
- floodmodeller_api/test/test_toolbox_structure_log.py +234 -239
- floodmodeller_api/test/test_xml2d.py +151 -156
- floodmodeller_api/test/test_zzn.py +36 -34
- floodmodeller_api/to_from_json.py +218 -0
- floodmodeller_api/tool.py +332 -330
- floodmodeller_api/toolbox/__init__.py +5 -5
- floodmodeller_api/toolbox/example_tool.py +45 -45
- floodmodeller_api/toolbox/model_build/__init__.py +2 -2
- floodmodeller_api/toolbox/model_build/add_siltation_definition.py +100 -94
- floodmodeller_api/toolbox/model_build/structure_log/__init__.py +1 -1
- floodmodeller_api/toolbox/model_build/structure_log/structure_log.py +287 -289
- floodmodeller_api/toolbox/model_build/structure_log_definition.py +76 -72
- floodmodeller_api/units/__init__.py +10 -10
- floodmodeller_api/units/_base.py +214 -209
- floodmodeller_api/units/boundaries.py +467 -469
- floodmodeller_api/units/comment.py +52 -55
- floodmodeller_api/units/conduits.py +382 -403
- floodmodeller_api/units/helpers.py +123 -132
- floodmodeller_api/units/iic.py +107 -101
- floodmodeller_api/units/losses.py +305 -308
- floodmodeller_api/units/sections.py +444 -445
- floodmodeller_api/units/structures.py +1690 -1684
- floodmodeller_api/units/units.py +93 -102
- floodmodeller_api/units/unsupported.py +44 -44
- floodmodeller_api/units/variables.py +87 -89
- floodmodeller_api/urban1d/__init__.py +11 -11
- floodmodeller_api/urban1d/_base.py +188 -177
- floodmodeller_api/urban1d/conduits.py +93 -85
- floodmodeller_api/urban1d/general_parameters.py +58 -58
- floodmodeller_api/urban1d/junctions.py +81 -79
- floodmodeller_api/urban1d/losses.py +81 -74
- floodmodeller_api/urban1d/outfalls.py +114 -107
- floodmodeller_api/urban1d/raingauges.py +111 -108
- floodmodeller_api/urban1d/subsections.py +92 -93
- floodmodeller_api/urban1d/xsections.py +147 -141
- floodmodeller_api/util.py +77 -21
- floodmodeller_api/validation/parameters.py +660 -660
- floodmodeller_api/validation/urban_parameters.py +388 -404
- floodmodeller_api/validation/validation.py +110 -112
- floodmodeller_api/version.py +1 -1
- floodmodeller_api/xml2d.py +688 -684
- floodmodeller_api/xml2d_template.py +37 -37
- floodmodeller_api/zzn.py +387 -365
- {floodmodeller_api-0.4.2.dist-info → floodmodeller_api-0.4.3.dist-info}/LICENSE.txt +13 -13
- {floodmodeller_api-0.4.2.dist-info → floodmodeller_api-0.4.3.dist-info}/METADATA +82 -82
- floodmodeller_api-0.4.3.dist-info/RECORD +179 -0
- {floodmodeller_api-0.4.2.dist-info → floodmodeller_api-0.4.3.dist-info}/WHEEL +1 -1
- floodmodeller_api-0.4.3.dist-info/entry_points.txt +3 -0
- floodmodeller_api/libifcoremd.dll +0 -0
- floodmodeller_api/test/test_data/EX3.bmp +0 -0
- floodmodeller_api/test/test_data/test_output.csv +0 -87
- floodmodeller_api/zzn_read.dll +0 -0
- floodmodeller_api-0.4.2.data/scripts/fmapi-add_siltation.bat +0 -2
- floodmodeller_api-0.4.2.data/scripts/fmapi-add_siltation.py +0 -3
- floodmodeller_api-0.4.2.data/scripts/fmapi-structure_log.bat +0 -2
- floodmodeller_api-0.4.2.data/scripts/fmapi-structure_log.py +0 -3
- floodmodeller_api-0.4.2.data/scripts/fmapi-toolbox.bat +0 -2
- floodmodeller_api-0.4.2.data/scripts/fmapi-toolbox.py +0 -41
- floodmodeller_api-0.4.2.dist-info/RECORD +0 -169
- {floodmodeller_api-0.4.2.dist-info → floodmodeller_api-0.4.3.dist-info}/top_level.txt +0 -0
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Flood Modeller Python API
|
|
3
|
-
Copyright (C)
|
|
4
|
-
|
|
5
|
-
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
|
|
6
|
-
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
7
|
-
|
|
8
|
-
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
-
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
-
|
|
11
|
-
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
|
|
12
|
-
|
|
13
|
-
If you have any query about this program or this License, please contact us at support@floodmodeller.com or write to the following
|
|
14
|
-
address: Jacobs UK Limited, Flood Modeller, Cottons Centre, Cottons Lane, London, SE1 2QG, United Kingdom.
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
DEFAULT_OPTIONS = {
|
|
18
|
-
"flow_units": None,
|
|
19
|
-
"infiltration": None,
|
|
20
|
-
"flow_routing": None,
|
|
21
|
-
"link_offsets": None,
|
|
22
|
-
"force_main_equation": None,
|
|
23
|
-
"ignore_rainfall": None,
|
|
24
|
-
"ignore_snowmelt": None,
|
|
25
|
-
"ignore_groundwater": None,
|
|
26
|
-
"ignore_rdii": None,
|
|
27
|
-
"ignore_routing": None,
|
|
28
|
-
"ignore_quality": None,
|
|
29
|
-
"allow_ponding": None,
|
|
30
|
-
"skip_steady_state": None,
|
|
31
|
-
"sys_flow_tol": None,
|
|
32
|
-
"lat_flow_tol": None,
|
|
33
|
-
"start_date": None,
|
|
34
|
-
"start_time": None,
|
|
35
|
-
"end_date": None,
|
|
36
|
-
"end_time": None,
|
|
37
|
-
"report_start_date": None,
|
|
38
|
-
"report_start_time": None,
|
|
39
|
-
"sweep_start": None,
|
|
40
|
-
"sweep_end": None,
|
|
41
|
-
"dry_days": None,
|
|
42
|
-
"report_step": None,
|
|
43
|
-
"wet_step": None,
|
|
44
|
-
"dry_step": None,
|
|
45
|
-
"routing_step": None,
|
|
46
|
-
"lengthening_step": None,
|
|
47
|
-
"variable_step": None,
|
|
48
|
-
"minimum_step": None,
|
|
49
|
-
"inertial_damping": None,
|
|
50
|
-
"normal_flow_limited": None,
|
|
51
|
-
"min_surfarea": None,
|
|
52
|
-
"min_slope": None,
|
|
53
|
-
"max_trials": None,
|
|
54
|
-
"head_tolerance": None,
|
|
55
|
-
"threads": None,
|
|
56
|
-
"tempdir": None,
|
|
57
|
-
"rule_step": None,
|
|
58
|
-
}
|
|
1
|
+
"""
|
|
2
|
+
Flood Modeller Python API
|
|
3
|
+
Copyright (C) 2024 Jacobs U.K. Limited
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
|
|
6
|
+
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
7
|
+
|
|
8
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
|
|
11
|
+
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
|
|
12
|
+
|
|
13
|
+
If you have any query about this program or this License, please contact us at support@floodmodeller.com or write to the following
|
|
14
|
+
address: Jacobs UK Limited, Flood Modeller, Cottons Centre, Cottons Lane, London, SE1 2QG, United Kingdom.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
DEFAULT_OPTIONS = {
|
|
18
|
+
"flow_units": None,
|
|
19
|
+
"infiltration": None,
|
|
20
|
+
"flow_routing": None,
|
|
21
|
+
"link_offsets": None,
|
|
22
|
+
"force_main_equation": None,
|
|
23
|
+
"ignore_rainfall": None,
|
|
24
|
+
"ignore_snowmelt": None,
|
|
25
|
+
"ignore_groundwater": None,
|
|
26
|
+
"ignore_rdii": None,
|
|
27
|
+
"ignore_routing": None,
|
|
28
|
+
"ignore_quality": None,
|
|
29
|
+
"allow_ponding": None,
|
|
30
|
+
"skip_steady_state": None,
|
|
31
|
+
"sys_flow_tol": None,
|
|
32
|
+
"lat_flow_tol": None,
|
|
33
|
+
"start_date": None,
|
|
34
|
+
"start_time": None,
|
|
35
|
+
"end_date": None,
|
|
36
|
+
"end_time": None,
|
|
37
|
+
"report_start_date": None,
|
|
38
|
+
"report_start_time": None,
|
|
39
|
+
"sweep_start": None,
|
|
40
|
+
"sweep_end": None,
|
|
41
|
+
"dry_days": None,
|
|
42
|
+
"report_step": None,
|
|
43
|
+
"wet_step": None,
|
|
44
|
+
"dry_step": None,
|
|
45
|
+
"routing_step": None,
|
|
46
|
+
"lengthening_step": None,
|
|
47
|
+
"variable_step": None,
|
|
48
|
+
"minimum_step": None,
|
|
49
|
+
"inertial_damping": None,
|
|
50
|
+
"normal_flow_limited": None,
|
|
51
|
+
"min_surfarea": None,
|
|
52
|
+
"min_slope": None,
|
|
53
|
+
"max_trials": None,
|
|
54
|
+
"head_tolerance": None,
|
|
55
|
+
"threads": None,
|
|
56
|
+
"tempdir": None,
|
|
57
|
+
"rule_step": None,
|
|
58
|
+
}
|
|
@@ -1,79 +1,81 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Flood Modeller Python API
|
|
3
|
-
Copyright (C)
|
|
4
|
-
|
|
5
|
-
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
|
|
6
|
-
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
7
|
-
|
|
8
|
-
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
-
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
-
|
|
11
|
-
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
|
|
12
|
-
|
|
13
|
-
If you have any query about this program or this License, please contact us at support@floodmodeller.com or write to the following
|
|
14
|
-
address: Jacobs UK Limited, Flood Modeller, Cottons Centre, Cottons Lane, London, SE1 2QG, United Kingdom.
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
from floodmodeller_api.units.helpers import _to_float, join_n_char_ljust
|
|
18
|
-
from floodmodeller_api.validation import _validate_unit
|
|
19
|
-
|
|
20
|
-
from ._base import UrbanSubsection, UrbanUnit
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class JUNCTION(UrbanUnit):
|
|
24
|
-
"""Class to hold and process JUNCTION unit type
|
|
25
|
-
|
|
26
|
-
Args:
|
|
27
|
-
name (str): Unit name
|
|
28
|
-
elevation (float): Elevation of junction invert (ft or m). (required)
|
|
29
|
-
max_depth (float): Depth from ground to invert elevation (ft or m) (default is 0). (optional)
|
|
30
|
-
initial_depth (float): Water depth at start of simulation (ft or m) (default is 0). (optional)
|
|
31
|
-
surface_depth (float): Maximum additional head above ground elevation that manhole junction can sustain under surcharge conditions (ft or m) (default is 0). (optional)
|
|
32
|
-
area_ponded (float): Area subjected to surface ponding once water depth exceeds Ymax (ft2 or m2) (default is 0) (optional).
|
|
33
|
-
|
|
34
|
-
Returns:
|
|
35
|
-
JUNCTION: Flood Modeller JUNCTION Unit class object
|
|
36
|
-
"""
|
|
37
|
-
|
|
38
|
-
_unit = "JUNCTION"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
self.
|
|
53
|
-
|
|
54
|
-
self.
|
|
55
|
-
self.
|
|
56
|
-
self.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
self.
|
|
70
|
-
self.
|
|
71
|
-
self.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
1
|
+
"""
|
|
2
|
+
Flood Modeller Python API
|
|
3
|
+
Copyright (C) 2024 Jacobs U.K. Limited
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
|
|
6
|
+
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
7
|
+
|
|
8
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
|
|
11
|
+
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
|
|
12
|
+
|
|
13
|
+
If you have any query about this program or this License, please contact us at support@floodmodeller.com or write to the following
|
|
14
|
+
address: Jacobs UK Limited, Flood Modeller, Cottons Centre, Cottons Lane, London, SE1 2QG, United Kingdom.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from floodmodeller_api.units.helpers import _to_float, join_n_char_ljust
|
|
18
|
+
from floodmodeller_api.validation import _validate_unit
|
|
19
|
+
|
|
20
|
+
from ._base import UrbanSubsection, UrbanUnit
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class JUNCTION(UrbanUnit):
|
|
24
|
+
"""Class to hold and process JUNCTION unit type
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
name (str): Unit name
|
|
28
|
+
elevation (float): Elevation of junction invert (ft or m). (required)
|
|
29
|
+
max_depth (float): Depth from ground to invert elevation (ft or m) (default is 0). (optional)
|
|
30
|
+
initial_depth (float): Water depth at start of simulation (ft or m) (default is 0). (optional)
|
|
31
|
+
surface_depth (float): Maximum additional head above ground elevation that manhole junction can sustain under surcharge conditions (ft or m) (default is 0). (optional)
|
|
32
|
+
area_ponded (float): Area subjected to surface ponding once water depth exceeds Ymax (ft2 or m2) (default is 0) (optional).
|
|
33
|
+
|
|
34
|
+
Returns:
|
|
35
|
+
JUNCTION: Flood Modeller JUNCTION Unit class object
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
_unit = "JUNCTION"
|
|
39
|
+
MIN_LENGTH = 6
|
|
40
|
+
|
|
41
|
+
def _read(self, line):
|
|
42
|
+
"""Function to read a given JUNCTION line and store data as class attributes"""
|
|
43
|
+
|
|
44
|
+
# TODO: add functionality to read comments
|
|
45
|
+
|
|
46
|
+
unit_data = line.split() # Get unit parameters
|
|
47
|
+
|
|
48
|
+
# Extend length of unit_data if options variables not provided.
|
|
49
|
+
while len(unit_data) < self.MIN_LENGTH:
|
|
50
|
+
unit_data.append("")
|
|
51
|
+
|
|
52
|
+
self.name = str(unit_data[0])
|
|
53
|
+
|
|
54
|
+
self.elevation = _to_float(unit_data[1], 0.0)
|
|
55
|
+
self.max_depth = _to_float(unit_data[2], 0.0)
|
|
56
|
+
self.initial_depth = _to_float(unit_data[3], 0.0)
|
|
57
|
+
self.surface_depth = _to_float(unit_data[4], 0.0)
|
|
58
|
+
self.area_ponded = _to_float(unit_data[5], 0.0)
|
|
59
|
+
|
|
60
|
+
def _write(self):
|
|
61
|
+
"""Function to write a valid JUNCTION line"""
|
|
62
|
+
|
|
63
|
+
_validate_unit(self, urban=True)
|
|
64
|
+
|
|
65
|
+
# TODO:Improve indentation format when writing and include header for completeness
|
|
66
|
+
|
|
67
|
+
return join_n_char_ljust(17, self.name) + join_n_char_ljust(
|
|
68
|
+
15,
|
|
69
|
+
self.elevation,
|
|
70
|
+
self.max_depth,
|
|
71
|
+
self.initial_depth,
|
|
72
|
+
self.surface_depth,
|
|
73
|
+
self.area_ponded,
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class JUNCTIONS(UrbanSubsection):
|
|
78
|
+
"""Class to read/write the table of junctions"""
|
|
79
|
+
|
|
80
|
+
_urban_unit_class = JUNCTION
|
|
81
|
+
_attribute = "junctions"
|
|
@@ -1,74 +1,81 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Flood Modeller Python API
|
|
3
|
-
Copyright (C)
|
|
4
|
-
|
|
5
|
-
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
|
|
6
|
-
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
7
|
-
|
|
8
|
-
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
-
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
-
|
|
11
|
-
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
|
|
12
|
-
|
|
13
|
-
If you have any query about this program or this License, please contact us at support@floodmodeller.com or write to the following
|
|
14
|
-
address: Jacobs UK Limited, Flood Modeller, Cottons Centre, Cottons Lane, London, SE1 2QG, United Kingdom.
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
from floodmodeller_api.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
self.
|
|
54
|
-
self.
|
|
55
|
-
self.
|
|
56
|
-
self.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
1
|
+
"""
|
|
2
|
+
Flood Modeller Python API
|
|
3
|
+
Copyright (C) 2024 Jacobs U.K. Limited
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
|
|
6
|
+
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
7
|
+
|
|
8
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
10
|
+
|
|
11
|
+
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
|
|
12
|
+
|
|
13
|
+
If you have any query about this program or this License, please contact us at support@floodmodeller.com or write to the following
|
|
14
|
+
address: Jacobs UK Limited, Flood Modeller, Cottons Centre, Cottons Lane, London, SE1 2QG, United Kingdom.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from floodmodeller_api.units.helpers import _to_float, _to_str, join_n_char_ljust
|
|
18
|
+
from floodmodeller_api.validation import _validate_unit
|
|
19
|
+
|
|
20
|
+
from ._base import UrbanSubsection, UrbanUnit
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class LOSS(UrbanUnit):
|
|
24
|
+
"""Class to hold and process LOSS unit type
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
name (str): Name of conduit. (required)
|
|
28
|
+
kentry (float): Entrance minor head loss coefficient. (required) # TODO: FM name - Entry Loss Coeff.
|
|
29
|
+
kexit (float): Exit minor head loss coefficient. (required) # TODO: FM name - Exit Loss Coeff.
|
|
30
|
+
kavg (float): Average minor head loss coefficient across lenght of culvert. (required) # TODO: FM name - Avg. Loss Coeff.
|
|
31
|
+
flap (str): YES/NO. If conduit has a flat valve that prevents back flow. (optional, default NO ) # TODO: FM name - Flap Gate.
|
|
32
|
+
seepage (float): Rate of seepage loss into surrounding soil (in/hr or mm/hr). (optional, default is 0) # TODO: FM name - Seepage Loss Rate
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
Returns:
|
|
36
|
+
LOSS: Flood Modeller LOSS Unit class object
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
_unit = "LOSS"
|
|
40
|
+
MIN_LENGTH = 6
|
|
41
|
+
|
|
42
|
+
def _read(self, line):
|
|
43
|
+
"""Function to read a given LOSS line and store data as class attributes"""
|
|
44
|
+
|
|
45
|
+
# TODO: add functionality to read comments
|
|
46
|
+
|
|
47
|
+
unit_data = line.split() # Get unit parameters
|
|
48
|
+
|
|
49
|
+
# Extend length of unit_data if options variables not provided.
|
|
50
|
+
while len(unit_data) < self.MIN_LENGTH:
|
|
51
|
+
unit_data.append("")
|
|
52
|
+
|
|
53
|
+
self.name = _to_str(unit_data[0], "")
|
|
54
|
+
self.kentry = _to_float(unit_data[1], 0)
|
|
55
|
+
self.kexit = _to_float(unit_data[2], 0)
|
|
56
|
+
self.kavg = _to_float(unit_data[3], 0)
|
|
57
|
+
self.flap = _to_str(unit_data[4], "NO")
|
|
58
|
+
self.seepage = _to_float(unit_data[5], 0)
|
|
59
|
+
|
|
60
|
+
def _write(self):
|
|
61
|
+
"""Function to write a valid LOSS line"""
|
|
62
|
+
|
|
63
|
+
_validate_unit(self, urban=True)
|
|
64
|
+
|
|
65
|
+
# TODO:Improve indentation format when writing and include header for completeness
|
|
66
|
+
|
|
67
|
+
return join_n_char_ljust(17, self.name) + join_n_char_ljust(
|
|
68
|
+
15,
|
|
69
|
+
self.kentry,
|
|
70
|
+
self.kexit,
|
|
71
|
+
self.kavg,
|
|
72
|
+
self.flap,
|
|
73
|
+
self.seepage,
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class LOSSES(UrbanSubsection):
|
|
78
|
+
"""Class to read/write the table of losses"""
|
|
79
|
+
|
|
80
|
+
_urban_unit_class = LOSS
|
|
81
|
+
_attribute = "losses"
|