//MODEL #region Add Water to Pond private void AddWater(double Volume, WaterProperties addedProps) { //This logic is valid because people can not overfill their ponds in the real world //because the water comes from a river by opening up the gates and letting gravity fill the pond. //Therefore you can not overfill it because the water level just becomes equal to the river. //Not sure about filling due to pumping the water though. //If it overfills due to rain, then because saltwater is more dense than rain water //the rainwater just runs straight off without mixing with the pond water. //Therefore no solutes are lost due to this runoff. double maxPondVolume = SurfaceArea * MaxPondDepth; if (pondVolume + Volume > maxPondVolume) { Volume = maxPondVolume - pondVolume; Summary.WriteMessage(this, "You have overfilled the pond. Reduced the volume added to volume the pond could accept", MessageType.Warning); } AddWater_TempChange(Volume, addedProps.Temperature); AddWater_SalinityChange(Volume, addedProps.Salinity); AddWater_PHChange(Volume, addedProps.PH); AddWater_NChange(Volume, addedProps.N); AddWater_PChange(Volume, addedProps.P); AddWater_TSSChange(Volume, addedProps.TSS); //Add DOX pondVolume = pondVolume + Volume; }
private void OnEndOfDay(object sender, EventArgs e) { //Add Today's Rain double rainVolume = SurfaceArea * (Weather.Rain * mm2m); WaterProperties rainProps = new WaterProperties(Weather.Tav, 0, 7.0, 0, 0, 0); AddWater(rainVolume, rainProps); //Remove Today's Evaporation double evapAmount_mm; evapAmount_mm = CalcEvap(); EvaporateWater(evapAmount_mm); }
/// <summary> /// Fill the Pond with a given volume of water. /// Must specifiy the properties of the water you are adding as well. /// </summary> /// <param name="Volume">Volume of water to add (m^3)</param> /// <param name="WaterTemp">Temperature of the water (oC)</param> /// <param name="Salinity">Salinity (kg/m^3)</param> /// <param name="PH">PH</param> /// <param name="N">Nitrogen (kg/m^3)</param> /// <param name="P">Phosporus (kg/m^3)</param> /// <param name="TSS">Total Suspended Solids (kg/m^3)</param> public void Fill(double Volume, double WaterTemp, double Salinity, double PH, double N, double P, double TSS) { WaterProperties addedProps = new WaterProperties(WaterTemp, Salinity, PH, N, P, TSS); AddWater(Volume, addedProps); }
//MANAGER COMMANDS #region Manager Commands /// <summary> /// Fill the Pond with a given volume of water. /// Must specifiy the properties of the water you are adding as well. /// </summary> /// <param name="Volume">Volume of water to add (m^3)</param> /// <param name="WaterProperties">Properties of the water you are adding</param> public void Fill(double Volume, WaterProperties WaterProperties) { AddWater(Volume, WaterProperties); }
private void AddWater(double Volume, WaterProperties addedProps) { //This logic is valid because people can not overfill their ponds in the real world //because the water comes from a river by opening up the gates and letting gravity fill the pond. //Therefore you can not overfill it because the water level just becomes equal to the river. //Not sure about filling due to pumping the water though. //If it overfills due to rain, then because saltwater is more dense than rain water //the rainwater just runs straight off without mixing with the pond water. //Therefore no solutes are lost due to this runoff. double maxPondVolume = SurfaceArea * MaxPondDepth; if (pondVolume + Volume > maxPondVolume) { Volume = maxPondVolume - pondVolume; Summary.WriteWarning(this, "You have overfilled the pond. Reduced the volume added to volume the pond could accept"); } AddWater_TempChange(Volume, addedProps.Temperature); AddWater_SalinityChange(Volume, addedProps.Salinity); AddWater_PHChange(Volume, addedProps.PH); AddWater_NChange(Volume, addedProps.N); AddWater_PChange(Volume, addedProps.P); AddWater_TSSChange(Volume, addedProps.TSS); //Add DOX pondVolume = pondVolume + Volume; }
/// <summary> /// Fill the Pond with a given volume of water. /// Must specifiy the properties of the water you are adding as well. /// </summary> /// <param name="Volume">Volume of water to add (m^3)</param> /// <param name="WaterProperties">Properties of the water you are adding</param> public void Fill(double Volume, WaterProperties WaterProperties) { AddWater(Volume, WaterProperties); }