Exemplo n.º 1
0
 public string TestPreConditions(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex, string callID)
 {
     try
     {
         //Set current values of the inputs to the static VarInfo representing the inputs properties of the domain classes
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.diffusionLimitedEvaporation.CurrentValue = s.diffusionLimitedEvaporation;
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.energyLimitedEvaporation.CurrentValue    = s.energyLimitedEvaporation;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions        pre = new Preconditions();
         RangeBasedCondition  r1  = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.diffusionLimitedEvaporation);
         if (r1.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.diffusionLimitedEvaporation.ValueType))
         {
             prc.AddCondition(r1);
         }
         RangeBasedCondition r2 = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.energyLimitedEvaporation);
         if (r2.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.energyLimitedEvaporation.ValueType))
         {
             prc.AddCondition(r2);
         }
         string preConditionsResult = pre.VerifyPreconditions(prc, callID); if (!string.IsNullOrEmpty(preConditionsResult))
         {
             pre.TestsOut(preConditionsResult, true, "PreConditions errors in strategy " + this.GetType().Name);
         }
         return(preConditionsResult);
     }
     catch (Exception exception)
     {
         string msg = "SiriusQuality.EnergyBalance, " + this.GetType().Name + ": Unhandled exception running pre-condition test. ";
         throw new Exception(msg, exception);
     }
 }
