Import use cases
- Import in project as data item; import a (complete) Sobek 2.11 MDB
- user selects import from file menu
- user selects data type from available types
- user specifies data source
- user selects (parts of) the data geographically or with time interval
- (selected) data is imported into project and added to project as data item.
- Import for specific/selected data item
for selected object in project
or selected object on map ...- user specifies data source
- user selects (parts of) the data geographically or with time interval
- (selected) data is imported into project and added to project as data item.
Import existing Sobek model database (MDB)
Version of Sobek MDB that will be imnported by plugin is set to: 2.11
and the following objects are read:
- node
- branch
- cross section
- friction
- boundary conditions
- laterals
Conv_sbk is existing software that can import various formats; reuse is a consideration.
After conferring with knowledgeable people, reviewing the source the following arguments against reuse of the Conv_sbk source were found:
- dependency to Netter
- quality of coding
- end of life of VB6
- procedural design (not OO)
- necessity to inflict serious adaptions to source for mapping to DelftShell data model
- only a fraction of the source code is of interest, namely the parts that actually read and hence have implicit knowledge of the structure of data
Hence it is decided to reimplement the 'readers' in .NET. When applicable implicit knowledge about structure from the Conv_sbk is reused.
The the tool of choice for implementing readers is LEX; contrary to existing reader implementations, with LEX we can define readers in a language independent, reusable industry standard notation.
A C# version of LEX is found in the free product GPLEX. Some first test in DS development environment were successfull.
ANTLR might be an alternative to GPLEX. ANTLR offers both a lexical and syntatical analyzer where GPLEX can only build a lexical analyzer.
TODO
- choose between GPLEX and ANTLR:
ANTLR is a more complex environment. It is able to generate both lexical and syntatical automatons; we only need the lexer. At this early stage gplex seems more lightweight and does not carry in any redundant component, does what we want from it, is fitted into the dev and build environment.
The approach is to start with implementing a full Sobek 2.11 MDB import in a time period of 20 days (40 fpe). After this period the experience will be applied to estimate the remainder of this sub project.
node
Import of node from NETWORK.TP has been implemented using gplex. Special type of node: linkage node is interpreted as node.
net-file (topography layer) This file contains the date for the topography: the definitions and positions of the nodes and branches. The node definition: NODE id '1' nm 'Node1' px 11404.2 py 123768.5 node Note: Fixed order Where: id = node id nm = name of the node px = position X (X coordinate) py = position Y (Y coordinate) The branch definition: BRCH id '1' nm 'Tak1' bn '1' en '2' al '1233.4' brch Note: Fixed order Where: id = branch id nm = branch name bn = id begin node en = id end node al = actual length Linkage nodes are described in NDLK records. A linkage node is handled as a normal calculation at the actual reach. The linkage node can be used as a start or end connection node for another reach. For the actual reach, this linkage node should also be decribed in the grid layer, at the same position at the reach. NDLK id '125' ci 'RIV_350' lc 25261.4 ndlk id = id of linkage node ci = reach id, where the linkage node is handled as calculation point lc = location at the reach
branch
branch is imported from NETWORK.TP
geometry of the branch is stored in NETWORK.CN
BRCH id '1' cp 1 ct bc Note: Fixed order TBLE .... tble brch Where: id = branch id, cp = number of curving points ct bc = curving point table TBLE ... tble = Table with 'curving points: column 1 = location on the branch in meters column 2 = angle (0 = north, 90= east)
remark: the location in column 1 is the location at the center of the branch, not the starting point of the branch. The number of curving points is not stored correctly so it has to be derived from the number of entries in the table.
Dry bed procedure is currently not imported. An example is needed.
This file contains the information for the 'dry bed procedure' in the flow module of SOBEK Rivers (NOT for SOBEK Urban/Rural). The data is necessary for each branch. BRCH id '1' db 1 th 0.01 sh 10.0 brch Where: id = branch id, db = dry bed procedure active (1) or not (0) th = threshold sh = slot depth (depth Preismann)
Cross section
cross section information is stored in a number of files.
NETWORK.CR stores the location of the cross sections along the branch.
Cross Section types in Sobek
0. tabulated 1. trapezoidal 2. open circle 3. sedredge (2D morfology) 4. closed circle 5. 6. egg shaped (width) 7. egg shaped 2 (radius) not implemented 8. closed rectangular not implemented 9. 10. yz table 11. asymmetrical trapeziodal
After discussion with Edward: Initially
- Tabulated/WH
- YZ
friction
Friction data is contained in the file friction.dat
Friction can be defined for a branch a cross section or a floodplain
Friction is defined for positive and negative flow direction
We only import
friction in negative or positive flow direction
friction at cross section segments.
Friction.dat contains friction data for branches and cross sections
This file contains the bed friction data per branch. For Channel Flow, Sewer Flow and River Flow: BDFR id '1' ci '1' mf 7 mt cp 0 20 0 mr cp 0 20 0 s1 6 s2 6 sf 7 st cp 0 20 0 sr cp 0 20 0 bdfr Fixed number of items in one record, separated by 1 or more blanks Where: id = id of bed friction definition nm = name of the bed friction definition (not in SOBEK Urban/Rural) ci = carrier id = id of the branch mf = main friction type (main = main channel) 0 = Chezy 1 = Manning 2 = Strickler Kn 3 = Strickler Ks 4 = White-Colebrook 5 6 7 = De Bos and Bijkerk mt = friction in positive flow direction mt fq = friction=f(Q) mt fh = C=f(h) mt cp = friction as a constant or as a function of the location on the branch For fq, fh, and cp: a constant (entered as a table) or a real table: 0 = constant 1 = variable The options fq and fh may have more dimensional tables: column 1 =Q or h value, column n = friction value on different locations along the branch for every Q or h Thus, the options fq and fh are a function of the location on the branch and Q (of h). The option cp (friction as function of the location) has a two-dimensional table: column 1 = location along the branch column 2 = friction-coefficient mr = friction in negative direction: mr fq = friction=f(Q) mr fh = friction=f(h) mr cp = friction as a constant or as a function of the location on the branch) Option fq, fh, and cp may contain a constant given in a table or a table. 0 = constant 1 = variable s1 = friction for floodplain 1 (not in SOBEK Urban/Rural) can be either 'equal to main section', or Chezy/../Nikuradse. (0=Chezy,..,6=Equal to main section) Note: Engelund cannot be used for the floodplains. s2 = friction for floodplain 2 (not in SOBEK Urban/Rural) sf = ground layer friction type (0 - 7 ) (for further details see description for mf) st = friction in positive direction st cp = (for all friction types, for further details see description for mt) sr = ground layer friction in negative direction sr cp for all friction types (for further details see description for mt) c1 cp,fq,fh = floodplain 1 friction coefficients (friction can be defined as a function of Q, of h, of the location or as a constant. r1 cp,fq,fh = floodplain 1 reversed flow friction coefficients as a function of Q, of h, of the location or as a constant. c2 cp,fq,fh = floodplain 2 r2 cp,fq,fh = floodplain 2 reversed flow d9 f9 = D90 Same friction for both directions (for SOBEK-River only) This feature is optional. It is defined by the flags em, er, e1, e2, e3, e4. If these flags are present (in this order) they should follow the carrier id (ci ' ') immediately. These flags are only used by the user interface. For the parser bed friction is fully defined by the keys mf etc. BDFR id '33' nm '(null)' ci '31' em 0 er 0 e1 0 e2 0 e3 0 e4 0 mf 0 mt fh 3 50 9.9999e+009 'Chezy Coefficient Waterlevel' PDIN 0 0 '' pdin CLTT 'H' '603.5' cltt CLID '(null)' '(null)' clid TBLE -0.5 52.79 < 0 49.69 < 0.5 48.98 < 1 53.66 < 1.5 56.96 < 2 65.4 < 2.5 63.92 < 3 62.03 < 3.5 59.89 < 4 59.02 < 4.5 59.97 < 5 59.68 < tble mr fh 3 50 9.9999e+009 'Chezy Coefficient Waterlevel' PDIN 0 0 '' pdin CLTT 'H' '603.5' cltt CLID '(null)' '(null)' clid TBLE 0 53.13 < 0.5 49.9 < 1 49.3 < tble s1 0 c1 cp 0 35 9.9999e+009 r1 cp 0 35 9.9999e+009 s2 6 c2 cp 0 9.9999e+009 9.9999e+009 r2 cp 0 9.9999e+009 9.9999e+009 d9 f9 0 9.9999e+009 9.9999e+009 bdfr Where: em = flag for main section 1 = bed friction for negative flow equals the definition for positive flow 0 = different friction definitions for both directions er = flag for main section 1 = bed friction for positive flow equals the definition for negative flow 0 = different friction definitions for both directions e1 = flag for floodplain 1 1 = bed friction for negative flow equals the definition for positive flow 0 = different friction definitions for both directions e2 = flag for floodplain 1 1 = bed friction for positive flow equals the definition for negative flow 0 = different friction definitions for both directions e3 = flag for floodplain 2 Same meaning as e1 e4 = flag for floodplain 2 Same meaning as e2 Cross section related Friction CRFR id 'fricid' nm 'Friction1' cs 'Crdef' lt ys TBLE 0.0 3.0 < 3.0 5.0 < tble ft ys TBLE 7 20 < 7 20 < tble fr ys TBLE 7 20 < 7 20 < tble crfr Where: cs 'Crdef' = cross section definition id (only for yz profile and a-symmetrical trapezoidal) to which this friction definition applies lt ys = table for y values which defines the sections (in this case 2) within the profile for definition of friction, flow, etc. Number of rows defines the number of defined sections and value per row defines the start of a section and end of a section (horizontal distance increasing from the left to right ). For example, the first defined section starts at Y= 0.0 (including) till Y =3.0 (not including), and so on. Note: the defined sections should be based on the same coordinate system used in defining yz table. ft ys = table for friction values in positive direction for (in this case 2) sections (division) of cross section with friction type (0-7), constant friction value, the number of rows should be the same as number of sections defined in the 'lt ys'. fr ys = table for friction values in negative direction for (in this case 2) sections (division) of cross section with friction type (0-7), constant friction value the number of rows should be the same as number of sections defined in the 'lt ys'. Structure Friction (for SOBEK Rural / Urban only) STFR id '1' ci 'Culvert1' mf 7 mt cp 0 20 0 mr cp 0 20 0 s1 6 s2 6 sf 7 st cp 0 20 0 sr cp 0 20 0 stfr Fixed number of items in one record, separated by 1 or more blanks Where: ci = id of structure definition mf = main friction type (main = main channel) 0 = Chezy 1 = Manning 2 = Strickler Kn 3 = Strickler Ks 4 = Nikuradse 5 = Engelund 6 7 = De Bos and Bijkerk mt = friction in positive flow direction mt fq = friction=f(Q) mt fh = C=f(h) mt cp = friction as a constant or as a function of the location on the branch For fq, fh, and cp: a constant (entered as a table) or a real table: 0 = constant 1 = variable The options fq and fh may have more dimensional tables: column 1 =Q or h value, column n = friction value on different locations along the branch for every Q or h Thus, the options fq and fh are a function of the location on the branch and Q (of h). The option cp (friction as function of the location) has a two-dimensional table: column 1 = location along the branch column 2 = friction-coefficient mr = friction in negative direction: mr fq = friction=f(Q) mr fh = friction=f(h) mr cp = friction as a constant or as a function of the location on the branch) Option fq, fh, and cp may contain a constant given in a table or a table. 0 = constant 1 = variable s1 = friction for floodplain 1 (not in SOBEK Urban/Rural) can be either 'equal to main section', or Chezy/../Nikuradse. (0=Chezy,..,6=Equal to main section) Note: Engelund cannot be used for the floodplains. s2 = friction for floodplain 2 (not in SOBEK Urban/Rural) sf = ground layer friction type (0 - 7 ) (for further details see description for mf) st = friction in positive direction st cp = (for all friction types, for further details see description for mt) sr = ground layer friction in negative direction sr cp for all friction types (for further details see description for mt) c1 cp,fq,fh = floodplain 1 friction coefficients (friction can be defined as a function of Q, of h, of the location or as a constant. r1 cp,fq,fh = floodplain 1 reversed flow friction coefficients as a function of Q, of h, of the location or as a constant. c2 cp,fq,fh = floodplain 2 r2 cp,fq,fh = floodplain 2 reversed flow d9 f9 = D90 For Overland Flow: D2FR id '1' nm 'Frictie1' ci '1' mf 0 mt cp 0 45 0 mw cp 0 45 0 d2fr where: id = bed friction definition id nm = bed friction definition name (not available yet) ci = carrier id = reach id mf = main friction type (main = main channel) 0 = Chezy 1 = Manning 4 = White Colebrook mt = bed friction mt cp 0 60 0 = all other cases (Chèzy / Manning etc. as constant or dependent on the location) 0 = constant mw cp 2 'c:\sobek\fls_files\bedfrict.asc' ' ' 2 = file mw = wall friction mw cp 0 60 0 = all other cases (Chèzy / Manning etc. as constant or dependent on the location) 0 = constant mw cp 2 'c:\sobek\fls_files\walfrict.asc' ' ' 2 = file
Extra resistance is not used in current sobek. Importing it is not implemented.
exr-file (friction layer) This file contains the definition of 'extra resistance'. XRST id '1' nm 'exr1' ci '1' lc 20 rt rs TBLE .. tble ty 0 xrst Where: id = id of the extra resistance definition nm = name of the resistance definition ci = carrier id (=id of the branch) lc = location on the branch rt rs = table with extra resistance column 1 = water level column 2 = extra resistance
Engelund friction and global friction (also in friction.dat)
glf-file (friction layer) This file contains two groups of global data: data necessary for the Engelund bed friction formula global bed friction parameters As these parameters are defined globally, they are not linked to any specific location. GLFR dd 1.65 s1 0.474 s2 0.55 p1 -6 p2 2.75 p3 5.5 p4 4.125 p5 -0.2 p6 2.447 a1 0.0005 a2 6e-005 ra 1 glfr Where: dd = delta D (global Engelund parameter) s1 = sigma1 (global Engelund parameter) s2 = sigma2 (global Engelund parameter) p1 = as11 (global Engelund parameter) p2 = as12 (global Engelund parameter) p3 = as21 (global Engelund parameter) p4 = as22 (global Engelund parameter) p5 = as31 (global Engelund parameter) p6 = as32 (global Engelund parameter) a1 = alpha1 (for wind friction) a2 = alpha2 (for wind friction) ra = rho lucht (for wind friction)
boundary conditions
laterals
Other
NETWORK.SA (reading not implemented)
This file contains extra data for the boundary-nodes in a estuarium-model, necessary for the salt module. Only SOBEK Rivers, NOT for SOBEK Urban/Rural. NODE id '1' mt 0 node Where: id = node id mt = mouth 0 = boundary node does not have estuarium mouth 1 = boundary node does have estuarium mouth This information is necessary for the choice of the formulation of the dispersion, when the Thatcher-Harleman of the 'user defined' option have been chosen. See dispersion layer for more information.
NETWORK.SM (reading not implemented)
This file contains the extra information necessary for the sediment/morphology module of SOBEK. Only SOBEK-Rivers, NOT for SOBEK Urban/Rural. BRCH id '1' sd 0 fl 1 ft fl TBLE .... tble rf 0 brch Where: id = branch id sd = sedredge option 0 = no 2D morphology on this branch (default) 1 = 2D morphology on this branch fl = fixed layer (1=active, 0=not active) ft fl = fixed layer table (between keywords TBLE en tble) The first column in the table contains the locations along the branch and the second column contains the layer. rf = reduction function 0 = sinus 1 = linear
NODES.DAT (reading not implemented)
This file contains data for the modelling of different kinds of storage for nodes in sewer calculations. Only SOBEK Urban/Rural, NOT River. NODE id '1' ty 0 ws 1.0 ss 100.0 wl -4.05 ml -1.0 node Where: id = node id ty = type water on street 1 = reservoir 2 = closed 3 = loss ws = storage area (manhole) ss = street storage area wl = bed level storage reservoir (manhole) ml = street level NODE id '0-62' ty 1 ct sw TBLE 16.28 2 < 20.84 2 < tble ct ss TBLE 20.85 100 < 21.9 150 < tble node Where: ct sw TBLE .. tble = table for storage in well ct ss TBLE .. tble = table for storage at street
Free format import
This comes second in priority.
Free format import should comprise a wizard like interface in which the structure of the data to be imported is investigated and specified by the user interactively.
Hymos has a import wizard for importing time series:
3rd Party network formats
This comes third in priority. These are the formats currently supported by Sobek.