public void RadonTest()
    {
      WaterPacket w = new WaterPacket(12);
      Chemical C =ChemicalFactory.Instance.GetChemical(ChemicalNames.Radon);
      Chemical cl = ChemicalFactory.Instance.GetChemical(ChemicalNames.Cl);

      //Checks old evaporation
      C.IsFirstOrderDegradable = false;

      w.AddChemical(C, 5);
      w.AddChemical(cl, 5);

      Assert.AreEqual(0.4167, w.GetConcentration(C),0.001);

      w.MoveInTime(TimeSpan.FromDays(1), 6);
      Assert.AreEqual(0.3846, w.GetConcentration(C),0.001);

      w.MoveInTime(TimeSpan.FromDays(1), 6);
      Assert.AreEqual(0.355, w.GetConcentration(C),0.001);

      //Checks new Reactions

      double d = w.GetConcentration(C);

      w.MoveInTime(TimeSpan.FromDays(3.8), ChemicalFactory.Instance.LakeReactions,0);
      Assert.AreEqual(d/2, w.GetConcentration(C), 0.01);
      Assert.AreEqual(5.0 / 12, w.GetConcentration(cl), 0.01);

    }
Example #2
0
        /// <summary>
        /// Returns a deep clone of this waterpacket with the specified volumen.
        /// This is a non-physical method that will destroy mass balance.
        /// Should only be used for data storage and non-physical boundaries.
        /// </summary>
        /// <param name="Volume"></param>
        /// <returns></returns>
        public virtual IWaterPacket DeepClone(double Volume)
        {
            WaterPacket W = new WaterPacket(Volume);

            DeepClone(W, Volume);
            return(W);
        }
Example #3
0
        /// <summary>
        /// Use this constructor to create an empty lake. Should only be used for unit testing
        /// </summary>
        /// <param name="VolumeOfLakeWater"></param>
        public Lake(string name, double VolumeOfLakeWater) : base(name)
        {
            SurfaceArea = XYPolygon.GetSquare(VolumeOfLakeWater);
            Depth       = 1;

            //Only used in unit test. Otherwise it should be set through the state
            CurrentStoredWater = new WaterPacket(0);
            Initialize();
        }
    public void MyTestInitialize()
    {
      ChemicalFactory cn = ChemicalFactory.Instance;
      Na = cn.GetChemical(ChemicalNames.Na);
      Cl = cn.GetChemical(ChemicalNames.Cl);

      WWC = new WaterPacket(100);
      WWC.AddChemical(Na, 3);
      WWC.AddChemical(Cl, 2);

    }
    public void WaterPacketTest()
    {
      WaterPacket wp1 = new WaterPacket(23);
      ReadWrite(wp1);

      WaterPacket wp = new WaterPacket(1, 250);
      wp.MoveInTime( TimeSpan.FromDays(1),1);

      WaterPacket wp2 = (WaterPacket)ReadWrite(wp);

      WaterEquals(wp, wp2);
    }
Example #6
0
        /// <summary>
        /// Copy constructor
        /// </summary>
        /// <param name="WaterToCopy"></param>
        public WaterPacket(WaterPacket WaterToCopy)
        {
            RelativeTimeTag = WaterToCopy.RelativeTimeTag;
            WaterAge        = WaterToCopy.WaterAge;
            LogString       = new StringBuilder(WaterToCopy.LogString.ToString());

            //Copy the properties
            foreach (var KVP in WaterToCopy.Composition)
            {
                Composition.Add(KVP.Key, KVP.Value);
            }
        }
    public void TemperatureTest()
    {
      WaterPacket w = new WaterPacket(1);
      w.AddEnergy(2000);

      Assert.AreEqual(4.779e-4, w.Temperature, 1e-6);
      w.AddEnergy(-2000);
      Assert.AreEqual(0, w.Temperature, 1e-6);
      w.AddEnergy(50000);
      Assert.AreEqual(0.01194, w.Temperature, 1e-4);
      WaterPacket w2 = new WaterPacket(1);

      w.Add(w2);
      Assert.AreEqual(0.0059737, w.Temperature, 1e-4);

    }
    public void CastingTest()
    {
      IsotopeWater Iw = new IsotopeWater(100);
      Iw.SetIsotopeRatio(0.5);

      Assert.IsFalse(Iw.GetType().Equals(typeof(WaterPacket)));

      WaterPacket wc = Iw as WaterPacket;
      Assert.IsNotNull(wc);

      Assert.IsTrue(wc.Chemicals.ContainsKey(ChemicalFactory.Instance.GetChemical(ChemicalNames.IsotopeFraction)));

      WaterPacket w = new WaterPacket(1);
      wc = w as IsotopeWater;
      Assert.IsNull(wc);
    }
    public void ConstructTest()
    {

      //Test that an argumentoutofrangeException is thrown if water volume is less than zero
      try
      {
        WaterPacket w = new WaterPacket(-1);
        throw new Exception();
      }
      catch (ArgumentOutOfRangeException AE)
      {

      }

      WaterPacket w2 = new WaterPacket(1, 100);
      Assert.AreEqual(1, w2.Composition[1]);

    }
Example #10
0
        /// <summary>
        /// Logs chemical
        /// </summary>
        /// <param name="Water"></param>
        /// <param name="Start"></param>
        /// <param name="End"></param>
        public void Log(IWaterPacket Water, DateTime Start, DateTime End)
        {
            WaterPacket wc = Water as WaterPacket;

            //Log chemicals if the water is based on WaterPacket
            if (wc != null)
            {
                if (LogAllChemicals)
                {
                    foreach (var c in wc.Chemicals.Keys)
                    {
                        TimestampSeries ts;
                        if (!ChemicalsToLog.TryGetValue(c, out ts))
                        {
                            ts = CreateChemicalSeries(c);
                        }
                        ts.AddSiValue(End, wc.GetConcentration(c));
                    }
                }
                else
                {
                    foreach (KeyValuePair <Chemical, TimestampSeries> ct in ChemicalsToLog)
                    {
                        ct.Value.AddSiValue(End, ((WaterPacket)Water).GetConcentration(ct.Key));
                    }
                }
            }

            //Log the water composition
            if (LogComposition)
            {
                foreach (var id in Water.Composition)
                {
                    TimestampSeries ts;
                    if (!CompositionLog.TryGetValue(id.Key, out ts))
                    {
                        ts = CreateCompositionTimeSeries(id.Key);
                    }
                    ts.AddValue(End, id.Value);
                }
            }
        }
Example #11
0
        protected virtual void DeepClone(IWaterPacket CloneToThis, double Volume)
        {
            WaterPacket W = (WaterPacket)CloneToThis;

            double factor = Volume / this.Volume;

            //Copy the properties
            W.RelativeTimeTag = this.RelativeTimeTag;
            W.WaterAge        = WaterAge;
            W.Temperature     = Temperature;
            W.LogString       = new StringBuilder(LogString.ToString());
            foreach (KeyValuePair <int, double> KVP in _composition)
            {
                W._composition.Add(KVP.Key, KVP.Value);
            }

            //Now clone the chemicals
            foreach (KeyValuePair <Chemical, double> KVP in _chemicals)
            {
                W.AddChemical(KVP.Key, KVP.Value * factor);
            }
        }
Example #12
0
    public void RoutingOfRecievedWaterTest()
    {
      Lake S = new Lake("L",100);

      DateTime Start = new DateTime(2000, 1, 1);

      S.SetState("Initial", Start, new WaterPacket(100));
      Lake storage = new Lake("storage", 10000);
      S.AddDownStreamWaterBody(storage);

      TimeSpan ts = new TimeSpan(1,0,0);

      WaterPacket WaterProvider = new WaterPacket(2, 200);
      
      IWaterPacket actual;
      S.AddWaterPacket(DateTime.Now, DateTime.Now, WaterProvider.DeepClone(200));

      S.Update(S.CurrentTime.Add(ts));

      actual = S.CurrentStoredWater;
      Assert.AreEqual(100, actual.Volume);

      Assert.AreEqual(200, storage.CurrentStoredWater.Volume);
      Assert.AreEqual(200.0/300.0, storage.CurrentStoredWater.Composition[2],0.000001);

      //In the next timestep there will be no water to route
      S.Update(S.CurrentTime.Add(ts));
      Assert.AreEqual(200, storage.CurrentStoredWater.Volume);
      Assert.AreEqual(200.0 / 300.0, storage.CurrentStoredWater.Composition[2], 0.000001);

      Assert.AreEqual(1, S.Output.GetStorageTime(Start, Start.AddHours(2)).TotalHours,0.001);

    }
