本文整理匯總了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");
}