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

Compare with Current View Page History

« Previous Version 4 Next »

The model calibration will be done by changing the less reliable parameters from the loaded model. Let’s assume that these factors are the flow boundary condition at the node Boxbergen, and the roughness of the main tributaries leading to Zwolle:

The definitions of boundary conditions object are not known yet in the scripting environment as variables. The complete name of the flow boundary condition at Boxbergen is, as shown in the previous figure, composed by the name of the location and the current value. However, the function GetBoundaryDataByName defined in API library SobekWaterFlowFunctions already takes this into account so you don't have to worry about it. Assign the name of the boundary condition to a new variable bcCalibrationName. Then use that string to assign the Boundary data object to the variable bcCalibration. The property Flow of this object contains the current numeric value of this constant flow boundary. We will save this number in the variable bcInitialValue.

Selecting Boundary Condition for calibration
bcCalibrationName = "Boxbergen"
bcCalibration = GetBoundaryDataByName(flowModel,bcCalibrationName)
bcInitialValue = bcCalibration.Flow

If you want to see how the BC is modified by the script you can look at the corresponding item on the project explorer view. Additionally, you can double click on this item to open the corresponding editor view.

The other object that will be used for tuning the model up is the roughness at the main tributaries. First of all, this object should be available in the scripting environment. Look for the object RoughnessType in the online help, and add the corresponding import to the first region of the script. The roughness at the main tributaries is the first object (so the index is [0]) in the list of roughness items, as shown in the picture above. The object to grab is the corresponding network coverage. You can save the current value for future reference, as done before with the BC.

Selecting Roughness for calibration
roughnessMain = flowModel.RoughnessSections[0].RoughnessNetworkCoverage
roughnessInitialValue = roughnessMain.DefaultValue


Similarly, if you double click on the item in the project explorer panel, you will open the corresponding editor view and will be able to see how it automatically changes while the calibration loop is being run.

 

  • No labels