Example #1
0
        //

        #region Constructors
        // ==================================================================================
        /// <summary>
        ///
        /// </summary>
        /// <param name="crf"></param>
        public IndustryDemand_employee(WaterSimCRFModel crf)
        {
            CRF = crf;
            //
            Initialize_Variables();
            isInstantiated = true;
        }
Example #2
0
        //

        #region Constructors
        // ==================================================================================
        /// <summary>
        ///
        /// </summary>
        /// <param name="crf"></param>
        public PowerDemand_wp(WaterSimCRFModel crf)
        {
            CRF = crf;
            //
            Initialize_Variables();
            isInstantiated = true;
        }
Example #3
0
        //

        #region Constructors
        // ==================================================================================
        /// <summary>
        ///
        /// </summary>
        /// <param name="crf"></param>
        public AgriculturalDemand_income(WaterSimCRFModel crf)
        {
            CRF = crf;
            //
            Initialize_Variables();
            isInstantiated = true;
        }
Example #4
0
        //

        #region Constructors
        // ==================================================================================


        /// <summary>
        ///
        /// </summary>
        /// <param name="crf"></param>
        public UrbanDemand_GPCD(WaterSimCRFModel crf)
        {
            CRF = crf;
            //
            Initialize_Variables();
            isInstantiated = true;
            // assigns itself to the owner
            crf.URBAN = this;
        }
        //

        #region Constructors
        // ========================================================================================

        /// <summary>
        ///
        /// </summary>
        /// <param name="crf"></param>
        /// <param name="TheRatedata"></param>
        /// <param name="TheAcreData"></param>
        public RuralDemand_LCLU_industry(WaterSimCRFModel crf, RateDataClass TheRatedata, DataClassLCLU TheAcreData)
        {
            CRF     = crf;
            FRDC    = TheRatedata;
            FDClclu = TheAcreData;
            SetBaseValues();
            isInstantiated = true;
            // assigns itself to the owner
            crf.INDUSTRY = this;
        }
Example #6
0
        // ===========================================================
        internal bool AirWaterInstallations(WaterSimCRFModel CRF)
        {
            bool temp = false;

            if (0 < CRF.AirWaterInstallations)
            {
                temp = true;
            }
            return(temp);
        }
Example #7
0
 internal void CalculatePanelsTotal(WaterSimCRFModel CRF)
 {
     if (AirWaterInstallations(CRF))
     {
         TotalPanels = CRF.AirWaterInstallations * Households * NWconstants.panelsHouse;
     }
     else
     {
         TotalPanels = AirWaterMax * Households * NWconstants.panelsHouse;
     }
 }
 public WaterSimSankeyForm(WaterSimCRFModel TheModel)
 {
     InitializeComponent();
     MyModel               = TheModel;
     FNetwork              = MyModel.TheCRFNetwork;
     sankeyGraph1.Network  = FNetwork;
     TheModel.OnRunHandler = RunModelCallBack;
     EndYear               = MyModel.endYear;
     animateModelRunToolStripMenuItem.Checked = Animate;
     RedrawSankey();
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="crf"></param>
 /// <param name="TheRateData"></param>
 /// <param name="TheAcreData"></param>
 public RuralDemand_LCLU_urban(WaterSimCRFModel crf, RateDataClass TheRateData, DataClassLCLU TheAcreData)
 {
     CRF     = crf;
     FRDC    = TheRateData;
     FDClclu = TheAcreData;
     //
     SetBaseValues();
     isInstantiated = true;
     // assigns itself to the owner
     crf.URBAN = this;
     CRF.URBAN = this; // does this make a difference?
 }
Example #10
0
        // ------------------------------------------------------------
        // Public call to this class
        // =========================
        /// <summary>
        ///
        /// </summary>
        /// <param name="CRF"></param>
        /// <param name="FDC"></param>
        /// <returns></returns>
        public double AirWaterUse(WaterSimCRFModel CRF, DCDC_Utilities.DataClassTemperature FDC)
        {
            double result = 0; double temp = 0;

            AirWaterMax = 0.5;
            CalculateHouseholds(CRF);
            CalculatePanelsTotal(CRF);
            AverageRH(CRF, FDC);
            //averageRHandSD(CRF, FDC);
            //
            temp   = DailyRateLitersAllHouseholds * NWconstants.LitersToGallons;
            result = temp / 1e6;
            return(result);
        }
Example #11
0
 private void ResetSanKeyGraphUnit(String aUnitName)
 {
     TheCRFModel = MyWSIM.WaterSimWestModel.GetUnitModel(aUnitName);
     if (TheCRFModel != null)
     {
         ModelUnitName                 = aUnitName;
         sankeyGraphUnit.Network       = TheCRFModel.TheCRFNetwork;
         SankeyGraphUnitNameLabel.Text = ModelUnitName;
         unitIndex = MyWSIM.WaterSimWestModel.GetIndex(TheCRFModel);
         // This is a pain it has to be done every time model is reset
         TheCRFModel.TheCRFNetwork.Industrial.Color = Color.Purple;
         ResetIndicators(unitIndex);
     }
 }
Example #12
0
        // ================================
        internal double AcreroofYearly(int year, string name, WaterSimCRFModel CRF)
        {
            double temp = 0;
            int    i    = I;

            A_harvesting = new double[FUnitCount];
            double A = LCLUclasses.FastArea_UN(name, "Acre", year) * CRF.ExurbanLowDensityChange;

            RWacres[i] += A;
            // acres
            temp = A * (RWconstants.EA_RoofAreaProp * RWconstants.Mod_roof) * RWconstants.RoofAreaLoss *
                   RWconstants.RoofAreaEfficiency * RWconstants.compliance;
            A_harvesting[i] = temp;
            return(temp);
        }
Example #13
0
        internal void RoofCaptureYearly(int year, string name, WaterSimCRFModel CRF)
        {
            double temp = 0;

            RWacres    = new double[FUnitCount];
            RWacres[I] = 0;
            temp       = INDroofYearly(year, name) + COMroofYearly(year, name) + EigthAcreroofYearly(year, name, CRF) +
                         QuarterAcreroofYearly(year, name, CRF) + ThirdAcreroofYearly(year, name, CRF) +
                         HalfAcreroofYearly(year, name, CRF) + AcreroofYearly(year, name, CRF);
            I += 1;

            if (23 < I)
            {
                I = 0;         // don't like this hard coded....
            }
        }
Example #14
0
        internal double EigthAcreroofYearly(int year, string name, WaterSimCRFModel CRF)
        {
            double temp = 0;
            int    i    = 0;

            i             = I;
            EA_harvesting = new double[FUnitCount];
            double EA = LCLUclasses.FastArea_UN(name, "EigthAcre", year) * CRF.UrbanHighDensityChange;

            RWacres[i] += EA;
            // acres
            temp = EA * RWconstants.EA_RoofAreaProp * RWconstants.RoofAreaLoss * RWconstants.RoofAreaEfficiency
                   * RWconstants.compliance;
            EA_harvesting[i] = temp;

            return(temp);
        }
Example #15
0
        internal void AverageRH(WaterSimCRFModel CRF, DCDC_Utilities.DataClassTemperature DT)
        {
            double temp   = 0;
            double result = 0;
            int    month  = 1;

            do
            {
                temp    = DT.FastRH(CRF.UnitName, CRF.currentYear, month);
                result += CalculateDailyRate(temp);
                month++;
            } while(month < 13);
            DailyRateLitersAllHouseholds = TotalPanels * result * 1 / 12;

            //
            // return result;
        }
Example #16
0
        private void DisplaySankeyMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            string Test = e.ClickedItem.ToString();

            Form SankeyForm = SankeyForms.Find(delegate(Form TF) { return(TF.Name == Test); });

            if (SankeyForm != null)
            {
                SankeyForm.Show();
            }
            else
            {
                WaterSimCRFModel WSCRF = MyWSIM.WaterSimWestModel.GetUnitModel(Test);
                SankeyForm = new WaterSimSankeyForm(WSCRF);
                SankeyForm.Show();
                SankeyForms.Add(SankeyForm);
            }
        }