Exemplo n.º 2
0
        private void CalculateModel(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
        {
            double diffusionLimitedEvaporation = s.diffusionLimitedEvaporation;
            double energyLimitedEvaporation    = s.energyLimitedEvaporation;
            double soilEvaporation;

            soilEvaporation   = Math.Min(diffusionLimitedEvaporation, energyLimitedEvaporation);
            a.soilEvaporation = soilEvaporation;
        }
Exemplo n.º 3
0
        private void CalculateModel(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
        {
            double netRadiation = s.netRadiation;
            double netRadiationEquivalentEvaporation;

            netRadiationEquivalentEvaporation   = netRadiation / lambdaV * 1000.0d;
            a.netRadiationEquivalentEvaporation = netRadiationEquivalentEvaporation;
        }
        private void CalculateModel(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
        {
            double netRadiationEquivalentEvaporation = s.netRadiationEquivalentEvaporation;
            double soilEvaporation = s.soilEvaporation;
            double soilHeatFlux;

            soilHeatFlux   = tau * netRadiationEquivalentEvaporation - soilEvaporation;
            r.soilHeatFlux = soilHeatFlux;
        }
        private void CalculateModel(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
        {
            double evapoTranspirationPriestlyTaylor = r.evapoTranspirationPriestlyTaylor;
            double hslope      = a.hslope;
            double VPDair      = a.VPDair;
            double conductance = s.conductance;
            double evapoTranspirationPenman;

            evapoTranspirationPenman   = evapoTranspirationPriestlyTaylor / Alpha + (1000.0d * (rhoDensityAir * specificHeatCapacityAir * VPDair * conductance / (lambdaV * (hslope + psychrometricConstant))));
            r.evapoTranspirationPenman = evapoTranspirationPenman;
        }
        private void CalculateModel(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
        {
            double deficitOnTopLayers = a.deficitOnTopLayers;
            double diffusionLimitedEvaporation;

            if (deficitOnTopLayers / 1000.0d <= 0.0d)
            {
                diffusionLimitedEvaporation = 8.3d * 1000.0d;
            }
            else
            {
                if (deficitOnTopLayers / 1000.0d < 25.0d)
                {
                    diffusionLimitedEvaporation = 2.0d * soilDiffusionConstant * soilDiffusionConstant / (deficitOnTopLayers / 1000.0d) * 1000.0d;
                }
                else
                {
                    diffusionLimitedEvaporation = 0.0d;
                }
            }
            s.diffusionLimitedEvaporation = diffusionLimitedEvaporation;
        }
Exemplo n.º 7
0
        private void CalculateModel(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
        {
            double minTair      = a.minTair;
            double maxTair      = a.maxTair;
            double cropHeatFlux = r.cropHeatFlux;
            double conductance  = s.conductance;
            double minCanopyTemperature;
            double maxCanopyTemperature;

            minCanopyTemperature   = minTair + (cropHeatFlux / (rhoDensityAir * specificHeatCapacityAir * conductance / lambdaV * 1000.0d));
            maxCanopyTemperature   = maxTair + (cropHeatFlux / (rhoDensityAir * specificHeatCapacityAir * conductance / lambdaV * 1000.0d));
            s.minCanopyTemperature = minCanopyTemperature;
            s.maxCanopyTemperature = maxCanopyTemperature;
        }
Exemplo n.º 8
0
 public void Estimate(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
 {
     try
     {
         CalculateModel(s, s1, r, a, ex);
     }
     catch (Exception exception)
     {
         string msg = "Error in component SiriusQualityEnergyBalance, strategy: " + this.GetType().Name + ": Unhandled exception running model. " + exception.GetType().FullName + " - " + exception.Message;
         throw new Exception(msg, exception);
     }
 }
        private void CalculateModel(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
        {
            double minTair             = a.minTair;
            double maxTair             = a.maxTair;
            double solarRadiation      = a.solarRadiation;
            double vaporPressure       = a.vaporPressure;
            double extraSolarRadiation = a.extraSolarRadiation;
            double netRadiation;
            double netOutGoingLongWaveRadiation;
            double Nsr;
            double clearSkySolarRadiation;
            double averageT;
            double surfaceEmissivity;
            double cloudCoverFactor;
            double Nolr;

            Nsr = (1.0d - albedoCoefficient) * solarRadiation;
            clearSkySolarRadiation = (0.75d + (2 * Math.Pow(10.0d, -5) * elevation)) * extraSolarRadiation;
            averageT          = (Math.Pow(maxTair + 273.16d, 4) + Math.Pow(minTair + 273.16d, 4)) / 2.0d;
            surfaceEmissivity = 0.34d - (0.14d * Math.Sqrt(vaporPressure / 10.0d));
            cloudCoverFactor  = 1.35d * (solarRadiation / clearSkySolarRadiation) - 0.35d;
            Nolr         = stefanBoltzman * averageT * surfaceEmissivity * cloudCoverFactor;
            netRadiation = Nsr - Nolr;
            netOutGoingLongWaveRadiation = Nolr;
            a.netRadiation = netRadiation;
            a.netOutGoingLongWaveRadiation = netOutGoingLongWaveRadiation;
        }
Exemplo n.º 10
0
 public string TestPreConditions(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex, string callID)
 {
     try
     {
         //Set current values of the inputs to the static VarInfo representing the inputs properties of the domain classes
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.minTair.CurrentValue = a.minTair;
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.maxTair.CurrentValue = a.maxTair;
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.cropHeatFlux.CurrentValue = r.cropHeatFlux;
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.conductance.CurrentValue = s.conductance;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions        pre = new Preconditions();
         RangeBasedCondition  r1  = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.minTair);
         if (r1.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.minTair.ValueType))
         {
             prc.AddCondition(r1);
         }
         RangeBasedCondition r2 = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.maxTair);
         if (r2.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.maxTair.ValueType))
         {
             prc.AddCondition(r2);
         }
         RangeBasedCondition r3 = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.cropHeatFlux);
         if (r3.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.cropHeatFlux.ValueType))
         {
             prc.AddCondition(r3);
         }
         RangeBasedCondition r4 = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.conductance);
         if (r4.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.conductance.ValueType))
         {
             prc.AddCondition(r4);
         }
         prc.AddCondition(new RangeBasedCondition(_modellingOptionsManager.GetParameterByName("lambdaV")));
         prc.AddCondition(new RangeBasedCondition(_modellingOptionsManager.GetParameterByName("rhoDensityAir")));
         prc.AddCondition(new RangeBasedCondition(_modellingOptionsManager.GetParameterByName("specificHeatCapacityAir")));
         string preConditionsResult = pre.VerifyPreconditions(prc, callID); if (!string.IsNullOrEmpty(preConditionsResult))
         {
             pre.TestsOut(preConditionsResult, true, "PreConditions errors in strategy " + this.GetType().Name);
         }
         return(preConditionsResult);
     }
     catch (Exception exception)
     {
         string msg = "SiriusQuality.EnergyBalance, " + this.GetType().Name + ": Unhandled exception running pre-condition test. ";
         throw new Exception(msg, exception);
     }
 }
 public string TestPreConditions(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex, string callID)
 {
     try
     {
         //Set current values of the inputs to the static VarInfo representing the inputs properties of the domain classes
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.minTair.CurrentValue             = a.minTair;
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.maxTair.CurrentValue             = a.maxTair;
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.solarRadiation.CurrentValue      = a.solarRadiation;
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.vaporPressure.CurrentValue       = a.vaporPressure;
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.extraSolarRadiation.CurrentValue = a.extraSolarRadiation;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions        pre = new Preconditions();
         RangeBasedCondition  r1  = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.minTair);
         if (r1.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.minTair.ValueType))
         {
             prc.AddCondition(r1);
         }
         RangeBasedCondition r2 = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.maxTair);
         if (r2.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.maxTair.ValueType))
         {
             prc.AddCondition(r2);
         }
         RangeBasedCondition r3 = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.solarRadiation);
         if (r3.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.solarRadiation.ValueType))
         {
             prc.AddCondition(r3);
         }
         RangeBasedCondition r4 = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.vaporPressure);
         if (r4.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.vaporPressure.ValueType))
         {
             prc.AddCondition(r4);
         }
         RangeBasedCondition r5 = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.extraSolarRadiation);
         if (r5.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.extraSolarRadiation.ValueType))
         {
             prc.AddCondition(r5);
         }
         prc.AddCondition(new RangeBasedCondition(_modellingOptionsManager.GetParameterByName("albedoCoefficient")));
         prc.AddCondition(new RangeBasedCondition(_modellingOptionsManager.GetParameterByName("stefanBoltzman")));
         prc.AddCondition(new RangeBasedCondition(_modellingOptionsManager.GetParameterByName("elevation")));
         string preConditionsResult = pre.VerifyPreconditions(prc, callID); if (!string.IsNullOrEmpty(preConditionsResult))
         {
             pre.TestsOut(preConditionsResult, true, "PreConditions errors in strategy " + this.GetType().Name);
         }
         return(preConditionsResult);
     }
     catch (Exception exception)
     {
         string msg = "SiriusQuality.EnergyBalance, " + this.GetType().Name + ": Unhandled exception running pre-condition test. ";
         throw new Exception(msg, exception);
     }
 }
