Ejemplo n.º 1
0
        private bool ConvertSeabedComposition()
        {
            if (!ConvertBottomLevelNumber())
            {
                return(false);
            }

            if (p.shenCohesiveSediment)
            {     //凝聚性沉滓
                if (p.surfaceErosion)
                { //表層沖刷
                    if (!ControllerUtility.CheckConvertDouble(ref p.surfaceErosionCoefficient, surfaceErosionCoefficientTxt, "請輸入正確的表層沖刷係數!", ControllerUtility.CheckType.GreaterThanZero))
                    {
                        return(false);
                    }
                    if (!ControllerUtility.CheckConvertDouble(ref p.surfaceErosionCriticalShearStress, surfaceErosionCriticalShearStressTxt, "請輸入正確的表層沖刷臨界剪應力!", ControllerUtility.CheckType.GreaterThanZero))
                    {
                        return(false);
                    }
                }
                if (p.massiveErosion)
                {   //塊狀沖蝕
                    if (!ControllerUtility.CheckConvertDouble(ref p.massiveErosionCriticalShearStress, massiveErosionCriticalShearStressTxt, "請輸入正確的塊狀沖蝕臨界剪應力!", ControllerUtility.CheckType.GreaterThanZero))
                    {
                        return(false);
                    }
                }
                if (p.noErosionElevationUse)
                {
                    //Check p.noErosionElevation
                }
            }
            return(true);
        }