Example #17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="name">The region name</param>
        /// <param name="year"></param>
        /// <param name="CRF">the CRF object</param>
        /// <returns></returns>
        public double RwHarvestingYearly(string name, int year, WaterSimCRFModel CRF)
        {
            // rainfall in mm yr-1
            // output is supposed to be MGD year-1
            double temp = 0;
            // double check = 0;
            int i = 0;

            i = I;
            int j = 0;


            //RWcaptureYear_MGD = new double[FUnitCount, FYearCount];
            //RWYear_MGD = new double[FUnitCount, FYearCount];
            //RWcaptureYear_ratio = new double[FUnitCount, FYearCount];

            j = year;
            int cYear = year + 2020;

            // RWcapture = new double[FUnitCount];
            RoofCaptureYearly(cYear, name, CRF);
            double T = RainFall.FastRainFall(name, cYear);

            RWYear_MGD[i, j] = RWacres[i] * UnitConvertLiters(T) / Utilities.DaysInAYear(cYear);
            // area in acres * rainfall conversion
            //temp = (IND_harvesting[i] + COMM_harvesting[i] + EA_harvesting[i] + QA_harvesting[i] +
            // TA_harvesting[i] + HA_harvesting[i] + A_harvesting[i]) * UnitConvert(T); // MGD;

            // add a compliance parameter? This code assumes that all residents capture and use rainwater
            temp = (IND_harvesting[i] + COMM_harvesting[i] + EA_harvesting[i] + QA_harvesting[i] +
                    TA_harvesting[i] + HA_harvesting[i] + A_harvesting[i]) * UnitConvertLiters(T); // MGD;
            RWcaptureYear_MGD[i, j] = temp / Utilities.DaysInAYear(cYear);
            if (0 < RWYear_MGD[i, j])
            {
                RWcaptureYear_ratio[i, j] =
                    RWcaptureYear_MGD[i, j] / RWYear_MGD[i, j]; // always < 1
            }
            //
            //return RWacres[i];// RWcaptureYear_ratio[i, j];
            return(RWcaptureYear_MGD[i, j]);
            //return RWcaptureYear_ratio[i, j];
        }
Example #18
0
 // ===========================================================
 #region methods and functions
 internal void CalculateHouseholds(WaterSimCRFModel CRF)
 {
     Households = CRF.population * 1 / NWconstants.ppH;
 }