public override FlowResponseData getFlowDriverDeliveryPossibleValues(FlowCalculationData baseData, FlowDriverModifier modifier)
        {
            pumpingPercent = lastSourcePossibleValue.flowPercent;
            mcrPressure = lastSourcePossibleValue.backPressure;
            FlowResponseData normalResponse = base.getFlowDriverDeliveryPossibleValues(baseData, modifier);

            double deltaP = lastSourcePossibleValue.backPressure - normalResponse.backPressure;
            if (deltaP < minDeltaP)
            {
                normalResponse.flowPercent = 0.0;
            }
            else
            {
                double flowPercent = 1.0;                   //Default to 1, in case deltaP > maxDeltaP, in which case, we do 100% of what we can.
                if (deltaP < maxDeltaP)
                {
                    flowPercent = (deltaP - minDeltaP) / (maxDeltaP - minDeltaP);
                }

                normalResponse.flowPercent = Math.Min(normalResponse.flowPercent, lastSourcePossibleValue.flowPercent) * flowPercent;
            }
            normalResponse.flowVolume = baseData.desiredFlowVolume * normalResponse.flowPercent;

            return normalResponse;
        }
 public override FlowResponseData getFlowDriverSourcePossibleValues(FlowCalculationData baseData, FlowDriverModifier modifier)
 {
     pumpingPercent = 1.0;
     FlowResponseData normalResponse = base.getFlowDriverSourcePossibleValues(baseData, modifier);
     lastSourcePossibleValue = normalResponse;
     return normalResponse;
 }
Пример #3
0
        public bool applySolution(FlowCalculationData baseData, FlowDriverModifier modifier, bool lastTime)
        {
            if (solutionApplied)
                return true;                     //If we have already successfully sent all our data, then we shouldn't do it again...

            SettingResponseData sourceResponse = setSourceValues(baseData, null, pumpingPercent * mcrRating * modifier.flowPercent, lastTime);
            if (sourceResponse != null)
            {
                baseData.applySourceResponse(sourceResponse);
                setDeliveryValues(baseData, null, pumpingPercent * mcrRating * modifier.flowPercent, lastTime);
                solutionApplied = true;
            }

            return solutionApplied;
        }
Пример #4
0
        public virtual FlowResponseData getFlowDriverSourcePossibleValues(FlowCalculationData baseData, FlowDriverModifier modifier)
        {
            //This shouldn't happen anymore, since GraphSolver calls the pump-specific (i.e. not override) version.
            baseData.flowDriver = this;
            baseData.desiredFlowVolume = pumpingPercent * mcrRating * modifier.flowPercent;
            baseData.pressure = calculateInletPressure(modifier);
            inletPressure = baseData.pressure;

            //We only do last response on the source side for pumps (all other components only have one side for this stuff...
            return sourceComponent.getSourcePossibleValues(baseData, this, 1.0, 1.0);         //Always ask 100% of whatever desired flow we have. Will send smaller percent upon solving whole solution.
        }
Пример #5
0
 public virtual FlowResponseData getFlowDriverDeliveryPossibleValues(FlowCalculationData baseData, FlowDriverModifier modifier)
 {
     baseData.flowDriver = this;
     baseData.desiredFlowVolume = pumpingPercent * mcrRating * modifier.flowPercent;
     baseData.pressure = calculateOutletPressure(modifier);
     outletPressure = baseData.pressure;
     return deliveryComponent.getDeliveryPossibleValues(baseData, this, 1.0, 1.0);             //Always ask 100% of whatever desired flow we have
 }
Пример #6
0
 protected double calculateOutletPressure(FlowDriverModifier modifier)
 {
     double ret = mcrPressure * pumpingPercent * modifier.minSourceFlowPercent;           //The source is the main thing that can drop the pressure
     if (modifier.minSourceFlowPercent > modifier.minDeliveryFlowPercent && modifier.minSourceFlowPercent > 0.0)
     {
         //This is functionality more typical of a centrifugal pump.
         //If the delivery side is more clogged than the source, then we can add back some because of back pressure.
         ret *= (1.0 + 0.20 * (1.0 - modifier.minDeliveryFlowPercent / modifier.minSourceFlowPercent));                   //Allow up to 20% higher pressure if the output is clogged
     }
     return ret;
 }
Пример #7
0
 protected double calculateInletPressure(FlowDriverModifier modifier)
 {
     double ret = -0.2 * pumpingPercent;                           //By default, it will be about -0.2 bar when running at 100% normally
     ret *= (1 + (2.0 * (1.0 - modifier.minSourceFlowPercent)));           //If the source is blocked, it can increase by up to 3x
     return ret;
 }