Example #13
0
        private Model CreateHydroNetModel()
        {
            
            DateTime startTime = new DateTime(2000, 1, 1);
          

            // -------------------- Polygons --------------------------------------
            HydroNumerics.Geometry.XYPolygon upperLakeGeometry = new HydroNumerics.Geometry.XYPolygon();
            upperLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(535.836, 2269.625));
            upperLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(675.768, 2187.713));
            upperLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(771.331, 2177.474));
            upperLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(887.372, 2184.300));
            upperLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(935.154, 2255.973));
            upperLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(945.392, 2385.666));
            upperLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(931.741, 2505.119));
            upperLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(877.133, 2546.075));
            upperLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(812.287, 2638.225));
            upperLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(696.246, 2675.768));
            upperLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(638.225, 2627.986));
            upperLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(573.379, 2587.031));

            HydroNumerics.Geometry.XYPolygon lowerLakeGeometry = new HydroNumerics.Geometry.XYPolygon();
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1935.154, 1150.171));
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1901.024, 1058.020));
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1877.133, 965.870));
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1894.198, 897.611));
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1938.567, 808.874));
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(2023.891, 761.092));
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(2116.041, 740.614));
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(2232.082, 747.440));
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(2327.645, 808.874));
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(2389.078, 969.283));
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(2372.014, 1109.215));
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(2262.799, 1218.430));
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(2105.802, 1235.495));
            lowerLakeGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1982.935, 1225.256));

            HydroNumerics.Geometry.XYPolygon upperStreamGeometry = new HydroNumerics.Geometry.XYPolygon();
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(863.481, 2177.474));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(914.676, 2129.693));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(965.870, 2071.672));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(976.109, 2027.304));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(976.109, 1989.761));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1006.826, 1959.044));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1051.195, 1918.089));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1095.563, 1877.133));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1126.280, 1808.874));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1187.713, 1781.570));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1228.669, 1730.375));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1262.799, 1665.529));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1283.276, 1597.270));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1317.406, 1535.836));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1341.297, 1484.642));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1389.078, 1457.338));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1423.208, 1440.273));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1477.816, 1402.730));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1511.945, 1358.362));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1539.249, 1327.645));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1566.553, 1354.949));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1535.836, 1406.143));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1508.532, 1457.338));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1440.273, 1522.184));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1368.601, 1580.205));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1327.645, 1631.399));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1307.167, 1696.246));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1269.625, 1767.918));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1221.843, 1819.113));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1191.126, 1843.003));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1136.519, 1894.198));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1088.737, 1935.154));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1061.433, 1976.109));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1030.717, 2040.956));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1013.652, 2105.802));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(972.696, 2177.474));
            upperStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(918.089, 2228.669));

            HydroNumerics.Geometry.XYPolygon lowerStreamGeometry = new HydroNumerics.Geometry.XYPolygon();
            lowerStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1904.437, 1081.911));
            lowerStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1921.502, 1153.584));
            lowerStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1771.331, 1255.973));
            lowerStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1573.379, 1354.949));
            lowerStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1542.662, 1324.232));
            lowerStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1597.270, 1273.038));
            lowerStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1709.898, 1215.017));
            lowerStreamGeometry.Points.Add(new HydroNumerics.Geometry.XYPoint(1839.590, 1143.345));

            // --- precipitation --------------------------------------------------

            const int numberOfTimesteps = 2190;
            double[] precipitation = new double[numberOfTimesteps] { 0.0000, 0.0000, 2.3000, 0.2000, 0.0000, 0.1000, 0.1000, 0.0000, 0.3000, 0.4000, 0.1000, 0.1000, 1.0000, 0.0000, 0.5000, 5.3000, 1.9000, 0.1000, 0.0000, 0.4000, 1.1000, 1.2000, 2.6000, 0.0000, 1.5000, 3.4000, 6.0000, 0.7000, 4.0000, 0.1000, 0.6000, 2.0000, 0.4000, 0.1000, 0.0000, 0.0000, 0.0000, 4.1000, 0.2000, 4.0000, 0.3000, 0.6000, 3.1000, 14.1000, 3.9000, 0.1000, 3.7000, 2.4000, 4.3000, 0.0000, 0.0000, 0.0000, 0.0000, 2.7000, 1.0000, 0.1000, 0.3000, 0.2000, 0.0000, 0.2000, 8.7000, 2.0000, 1.8000, 0.9000, 0.1000, 0.2000, 0.1000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.6000, 1.8000, 0.0000, 1.1000, 4.7000, 2.4000, 0.0000, 0.1000, 8.2000, 4.6000, 1.0000, 0.1000, 0.0000, 0.0000, 7.8000, 2.0000, 0.3000, 0.0000, 0.1000, 0.1000, 0.0000, 0.0000, 0.3000, 0.1000, 2.2000, 2.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 6.7000, 0.0000, 0.0000, 0.0000, 5.4000, 2.2000, 1.0000, 10.8000, 3.6000, 3.1000, 10.1000, 0.0000, 0.3000, 2.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.3000, 0.0000, 0.0000, 7.6000, 3.6000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 4.5000, 0.0000, 12.8000, 0.0000, 4.4000, 0.0000, 0.0000, 0.0000, 0.0000, 4.9000, 0.0000, 0.8000, 0.0000, 2.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 7.1000, 0.2000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 4.4000, 1.5000, 4.6000, 1.4000, 0.8000, 0.0000, 0.0000, 0.0000, 0.0000, 5.5000, 4.6000, 1.3000, 0.1000, 2.8000, 2.6000, 0.0000, 0.1000, 3.5000, 1.0000, 8.7000, 0.5000, 0.0000, 0.4000, 0.0000, 0.0000, 0.0000, 0.0000, 3.8000, 4.9000, 4.6000, 2.5000, 7.9000, 0.1000, 4.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.6000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2000, 14.4000, 2.0000, 6.2000, 0.5000, 0.3000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 3.2000, 8.1000, 1.3000, 20.2000, 13.5000, 1.1000, 1.3000, 0.0000, 0.0000, 2.1000, 13.7000, 3.9000, 0.5000, 0.1000, 0.0000, 0.0000, 0.1000, 0.0000, 0.0000, 0.2000, 4.8000, 7.2000, 0.4000, 0.0000, 4.6000, 0.2000, 0.0000, 0.0000, 0.5000, 4.8000, 9.8000, 0.6000, 0.0000, 0.0000, 0.0000, 0.0000, 3.2000, 0.0000, 0.0000, 0.0000, 0.0000, 0.4000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.5000, 8.5000, 0.5000, 1.9000, 1.2000, 0.0000, 3.2000, 1.7000, 12.3000, 1.9000, 0.0000, 4.3000, 3.6000, 1.1000, 6.7000, 5.4000, 0.0000, 0.0000, 0.9000, 10.0000, 7.8000, 0.1000, 1.3000, 0.5000, 0.1000, 0.2000, 0.5000, 0.0000, 7.2000, 0.0000, 0.0000, 10.2000, 9.7000, 0.2000, 0.1000, 0.9000, 3.5000, 1.2000, 4.9000, 4.6000, 3.5000, 1.1000, 5.8000, 0.4000, 0.0000, 0.0000, 0.6000, 0.1000, 1.2000, 0.8000, 9.4000, 1.5000, 0.1000, 0.1000, 0.2000, 0.9000, 4.8000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.0000, 0.1000, 1.9000, 0.8000, 0.9000, 2.1000, 7.9000, 3.8000, 3.8000, 9.6000, 1.4000, 7.9000, 0.4000, 0.6000, 0.7000, 0.0000, 0.0000, 0.0000, 7.0000, 0.1000, 0.1000, 0.1000, 5.3000, 1.0000, 4.3000, 0.2000, 0.0000, 1.8000, 0.1000, 0.6000, 0.0000, 1.5000, 3.2000, 0.1000, 4.1000, 5.5000, 10.6000, 9.0000, 0.9000, 0.8000, 2.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.4000, 0.6000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.1000, 2.5000, 5.7000, 2.3000, 2.0000, 0.6000, 0.8000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 4.2000, 9.6000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 9.3000, 0.0000, 0.0000, 0.0000, 0.0000, 5.3000, 0.0000, 0.0000, 0.7000, 9.0000, 0.2000, 0.0000, 0.0000, 2.8000, 2.4000, 1.5000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 6.4000, 0.0000, 0.0000, 0.8000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 7.1000, 0.1000, 0.0000, 0.2000, 0.0000, 0.0000, 0.2000, 0.0000, 0.6000, 0.9000, 10.0000, 5.1000, 4.1000, 10.3000, 1.9000, 0.0000, 0.0000, 0.0000, 0.2000, 4.2000, 0.4000, 5.8000, 0.5000, 0.1000, 3.3000, 4.9000, 1.4000, 0.5000, 0.0000, 1.8000, 2.5000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 1.4000, 0.0000, 2.4000, 7.6000, 5.2000, 11.4000, 0.1000, 1.1000, 0.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.8000, 0.0000, 2.3000, 0.4000, 0.0000, 0.0000, 0.0000, 0.0000, 5.2000, 2.2000, 0.0000, 10.0000, 5.3000, 1.2000, 8.0000, 30.7000, 2.9000, 0.0000, 0.0000, 0.0000, 6.8000, 0.0000, 0.0000, 0.0000, 1.4000, 0.5000, 4.1000, 0.1000, 10.6000, 11.2000, 2.5000, 6.2000, 5.3000, 4.5000, 12.8000, 0.1000, 1.0000, 0.0000, 0.0000, 22.7000, 2.5000, 5.5000, 3.7000, 0.8000, 0.0000, 1.6000, 1.7000, 3.8000, 0.2000, 0.3000, 0.0000, 0.4000, 0.0000, 0.2000, 0.5000, 1.0000, 16.3000, 0.3000, 4.3000, 14.8000, 0.0000, 2.7000, 0.0000, 2.8000, 3.2000, 5.3000, 2.1000, 0.0000, 2.2000, 0.4000, 0.3000, 0.1000, 0.0000, 0.0000, 1.8000, 0.5000, 9.4000, 11.4000, 2.4000, 9.2000, 1.1000, 11.1000, 6.4000, 8.3000, 15.3000, 0.1000, 6.8000, 2.9000, 0.0000, 0.3000, 0.4000, 0.2000, 3.3000, 6.2000, 1.0000, 9.0000, 5.5000, 0.0000, 0.0000, 3.0000, 1.1000, 0.0000, 10.8000, 0.0000, 7.1000, 2.0000, 1.6000, 7.2000, 9.4000, 0.9000, 6.1000, 1.4000, 2.5000, 0.6000, 8.1000, 0.9000, 2.8000, 5.0000, 3.3000, 2.1000, 9.5000, 0.0000, 6.0000, 7.0000, 0.0000, 2.2000, 1.8000, 0.2000, 1.1000, 5.2000, 0.0000, 0.3000, 1.6000, 0.8000, 0.4000, 0.0000, 0.2000, 1.4000, 5.9000, 7.1000, 7.0000, 1.9000, 1.5000, 0.1000, 0.3000, 5.6000, 4.1000, 4.8000, 1.5000, 1.5000, 2.7000, 11.4000, 8.6000, 3.7000, 5.7000, 1.3000, 13.4000, 5.6000, 5.9000, 5.4000, 5.3000, 0.1000, 0.1000, 0.2000, 0.0000, 0.5000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 4.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.0000, 2.9000, 3.0000, 1.0000, 14.6000, 0.6000, 5.0000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 1.6000, 2.2000, 0.0000, 0.0000, 0.6000, 0.0000, 0.2000, 2.4000, 0.3000, 0.0000, 0.3000, 5.8000, 1.6000, 1.6000, 5.7000, 2.8000, 1.9000, 0.6000, 2.8000, 0.0000, 8.8000, 2.5000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 3.1000, 0.0000, 0.0000, 0.0000, 0.2000, 0.5000, 0.0000, 3.7000, 5.0000, 10.2000, 1.2000, 0.4000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.6000, 0.3000, 0.0000, 0.0000, 2.2000, 8.4000, 11.5000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.8000, 12.4000, 2.8000, 3.9000, 10.1000, 4.5000, 6.6000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.5000, 0.5000, 0.0000, 0.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.3000, 0.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 3.2000, 1.4000, 7.3000, 0.0000, 3.7000, 11.1000, 1.2000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 8.3000, 2.2000, 6.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2000, 0.0000, 0.0000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 11.6000, 5.9000, 0.0000, 0.0000, 8.9000, 17.1000, 0.1000, 4.9000, 2.3000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 14.5000, 2.7000, 1.9000, 3.3000, 0.0000, 0.0000, 19.9000, 2.4000, 4.1000, 2.0000, 4.2000, 0.9000, 0.3000, 0.0000, 0.1000, 0.3000, 0.0000, 3.1000, 2.5000, 0.0000, 1.6000, 3.8000, 8.2000, 5.7000, 7.7000, 0.3000, 0.0000, 5.4000, 7.9000, 1.3000, 10.0000, 0.6000, 0.7000, 0.0000, 0.0000, 0.0000, 0.9000, 0.0000, 0.0000, 0.1000, 2.6000, 6.3000, 4.7000, 0.7000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 2.3000, 2.0000, 0.0000, 3.1000, 0.9000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.3000, 0.4000, 7.5000, 12.4000, 2.9000, 0.5000, 7.6000, 1.6000, 2.3000, 0.0000, 0.0000, 2.1000, 2.3000, 8.0000, 2.1000, 1.7000, 0.0000, 0.0000, 17.9000, 4.5000, 0.5000, 0.7000, 0.3000, 0.0000, 1.1000, 0.1000, 0.0000, 0.0000, 1.1000, 0.1000, 0.0000, 1.2000, 0.0000, 1.2000, 0.8000, 0.7000, 0.0000, 0.1000, 0.2000, 0.2000, 0.0000, 0.4000, 1.3000, 0.0000, 0.0000, 0.0000, 0.1000, 1.4000, 0.0000, 0.0000, 2.3000, 0.2000, 0.0000, 0.1000, 0.1000, 0.0000, 0.3000, 0.4000, 0.1000, 0.1000, 1.0000, 0.0000, 0.5000, 5.3000, 1.9000, 0.1000, 0.0000, 0.4000, 1.1000, 1.2000, 2.6000, 0.0000, 1.5000, 3.4000, 6.0000, 0.7000, 4.0000, 0.1000, 0.6000, 2.0000, 0.4000, 0.1000, 0.0000, 0.0000, 0.0000, 4.1000, 0.2000, 4.0000, 0.3000, 0.6000, 3.1000, 14.1000, 3.9000, 0.1000, 3.7000, 2.4000, 4.3000, 0.0000, 0.0000, 0.0000, 0.0000, 2.7000, 1.0000, 0.1000, 0.3000, 0.2000, 0.0000, 0.2000, 8.7000, 2.0000, 1.8000, 0.9000, 0.1000, 0.2000, 0.1000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.6000, 1.8000, 0.0000, 1.1000, 4.7000, 2.4000, 0.0000, 0.1000, 8.2000, 4.6000, 1.0000, 0.1000, 0.0000, 0.0000, 7.8000, 2.0000, 0.3000, 0.0000, 0.1000, 0.1000, 0.0000, 0.0000, 0.3000, 0.1000, 2.2000, 2.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 6.7000, 0.0000, 0.0000, 0.0000, 5.4000, 2.2000, 1.0000, 10.8000, 3.6000, 3.1000, 10.1000, 0.0000, 0.3000, 2.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.3000, 0.0000, 0.0000, 7.6000, 3.6000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 4.5000, 0.0000, 12.8000, 0.0000, 4.4000, 0.0000, 0.0000, 0.0000, 0.0000, 4.9000, 0.0000, 0.8000, 0.0000, 2.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 7.1000, 0.2000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 4.4000, 1.5000, 4.6000, 1.4000, 0.8000, 0.0000, 0.0000, 0.0000, 0.0000, 5.5000, 4.6000, 1.3000, 0.1000, 2.8000, 2.6000, 0.0000, 0.1000, 3.5000, 1.0000, 8.7000, 0.5000, 0.0000, 0.4000, 0.0000, 0.0000, 0.0000, 0.0000, 3.8000, 4.9000, 4.6000, 2.5000, 7.9000, 0.1000, 4.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.6000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2000, 14.4000, 2.0000, 6.2000, 0.5000, 0.3000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 3.2000, 8.1000, 1.3000, 20.2000, 13.5000, 1.1000, 1.3000, 0.0000, 0.0000, 2.1000, 13.7000, 3.9000, 0.5000, 0.1000, 0.0000, 0.0000, 0.1000, 0.0000, 0.0000, 0.2000, 4.8000, 7.2000, 0.4000, 0.0000, 4.6000, 0.2000, 0.0000, 0.0000, 0.5000, 4.8000, 9.8000, 0.6000, 0.0000, 0.0000, 0.0000, 0.0000, 3.2000, 0.0000, 0.0000, 0.0000, 0.0000, 0.4000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.5000, 8.5000, 0.5000, 1.9000, 1.2000, 0.0000, 3.2000, 1.7000, 12.3000, 1.9000, 0.0000, 4.3000, 3.6000, 1.1000, 6.7000, 5.4000, 0.0000, 0.0000, 0.9000, 10.0000, 7.8000, 0.1000, 1.3000, 0.5000, 0.1000, 0.2000, 0.5000, 0.0000, 7.2000, 0.0000, 0.0000, 10.2000, 9.7000, 0.2000, 0.1000, 0.9000, 3.5000, 1.2000, 4.9000, 4.6000, 3.5000, 1.1000, 5.8000, 0.4000, 0.0000, 0.0000, 0.6000, 0.1000, 1.2000, 0.8000, 9.4000, 1.5000, 0.1000, 0.1000, 0.2000, 0.9000, 4.8000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.0000, 0.1000, 1.9000, 0.8000, 0.9000, 2.1000, 7.9000, 3.8000, 3.8000, 9.6000, 1.4000, 7.9000, 0.4000, 0.6000, 0.7000, 0.0000, 0.0000, 0.0000, 7.0000, 0.1000, 0.1000, 0.1000, 5.3000, 1.0000, 4.3000, 0.2000, 0.0000, 1.8000, 0.1000, 0.6000, 0.0000, 1.5000, 3.2000, 0.1000, 4.1000, 5.5000, 10.6000, 9.0000, 0.9000, 0.8000, 2.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.4000, 0.6000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.1000, 2.5000, 5.7000, 2.3000, 2.0000, 0.6000, 0.8000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 4.2000, 9.6000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 9.3000, 0.0000, 0.0000, 0.0000, 0.0000, 5.3000, 0.0000, 0.0000, 0.7000, 9.0000, 0.2000, 0.0000, 0.0000, 2.8000, 2.4000, 1.5000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 6.4000, 0.0000, 0.0000, 0.8000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 0.0000, 7.1000, 0.1000, 0.0000, 0.2000, 0.0000, 0.0000, 0.2000, 0.0000, 0.6000, 0.9000, 10.0000, 5.1000, 4.1000, 10.3000, 1.9000, 0.0000, 0.0000, 0.0000, 0.2000, 4.2000, 0.4000, 5.8000, 0.5000, 0.1000, 3.3000, 4.9000, 1.4000, 0.5000, 0.0000, 1.8000, 2.5000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 1.4000, 0.0000, 2.4000, 7.6000, 5.2000, 11.4000, 0.1000, 1.1000, 0.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.8000, 0.0000, 2.3000, 0.4000, 0.0000, 0.0000, 0.0000, 0.0000, 5.2000, 2.2000, 0.0000, 10.0000, 5.3000, 1.2000, 8.0000, 30.7000, 2.9000, 0.0000, 0.0000, 0.0000, 6.8000, 0.0000, 0.0000, 0.0000, 1.4000, 0.5000, 4.1000, 0.1000, 10.6000, 11.2000, 2.5000, 6.2000, 5.3000, 4.5000, 12.8000, 0.1000, 1.0000, 0.0000, 0.0000, 22.7000, 2.5000, 5.5000, 3.7000, 0.8000, 0.0000, 1.6000, 1.7000, 3.8000, 0.2000, 0.3000, 0.0000, 0.4000, 0.0000, 0.2000, 0.5000, 1.0000, 16.3000, 0.3000, 4.3000, 14.8000, 0.0000, 2.7000, 0.0000, 2.8000, 3.2000, 5.3000, 2.1000, 0.0000, 2.2000, 0.4000, 0.3000, 0.1000, 0.0000, 0.0000, 1.8000, 0.5000, 9.4000, 11.4000, 2.4000, 9.2000, 1.1000, 11.1000, 6.4000, 8.3000, 15.3000, 0.1000, 6.8000, 2.9000, 0.0000, 0.3000, 0.4000, 0.2000, 3.3000, 6.2000, 1.0000, 9.0000, 5.5000, 0.0000, 0.0000, 3.0000, 1.1000, 0.0000, 10.8000, 0.0000, 7.1000, 2.0000, 1.6000, 7.2000, 9.4000, 0.9000, 6.1000, 1.4000, 2.5000, 0.6000, 8.1000, 0.9000, 2.8000, 5.0000, 3.3000, 2.1000, 9.5000, 0.0000, 6.0000, 7.0000, 0.0000, 2.2000, 1.8000, 0.2000, 1.1000, 5.2000, 0.0000, 0.3000, 1.6000, 0.8000, 0.4000, 0.0000, 0.2000, 1.4000, 5.9000, 7.1000, 7.0000, 1.9000, 1.5000, 0.1000, 0.3000, 5.6000, 4.1000, 4.8000, 1.5000, 1.5000, 2.7000, 11.4000, 8.6000, 3.7000, 5.7000, 1.3000, 13.4000, 5.6000, 5.9000, 5.4000, 5.3000, 0.1000, 0.1000, 0.2000, 0.0000, 0.5000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 4.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 0.0000, 2.9000, 3.0000, 1.0000, 14.6000, 0.6000, 5.0000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 1.6000, 2.2000, 0.0000, 0.0000, 0.6000, 0.0000, 0.2000, 2.4000, 0.3000, 0.0000, 0.3000, 5.8000, 1.6000, 1.6000, 5.7000, 2.8000, 1.9000, 0.6000, 2.8000, 0.0000, 8.8000, 2.5000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 3.1000, 0.0000, 0.0000, 0.0000, 0.2000, 0.5000, 0.0000, 3.7000, 5.0000, 10.2000, 1.2000, 0.4000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.6000, 0.3000, 0.0000, 0.0000, 2.2000, 8.4000, 11.5000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.8000, 12.4000, 2.8000, 3.9000, 10.1000, 4.5000, 6.6000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.5000, 0.5000, 0.0000, 0.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.3000, 0.7000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 3.2000, 1.4000, 7.3000, 0.0000, 3.7000, 11.1000, 1.2000, 0.0000, 0.0000, 0.0000, 0.0000, 0.1000, 8.3000, 2.2000, 6.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2000, 0.0000, 0.0000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 11.6000, 5.9000, 0.0000, 0.0000, 8.9000, 17.1000, 0.1000, 4.9000, 2.3000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 14.5000, 2.7000, 1.9000, 3.3000, 0.0000, 0.0000, 19.9000, 2.4000, 4.1000, 2.0000, 4.2000, 0.9000, 0.3000, 0.0000, 0.1000, 0.3000, 0.0000, 3.1000, 2.5000, 0.0000, 1.6000, 3.8000, 8.2000, 5.7000, 7.7000, 0.3000, 0.0000, 5.4000, 7.9000, 1.3000, 10.0000, 0.6000, 0.7000, 0.0000, 0.0000, 0.0000, 0.9000, 0.0000, 0.0000, 0.1000, 2.6000, 6.3000, 4.7000, 0.7000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.2000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 2.3000, 2.0000, 0.0000, 3.1000, 0.9000, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.3000, 0.4000, 7.5000, 12.4000, 2.9000, 0.5000, 7.6000, 1.6000, 2.3000, 0.0000, 0.0000, 2.1000, 2.3000, 8.0000, 2.1000, 1.7000, 0.0000, 0.0000, 17.9000, 4.5000, 0.5000, 0.7000, 0.3000, 0.0000, 1.1000, 0.1000, 0.0000, 0.0000, 1.1000, 0.1000, 0.0000, 1.2000, 0.0000, 1.2000, 0.8000, 0.7000, 0.0000, 0.1000, 0.2000, 0.2000, 0.0000, 0.4000, 1.3000, 0.0000, 0.0000, 0.0000, 0.1000, 1.4000 };
            HydroNumerics.Time.Core.TimestampSeries precipitationTs = new HydroNumerics.Time.Core.TimestampSeries("PrecipitationTS", startTime, numberOfTimesteps, 1, HydroNumerics.Time.Core.TimestepUnit.Days, -99999, new HydroNumerics.Core.Unit("m3PrSec", 1, 0));
            //HydroNumerics.Time.Core.TimestampSeries precipitationTs = new HydroNumerics.Time.Core.TimestampSeries("PrecipitationTS", startTime, numberOfTimesteps, 1, HydroNumerics.Time.Core.TimestepUnit.Days, -99999, new HydroNumerics.Core.Unit("mmPrDay", 1.0/(1000*24*3600), 0));
            for (int i = 0; i < numberOfTimesteps; i++)
            {
                precipitationTs.Items[i].Value = precipitation[i]  / (24 * 3600 * 1000);
                //precipitationTs.Items[i].Value = precipitation[i];
            }
            // --------------------------------------------------------------------


            // Upper Lake configuration
            //Lake upperLake = new Lake("Upper Lake", 2 * upperLakeGeometry.GetArea());
            Lake upperLake = new Lake("Upper Lake", upperLakeGeometry);
            upperLake.WaterLevel = 6.1;
            upperLake.Depth = 2;
            upperLake.Output.LogAllChemicals = true;
            

            //Lake lowerLake = new Lake("lower Lake", 2 * lowerLakeGeometry.GetArea());
            Lake lowerLake = new Lake("lower Lake", lowerLakeGeometry);
            lowerLake.Depth = 2;
            lowerLake.WaterLevel = 6.0;
            lowerLake.Output.LogAllChemicals = true;

            HydroNet.Core.Stream upperStream = new HydroNet.Core.Stream("The stream", 2000, 2, 1);
            upperStream.WaterLevel = 6.0;
            upperStream.Output.LogAllChemicals = true;
            
            HydroNet.Core.Stream lowerStream = new HydroNet.Core.Stream("Lower Stream", 1000, 2, 1);
            lowerStream.WaterLevel = 6.0;
            lowerStream.Output.LogAllChemicals = true;

            //SinkSourceBoundary upperLakePrecipitation = new SinkSourceBoundary(0.002 * contactPolygonUpperLake.GetArea() / (24 * 3600));
            SinkSourceBoundary upperLakePrecipitation = new SinkSourceBoundary(precipitationTs);
            upperLakePrecipitation.ContactGeometry = upperLakeGeometry;
            
            upperLakePrecipitation.Name = "Inflow to upperlake";


            //SinkSourceBoundary lowerLakePrecipitation = new SinkSourceBoundary(0.002 * contactPolygonLowerLake.GetArea()/ (24 * 3600));
            SinkSourceBoundary lowerLakePrecipitation = new SinkSourceBoundary(precipitationTs);
            lowerLakePrecipitation.ContactGeometry = lowerLakeGeometry;
            upperLakePrecipitation.Name = "Inflow to lowerlake";

            // -------- Groundwater boundary under upper lake ----------
            GroundWaterBoundary groundWaterBoundaryUpperLake = new GroundWaterBoundary();
            groundWaterBoundaryUpperLake.Connection = upperLake;
            groundWaterBoundaryUpperLake.ContactGeometry = upperLakeGeometry;
            groundWaterBoundaryUpperLake.Distance = 2.3;
            groundWaterBoundaryUpperLake.HydraulicConductivity = 1e-9;
            groundWaterBoundaryUpperLake.GroundwaterHead = 5.0;
            groundWaterBoundaryUpperLake.Name = "Groundwater boundary under UpperLake";
            groundWaterBoundaryUpperLake.Name = "UpperGWBoundary";
            ((WaterPacket)groundWaterBoundaryUpperLake.WaterSample).AddChemical(ChemicalFactory.Instance.GetChemical(ChemicalNames.Radon), 2.3);
            ((WaterPacket)groundWaterBoundaryUpperLake.WaterSample).AddChemical(ChemicalFactory.Instance.GetChemical(ChemicalNames.Cl), 2.3);

            // -------- Groundwater boundary under lower lake ----------
            GroundWaterBoundary groundWaterBoundaryLowerLake = new GroundWaterBoundary();
            groundWaterBoundaryLowerLake.Connection = lowerLake;
            groundWaterBoundaryLowerLake.ContactGeometry = lowerLakeGeometry;
            groundWaterBoundaryLowerLake.Distance = 2.3;
            groundWaterBoundaryLowerLake.HydraulicConductivity = 1e-12;
            groundWaterBoundaryLowerLake.GroundwaterHead = 5.0;
            groundWaterBoundaryLowerLake.Name = "Groundwater boundary under LowerLake";
            groundWaterBoundaryLowerLake.Name = "LowerGWBoundary";

            //--- Ground water boundary upper Stream ------
            GroundWaterBoundary groundWaterBoundaryUpperStream = new GroundWaterBoundary();
            groundWaterBoundaryUpperStream.Connection = upperStream;
            groundWaterBoundaryUpperStream.ContactGeometry = upperStreamGeometry;
            groundWaterBoundaryUpperStream.Distance = 2.3;
            groundWaterBoundaryUpperStream.HydraulicConductivity = 1e-12;
            groundWaterBoundaryUpperStream.GroundwaterHead = 5.0;
            groundWaterBoundaryUpperStream.Name = "Groundwater boundary Upper Stream";
            groundWaterBoundaryUpperStream.Name = "UpperStreamGWBoundary";
            
            // ---------  Ground water boundary lower stream ------------------------------------------
            GroundWaterBoundary groundWaterBoundaryLowerStream = new GroundWaterBoundary();
            groundWaterBoundaryLowerStream.Connection = lowerStream;
            groundWaterBoundaryLowerStream.ContactGeometry = lowerStreamGeometry;
            groundWaterBoundaryLowerStream.Distance = 2.3;
            groundWaterBoundaryLowerStream.HydraulicConductivity = 1e-12;
            groundWaterBoundaryLowerStream.GroundwaterHead = 5.0;
            groundWaterBoundaryLowerStream.Name = "Groundwater boundary Lower Stream";
            groundWaterBoundaryLowerStream.Name = "LowerStreamGWBoundary";
            // ------------------------------------------------------------------------------

            upperLake.SurfaceArea = upperLakeGeometry;
            lowerLake.SurfaceArea = lowerLakeGeometry;
            upperLake.Precipitation.Add(upperLakePrecipitation);
            lowerLake.Precipitation.Add(lowerLakePrecipitation);

            upperLake.GroundwaterBoundaries.Add(groundWaterBoundaryUpperLake);
            upperStream.GroundwaterBoundaries.Add(groundWaterBoundaryUpperStream);
            lowerStream.GroundwaterBoundaries.Add(groundWaterBoundaryLowerStream);
            lowerLake.GroundwaterBoundaries.Add(groundWaterBoundaryLowerLake);

 
            upperLake.DownStreamConnections.Add(upperStream);
            upperStream.DownStreamConnections.Add(lowerStream);
            lowerStream.DownStreamConnections.Add(lowerLake);

            //Creating the model
            Model model = new Model();
            model._waterBodies.Add(upperLake);
            model._waterBodies.Add(upperStream);
            model._waterBodies.Add(lowerStream);
            model._waterBodies.Add(lowerLake);
            

            WaterPacket waterPacket = new WaterPacket(1000);
            waterPacket.AddChemical(ChemicalFactory.Instance.GetChemical(ChemicalNames.Cl), 9.2);

            WaterPacket waterpacketLowerLake = new WaterPacket(lowerLake.Volume);
            waterpacketLowerLake.AddChemical(ChemicalFactory.Instance.GetChemical(ChemicalNames.Cl), 4.2);


            model.SetState("MyState", startTime, waterPacket);
            lowerLake.SetState("MyState", startTime, waterpacketLowerLake);
            
            //model.SetState("kkk", startTime, new 
            //upperLake.SetState("MyState", startTime, new WaterPacket(2));
            model.Name = "Lake model";
            model.Initialize();
            //model.Update(new DateTime(2001, 1, 1));
            return model;
        }
    public void GetSourceWaterTest()
    {
      s.WaterLevel = 18;
      TimeSpan TimeStep = new TimeSpan(1, 0, 0);
      DateTime Start = DateTime.Now;

      int ID = 1;
      IWaterPacket expected = new WaterPacket(ID, area * hydraulicConductivity * (head - s.WaterLevel) / distance * TimeStep.TotalSeconds);
      IWaterPacket actual;

      actual = target.GetSourceWater(Start, TimeStep);
      Assert.AreEqual(ID, actual.Composition.Keys.First());
      Assert.AreEqual(expected.Volume, actual.Volume,0.000001);
    }
