Esempio n. 1
0
        /// <summary>
        /// Creates a new instance of a Duval Pentagon.
        /// Specify gases in counter clock-wise order starting at 12 o'oclock position.
        /// </summary>
        public AbstractDuvalPentagonRule(string name, Gas hydrogen, Gas ethane, Gas methane, Gas ethylene, Gas acetylene)
        {
            PentagonName = name;

            Pentagon = new EquilateralPentagon(
                new PolygonalAxis(hydrogen.ToString(), new Measurement()
            {
                Value = 90.0, Unit = new AngleUnits.Degrees()
            }),
                new PolygonalAxis(ethane.ToString(), new Measurement()
            {
                Value = 162.0, Unit = new AngleUnits.Degrees()
            }),
                new PolygonalAxis(methane.ToString(), new Measurement()
            {
                Value = 234.0, Unit = new AngleUnits.Degrees()
            }),
                new PolygonalAxis(ethylene.ToString(), new Measurement()
            {
                Value = 306.0, Unit = new AngleUnits.Degrees()
            }),
                new PolygonalAxis(acetylene.ToString(), new Measurement()
            {
                Value = 18.0, Unit = new AngleUnits.Degrees()
            }));

            GasMeasurements.Add(hydrogen, null);
            GasMeasurements.Add(ethane, null);
            GasMeasurements.Add(methane, null);
            GasMeasurements.Add(ethylene, null);
            GasMeasurements.Add(acetylene, null);

            GasPercentages.Add(hydrogen, 0.0);
            GasPercentages.Add(ethane, 0.0);
            GasPercentages.Add(methane, 0.0);
            GasPercentages.Add(ethylene, 0.0);
            GasPercentages.Add(acetylene, 0.0);
        }
Esempio n. 2
0
 public double TotalGases()
 {
     return(GasMeasurements.Sum(g => { return g.Value.Value; }));
 }
Esempio n. 3
0
 public virtual bool IsApplicable(DissolvedGasAnalysis currentDga, DissolvedGasAnalysis previousDga, List <IOutput> outputs)
 {
     FindGases(currentDga);
     return(GasMeasurements.All(g => g.Value != null));
 }