Пример #1
0
            /// <summary>
            /// This method is called whenever the urban catchment has completed a time step.
            /// </summary>
            /// <param name="time">Simulation time</param>
            public void Plowing(DateTime time)
            {
                if (_urbanCatchment is CatchmentKinematicWave)
                {
                    // Circumventing dry-jumping when there is snow on the catchment:
                    CatchmentKinematicWave catchmentKinematicWave = (CatchmentKinematicWave)_urbanCatchment;
                    // Disable jumping when there is snow, re-enable jumping when there is no snow.
                    if (_urbanCatchment.SnowStorage > 0)
                    {
                        catchmentKinematicWave.TimeStepDry = catchmentKinematicWave.TimeStep;
                    }
                    else
                    {
                        catchmentKinematicWave.TimeStepDry = _timeStepDry;
                    }
                }

                // Plow between 4 and 6 every morning
                if (time > _lastPlowed.AddHours(12) && 4 <= time.Hour && time.Hour <= 6)
                {
                    // Plow 1 mm (0.001 m), if there is more than 2 mm on the ground
                    if (_urbanCatchment.SnowStorage > 0.002)
                    {
                        _urbanCatchment.SnowStorage -= 0.001;
                    }
                    else if (_urbanCatchment.SnowStorage > 0.001)
                    {
                        _urbanCatchment.SnowStorage = 0.001;
                    }
                    // Store _lastPlowed, to only plow once a day.
                    _lastPlowed = time;
                }
            }
Пример #2
0
            public UrbanCatchmentPlowing(CatchmentAbstractUrban urbanCatchment)
            {
                _urbanCatchment = urbanCatchment;
                _lastPlowed     = DateTime.MinValue;

                if (_urbanCatchment is CatchmentKinematicWave)
                {
                    // Circumventing dry-jumping when there is snow on the catchment
                    CatchmentKinematicWave catchmentKinematicWave = (CatchmentKinematicWave)_urbanCatchment;
                    _timeStepDry = catchmentKinematicWave.TimeStepDry;
                }
            }
Пример #3
0
        public void AddKWCatchments(Mike1DData mike1DData)
        {
            // Conversion from mm/h to m/s

            List <CatchmentKinematicWave> myModels = new List <CatchmentKinematicWave>();
            var c1 = new CatchmentKinematicWave("KW1")
            {
                Area = 750, Slope = 0.01, Length = 750.0 / 50,
            };
            var c2 = new CatchmentKinematicWave("KW2")
            {
                Area = 10000, Slope = 0.03, Length = 10000.0 / 100,
            };

            foreach (var c in c1.Surfaces)
            {
                c.AreaFraction = 0;
            }
            foreach (var c in c2.Surfaces)
            {
                c.AreaFraction = 0;
            }
            c1.Surfaces[3].AreaFraction    = 1.0;
            c2.Surfaces[3].AreaFraction    = 1.0;
            c1.Surfaces[3].ManningM        = 65;
            c2.Surfaces[3].ManningM        = 65;
            c1.Surfaces[3].WettingCapacity = 0.05e-3;
            c2.Surfaces[3].WettingCapacity = 0.05e-3;
            c1.Surfaces[3].StorageCapacity = 2.0e-3;
            c2.Surfaces[3].StorageCapacity = 2.0e-3;
            c1.Surfaces[3].Infiltration    = new Horton()
            {
                F0 = 2 * mmph2mps, Fc = 0.5 * mmph2mps, Kwet = 0.0015, Kdry = 3.0e-5
            };
            c2.Surfaces[3].Infiltration = new Horton()
            {
                F0 = 2 * mmph2mps, Fc = 0.5 * mmph2mps, Kwet = 0.0015, Kdry = 3.0e-5
            };

            myModels.Add(c1);
            myModels.Add(c2);

            foreach (var myModel in myModels)
            {
                myModel.TimeStep = TimeSpan.FromSeconds(60);
                mike1DData.RainfallRunoffData.Catchments.Add(myModel);
            }
        }