Example #15
0
    public void SortingOfIncomingWater()
    {
      Stream_Accessor s = new Stream_Accessor("s", 100,1,1);

      
      WaterPacket wp1 = new WaterPacket(1, 50);
      WaterPacket wp2 = new WaterPacket(2,100);

      s.AddWaterPacket(new DateTime(2000, 1, 1), new DateTime(2000, 1, 11), wp1);
      s.AddWaterPacket(new DateTime(2000, 1, 6), new DateTime(2000, 1, 11), wp2);

      s.PrePareIncomingWater();

      Assert.AreEqual(2, s._incomingWater.Count);
      
      IWaterPacket iwp = s._incomingWater.Dequeue();
      Assert.AreEqual(25, iwp.Volume);
      Assert.AreEqual(1, iwp.Composition[1]);

      iwp = s._incomingWater.Dequeue();
      Assert.AreEqual(125, iwp.Volume);
      Assert.AreEqual(25.0 / 125.0, iwp.Composition[1]);
      Assert.AreEqual(100.0 / 125.0, iwp.Composition[2]);
      
      WaterPacket wp3 = new WaterPacket(3,100);
      WaterPacket wp4 = new WaterPacket(4, 200);
      WaterPacket wp5 = new WaterPacket(5, 300);

      s.AddWaterPacket(new DateTime(2000, 1, 1), new DateTime(2000, 1, 3), wp3);
      s.AddWaterPacket(new DateTime(2000, 1, 2), new DateTime(2000, 1, 3), wp4);
      s.AddWaterPacket(new DateTime(2001, 1, 1, 12, 0, 0), new DateTime(2001, 1, 5), wp5);

      s.PrePareIncomingWater();

     

    }
    public void AddTest()
    {
      int ID1 = 1;
      int ID2 = 2;

      WaterPacket w = new WaterPacket(1);
      w.IDForComposition = ID1;
      
      
      WaterPacket w2 = new WaterPacket(9);
      w2.IDForComposition = ID2;

      w.Add(w2);
      Assert.AreEqual(10, w.Volume);
      Assert.AreEqual(0.1, w.Composition[ID1]);
      Assert.AreEqual(0.9, w.Composition[ID2]);
      Assert.AreEqual(1, w2.Composition[ID2]);
    }
