コード例 #1
0
 public void HydroNetExample01()
 {
     Lake lake = new Lake("L", 10000);
     SinkSourceBoundary flowBoundary = new SinkSourceBoundary(2);
     lake.Sources.Add(flowBoundary);
     Model model = new Model();
     model._waterBodies.Add(lake);
     model.SetState("Kurt", new DateTime(2010, 1, 1), new WaterPacket(1.2));
     
     for (int i = 0; i < 5; i++)
     {
         model.Update(model.CurrentTime.Add(new System.TimeSpan(0, 0, 1)));
     }
 }
コード例 #2
0
ファイル: EngineWrapper.cs プロジェクト: msruzy/hydronumerics
 public bool PerformTimeStep()
 {
     //TODO: make sure that the state is defined...
     model.Update(model.CurrentTime.Add(timestepLength));
     return(true);
 }
コード例 #3
0
        private Model CreateHydroNetModel()
        {
            // Upper Lake configuration
            Lake lake = new Lake("The Lake", 1000);
            lake.WaterLevel = 5.1;
            
            SinkSourceBoundary inflow = new SinkSourceBoundary(2);
            inflow.Name = "Inflow to lake";

            HydroNumerics.Geometry.XYPolygon contactPolygon = new HydroNumerics.Geometry.XYPolygon();



            contactPolygon.Points.Add(new HydroNumerics.Geometry.XYPoint(350, 625));
            contactPolygon.Points.Add(new HydroNumerics.Geometry.XYPoint(447, 451));
            contactPolygon.Points.Add(new HydroNumerics.Geometry.XYPoint(715, 433));
            contactPolygon.Points.Add(new HydroNumerics.Geometry.XYPoint(863, 671));
            contactPolygon.Points.Add(new HydroNumerics.Geometry.XYPoint(787, 823));
            contactPolygon.Points.Add(new HydroNumerics.Geometry.XYPoint(447, 809));
            GroundWaterBoundary groundWaterBoundary = new GroundWaterBoundary();
            groundWaterBoundary.Connection = lake;
            groundWaterBoundary.ContactGeometry = contactPolygon;
            groundWaterBoundary.Distance = 2.3;
            groundWaterBoundary.HydraulicConductivity = 1e-9;
            groundWaterBoundary.GroundwaterHead = 5.0;
            groundWaterBoundary.Name = "Groundwater boundary under Lake";
            groundWaterBoundary.Name = "MyGWBoundary";

            lake.Sources.Add(inflow);
            lake.GroundwaterBoundaries.Add(groundWaterBoundary);

            //Creating the model
            Model model = new Model();
            model._waterBodies.Add(lake);

            DateTime startTime = new DateTime(2000, 1, 1);
            model.SetState("MyState", startTime, new WaterPacket(1000));
            lake.SetState("MyState", startTime, new WaterPacket(2));
            model.Name = "Lake model";
            model.Initialize();
            model.Update(new DateTime(2001, 1, 1));
            return model;
        }