Exemplo n.º 1
0
        //Initialise the Accumulating Variables
        public void InitialiseAccumulatingVars(SoilWaterSoil SoilObject, Clock Clock)
        {
            //reset the accumulated Evap variables (sumes1, sumes2, t)
            //nb. sumes1 -> is sum of es during stage1
            //used in the SoilWater Init, Reset event

            // soilwat2_soil_property_param()

            //assign u and cona to either sumer or winter values
            // Need to add 12 hours to move from "midnight" to "noon", or this won't work as expected
            if (DateUtilities.WithinDates(winterDate, Clock.Today, summerDate))
                {
                cona = winterCona;
                u = winterU;
                }
            else
                {
                cona = summerCona;
                u = summerU;
                }

            //private void soilwat2_evap_init()
            //    {

            //##################
            //Evap Init   --> soilwat2_evap_init (), soilwat2_ritchie_init()
            //##################

            //soilwat2_ritchie_init();
            //*+  Mission Statement
            //*       Initialise ritchie evaporation model

            double swr_top;       //! stage 2 evaporation occurs ratio available sw potentially available sw in top layer

            Layer top = SoilObject.GetTopLayer();

            //! set up evaporation stage
            swr_top = MathUtilities.Divide((top.sw_dep - top.ll15_dep), (top.dul_dep - top.ll15_dep), 0.0);
            swr_top = cons.bound(swr_top, 0.0, 1.0);

            //! are we in stage1 or stage2 evap?
            if (swr_top < cons.sw_top_crit)
                {
                //! stage 2 evap
                sumes2 = cons.sumes2_max - (cons.sumes2_max * MathUtilities.Divide(swr_top, cons.sw_top_crit, 0.0));
                sumes1 = u;
                t = MathUtilities.Sqr(MathUtilities.Divide(sumes2, cona, 0.0));
                }
            else
                {
                //! stage 1 evap
                sumes2 = 0.0;
                sumes1 = cons.sumes1_max - (cons.sumes1_max * swr_top);
                t = 0.0;
                }
        }