Example #17
0
 /// <summary>
 /// Returns a deep clone of this waterpacket with the specified volumen.
 /// This is a non-physical method that will destroy mass balance.
 /// Should only be used for data storage and non-physical boundaries.
 /// </summary>
 /// <param name="Volume"></param>
 /// <returns></returns>
 public virtual IWaterPacket DeepClone(double Volume)
 {
   WaterPacket W = new WaterPacket(Volume);
   DeepClone(W, Volume);
   return W;
 }
Example #18
0
    public void TestMethod1()
    {
      Lake Hampen = LakeFactory.GetLake("Hampen Sø");
      Hampen.Depth = 3.2e6 / 760000/1000;

      DateTime start = new DateTime(2008, 1, 1);
      DateTime end = new DateTime(2008, 12, 31);

      Assert.AreEqual(Hampen.Area, 722200,1);

      EvaporationRateBoundary er = new EvaporationRateBoundary(407.0 / 1000 / 365 / 86400);
      er.ContactGeometry = Hampen.Geometry;
      er.Name = "Fordampning";
      Hampen.EvaporationBoundaries.Add(er);

      SourceBoundary pr = new SourceBoundary(901.0 / 1000 / 365 / 86400);
      pr.ContactGeometry = Hampen.Geometry;
      pr.Name = "Nedbør";
      Hampen.Precipitation.Add(pr);

      SinkSourceBoundary outlet = new SinkSourceBoundary(-200.0 / 1000 / 365 / 86400);
      outlet.ContactGeometry = Hampen.Geometry;
      outlet.Name = "Udløb";
      Hampen.Sinks.Add(outlet);

      GroundWaterBoundary gwb = new GroundWaterBoundary();
      gwb.FlowType = GWType.Flow;
      gwb.Name = "Ud";
      gwb.WaterFlow = new HydroNumerics.Time.Core.TimespanSeries("inflow", new DateTime(2008, 1, 1), 2, 1, HydroNumerics.Time.Core.TimestepUnit.Years, -294.0 / 1000 / 365 / 86400*Hampen.Area);
      Hampen.GroundwaterBoundaries.Add(gwb);


      Model m = new Model();
      m._waterBodies.Add(Hampen);

      m.SetState("start", start , new WaterPacket(1));
      m.SimulationStartTime = start;
      m.SimulationEndTime = end;
      m.MoveInTime(end,TimeSpan.FromDays(30));
      m.Save(@"..\..\..\TestData\Hampen1.xml");

      WaterPacket ChlorideWater = new WaterPacket(1);
      ChlorideWater.SetConcentration(ChemicalNames.Cl, 20);
      ChlorideWater.SetConcentration(ChemicalNames.IsotopeFraction, 4);
      ChlorideWater.SetConcentration(ChemicalNames.Nitrate, 0.2);
      ChlorideWater.SetConcentration(ChemicalNames.Phosphate, 0.02);

      m.SetState("start", start, ChlorideWater);
      Hampen.Output.LogAllChemicals = true;

      double gwinflow = 1000.0;


      gwb.WaterFlow = new HydroNumerics.Time.Core.TimespanSeries("inflow", new DateTime(2008, 1, 1), 2, 1, HydroNumerics.Time.Core.TimestepUnit.Years, -(294.0 + gwinflow) / 1000 / 365 / 86400 * Hampen.Area);

      GroundWaterBoundary gwbin = new GroundWaterBoundary();
      gwbin.FlowType = GWType.Flow;
      gwbin.WaterFlow = new HydroNumerics.Time.Core.TimespanSeries("inflow", new DateTime(2008, 1, 1), 2, 1, HydroNumerics.Time.Core.TimestepUnit.Years, 0.955*gwinflow / 1000 / 365 / 86400 * Hampen.Area);
      ChlorideWater.SetConcentration(ChemicalNames.Cl, 30);
      ChlorideWater.SetConcentration(ChemicalNames.IsotopeFraction, 8);
      ChlorideWater.SetConcentration(ChemicalNames.Nitrate, 1.6);
      ChlorideWater.SetConcentration(ChemicalNames.Phosphate, 0.017);
      gwbin.Name = "Ind Skov";
      gwbin.WaterSample = ChlorideWater.DeepClone();
      Hampen.GroundwaterBoundaries.Add(gwbin);

      GroundWaterBoundary gwbin2 = new GroundWaterBoundary();
      gwbin2.FlowType = GWType.Flow;
      gwbin2.WaterFlow = new HydroNumerics.Time.Core.TimespanSeries("inflow", new DateTime(2008, 1, 1), 2, 1, HydroNumerics.Time.Core.TimestepUnit.Years, 0.045 * gwinflow / 1000 / 365 / 86400 * Hampen.Area);
      ChlorideWater.SetConcentration(ChemicalNames.Nitrate, 65.3);
      gwbin2.Name = "Ind Landbrug";
      gwbin2.WaterSample = ChlorideWater.DeepClone();

      Hampen.GroundwaterBoundaries.Add(gwbin2);
      ChlorideWater.SetConcentration(ChemicalNames.Cl, 10);
      ChlorideWater.SetConcentration(ChemicalNames.Phosphate, 0);
      ChlorideWater.SetConcentration(ChemicalNames.Nitrate, 1.7);
      pr.WaterSample = ChlorideWater.DeepClone();

      m.MoveInTime(end, TimeSpan.FromDays(30));
      m.Save(@"..\..\..\TestData\Hampen2.xml");
    
    }
    public void Tagtest()
    {
      WaterPacket w = new WaterPacket(500);

      w.Tag(1234);
      w.Tag(4567);

      Assert.IsTrue(w.LogString.ToString().Contains("1234"));
      Assert.IsTrue(w.LogString.ToString().Contains("4567"));


    }
    public void EvaporateTest()
    {
      WaterPacket w = new WaterPacket(500);

      w.IDForComposition = 1;

      w.Evaporate(200);

      Assert.AreEqual(300, w.Volume);

      Assert.AreEqual(1, w.Composition[1]);

      w.Evaporate(1000);
      Assert.AreEqual(0, w.Volume);

    }
