public static List <ISO19030RESULT> Analysis() { // Collect Data and Compilation if (!(DataRetrieval() && DataCompilation())) { return(null); } //Chauvent Filtering & Validation sailingData = Filters.BasicFilteringContorller(sailingData); //Create wind Resistance windResistance = WindResistance.CreateWindResistance(shipParticular, sailingData.Count()); //Environment Filtering sailingData = Filters.FilteringForReferenceCondition(sailingData, shipParticular, ballastValues, scantlingValues, windResistance); //Create Reference List <double[]> powerToSpeedTable = DataFunctions.PowerToSpeedTable(shipParticular, ballastValues, scantlingValues); //var nowDraft = sailingData.Where(d => d.DRAFT_FORE != -9999).Average(d => d.DRAFT_FORE); //var modelDraftMeanBallast = (ballastValues.DRAFT_FORE + ballastValues.DRAFT_AFT) / 2; //var modelDraftMeanScantling = (scantlingValues.DRAFT_FORE + scantlingValues.DRAFT_AFT) / 2; //Create Result Data var iso19030resultList = CreateResultData(sailingData, powerToSpeedTable); return(iso19030resultList); }
public static List <ISO19030File> FilteringForReferenceCondition(List <ISO19030File> sailingData, SHIP_PARTICULAR shipParticular, dynamic ballastValues, dynamic scantlingValues, WindResistance windResistance) { int index = 0; foreach (var item in sailingData) { //if (item.VALID_CHAUVENT == true && item.VALID_VALIDATION == true && item.VALID_REFCONDITION == true) //{ var minDraft = (item.DRAFT_FORE + item.DRAFT_AFT) / 2; var deltaT = (ballastValues.DRAFT_FORE + ballastValues.DRAFT_AFT) / 2 - minDraft; var A = shipParticular.TRANSVERSE_PROJECTION_AREA_BALLAST + deltaT * shipParticular.BREADTH; var Za = 18.2 + deltaT; windResistance.data.zref[index] = (shipParticular.TRANSVERSE_PROJECTION_AREA_BALLAST * (10 + deltaT) + 0.5 * shipParticular.BREADTH * Math.Pow(deltaT, 2)) / A; windResistance.data.axv[index] = shipParticular.TRANSVERSE_PROJECTION_AREA_BALLAST + ((ballastValues.DRAFT_FORE + ballastValues.DRAFT_AFT) / 2 - minDraft) * shipParticular.BREADTH; windResistance.data.za[index] = /*shipModelTestData.ZA_BALLAST*/ 18.2 + ((ballastValues.DRAFT_FORE + ballastValues.DRAFT_AFT) / 2 - minDraft); windResistance.data.vg[index] = item.SPEED_VG * 0.5144; windResistance.data.psi0[index] = Math.PI * item.SHIP_HEADING / 180; windResistance.data.rhoair[index] = /*item.AMBIENT_DENSITY;*/ 1.225; windResistance.data.vwr[index] = item.REL_WIND_SPEED; windResistance.data.psiwr[index] = Math.PI * item.REL_WIND_DIR / 180; index++; //} } //바람 저항도 계산 windResistance.CalculateWindResistance(); index = 0; //마지막 필터 계산 foreach (var item in afterValID_shipdata) { var windSpeedTrue = windResistance.data.vwtref[item.ID]; var speedLw = item.SPEED_LW * 0.5144f; //수심의 깊이 체크 var waterDepth1 = 3 * Math.Sqrt(shipParticular.BREADTH * ((item.DRAFT_FORE + item.DRAFT_AFT) / 2)); var waterDepth2 = 2.75 * (speedLw * speedLw) / 9.80665; if (waterDepth1 < waterDepth2) { waterDepth1 = waterDepth2; } if (index == 22) { var check = 0; } if (item.WATER_DEPTH < -999) { item.WATER_DEPTH = 9999; } //수온이 너무 낮거나! 바람의 세기가 8이상 타각이 5이상인걸 날림 if (item.SW_TEMP < 2 || item.WATER_DEPTH <= waterDepth1 || windSpeedTrue > 7.9 || Math.Abs(item.RUDDER_ANGLE) > 5) { sailingData.ElementAt((int)item.ID).VALID_REFCONDITION = false; REF_CONDITION_COUNT++; FILTER_TOTAL_COUNT++; errorList.Add(item.ID); } else { //통과한 것만 넣음 afterRef_shipdata.Add(item); } index++; } return(sailingData); }