You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

We will now add the values for the boundary conditions by importing the corresponding data from a csv file with the function ImportBoundaryConditions . The information regarding the lateral sources can be similarly imported using the function ImportLateralData . In both cases, for the sake of simplicity, we have assumed that they have constant (not time dependent) values.

Import boundaries
ImportBoundaryConditions(rootPath + r"\boundaryConditions.csv", flowModel)
ImportLateralData(rootPath + r"\laterals.csv", flowModel)

We continue by setting the roughness. Starting with the main roughness section. The following code sets the default roughness of the main roughness section to StricklerKs with a default value of 30.

Set main roughness section
SetDefaultRoughness(flowModel, "Main", RoughnessType.StricklerKs, 30)

 

Now we create a new roughness section and "FloodPlain" and make cross-sections "prof_SW2815-SW2870_Bo" and "prof_D20060515-DP-295" use it. To declare roughness sections on cross-sections, you need to declare the start and end distance along the cross-section. Because we want these cross-sections to only use our new "FloodPlain" section we use the min and max of the cross-section profile using the "GetMinYMaxYofCrossSectionProfile" function.

Set floodplain roughness on cross-sections
sectionFloodPlain = AddNewRoughnessSection(flowModel,"FloodPlain")

crs1 = GetItemByName(network.CrossSections, "prof_SW2815-SW2870_Bo")
crs2 = GetItemByName(network.CrossSections, "prof_D20060515-DP-295")

minY, maxY = GetMinYMaxYofCrossSectionProfile(crs1)
AddCrossSectionRoughness(flowModel, crs1, minY, maxY, sectionFloodPlain)

minY, maxY = GetMinYMaxYofCrossSectionProfile(crs2)
AddCrossSectionRoughness(flowModel, crs2, minY, maxY, sectionFloodPlain)

 

Now we only need to set the initial depth to a default of 3 using the following lines:

Set initial water depth
SetInitialConditionType(flowModel, InitialConditionType.Depth)
flowModel.DefaultInitialDepth = 3

 

 

  • No labels