Example #21
0
    public void RoutingOfGroundwaterTest()
    {

      Stream S = new Stream("S", 100,1,1);

      S.SetState("Initial", DateTime.Now, new WaterPacket(100));

      TimeSpan ts = new TimeSpan(0,1,0);

      int Id = 2;
      IWaterPacket expected = new WaterPacket(Id, 200);
      IWaterPacket actual;

      S.WaterLevel = 8;
      GroundWaterBoundary b = new GroundWaterBoundary(S, 0.001, 10, 100, XYPolygon.GetSquare(250));
      b.WaterSample = expected;
      S.GroundwaterBoundaries.Add(b);
      S.Update(S.CurrentTime.Add(ts));

      actual = S.CurrentStoredWater;
      double ExpectedVolume = b.GetSourceWater(DateTime.Now, ts).Volume;

      Assert.AreEqual(expected.Composition.Keys.First(), actual.Composition.Keys.First());
      Assert.AreEqual(100, actual.Volume, 0.000001);

      S.Update(S.CurrentTime.Add(ts));

      actual = S.CurrentStoredWater;
      Assert.AreEqual(expected.Composition.Keys.First(), actual.Composition.Keys.First());
      Assert.AreEqual(100, actual.Volume, 0.000001);

      S.AddWaterPacket(DateTime.Now, DateTime.Now, expected);
      S.Update(S.CurrentTime.Add(ts));
      actual = S.CurrentStoredWater;

      Assert.AreEqual(100, actual.Volume, 0.000001);

    }
