HEC-RAS模型接口开发
# 模型空间拓扑(河网、断面)、参数及边界信息解析
指定HEC-RAS模型文件夹和工程名称,实现对模型边界、参数等配置文件的识别;实现对模型空间拓扑(河网、断面数据)的识别;模拟时间、边界时间序列数据的识别。
识别出的信息存储在抽象的模型通用数据模型对象中。
- 模拟时间数据对象
/// <summary>
/// 模型计算开始时间
/// </summary>
[DataMember]
public DateTime StartTime { get; set; }
/// <summary>
/// 模型计算结束时间
/// </summary>
[DataMember]
public DateTime EndTime { get; set; }
/// <summary>
/// 预报时刻
/// </summary>
[DataMember]
public DateTime ForecastingTime { get; set; }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- 边界数据对象示例
{
"WaterLever": 0,
"Flow": 0,
"DomainType": 0,
"HDType": 2,
"WQType": 0,
"RRType": 0,
"Location": null,
"Location2": null,
"NodeID": 0,
"ElementID": 0,
"Value": [
{
"DT": "2022-04-01T00:00:00",
"Data": 0.1
},
{
"DT": "2022-04-01T01:00:00",
"Data": 0.1
},
],
"RiverName": null,
"Chainage": 0,
"EndChainage": 0,
"Pollutants": [
"Water Temperature",
"NH3N",
"TP",
"COD"
],
"Concetration": [
[],
[
{
"DT": "2022-04-01T00:00:00",
"Data": 0.87
},
{
"DT": "2022-04-05T00:00:00",
"Data": 0.87
}
],
],
"ObsConcetration": [
[
{
"DT": "2022-04-01T00:00:00",
"Data": 0
},
{
"DT": "2022-04-05T00:00:00",
"Data": 0
}
],
],
"IntConcetration": null,
"Location3": {
"riverName": "yellow",
"reachName": "yellow",
"station": "31430.88",
"station2": null
},
"IntervalStr": "1HOUR",
"StuctureBnd": null,
"BndDescription": 0,
"Boundarykey": null,
"IsConstant": false,
"IsAdConstant": false,
"IsTimeseriers": false,
"ConstantValue": 0,
"AdConstantValue": null,
"Tsfile": null,
"Depth": 0
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
- 河网、断面数据对象示例,识别河网的空间坐标并转换为经纬度、识别断面起点距及高程数据,并计算出横断面平面布置坐标,同时追踪出上下游河道代码。
{
"UpRvr": null,
"DnRvr": [
"rivercode"
],
"XSectoin": [
{
"Station": 0,
"Data": [
{
"X": 0,
"Y": 11.279,
"Z": 0,
"Attribute": 0
},
{
"X": 2.602,
"Y": 8.833,
"Z": 0,
"Attribute": 0
},
],
"Points": [
{
"X": 113.82124811188008,
"Y": 22.73713926396902,
"Z": 0,
"Attribute": 0
},
{
"X": 113.82122506452923,
"Y": 22.737129550438965,
"Z": 0,
"Attribute": 0
},
],
"BranchTopoIdChainageTb": null,
"VerticalProfile": null
},],
"RvrMdCode": "wanfenghe&wanfenghe",
"TopoID": null,
"Name": null,
"RvrName": "wanfenghe",
"RchName": "wanfenghe",
"StChainage": 0,
"EdChainage": 1,
"Points": [
{
"X": 113.82227772408609,
"Y": 22.708300308199295,
"Z": 0,
"Attribute": 0
},
{
"X": 113.82305343158593,
"Y": 22.709056021342377,
"Z": 0,
"Attribute": 0
},
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
54
55
56
57
58
59
60
61
62
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
54
55
56
57
58
59
60
61
62
# 通过河网通用地理数据生成HEC-RAS模型河网文件(*.g**)
public void WriteGeoFile(HEC_DM hecModel, string geoFile)
{
...
}
1
2
3
4
2
3
4
# 导入ZDM断面数据
public void ImportHdm2Gemetry(string hdmfodler, string geometryFile, int tag)
{
...
}
1
2
3
4
2
3
4
# 合并两个河网数据
public void MergeGeometry(HEC_DM hecModel, HEC_DM hecModel2, string geoFile)
{
...
}
1
2
3
4
2
3
4
# 将边界通用数据对象保存或修改到HEC-RAS模型水动力边界文件
public void SetBoundary(List<Boundary> boundaryList)
{
...
}
1
2
3
4
2
3
4
# 将边界通用数据对象保存或修改到HEC-RAS模型水质边界文件
public void SetWqBoundary(List<Boundary> boundaryList)
{
...
}
1
2
3
4
2
3
4
# 将模拟时间通用数据对象保存或修改到HEC-RAS模型Plan文件
public void SetSimulationTime(ModelTime modeltime)
{
...
}
1
2
3
4
2
3
4
# 将HEC-RAS模型结果解析到一维水动力水质结果通用数据对象
按河网模型差分计算河段输出结果,附加时段统计值,水质类别计算等。
public List<RiverSegModelResults> GetResults(DateTime startTime, DateTime endTime, string Projection, int centralLgtd)
{
...
}
1
2
3
4
2
3
4
上次更新: 2022/10/07, 17:21:48