当前位置: 首页>>代码示例>>C#>>正文


C# Stream.AddDownStreamWaterBody方法代码示例

本文整理汇总了C#中System.Stream.AddDownStreamWaterBody方法的典型用法代码示例。如果您正苦于以下问题:C# Stream.AddDownStreamWaterBody方法的具体用法?C# Stream.AddDownStreamWaterBody怎么用?C# Stream.AddDownStreamWaterBody使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Stream的用法示例。


在下文中一共展示了Stream.AddDownStreamWaterBody方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TracerTest

    public void TracerTest()
    {
      int count = 3;
      double length = 10870;
      DateTime Start= new DateTime(2000,1,1);

      List<Lake> lakes = NetworkBuilder.CreateConnectedLakes(count);
      
      foreach (Lake L in lakes)
      {
        L.SurfaceArea = XYPolygon.GetSquare(length / count);
        L.Depth = 1;
        L.SetState("Initial",Start, new WaterPacket(L.Volume));
      }
      Chemical c = ChemicalFactory.Instance.GetChemical(ChemicalNames.Cl);

      SinkSourceBoundary fb = new SinkSourceBoundary(10870.0 / (8.49 * 3600));
      fb.WaterSample = new WaterPacket(1);
      lakes.First().Sources.Add(fb);

      WaterPacket plug = new WaterPacket(1);
      plug.AddChemical(c, 10000);
      lakes.First().AddWaterPacket(Start, Start.AddHours(1), plug.DeepClone());

      lakes.First().Output.LogChemicalConcentration(c);

      lakes.Last().Output.LogChemicalConcentration(c);


      Stream us = new Stream("us",1, 1, 1);
      us.Sources.Add(fb);
      Stream s = new Stream("s",1000, 1, 1);

      Lake L2 = new Lake("L2",870);

      Stream s1 = new Stream("s1", 9000, 1, 1);

      s.AddWaterPacket(Start, Start.AddSeconds(1), plug.DeepClone());
      s1.Output.LogChemicalConcentration(c);

      us.AddDownStreamWaterBody(s);
      s.AddDownStreamWaterBody(L2);
      L2.AddDownStreamWaterBody(s1);


      Model m = new Model();
      m._waterBodies.AddRange(lakes.Cast<IWaterBody>());

      m._waterBodies.Add((IWaterBody)us);
      m._waterBodies.Add((IWaterBody)s);
      m._waterBodies.Add((IWaterBody)L2);
      m._waterBodies.Add((IWaterBody)s1);

      m.SetState("Initial", Start, new WaterPacket(1));



      m.MoveInTime(Start.AddHours(15), TimeSpan.FromMinutes(1));

      lakes.Last().Output.Save(@"C:\temp\LastLake.xts");
      s1.Output.Save(@"C:\temp\Stream.xts");


      int n = 15;
      List<IWaterBody> wbs = NetworkBuilder.CreateCombo(n, 10870 / n/2.0);
      foreach (IWaterBody wb in wbs)
      {
        wb.SetState("Initial", Start, new WaterPacket(wb.Volume));
      }

      wbs.First().AddWaterPacket(Start, Start.AddHours(1), plug.DeepClone());
      us.AddDownStreamWaterBody(wbs.First());
      us.RestoreState("Initial");

      m._waterBodies.Clear();
      m._waterBodies.Add(us);
      m._waterBodies.AddRange(wbs);

      m.SetState("Initial", Start, new WaterPacket(1));

      ((Stream)wbs.Last()).Output.LogChemicalConcentration(c);

      m.MoveInTime(Start.AddHours(15), TimeSpan.FromMinutes(1));

      ((Stream)wbs.Last()).Output.Save(@"C:\temp\Stream.xts");
    }
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:86,代码来源:SkjernAA.cs


注:本文中的System.Stream.AddDownStreamWaterBody方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。