Example #22
0
    public void RoutingOfInflow2()
    {
      Stream S = new Stream("S", 25,1,1);

      DateTime Start = DateTime.Now;
      S.SetState("Initial", Start, new WaterPacket(1, 25));

      Stream s2 = new Stream("s2", 50,1,1);
      s2.SetState("Initial", Start, new WaterPacket(50));

      Stream s3 = new Stream("s3", 300,1,1);
      s3.SetState("Initial", Start, new WaterPacket(300));

      S.AddDownStreamWaterBody(s2);
      s2.AddDownStreamWaterBody(s3);

      SinkSourceBoundary FB = new SinkSourceBoundary(0.0005);
      FB.WaterSample = new WaterPacket(5, 5);

      S.Sources.Add(FB);

      TimeSpan ts = new TimeSpan(1, 0, 0);

      WaterPacket WaterProvider = new WaterPacket(2, 200);

      S.AddWaterPacket(DateTime.Now, DateTime.Now, WaterProvider.DeepClone(200));
      S.Update(S.CurrentTime.Add(ts));
    }
Example #23
0
    /// <summary>
    /// Use this constructor to create an empty lake. Should only be used for unit testing
    /// </summary>
    /// <param name="VolumeOfLakeWater"></param>
    public Lake(string name, double VolumeOfLakeWater):base(name)
    {
      SurfaceArea = XYPolygon.GetSquare(VolumeOfLakeWater);
      Depth = 1;

      //Only used in unit test. Otherwise it should be set through the state
      CurrentStoredWater = new WaterPacket(0);
      Initialize();
    }
