Beispiel #1
0
        public void IsotopeTest()
        {
            DateTime Start = new DateTime(2007, 1, 1);
            DateTime End   = new DateTime(2007, 12, 31);

            Model m       = ModelFactory.GetModel(testDataPath + "VedstedNoGroundwater.xml");
            Lake  Vedsted = (Lake)m._waterBodies[0];

            Vedsted.Sources.RemoveAt(0);

            Chemical cl = ChemicalFactory.Instance.GetChemical(ChemicalNames.Cl);

            Vedsted.Output.LogChemicalConcentration(ChemicalFactory.Instance.GetChemical(ChemicalNames.IsotopeFraction));
            Vedsted.Output.LogChemicalConcentration(cl);

            IsotopeWater Iw = new IsotopeWater(1);

            Iw.SetIsotopeRatio(10);
            Iw.AddChemical(cl, 0.1);

            Assert.AreEqual(10, Iw.GetConcentration(ChemicalFactory.Instance.GetChemical(ChemicalNames.IsotopeFraction)));
            m.SetState("Initial", Start, Iw);

            Assert.AreEqual(10, ((WaterPacket)Vedsted.CurrentStoredWater).GetConcentration(ChemicalFactory.Instance.GetChemical(ChemicalNames.IsotopeFraction)));

            IsotopeWater precip = new IsotopeWater(1);

            precip.SetIsotopeRatio(5);
            m.MoveInTime(End, TimeSpan.FromDays(30));

            foreach (var v in Vedsted.Output.Items[6].Values)
            {
                Console.WriteLine(v);
            }
            foreach (var v in Vedsted.Output.Items[5].Values)
            {
                Console.WriteLine(v);
            }

            Console.WriteLine(Vedsted.Output.GetStorageTime(Start.AddDays(40), End.AddDays(-40)));

            ModelFactory.SaveModel(testDataPath + "VedstedIso.xml", m);
        }
    public void IsotopeTest()
    {
      DateTime Start = new DateTime(2007, 1, 1);
      DateTime End = new DateTime(2007, 12, 31);

      Model m = ModelFactory.GetModel(testDataPath + "VedstedNoGroundwater.xml");
      Lake Vedsted = (Lake)m._waterBodies[0];
      Vedsted.Sources.RemoveAt(0);

      Chemical cl = ChemicalFactory.Instance.GetChemical(ChemicalNames.Cl);
      Vedsted.Output.LogChemicalConcentration(ChemicalFactory.Instance.GetChemical(ChemicalNames.IsotopeFraction));
      Vedsted.Output.LogChemicalConcentration(cl);

      IsotopeWater Iw = new IsotopeWater(1);
      Iw.SetIsotopeRatio(10);
      Iw.AddChemical(cl, 0.1);

      Assert.AreEqual(10,Iw.GetConcentration(ChemicalFactory.Instance.GetChemical(ChemicalNames.IsotopeFraction)));
       m.SetState("Initial", Start, Iw);

       Assert.AreEqual(10, ((WaterPacket)Vedsted.CurrentStoredWater).GetConcentration(ChemicalFactory.Instance.GetChemical(ChemicalNames.IsotopeFraction)));

       IsotopeWater precip = new IsotopeWater(1);
       precip.SetIsotopeRatio(5);
      m.MoveInTime(End, TimeSpan.FromDays(30));

      foreach (var v in Vedsted.Output.Items[6].Values)
        Console.WriteLine(v);
      foreach (var v in Vedsted.Output.Items[5].Values)
        Console.WriteLine(v);

      Console.WriteLine(Vedsted.Output.GetStorageTime(Start.AddDays(40), End.AddDays(-40)));

      ModelFactory.SaveModel(testDataPath + "VedstedIso.xml",m);
    }