Example #1
0
 public Vessel(IModel model, string name, string description, Guid guid, double capacity, double pressure, bool autoReset)
 {
     InitializeIdentity(model, name, description, guid);
     m_mixture                  = new Mixture(model, name + ".Mixture", GuidOps.XOR(guid, s_mixture_Guidmask));
     m_mixtureMass              = new DoubleTracker();
     m_mixtureVolume            = new DoubleTracker();
     m_mixture.MaterialChanged += new MaterialChangeListener(m_mixture_MaterialChanged);
     m_pressure                 = m_initialPressure = pressure;
     m_capacity                 = capacity;
     m_autoReset                = autoReset;
     m_model.Starting          += new ModelEvent(m_model_Starting);
 }
Example #2
0
 /// <summary>
 /// Creates a MVTracker with a full complement of parameters.
 /// </summary>
 /// <param name="initial">The initial mixture.</param>
 /// <param name="inflow">The inflowing mixture.</param>
 /// <param name="outflow">The outflowing mixture.</param>
 /// <param name="capacity">The capacity of the vessel.</param>
 /// <param name="rp">The ReactionProcessor that knows of any reactions that will take place. Can be null.</param>
 public MassVolumeTracker(Mixture initial, Mixture inflow, Mixture outflow, double capacity, ReactionProcessor rp)
 {
     m_massHistory   = new DoubleTracker();
     m_volumeHistory = new DoubleTracker();
     SetInitialMixture(initial == null ? new Mixture() : (Mixture)initial.Clone());
     SetInflowMixture(inflow == null ? new Mixture() : (Mixture)inflow.Clone());
     SetOutflowMixture(outflow == null ? new Mixture() : (Mixture)outflow.Clone());
     m_reactionProcessor = rp;
     m_capacity          = capacity;
     m_cyclical          = true;
     m_inflowFirst       = true;
 }