Ejemplo n.º 2
0
        private bool ConvertPhysicalParam()
        {
            //zeroEquationTypeCombo.SelectedIndex = (int)p.zeroEquationType;

            ////1.2.3 其他
            if (p.turbulenceViscosityType == RiverSimulationProfile.TurbulenceViscosityType.UserDefine)
            {
                if (!ControllerUtility.CheckConvertDouble(ref p.tvInMainstreamDirection, tvInMainstreamDirectionTxt, "請輸入正確的物理參數-主流方向紊流黏滯係數!", ControllerUtility.CheckType.NoCheck))
                {
                    return(false);
                }
                if (!ControllerUtility.CheckConvertDouble(ref p.tvInSideDirection, tvInSideDirectionTxt, "請輸入正確的物理參數-側方向紊流黏滯係數!", ControllerUtility.CheckType.NoCheck))
                {
                    return(false);
                }
            }
            else if (p.turbulenceViscosityType == RiverSimulationProfile.TurbulenceViscosityType.None)
            {
                MessageBox.Show("請選擇物理參數-紊流黏滯係數!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }

            if (p.roughnessType == RiverSimulationProfile.RoughnessType.Chezy && !p.chezy.HasInputed())
            {
                MessageBox.Show("請輸入物理參數-Chezy!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }
            else if (p.roughnessType == RiverSimulationProfile.RoughnessType.ManningN && !p.manningN.HasInputed())
            {
                MessageBox.Show("請輸入物理參數-Manning n!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }
            else if (p.roughnessType == RiverSimulationProfile.RoughnessType.None)
            {
                MessageBox.Show("請選擇物理參數-糙度係數!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }

            //gravityConstantTxt.Text = p.gravityConstant.ToString();
            //waterDensityTxt.Text = p.waterDensity.ToString();
            //tvInMainstreamDirectionTxt.Enabled = (p.turbulenceViscosityType == RiverSimulationProfile.TurbulenceViscosityType.UserDefine);
            //tvInSideDirectionTxt.Enabled = (p.turbulenceViscosityType == RiverSimulationProfile.TurbulenceViscosityType.UserDefine);
            if (roughnessHeightKsBtn.Enabled && p.roughnessHeightKs.type == RiverSimulationProfile.TwoInOne.Type.None)
            {
                MessageBox.Show("請輸入物理參數-粗糙高度Ks!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.gravityConstant, gravityConstantTxt, "", ControllerUtility.CheckType.NoCheck))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.waterDensity, waterDensityTxt, "請輸入正確的水密度!", ControllerUtility.CheckType.NotNegative))
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 3
0
 private bool ConvertDownVerticalDistributionValue()
 {
     if (!ControllerUtility.CheckConvertDouble(ref p.boundaryDownVerticalDistribution.ValueDouble()[0], downVdValueTxt, "請輸入正確的下游垂直濃度分布值!", ControllerUtility.CheckType.NotNegative))
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 4
0
 private bool ConvertBedrock()
 {
     if (!ControllerUtility.CheckConvertDouble(ref p.waterJettingAlpha, waterJettingAlphaTxt, "請輸入正確的水力沖刷常數α", ControllerUtility.CheckType.NoCheck))
     {
         return(false);
     }
     if (!ControllerUtility.CheckConvertDouble(ref p.waterJettingBeta, waterJettingBetaTxt, "請輸入正確的水力沖刷常數β", ControllerUtility.CheckType.NoCheck))
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 5
0
        private bool ConvertValueParam()
        {
            if (!ControllerUtility.CheckConvertDouble(ref p.totalSimulationTime, totalSimulationTimeTxt, "請輸入正確的總模擬時間!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.timeSpan2d, timeSpan2dTxt, "請輸入正確的二維時間間距!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertInt32(ref p.outputFrequency, outputFrequencyTxt, "請輸入正確的輸出頻率!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertInt32(ref p.steppingTimesInVertVslcTime, steppingTimesInVertVslcTimeTxt, "請輸入正確的垂直方向計算時間步進次數!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.waterModelingConvergenceCriteria2d, waterModelingConvergenceCriteria2dTxt, "請輸入正確的二維水理收斂標準!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }
            if (!ControllerUtility.CheckConvertDouble(ref p.waterModelingConvergenceCriteria3d, waterModelingConvergenceCriteria3dTxt, "請輸入正確的三維水理收斂標準!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.minWaterDeoth, minWaterDeothTxt, "請輸入正確的最小水深!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }
            if (!ControllerUtility.CheckConvertDouble(ref p.viscosityFactorAdditionInMainstream, viscosityFactorAdditionInMainstreamTxt, "請輸入正確的主流方向黏滯係數加成比例!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }
            if (!ControllerUtility.CheckConvertDouble(ref p.viscosityFactorAdditionInSideDirection, viscosityFactorAdditionInSideDirectionTxt, "請輸入正確的側方向黏滯係數加成比例!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 6
0
        private bool ConvertValueParam()
        {
            if (!ControllerUtility.CheckConvertDouble(ref p.waterTimeSpan, waterTimeSpanTxt, "請輸入正確的時間間距!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertInt32(ref p.waterOutputFrequency, waterOutputFrequencyTxt, "請輸入正確的輸出頻率!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (p.diffusionFormulaUse)
            {
                if (p.diffusionFormula == RiverSimulationProfile.DiffusionFormulaType.None)
                {
                    MessageBox.Show("請選擇數值參數-擴散公式 !", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.diffusionBonusProportionalInMainstream, diffusionBonusProportionalInMainstreamTxt, "請輸入正確的主流方向擴散係數加成比例!", ControllerUtility.CheckType.NotNegative))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.diffusionBonusProportionalInSideflow, diffusionBonusProportionalInSideflowTxt, "請輸入正確的側方向擴散係數加成比例!", ControllerUtility.CheckType.NotNegative))
            {
                return(false);
            }
            if (!ControllerUtility.CheckConvertDouble(ref p.diffusionBonusProportionalInSurface, diffusionBonusProportionalInSurfaceTxt, "請輸入正確的水面擴散係數加成比例!", ControllerUtility.CheckType.NotNegative))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.diffusionBonusProportionalInBottom, diffusionBonusProportionalInBottomTxt, "請輸入正確的底床擴散係數加成比例!", ControllerUtility.CheckType.NotNegative))
            {
                return(false);
            }


            return(true);
        }
Ejemplo n.º 7
0
        private bool ConvertPhysicalParam()
        {
            if (!ControllerUtility.CheckConvertDouble(ref p.kinematicViscosityCoefficient, kinematicViscosityCoefficientTxt, "請輸入正確的動力黏滯係數!", ControllerUtility.CheckType.NotNegative))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.sedimentPoreRatio, sedimentPoreRatioTxt, "請輸入正確的泥砂孔隙比!", ControllerUtility.CheckType.NotNegative))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.sedimentDensity, sedimentDensityTxt, "請輸入正確的泥砂密度!", ControllerUtility.CheckType.NotNegative))
            {
                return(false);
            }

            if (!ConvertSedimentParticlesNumber())  //讀取泥砂顆粒數目
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 8
0
        private bool ConvertQuayStable()
        {
            if (!ControllerUtility.CheckConvertDouble(ref p.rockStableTimeSpacing, rockStableTimeSpacingTxt, "請輸入正確的岸壁穩定-時間間距", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!(p.analysisLeftBankStable || p.analysisRightBankStable))
            {
                MessageBox.Show("請至少選取一側岸壁穩定分析!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.leftSlopeToePosiotion, leftSlopeToePosiotionTxt, "請輸入正確的岸壁穩定-分析左岸岸壁穩定-坡腳位置!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.leftBankHeight, leftBankHeightTxt, "請輸入正確的岸壁穩定-分析左岸岸壁穩定-岸壁高度!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.leftInitBankSlope, leftInitBankSlopeTxt, "請輸入正確的岸壁穩定-分析左岸岸壁穩定-初始岸壁坡度!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.leftDikeToBankLength, leftDikeToBankLengthTxt, "請輸入正確的岸壁穩定-分析左岸岸壁穩定-堤防到岸壁的長度!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.rightSlopeToePosiotion, rightSlopeToePosiotionTxt, "請輸入正確的岸壁穩定-分析右岸岸壁穩定-坡腳位置!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.rightBankHeight, rightBankHeightTxt, "請輸入正確的岸壁穩定-分析右岸岸壁穩定-岸壁高度!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.rightInitBankSlope, rightInitBankSlopeTxt, "請輸入正確的岸壁穩定-分析右岸岸壁穩定-初始岸壁坡度!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.rightDikeToBankLength, rightDikeToBankLengthTxt, "請輸入正確的岸壁穩定-分析右岸岸壁穩定-堤防到岸壁的長度!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.bankSoilInternalFrictionAngle, bankSoilInternalFrictionAngleTxt, "請輸入正確的岸壁穩定-岸壁土壤性質-內摩擦角!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.bankSoilConductCoefficient, bankSoilConductCoefficientTxt, "請輸入正確的岸壁穩定-岸壁土壤性質-傳導係數!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.bankSoilBankScourCriticalStress, bankSoilBankScourCriticalStressTxt, "請輸入正確的岸壁穩定-岸壁土壤性質-岸壁沖刷臨界剪應力!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.bankSoilCohesion, bankSoilCohesionTxt, "請輸入正確的岸壁穩定-岸壁土壤性質-凝聚力!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.bankSoilAngleOfRepose, bankSoilAngleOfReposeTxt, "請輸入正確的岸壁穩定-岸壁土壤性質-安息角!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.bankSoilSpecificYield, bankSoilSpecificYieldTxt, "請輸入正確的岸壁穩定-岸壁土壤性質-比流率!", ControllerUtility.CheckType.GreaterThanZero))
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 9
0
        private bool ConvertWaterModeling()
        {
            if (boundaryTimeBtn.Enabled)
            {
                if (!ConvertBoundaryTimeNumber())
                {
                    return(false);
                }

                if (p.boundaryTime == null || p.boundaryTime.Length != p.boundaryTimeNumber)
                {
                    MessageBox.Show("請輸入水理模式-邊界時間!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }
            }

            if (p.upFlowCondition == RiverSimulationProfile.FlowConditionType.None)
            {
                MessageBox.Show("請選擇水理模式-上游-流況設定!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }
            else if (p.upFlowCondition == RiverSimulationProfile.FlowConditionType.SuperCriticalFlow)
            {
                if (!p.superMainFlowQuantity.HasInputed())
                {
                    MessageBox.Show("請輸入水理模式-上游-超臨界流-主流方向流量!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }
                if (!p.superSideFlowQuantity.HasInputed())
                {
                    MessageBox.Show("請輸入水理模式-上游-超臨界流-側方向流量!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }
                if (!p.superWaterLevel.HasInputed())
                {
                    MessageBox.Show("請輸入水理模式-上游-超臨界流-水位!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }
            }
            else if (p.upFlowCondition == RiverSimulationProfile.FlowConditionType.SubCriticalFlow)
            {
                if (!p.subMainFlowQuantity.HasInputed())
                {
                    MessageBox.Show("請輸入水理模式-上游-亞臨界流-主流方向流量!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }
                if (!p.subSideFlowQuantity.HasInputed())
                {
                    MessageBox.Show("請輸入水理模式-上游亞臨界流-側方向流量!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }
            }

            if (p.downFlowCondition == RiverSimulationProfile.FlowConditionType.None)
            {
                MessageBox.Show("請選擇水理模式-下游-流況設定!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(false);
            }
            else if (p.downFlowCondition == RiverSimulationProfile.FlowConditionType.SubCriticalFlow)
            {
                if (!p.downSubWaterLevel.HasInputed())
                {
                    MessageBox.Show("請輸入水理模式-下游-亞臨界流-水位!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }
            }

            if (!ConvertVerticalVelocityDistributionNumber())
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.mainstreamWindShear, mainstreamWindShearTxt, "請輸入正確的水理模式-主流方向風剪!", ControllerUtility.CheckType.NoCheck))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.sideWindShear, sideWindShearTxt, "請輸入正確的水理模式-側方向風剪!", ControllerUtility.CheckType.NoCheck))
            {
                return(false);
            }

            if (!ControllerUtility.CheckConvertDouble(ref p.coriolisForce, coriolisForceTxt, "請輸入正確的水理模式-科氏力!", ControllerUtility.CheckType.NoCheck))
            {
                return(false);
            }
            return(true);
        }