Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
scrollbar |
---|
When adding boundary conditions to the model you must first declare the type of the boundary you want to add. This is done as follows for a waterlevel timeseries:
Code Block | ||||
---|---|---|---|---|
| ||||
flowLeftBoundaryCondition = AddFlowBoundaryCondition(fmModel, leftBoundary.Name, FlowBoundaryQuantityType.WaterLevel, BoundaryConditionDataType.TimeSeries) flowTopBoundaryCondition = AddFlowBoundaryCondition(fmModel, topBoundary.Name, FlowBoundaryQuantityType.WaterLevel, BoundaryConditionDataType.TimeSeries) |
This can be seen on the map on the boundary :
Now we declare a timeseries as a list of [datetime, value]. To do this we need to import the datetime and time classes from the python datetime library.
Code Block | ||
---|---|---|
| ||
from datetime import datetime, time boundaryTimeSeries = [[datetime(2014,1,1, 12,0,0), 2.0], [datetime(2014,1,2, 12,0,0), 2.2], [datetime(2014,1,3, 12,0,0), -1.8], [datetime(2014,1,4, 12,0,0), 2.0], [datetime(2014,1,5, 12,0,0), -2.0], [datetime(2014,1,6, 12,0,0), 2.0], [datetime(2014,1,7, 12,0,0), -2.0], [datetime(2014,1,8, 12,0,0), 2.0]] |
Then we continue by adding the timeseries to a support point of the boundary. In this case we assign the timeseries to 4 support points (left boundary - point 0, 2 and 5 <=> top boundary - point 0).
Code Block | ||||
---|---|---|---|---|
| ||||
AddTimeSeriesToSupportPoint(fmModel, flowLeftBoundaryCondition, 0, boundaryTimeSeries) AddTimeSeriesToSupportPoint(fmModel, flowLeftBoundaryCondition, 2, boundaryTimeSeries) AddTimeSeriesToSupportPoint(fmModel, flowLeftBoundaryCondition, 5, boundaryTimeSeries) AddTimeSeriesToSupportPoint(fmModel, flowTopBoundaryCondition, 0, boundaryTimeSeries) |
Image Removed
The result can be viewed double clicking the boundary on the map and looking at the boundary conditions editor :
Image Added
Here you can see that for the left boundary there is a waterlevel timeseries declared on the nodes 0 (LeftBoundary_0001), 2 (LeftBoundary_0003) and 5 (LeftBoundary_0006)
scrollbar |
---|