Example #1
0
 public UnitSystem()
 {
     this.temperature        = TemperatureUnit.Celsius;
     this.pressure           = PressureUnit.Pascal;
     this.massFlowRate       = MassFlowRateUnit.KgPerSec;
     this.volumeFlowRate     = VolumeFlowRateUnit.CubicMeterPerSec;
     this.moistureContent    = MoistureContentUnit.KgPerKg;
     this.relativeHumidity   = RatioUnit.Percent;
     this.enthalpy           = SpecificEnergyUnit.JoulePerKg;
     this.specificHeat       = SpecificHeatUnit.JoulePerKgKelvin;
     this.energy             = EnergyUnit.Joule;
     this.power              = PowerUnit.JoulePerSec;
     this.density            = DensityUnit.KgPerCubicMeter;
     this.dynamicViscosity   = DynamicViscosityUnit.PascalSecond;
     this.kinematicViscosity = KinematicViscosityUnit.SquareMeterPerSec;
     this.conductivity       = ThermalConductivityUnit.WattPerMeterKelvin;
     this.diffusivity        = DiffusivityUnit.SquareMeterPerSec;
     this.mass     = MassUnit.Kilogram;
     this.length   = LengthUnit.Meter;
     this.area     = AreaUnit.SquareMeter;
     this.volume   = VolumeUnit.CubicMeter;
     this.time     = TimeUnit.Second;
     this.Name     = "SI"; //ep
     this.readOnly = true;
 }
Example #2
0
        //HeatFluxDensityUnit heatTransferCoefficient;
        //ForceUnit force;
        //SurfaceTensionUnit surfaceTension;

        public UnitSystem(TemperatureUnit temperature, PressureUnit pressure, MassFlowRateUnit massFlowRate,
                          VolumeFlowRateUnit volumeFlowRate, MoistureContentUnit moistureContent,
                          RatioUnit relativeHumidity, SpecificEnergyUnit enthalpy,
                          SpecificHeatUnit specificHeat, EnergyUnit energy, PowerUnit power, DensityUnit density,
                          DynamicViscosityUnit dynamicViscosity, KinematicViscosityUnit kinematicViscosity,
                          ThermalConductivityUnit conductivity, DiffusivityUnit diffusivity, MassUnit mass,
                          LengthUnit length, AreaUnit area, VolumeUnit volume, TimeUnit Time, string name) //ep
        {
            this.temperature        = temperature;
            this.pressure           = pressure;
            this.massFlowRate       = massFlowRate;
            this.volumeFlowRate     = volumeFlowRate;
            this.moistureContent    = moistureContent;
            this.relativeHumidity   = relativeHumidity;
            this.enthalpy           = enthalpy;
            this.specificHeat       = specificHeat;
            this.energy             = energy;
            this.power              = power;
            this.density            = density;
            this.dynamicViscosity   = dynamicViscosity;
            this.kinematicViscosity = kinematicViscosity;
            this.conductivity       = conductivity;
            this.diffusivity        = diffusivity;
            this.mass     = mass;
            this.length   = length;
            this.area     = area;
            this.volume   = volume;
            this.time     = time;
            this.Name     = name;  //ep
            this.readOnly = false; //ep
        }
 public void MassFlowRateConversions(double value1, MassFlowRateUnit units1, double value2, MassFlowRateUnit units2)
 {
     new MassFlowRate(value1, units1) {
         Units = units2
     }.Value.ShouldBeWithinEpsilonOf(value2);
     new MassFlowRate(value2, units2) {
         Units = units1
     }.Value.ShouldBeWithinEpsilonOf(value1);
 }
