Difference between revisions of "MemEOL"

From Desal Wiki
Line 41: Line 41:
 
     var CONST_CONV_TO_UF = 'conversion_to_uf';
 
     var CONST_CONV_TO_UF = 'conversion_to_uf';
 
     var CONST_REUSE_RO = 'reuse_as_ro';
 
     var CONST_REUSE_RO = 'reuse_as_ro';
 +
 +
    var rangesRO = {
 +
        "Designation":["High quality SWRO","High quality BWRO","Medium quality BWRO","Low quality BWRO","Medium quality NF"],
 +
        "High NaCl rejection range (%)":[99.9,99.7,99.2,98,96],
 +
        "Low NaCl rejection range (%)":[99.60,99.20,98.00,96.00,80.00],
 +
        "Min permeability range (l.m-2.h-1.bar-1)":[0.45,1.60,1.60,1.00,5.00]
 +
    };
  
 
//create value from each iteration
 
//create value from each iteration
Line 125: Line 132:
 
     }
 
     }
  
     function conversionToUFCalc(UFscore, damage){
+
     function conversionToUFCalc(scoreUF, damage){
 
         if(damage === 1){
 
         if(damage === 1){
             UFscore = 0;
+
             scoreUF = 0;
 
         }
 
         }
         return UFscore;
+
         return scoreUF;
 +
    }
 +
 
 +
    function calculateROReuseQuality(damage, minPermeability, saltRejection){
 +
        var j=0;
 +
        var k=0;
 +
        //if the membrane is physically damaged it can not be reused for RO.
 +
        if(damage===1){
 +
            return -1;
 +
        }
 +
        for (var item in rangesRO) {
 +
            if(j===0){
 +
                k=rangesRO[item].length;
 +
            } else if (k!==rangesRO[item].length) {
 +
                console.log('k!==rangesRO[item].length');
 +
                throw new Error('k!==rangesRO[item].length.'); //break the script
 +
            } else {
 +
                j++;
 +
            }
 +
        }
 +
        var x=1;
 +
        var y=0;
 +
        for(y=0; y<k; y++){
 +
            if(rangesRO[x][y]>saltRejection && (rangesRO[x+1][y]<saltRejection && rangesRO[x+2][y]>minPermeability)){ //max < rejection < min. perm > minPerm
 +
                return y;
 +
            }
 +
        }
 +
        return -1;
 
     }
 
     }
  
Line 177: Line 211:
 
                     }
 
                     }
 
                 }
 
                 }
 +
                //adjust UF score
 
                 if(scoreObject.hasOwnProperty(CONST_CONV_TO_UF)){
 
                 if(scoreObject.hasOwnProperty(CONST_CONV_TO_UF)){
 
                     scoreObject[CONST_CONV_TO_UF] = conversionToUFCalc(scoreObject[CONST_CONV_TO_UF], getPhysicalDamage());
 
                     scoreObject[CONST_CONV_TO_UF] = conversionToUFCalc(scoreObject[CONST_CONV_TO_UF], getPhysicalDamage());
Line 184: Line 219:
 
                         console.log(scoreObject[property]);
 
                         console.log(scoreObject[property]);
 
                     }
 
                     }
                 }            
+
                 }
 
+
                //adjust RO score & determine RO reuse quality
 +
                var roReuseResult=0;
 +
                if(scoreObject.hasOwnProperty(CONST_REUSE_RO)){
 +
                    roReuseResult = calculateROReuseQuality(getPhysicalDamage(), getPermeability(), getNaClRejection());
 +
                    if(reReuseResult===-1){
 +
                        scoreObject[CONST_REUSE_RO]=0;
 +
                    }
 +
                }
 +
                //determine highest score & second highest scores
 +
                var max=-1;
 +
                var maxName="";
 +
                var second=-1;
 +
                var secondName="";
 +
                for (var property in scoreObject) {
 +
                    if (scoreObject.hasOwnProperty(property)) {
 +
                        if(scoreObject[property]>max){
 +
                            max = scoreObject[property];
 +
                            maxName=property;
 +
                        } else if (scoreObject[property]===max) {
 +
                            second = scoreObject[property];
 +
                            secondName=property;
 +
                            //ignore case that max===second===third
 +
                        } else if (scoreObject[property]>=second) {
 +
                            second = scoreObject[property];
 +
                            secondName=property;
 +
                        }
 +
                    }
 +
                }
 +
                console.log(maxName + ': ' + String(max));
 +
                console.log(secondName + ': ' + String(second));
 
       });
 
       });
 
   });
 
   });

Revision as of 07:20, 10 December 2014

Introduction text

Do you suspect there is any physical damage to the membranes that would prevent them from being reused?

What is the tested permeability of your membranes (LMH/bar)?

What is the tested NaCl rejection of your membranes? (% NaCl rejection)


Please order the following criteria in the order of importance for your project (drag and drop):

  • Financial
  • Effort required
  • Environmental impact
  • Landfill impact
  • Public perception
Most important Least important