Exemplo n.º 12
0
        private void CalculateModel(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
        {
            double evapoTranspiration = r.evapoTranspiration;
            double potentialTranspiration;

            potentialTranspiration   = evapoTranspiration * (1.0d - tau);
            r.potentialTranspiration = potentialTranspiration;
        }
        private void CalculateModel(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
        {
            double plantHeight = a.plantHeight;
            double wind        = a.wind;
            double conductance;
            double h;

            h             = Math.Max(10.0d, plantHeight) / 100.0d;
            conductance   = wind * Math.Pow(vonKarman, 2) / (Math.Log((heightWeatherMeasurements - (d * h)) / (zm * h)) * Math.Log((heightWeatherMeasurements - (d * h)) / (zh * h)));
            s.conductance = conductance;
        }
Exemplo n.º 14
0
 public string TestPostConditions(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex, string callID)
 {
     try
     {
         //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.evapoTranspirationPriestlyTaylor.CurrentValue = r.evapoTranspirationPriestlyTaylor;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions        pre = new Preconditions();
         RangeBasedCondition  r5  = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.evapoTranspirationPriestlyTaylor);
         if (r5.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.evapoTranspirationPriestlyTaylor.ValueType))
         {
             prc.AddCondition(r5);
         }
         string postConditionsResult = pre.VerifyPostconditions(prc, callID); if (!string.IsNullOrEmpty(postConditionsResult))
         {
             pre.TestsOut(postConditionsResult, true, "PostConditions errors in strategy " + this.GetType().Name);
         }
         return(postConditionsResult);
     }
     catch (Exception exception)
     {
         string msg = "SiriusQuality.EnergyBalance, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
         throw new Exception(msg, exception);
     }
 }
        private void CalculateModel(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
        {
            double evapoTranspirationPriestlyTaylor = r.evapoTranspirationPriestlyTaylor;
            double evapoTranspirationPenman         = r.evapoTranspirationPenman;
            double evapoTranspiration;

            if (isWindVpDefined == 1)
            {
                evapoTranspiration = evapoTranspirationPenman;
            }
            else
            {
                evapoTranspiration = evapoTranspirationPriestlyTaylor;
            }
            r.evapoTranspiration = evapoTranspiration;
        }
Exemplo n.º 16
0
 public string TestPreConditions(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex, string callID)
 {
     try
     {
         //Set current values of the inputs to the static VarInfo representing the inputs properties of the domain classes
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.netRadiationEquivalentEvaporation.CurrentValue = s.netRadiationEquivalentEvaporation;
         SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.hslope.CurrentValue = a.hslope;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions        pre = new Preconditions();
         RangeBasedCondition  r1  = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.netRadiationEquivalentEvaporation);
         if (r1.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.netRadiationEquivalentEvaporation.ValueType))
         {
             prc.AddCondition(r1);
         }
         RangeBasedCondition r2 = new RangeBasedCondition(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.hslope);
         if (r2.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.hslope.ValueType))
         {
             prc.AddCondition(r2);
         }
         prc.AddCondition(new RangeBasedCondition(_modellingOptionsManager.GetParameterByName("psychrometricConstant")));
         prc.AddCondition(new RangeBasedCondition(_modellingOptionsManager.GetParameterByName("Alpha")));
         string preConditionsResult = pre.VerifyPreconditions(prc, callID); if (!string.IsNullOrEmpty(preConditionsResult))
         {
             pre.TestsOut(preConditionsResult, true, "PreConditions errors in strategy " + this.GetType().Name);
         }
         return(preConditionsResult);
     }
     catch (Exception exception)
     {
         string msg = "SiriusQuality.EnergyBalance, " + this.GetType().Name + ": Unhandled exception running pre-condition test. ";
         throw new Exception(msg, exception);
     }
 }
