public RoundDuctViewModel(
     DarcyFrictionFactorApproximation approximation,
     double relativeRoughness,
     double diameter,
     double length,
     AirFlow airFlow,
     double targetValue) : base(approximation, relativeRoughness, diameter, length, airFlow)
 {
     TargetValue = targetValue;
 }
 public RectangularDuctViewModel(
     DarcyFrictionFactorApproximation approximation,
     double relativeRoughness,
     double aSize,
     double bSize,
     double length,
     AirFlow airFlow,
     double targetValue) : base(approximation, relativeRoughness, aSize, bSize, length, airFlow)
 {
     TargetValue = targetValue;
 }
 public void configureBeforeClass()
 {
     driver             = Browser.getBrowser("Chrome");
     loginPage          = new Login();
     air                = new AirFlow();
     flightSearchResult = new FlightSearchResult();
     quote              = new Quote();
     reprice            = new RepriceBook();
     tsp                = new TSP();
     addTravelers       = new AddTravelers();
     payment            = new Payment();
     logout             = new Logout();
 }
Beispiel #4
0
        public DuctDesignViewModel()
        {
            PropertyChanged += DuctDesignViewModel_PropertyChanged;

            AirFlow                 = new AirFlow(293.15, 101325, 0.0);
            TargetValue             = 3.5;
            SelectionType           = SelectionType.Velocity;
            Approximation           = DarcyFrictionFactorApproximation.GoudarSonnad;
            RectangularDuctHeight   = 0.2;
            RelativeRoughness       = 0.00001;
            DuctLenght              = 1;
            RoundDuctDesigner       = new RoundDuctDesigner();
            RectangularDuctDesigner = new RectangularDuctDesigner();
            LocalLosses             = new ObservableCollection <LocalLoss>();
            DuctSystem              = new DuctSystem();
        }
 public void Execute(
     AirFlow airFloe,
     DarcyFrictionFactorApproximation approximation,
     double relativeRoughness,
     double ductLenght,
     SelectionType selType,
     double targetVal,
     ObservableCollection <LocalLoss> localLosses)
 {
     DuctCollection = new ObservableCollection <RoundDuctViewModel>();
     foreach (double d in diameterList)
     {
         RoundDuctViewModel duct = new RoundDuctViewModel(approximation, relativeRoughness, d, ductLenght, airFloe, targetVal);
         duct.LocalLosses = localLosses.Where(x => x.LocalLossCoefficient > 0.0).ToList();
         DuctCollection.Add(duct);
     }
 }
Beispiel #6
0
        private static void Update(BrakeSystem car, float dt)
        {
            var state = ExtraBrakeState.Instance(car);

            foreach (var c**k in new HoseAndCock[] { car.Front, car.Rear })
            {
                float rate = c**k.IsOpenToAtmosphere
                    ? AirFlow.Vent(
                    dt,
                    ref state.brakePipePressureUnsmoothed,
                    Constants.BrakePipeVolume,
                    VentRate)
                    : 0f;
                // AirBrake.DebugLog(car, $"cockOpen={c**k.IsOpenToAtmosphere}, ventRate={rate}");
                c**k.exhaustFlow = Mathf.SmoothDamp(c**k.exhaustFlow, rate, ref c**k.exhaustFlowRef, 0.1f);
            }
        }
Beispiel #7
0
 private static void RechargeMainReservoir(BrakeSystem car, ExtraBrakeState state, float dt)
 {
     if (car.compressorRunning)
     {
         var increase = car.compressorProductionRate * Main.settings.compressorSpeed * dt;
         car.mainReservoirPressureUnsmoothed =
             Mathf.Clamp(car.mainReservoirPressureUnsmoothed + increase, 0f, Constants.MaxMainReservoirPressure);
     }
     AirFlow.OneWayFlow(
         dt,
         ref car.mainReservoirPressureUnsmoothed,
         ref state.brakePipePressureUnsmoothed,
         Constants.MainReservoirVolume,
         Constants.BrakePipeVolume,
         float.PositiveInfinity);
     car.mainReservoirPressure = Mathf.SmoothDamp(car.mainReservoirPressure, car.mainReservoirPressureUnsmoothed, ref car.mainResPressureRef, 0.8f);
 }
Beispiel #8
0
        public List <RectangularDuct> GetRoundDuctList(DuctDesignViewModel ddvm)
        {
            AirFlow airFlow = new AirFlow(ddvm.Temperature, ddvm.Pressure, ddvm.AirFlow);
            List <RectangularDuct> ductList = new List <RectangularDuct>();

            foreach (var ductSize in rectangularDuctSizes)
            {
                ductList.Add(new RectangularDuct(ddvm.ApproximationType, ddvm.RelativeRoughness, ductSize, ddvm.RectangularDuctHeight, ddvm.DuctLenght, airFlow));
            }
            if (ddvm.SelectionType == SelectionType.Velocity)
            {
                return(ductList.OrderBy(x => Math.Abs(x.Velocity - ddvm.TargetValue)).Take(10).OrderByDescending(x => x.Velocity).ToList());
            }
            else
            {
                return(ductList.OrderBy(x => Math.Abs(x.FrictionLoss - ddvm.TargetValue)).Take(10).OrderByDescending(x => x.FrictionLoss).ToList());
            }
        }
        private void UpdateAirMap()
        {
            var flow = new AirFlow();

            airMap = flow.CreateAirFlowMap(level);
        }