Exemplo n.º 2
0
        public void CalcEs_RitchieEq_LimitedBySW(SoilWaterSoil SoilObject, Clock Clock, double Infiltration)
        {
            //private void soilwat2_ritchie_evaporation()
            //    {
            //es          -> ! (output) actual evaporation (mm)
            //eos         -> ! (input) potential rate of evaporation (mm/day)
            //avail_sw_top -> ! (input) upper limit of soil evaporation (mm/day)  !sv- now calculated in here, not passed in as a argument.

            //*+  Purpose
            //*          ****** calculate actual evaporation from soil surface (es) ******
            //*          most es takes place in two stages: the constant rate stage
            //*          and the falling rate stage (philip, 1957).  in the constant
            //*          rate stage (stage 1), the soil is sufficiently wet for water
            //*          be transported to the surface at a rate at least equal to the
            //*          evaporation potential (eos).
            //*          in the falling rate stage (stage 2), the surface soil water
            //*          content has decreased below a threshold value, so that es
            //*          depends on the flux of water through the upper layer of soil
            //*          to the evaporating site near the surface.

            //*+  Notes
            //*       This changes globals - sumes1/2 and t.

            Es = 0.0;  //Zero the return value.

            double avail_sw_top;    //! available soil water in top layer for actual soil evaporation (mm)

            //2. get available soil water for evaporation

            Layer top = SoilObject.GetTopLayer();
            avail_sw_top = top.sw_dep - top.air_dry_dep;
            avail_sw_top = cons.bound(avail_sw_top, 0.0, Eo);

            //3. get actual soil water evaporation

            double esoil1;     //! actual soil evap in stage 1
            double esoil2;     //! actual soil evap in stage 2
            double sumes1_max; //! upper limit of sumes1
            double w_inf;      //! infiltration into top layer (mm)

            // Need to add 12 hours to move from "midnight" to "noon", or this won't work as expected
            if (DateUtilities.WithinDates(winterDate, Clock.Today, summerDate))
                {
                cona = winterCona;
                u = winterU;
                }
            else
                {
                cona = summerCona;
                u = summerU;
                }

            sumes1_max = u;
            w_inf = Infiltration;

            //! if infiltration, reset sumes1
            //! reset sumes2 if infil exceeds sumes1
            if (w_inf > 0.0)
                {
                sumes2 = Math.Max(0.0, (sumes2 - Math.Max(0.0, w_inf - sumes1)));
                sumes1 = Math.Max(0.0, sumes1 - w_inf);

                //! update t (incase sumes2 changed)
                t = MathUtilities.Sqr(MathUtilities.Divide(sumes2, cona, 0.0));
                }
            else
                {
                //! no infiltration, no re-set.
                }

            //! are we in stage1 ?
            if (sumes1 < sumes1_max)
                {
                //! we are in stage1
                //! set esoil1 = potential, or limited by u.
                esoil1 = Math.Min(Eos, sumes1_max - sumes1);

                if ((Eos > esoil1) && (esoil1 < avail_sw_top))
                    {
                    //*           !  eos not satisfied by 1st stage drying,
                    //*           !  & there is evaporative sw excess to air_dry, allowing for esoil1.
                    //*           !  need to calc. some stage 2 drying(esoil2).

                    //*  if g%sumes2.gt.0.0 then esoil2 =f(sqrt(time),p%cona,g%sumes2,g%eos-esoil1).
                    //*  if g%sumes2 is zero, then use ritchie's empirical transition constant (0.6).

                    if (sumes2 > 0.0)
                        {
                        t = t + 1.0;
                        esoil2 = Math.Min((Eos - esoil1), (cona * Math.Pow(t, 0.5) - sumes2));
                        }
                    else
                        {
                        esoil2 = 0.6 * (Eos - esoil1);
                        }
                    }
                else
                    {
                    //! no deficit (or esoil1.eq.eos_max,) no esoil2 on this day
                    esoil2 = 0.0;
                    }

                //! check any esoil2 with lower limit of evaporative sw.
                esoil2 = Math.Min(esoil2, avail_sw_top - esoil1);

                //!  update 1st and 2nd stage soil evaporation.
                sumes1 = sumes1 + esoil1;
                sumes2 = sumes2 + esoil2;
                t = MathUtilities.Sqr(MathUtilities.Divide(sumes2, cona, 0.0));
                }
            else
                {
                //! no 1st stage drying. calc. 2nd stage
                esoil1 = 0.0;

                t = t + 1.0;
                esoil2 = Math.Min(Eos, (cona * Math.Pow(t, 0.5) - sumes2));

                //! check with lower limit of evaporative sw.
                esoil2 = Math.Min(esoil2, avail_sw_top);

                //!   update 2nd stage soil evaporation.
                sumes2 = sumes2 + esoil2;
                }

            Es = esoil1 + esoil2;

            //! make sure we are within bounds
            Es = cons.bound(Es, 0.0, Eos);
            Es = cons.bound(Es, 0.0, avail_sw_top);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Removes the evaporation from soil.
 /// </summary>
 /// <param name="SoilObject">The soil object.</param>
 public override void RemoveEvaporationFromSoil(ref SoilWaterSoil SoilObject)
 {
     Layer top = SoilObject.GetTopLayer();
     top.sw_dep = top.sw_dep - Es;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Adds the backed up water to surface.
        /// </summary>
        /// <param name="BackedUp">The backed up.</param>
        /// <param name="SoilObject">The soil object.</param>
        public override void AddBackedUpWaterToSurface(double BackedUp, ref SoilWaterSoil SoilObject)
        {
            //If Infiltration was more water that the top layer of soil had empty then the extra water had no choice but to back up.
            //In this case turn the backed up water into runoff and reduce the infiltration to only what the top layer could take before backing up.
            //The amount the top layer can take must be equal to the infiltration - backedup amount.

            //nb. What if lateral inflow caused it to back up? We are assuming only source of water into top layer is infiltration from surface.

            //remove backed up amount from the top layer of the soil. (All of the infiltration did not infiltrate)
            Layer top = SoilObject.GetTopLayer();
            top.sw_dep = top.sw_dep - BackedUp;

            //now reduce the infiltration amount by what backed up.
            base.Infiltration = base.Infiltration - BackedUp;

            //turn the proportion of the infiltration that backed up into runoff.
            base.Runoff = base.Runoff + BackedUp;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Adds the infiltration to soil.
 /// </summary>
 /// <param name="SoilObject">The soil object.</param>
 public override void AddInfiltrationToSoil(ref SoilWaterSoil SoilObject)
 {
     Layer top = SoilObject.GetTopLayer();
     top.sw_dep = top.sw_dep + Infiltration;
 }