Exemplo n.º 17
0
        private void CalculateModel(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
        {
            double netRadiationEquivalentEvaporation = a.netRadiationEquivalentEvaporation;
            double soilHeatFlux           = r.soilHeatFlux;
            double potentialTranspiration = r.potentialTranspiration;
            double cropHeatFlux;

            cropHeatFlux   = netRadiationEquivalentEvaporation - soilHeatFlux - potentialTranspiration;
            r.cropHeatFlux = cropHeatFlux;
        }
Exemplo n.º 18
0
        private void CalculateModel(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
        {
            double netRadiationEquivalentEvaporation = s.netRadiationEquivalentEvaporation;
            double hslope = a.hslope;
            double evapoTranspirationPriestlyTaylor;

            evapoTranspirationPriestlyTaylor   = Math.Max(Alpha * hslope * netRadiationEquivalentEvaporation / (hslope + psychrometricConstant), 0.0d);
            r.evapoTranspirationPriestlyTaylor = evapoTranspirationPriestlyTaylor;
        }
        private void CalculateModel(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState s1, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate r, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary a, SiriusQualityEnergyBalance.DomainClass.EnergyBalanceExogenous ex)
        {
            double evapoTranspirationPriestlyTaylor = r.evapoTranspirationPriestlyTaylor;
            double energyLimitedEvaporation;
            double AlphaE;

            if (tau < tauAlpha)
            {
                AlphaE = 1.0d;
            }
            else
            {
                AlphaE = Alpha - ((Alpha - 1.0d) * (1.0d - tau) / (1.0d - tauAlpha));
            }
            energyLimitedEvaporation   = evapoTranspirationPriestlyTaylor / Alpha * AlphaE * tau;
            a.energyLimitedEvaporation = energyLimitedEvaporation;
        }