Example #24
0
    public void RoutingOfChemical()
    {
      Stream_Accessor s = new Stream_Accessor("s", 100, 1, 1);

      s.SetState("Initial", DateTime.Now, new WaterPacket(100));

      SinkSourceBoundary fb = new SinkSourceBoundary(50);
      s.Sources.Add(fb);
      WaterPacket Wcc = new WaterPacket(50);
      Chemical c = ChemicalFactory.Instance.GetChemical(ChemicalNames.Cl);
      Wcc.AddChemical(c, 1);

      fb.WaterSample = Wcc.DeepClone();

      double conc = Wcc.GetConcentration(c);
      Assert.AreEqual(1.0 / 50.0, conc, 0.000001);

      TimeSpan ts = new TimeSpan(0, 0, 1);

      s.Output.LogChemicalConcentration(c);

      s.AddWaterPacket(DateTime.Now, DateTime.Now.AddDays(1), Wcc.DeepClone());
      s.Update(s.CurrentTime.Add(ts));

      WaterPacket WccNew = (WaterPacket)s._waterInStream.Last();
      Assert.AreEqual(64.8721, WccNew.Volume, 0.0001);
      Assert.AreEqual(TimeSpan.FromSeconds(0.5), WccNew.WaterAge);
      Assert.AreEqual(conc, WccNew.GetConcentration(c));

      s.AddWaterPacket(DateTime.Now, DateTime.Now.AddDays(1), Wcc);
      s.Update(s.CurrentTime.Add(TimeSpan.FromDays(1)));

      Assert.AreEqual(0.0042, s.Output.ChemicalsToLog[c].Items[0].Value,1e-4);
      Assert.AreEqual(0.0078, s.Output.ChemicalsToLog[c].Items[1].Value, 1e-4);
      Assert.AreEqual(conc, s.Output.ChemicalsToLog[c].Items[2].Value);


    }
 public SinkSourceBoundary()
 {
   WaterSample = new WaterPacket(1);
   ContactGeometry = XYPolygon.GetSquare(1);
 }
Example #26
0
    public void RoutingOfGroundwaterTest()
    {

      Lake S = new Lake("L",100);

      S.SetState("Initial", DateTime.Now, new WaterPacket(100));

      Lake storage = new Lake("Storage",10000);
      S.AddDownStreamWaterBody(storage);

      TimeSpan ts = new TimeSpan(1,0,0);

      int Id = 2;
      IWaterPacket expected = new WaterPacket(Id, 200);
      IWaterPacket actual;

      S.WaterLevel = 8;
      GroundWaterBoundary b = new GroundWaterBoundary(S, 0.001, 100, 10, XYPolygon.GetSquare(2.5));
      b.WaterSample = expected;
      S.GroundwaterBoundaries.Add(b);
      S.Update(S.CurrentTime.Add(ts));

      actual = storage.CurrentStoredWater;
      double ExpectedVolume = b.GetSourceWater(DateTime.Now, ts).Volume;

      Assert.AreEqual(expected.Composition.Keys.First(), actual.Composition.Keys.First());
      Assert.AreEqual(ExpectedVolume, actual.Volume, 0.000001);

      S.Update(S.CurrentTime.Add(new TimeSpan(2,0,0)));

      actual = storage.CurrentStoredWater;
      Assert.AreEqual(expected.Composition.Keys.First(), actual.Composition.Keys.First());
      Assert.AreEqual(0.54, actual.Volume, 0.000001);

      S.AddWaterPacket(DateTime.Now, DateTime.Now, expected);
      S.Update(S.CurrentTime.Add(new TimeSpan(2, 0, 0)));
      actual = storage.CurrentStoredWater;

      Assert.AreEqual(200.9, actual.Volume, 0.000001);


    }
