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

Compare with Current View Page History

« Previous Version 4 Next »

We start by creating a list of coordinates using the cell centers (the initial waterlevel values are defined per cell).

Set intial confitions
coordinates = [cell.Center.X, cell.Center.Y] for cell in fmModel.Grid.Cells

 

Then we get the waterlevel for these coordinates at the start time and set them as the initial waterlevel of our model.

Set intial confitions
initialWaterLevels = wps.GetTidalPredictForTime(startTime, lineGeometry, EPSGCode)

fmModel.InitialWaterLevels.SetValues(initialWaterLevels)

 

To limit the calculation time we change the maximum and initial delta t (time) to 1 hour using the SetModelProperty" function.

Set dtMax and dtInitial
# set model max and initial timestep size
timeStep = timedelta(hours=1)

SetModelProperty(fmModel, KnownProperties.DtMax, str(timeStep.total_seconds()))
SetModelProperty(fmModel, KnownProperties.DtInit, str(timeStep.total_seconds()))

 

We also need to set the general model times with the start time, end time and time step.

Set model times
SetModelTimes(fmModel, startTime, endTime, time(6,0,0))

 

 

  • No labels