Example #4
0
        public void UpdateUnitSystem(UnitSystem unitSystem)
        {
            this.unitSystem = unitSystem;
            this.TextBox.Clear();
            if (unitSystem != null)
            {
                this.textBoxUnitSystem.ScrollBars = System.Windows.Forms.ScrollBars.None;

                string temperature        = "Temperature: \t\t" + TemperatureUnit.GetUnitAsString(unitSystem.TemperatureUnitType);
                string pressure           = "Pressure: \t\t\t" + PressureUnit.GetUnitAsString(unitSystem.PressureUnitType);
                string massFlowRate       = "Mass Flow Rate: \t\t" + MassFlowRateUnit.GetUnitAsString(unitSystem.MassFlowRateUnitType);
                string volumeFlowRate     = "Volume Flow Rate: \t\t" + VolumeFlowRateUnit.GetUnitAsString(unitSystem.VolumeFlowRateUnitType);
                string moistureContent    = "Moisture Content: \t\t" + MoistureContentUnit.GetUnitAsString(unitSystem.MoistureContentUnitType);
                string relativeHumidity   = "Fraction: \t\t\t" + FractionUnit.GetUnitAsString(unitSystem.FractionUnitType);
                string enthalpy           = "Specific Energy: \t\t" + SpecificEnergyUnit.GetUnitAsString(unitSystem.SpecificEnergyUnitType);
                string specificHeat       = "Specific Heat: \t\t" + SpecificHeatUnit.GetUnitAsString(unitSystem.SpecificHeatUnitType);
                string energy             = "Energy: \t\t\t" + EnergyUnit.GetUnitAsString(unitSystem.EnergyUnitType);
                string power              = "Power: \t\t\t" + PowerUnit.GetUnitAsString(unitSystem.PowerUnitType);
                string density            = "Density: \t\t\t" + DensityUnit.GetUnitAsString(unitSystem.DensityUnitType);
                string dynamicViscosity   = "Dynamic Viscosity: \t\t" + DynamicViscosityUnit.GetUnitAsString(unitSystem.DynamicViscosityUnitType);
                string kinematicViscosity = "Kinematic Viscosity: \t" + KinematicViscosityUnit.GetUnitAsString(unitSystem.KinematicViscosityUnitType);
                string conductivity       = "Thermal Conductivity: \t" + ThermalConductivityUnit.GetUnitAsString(unitSystem.ThermalConductivityUnitType);
                string diffusivity        = "Diffusivity: \t\t" + DiffusivityUnit.GetUnitAsString(unitSystem.DiffusivityUnitType);
                string mass                          = "Mass: \t\t\t" + MassUnit.GetUnitAsString(unitSystem.MassUnitType);
                string length                        = "Length: \t\t\t" + LengthUnit.GetUnitAsString(unitSystem.LengthUnitType);
                string area                          = "Area: \t\t\t" + AreaUnit.GetUnitAsString(unitSystem.AreaUnitType);
                string volume                        = "Volume: \t\t\t" + VolumeUnit.GetUnitAsString(unitSystem.VolumeUnitType);
                string time                          = "Time: \t\t\t" + TimeUnit.GetUnitAsString(unitSystem.TimeUnitType);
                string smallLength                   = "Small Length: \t\t" + SmallLengthUnit.GetUnitAsString(unitSystem.SmallLengthUnitType);
                string microLength                   = "Micro Length: \t\t" + MicroLengthUnit.GetUnitAsString(unitSystem.MicroLengthUnitType);
                string liquidHead                    = "Liquid Head: \t\t" + LiquidHeadUnit.GetUnitAsString(unitSystem.LiquidHeadUnitType);
                string volumeRateFlowLiquids         = "Volume Rate Flow Liquids: \t" + VolumeRateFlowLiquidsUnit.GetUnitAsString(unitSystem.VolumeRateFlowLiquidsUnitType);
                string volumeRateFlowGases           = "Volume Rate Flow Gases: \t" + VolumeRateFlowGasesUnit.GetUnitAsString(unitSystem.VolumeRateFlowGasesUnitType);
                string heatTransferCoeff             = "Heat Transfer Coeff.: \t" + HeatTransferCoefficientUnit.GetUnitAsString(unitSystem.HeatTransferCoefficientUnitType);
                string surfaceTension                = "Surface Tension: \t\t" + SurfaceTensionUnit.GetUnitAsString(unitSystem.SurfaceTensionUnitType);
                string velocity                      = "Velocity: \t\t\t" + VelocityUnit.GetUnitAsString(unitSystem.VelocityUnitType);
                string foulingFactor                 = "Fouling Factor: \t\t" + FoulingFactorUnit.GetUnitAsString(unitSystem.FoulingFactorUnitType);
                string specificVolume                = "Specific Volume: \t\t" + SpecificVolumeUnit.GetUnitAsString(unitSystem.SpecificVolumeUnitType);
                string massVolumeConcentration       = "Mass Volume Concentration: \t" + MassVolumeConcentrationUnit.GetUnitAsString(unitSystem.MassVolumeConcentrationUnitType);
                string planeAngle                    = "Plane Angle: \t\t" + PlaneAngleUnit.GetUnitAsString(unitSystem.PlaneAngleUnitType);
                string volumeHeatTransferCoefficient = "Volume Heat Transfer Coeff.: \t" + VolumeHeatTransferCoefficientUnit.GetUnitAsString(unitSystem.VolumeHeatTransferCoefficientUnitType);

                this.TextBox.AppendText(temperature + "\r\n");
                this.TextBox.AppendText(pressure + "\r\n");
                this.TextBox.AppendText(massFlowRate + "\r\n");
                this.TextBox.AppendText(volumeFlowRate + "\r\n");
                this.TextBox.AppendText(moistureContent + "\r\n");
                this.TextBox.AppendText(relativeHumidity + "\r\n");
                this.TextBox.AppendText(enthalpy + "\r\n");
                this.TextBox.AppendText(specificHeat + "\r\n");
                this.TextBox.AppendText(energy + "\r\n");
                this.TextBox.AppendText(power + "\r\n");
                this.TextBox.AppendText(density + "\r\n");
                this.TextBox.AppendText(dynamicViscosity + "\r\n");
                this.TextBox.AppendText(kinematicViscosity + "\r\n");
                this.TextBox.AppendText(conductivity + "\r\n");
                this.TextBox.AppendText(diffusivity + "\r\n");
                this.TextBox.AppendText(mass + "\r\n");
                this.TextBox.AppendText(length + "\r\n");
                this.TextBox.AppendText(area + "\r\n");
                this.TextBox.AppendText(volume + "\r\n");
                this.TextBox.AppendText(time + "\r\n");
                this.TextBox.AppendText(smallLength + "\r\n");
                this.TextBox.AppendText(microLength + "\r\n");
                this.TextBox.AppendText(liquidHead + "\r\n");
                this.TextBox.AppendText(volumeRateFlowLiquids + "\r\n");
                this.TextBox.AppendText(volumeRateFlowGases + "\r\n");
                this.TextBox.AppendText(heatTransferCoeff + "\r\n");
                this.TextBox.AppendText(surfaceTension + "\r\n");
                this.TextBox.AppendText(velocity + "\r\n");
                this.TextBox.AppendText(foulingFactor + "\r\n");
                this.TextBox.AppendText(specificVolume + "\r\n");
                this.TextBox.AppendText(massVolumeConcentration + "\r\n");
                this.TextBox.AppendText(planeAngle + "\r\n");
                this.TextBox.AppendText(volumeHeatTransferCoefficient + "\r\n");

                this.textBoxUnitSystem.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            }
        }