Example #27
0
    public void RoutingOfInflow()
    {
      Stream S = new Stream("S", 10,1,1);
      DateTime Start = DateTime.Now;
      S.SetState("Initial", Start, new WaterPacket(1, 10));

      Stream s2 = new Stream("s2", 10,1,1);


      Lake Storage = new Lake("storage", 100000);

      S.AddDownStreamWaterBody(s2);
      s2.AddDownStreamWaterBody(Storage);

      SinkSourceBoundary FB = new SinkSourceBoundary(5.0 / 60);
      FB.WaterSample = new WaterPacket(5, 5);

      S.Sources.Add(FB);
      
      TimeSpan ts = new TimeSpan(0, 1, 0);

      WaterPacket WaterProvider = new WaterPacket(2, 5);

      S.AddWaterPacket(Start, Start.AddDays(1), WaterProvider.DeepClone(15));
      S.Update(S.CurrentTime.Add(ts));
      s2.Update(S.CurrentTime.Add(ts));

      Assert.AreEqual(10, S.CurrentStoredWater.Volume, 0.00001);
      Assert.AreEqual(0.137, S.CurrentStoredWater.Composition[5], 0.001);
      Assert.AreEqual(0.863, S.CurrentStoredWater.Composition[2], 0.001);   
      Assert.AreEqual(0.1309, s2.CurrentStoredWater.Composition[1], 0.001);

    }
Example #28
0
 public GroundWaterBoundary() : base()
 {
     WaterSample = new WaterPacket(1);
     FlowType    = GWType.Darcy;
 }
 public GroundWaterBoundary() : base()
 {
   WaterSample = new WaterPacket(1);
   FlowType = GWType.Darcy;
 }
Example #30
0
    /// <summary>
    /// Copy constructor
    /// </summary>
    /// <param name="WaterToCopy"></param>
    public WaterPacket(WaterPacket WaterToCopy)
    {
      RelativeTimeTag = WaterToCopy.RelativeTimeTag;
      WaterAge = WaterToCopy.WaterAge;
      LogString = new StringBuilder(WaterToCopy.LogString.ToString());

      //Copy the properties
      foreach (var KVP in WaterToCopy.Composition)
        Composition.Add(KVP.Key, KVP.Value);

    }
Example #31
0
    public void TestMethod1()
    {
      Lake Gjeller = LakeFactory.GetLake("Gjeller Sø");
      Gjeller.Depth = 1.2;
      Gjeller.WaterLevel = 0.4;

      WaterPacket GjellerWater = new WaterPacket(1, 1);
      GjellerWater.AddChemical(ChemicalFactory.Instance.GetChemical(ChemicalNames.Cl), 1);

      TimeSeriesGroup climate = TimeSeriesGroupFactory.Create("climate.xts");

      foreach (var I in climate.Items)
      {
        I.ExtrapolationMethod = ExtrapolationMethods.RecycleYear;
        I.AllowExtrapolation = true;
      }

      EvaporationRateBoundary evap = new EvaporationRateBoundary((TimespanSeries)climate.Items[1]);
      evap.ContactGeometry = Gjeller.Geometry;
      Gjeller.EvaporationBoundaries.Add(evap);

      SinkSourceBoundary precip = new SinkSourceBoundary(climate.Items[0]);
      precip.ContactGeometry = Gjeller.Geometry;
      Gjeller.Precipitation.Add(precip);
      precip.ID = 2;
      precip.WaterSample = GjellerWater.DeepClone();
      precip.WaterSample.IDForComposition = precip.ID; ;

      GroundWaterBoundary GWIN = new GroundWaterBoundary(Gjeller, 1e-5, 2, 0.45, XYPolygon.GetSquare(Gjeller.Area / 2));
      GWIN.WaterSample = GjellerWater.DeepClone();
      GWIN.ID = 3;
      GWIN.WaterSample.IDForComposition = GWIN.ID;
      GWIN.Name = "Inflow";
      Gjeller.GroundwaterBoundaries.Add(GWIN);

      GroundWaterBoundary GWout = new GroundWaterBoundary(Gjeller, 1e-5, 2, 0.35, XYPolygon.GetSquare(Gjeller.Area / 2));
      GWout.Name = "Outflow";
      Gjeller.GroundwaterBoundaries.Add(GWout);


      TimespanSeries pumping = new TimespanSeries();
      pumping.AddSiValue(new DateTime(1990, 01, 01), new DateTime(2010, 01, 01), 0);
      pumping.AddSiValue(new DateTime(2010, 01, 01), new DateTime(2010, 05, 01), 0.05);
      pumping.AddSiValue(new DateTime(2010, 05, 01), DateTime.Now, 0);


      SinkSourceBoundary DrainageWater = new SinkSourceBoundary(pumping);
      DrainageWater.ID = 4;
      DrainageWater.WaterSample = GjellerWater.DeepClone();
      DrainageWater.WaterSample.IDForComposition = DrainageWater.ID;
      DrainageWater.Name = "Indpumpet Drænvand";
      Gjeller.Sources.Add(DrainageWater);


      var tsg = TimeSeriesGroupFactory.Create(@"..\..\..\TestData\GjellerObservations.xts");

      foreach (var ts in tsg.Items)
      {
        Chemical c = new Chemical(ts.Name, 1);
        Gjeller.RealData.AddChemicalTimeSeries(c);
        Gjeller.RealData.ChemicalConcentrations[c] = (TimestampSeries) ts;


      }

      Model M = new Model();
      M._waterBodies.Add(Gjeller);
      Gjeller.Output.LogAllChemicals = true;
      Gjeller.Output.LogComposition = true;

      M.SetState("Initial", new DateTime(1995, 1, 1), GjellerWater);


      M.MoveInTime(DateTime.Now, TimeSpan.FromDays(10));
      M.Save(@"..\..\..\TestData\Gjeller.xml");

    }
 public SinkSourceBoundary()
 {
     WaterSample     = new WaterPacket(1);
     ContactGeometry = XYPolygon.GetSquare(1);
 }
Example #33
0
    public void RoutingOfRecievedWaterTest()
    {

      Stream_Accessor S = new Stream_Accessor("S", 25,1,1);

      DateTime Start = DateTime.Now;

      S.SetState("Initial", Start, new WaterPacket(1, 25));
      
      Stream s2 = new Stream("s2", 50,1,1);
      s2.SetState("Initial", Start, new WaterPacket(50));
      
      Stream s3 = new Stream("s3", 300,1,1);
      s3.SetState("Initial", Start, new WaterPacket(300));

      S.AddDownStreamWaterBody(s2);
      s2.AddDownStreamWaterBody(s3);

      TimeSpan ts = new TimeSpan(1,0,0);

      WaterPacket WaterProvider = new WaterPacket(2, 200);

      S.AddWaterPacket(Start, Start.AddDays(1), WaterProvider.DeepClone(200));



      S.Update(S.CurrentTime.Add(ts));

      Assert.AreEqual(0, S._incomingWater.Count);
      Assert.AreEqual(1, S.CurrentStoredWater.Composition[2]);

      s2.Update(S.CurrentTime.Add(ts));
      s3.Update(S.CurrentTime.Add(ts));

      Assert.AreEqual(1, s2.CurrentStoredWater.Composition[2]);
      
      //In the next timestep there will be no water to route
      S.Update(S.CurrentTime.Add(ts));

    }
    public void SubtractTest()
    {
      int ID1 = 1;
      WaterPacket w = new WaterPacket(500);
      w.IDForComposition = ID1;

      IWaterPacket w2 = w.Substract(230);

      Assert.AreEqual(270, w.Volume);
      Assert.AreEqual(230, w2.Volume);

      Assert.AreEqual(1, w.Composition[ID1]);
      Assert.AreEqual(1, w.Composition[ID1]);

      IWaterPacket w3 = w.Substract(1000);
      Assert.AreEqual(0, w.Volume);
      Assert.AreEqual(270, w3.Volume);

      Assert.AreEqual(1, w3.Composition[ID1]);

    }
    public void AddTest()
    {
      WaterPacket WWC2 = new WaterPacket(50);
      WWC2.Add(WWC);

      Assert.IsTrue(WWC2.Chemicals.ContainsKey(Cl));
      Assert.IsTrue(WWC2.Chemicals.ContainsKey(Na));
      Assert.AreEqual(2, WWC2.Chemicals[Cl]);
      Assert.AreEqual(150, WWC2.Volume, 0.0001);

    }