Exemplo n.º 1
0
        private void ExportSection_BankErosion(Utils.IniFile config, string initXsPropFile, string floodPlainFile)
        {
            string cat = "BANK_EROSION";

            if (true) // rbMigrationCoefficient.Checked
            {
                config.SetValue(cat, "method", "Migration coefficient");
            }
            else
            {
                config.SetValue(cat, "method", "Physically-based");
            }
            config.SetValue(cat, "floodplain_heterogeneity", false);
            config.SetValue(cat, "erosion_coeff", 0.00000030);
            config.SetValue(cat, "pb_method", 2);                // Purely Erosional
            config.SetValue(cat, "bank_shear_stress_method", 3); // Stage based
            config.SetValue(cat, "node_to_monitor", 75);
            config.SetValue(cat, "update_width_method", 4);      // WS-banks intersects; mean dist.
            config.SetValue(cat, "erosion_distance_method", 2);  // WS-banks intersects
            config.SetValue(cat, "gap_elongation", 0.1);
            config.SetValue(cat, "regrid_centerline_nodes", true);
            config.SetValue(cat, "interpolate_after_splines", false);
            config.SetValue(cat, "interpolate_frequency", 10);
            config.SetValue(cat, "bank_interpolation_tolerance", 0.02);
            config.SetValue(cat, "initial_section_prop_file", initXsPropFile);
            config.SetValue(cat, "floodplain_file", floodPlainFile);
            config.SetValue(cat, "tblock", 0.0);
            config.SetValue(cat, "use_karmor", false);
        }
Exemplo n.º 2
0
        private void ExportSection_Channel(Utils.IniFile config, string valleyFile, string riverFile)
        {
            string cat = "CHANNEL";

            double sedSize;

            if (!double.TryParse(this.propsWindow.PropSedimentSize, out sedSize))
            {
                sedSize = 0.06;
            }
            else
            {
                sedSize /= 1000;
            }

            config.SetValue(cat, "flow", this.propsWindow.PropFlow);
            config.SetValue(cat, "width", this.propsWindow.PropWidth);
            config.SetValue(cat, "sediment_size", sedSize);
            config.SetValue(cat, "water_density", 1000);
            config.SetValue(cat, "valley_slope", this.propsWindow.PropValleySlope);
            config.SetValue(cat, "upstream_bed_elevation", this.propsWindow.PropUpstreamBedElev);
            config.SetValue(cat, "num_transverse_nodes", 51);
            config.SetValue(cat, "centerline", Path.GetFileName(riverFile));
            config.SetValue(cat, "valley_centerline", Path.GetFileName(valleyFile));
            config.SetValue(cat, "manning_coefficient", this.propsWindow.PropManningsN);
            config.SetValue(cat, "mesh_generation_method", 1); //TODO: represent in GUI
            config.SetValue(cat, "use_valley_centerline", false);
            config.SetValue(cat, "threshold_regridding", 100); //TODO: represent in GUI
        }
Exemplo n.º 3
0
        private void ExportSection_BankErosionProperties(Utils.IniFile config)
        {
            string cat = "BANK_EROSION.BANK_EVOLUTION_PROPERTIES";

            config.SetValue(cat, "use_hydraulic_erosion", true);
            config.SetValue(cat, "type_law_hydraulic_erosion", 1); // Original
            config.SetValue(cat, "xs_division", 2);
            config.SetValue(cat, "gr_threshold", 0.016);
            config.SetValue(cat, "wp_threshold", 0.025);
            if (true)
            {
                config.SetValue(cat, "max_erosion_dist", 8.0);
            }
            else
            {
                config.SetValue(cat, "max_erosion_dist", 10.0);
            }
            config.SetValue(cat, "min_distance", 0.05);
            config.SetValue(cat, "use_cantilever_failure", true);
            config.SetValue(cat, "undercut_threshold", 0.1);
            config.SetValue(cat, "use_planar_failure", false);
            config.SetValue(cat, "num_intersects", 3);
            config.SetValue(cat, "z_threshold", 0.1);
            config.SetValue(cat, "tension_crack_opt", 0.5);
            config.SetValue(cat, "slice_multip", 5);
            config.SetValue(cat, "positive_pore", true);
            config.SetValue(cat, "negative_pore", true);
            config.SetValue(cat, "hydrost_force", true);
            config.SetValue(cat, "accuracy", 0.005);
            config.SetValue(cat, "max_iter", 8);
            config.SetValue(cat, "analysis_method", 3); // Ordinary
            config.SetValue(cat, "lambda", 0.4);
            //cf.SetValue(cat, "tblock", txtCharacteristicPeriodOfExistenceForASlumpBlock.Text);
            //cf.SetValue(cat, "use_karmor", getTrueFalseValue(ref chkUseDimensionlessSlumpBlockArmoringFactor));
        }
Exemplo n.º 4
0
        private void ExportSection_PrepCurv(Utils.IniFile config)
        {
            string cat = "PREPROCESSING.CURVATURE";

            config.SetValue(cat, "method", 1);            // Parametric
            config.SetValue(cat, "upstream_method", 2);   // User-specified and constant
            config.SetValue(cat, "downstream_method", 1); // Extrapolated
            config.SetValue(cat, "curvature_capping", false);
        }
Exemplo n.º 5
0
        private void ExportSection_Hydrodynamics(Utils.IniFile config)
        {
            string cat = "HYDRODYNAMICS";

            config.SetValue(cat, "method", "Ikeda Et. Al. 1981"); // Ikeda et al 1981
            config.SetValue(cat, "last_node_method", 1);          // Extrapolation
            config.SetValue(cat, "init_perturbation_velocity", 0);
            config.SetValue(cat, "scour_factor", 5.0);
            config.SetValue(cat, "secondary_flow_correction", false);
        }
Exemplo n.º 6
0
        private void ExportSection_Migration(Utils.IniFile config)
        {
            string cat = "MIGRATION";

            config.SetValue(cat, "duration", this.propsWindow.PropDuration);
            config.SetValue(cat, "num_iterations", this.propsWindow.PropNumIterations);
            config.SetValue(cat, "filter_iterations", 10);
            config.SetValue(cat, "splines_initially", false);
            config.SetValue(cat, "plot_iterations", 5);
            config.SetValue(cat, "migrate_upstream_node", true);
            config.SetValue(cat, "migrate_downstream_node", true);
            config.SetValue(cat, "threshold_for_cutoff", 1.0);
            config.SetValue(cat, "init_curvature", 0.0);
            config.SetValue(cat, "init_perturbation_velocity", 0.0);
        }
Exemplo n.º 7
0
        private void ExportSection_Smoothing(Utils.IniFile config)
        {
            string cat = "SMOOTHING";

            //Verify with Nils that we need this method call
            //cf.SetValue(cat, "method", cboFilterOnCenterlineMethod.SelectedItem.ToString());
            config.SetValue(cat, "method", "Savitzky-Golay");
            config.SetValue(cat, "smoothing_order", 2); // Splines; no filter on centerline
            config.SetValue(cat, "curvature_filter", true);

            cat = "SMOOTHING.PARAMETERS";

            config.SetValue(cat, "iterations", 1);
            config.SetValue(cat, "window_nodes", 5);
            config.SetValue(cat, "polynomial_order", 2);
        }
Exemplo n.º 8
0
        private bool PopulateSimulation(string dirPath, string iniFilePath)
        {
            string valleyFile;
            string riverFile;

            if (!ExportShapeFiles(dirPath, out valleyFile, out riverFile))
            {
                return(false);
            }

            Utils.IniFile config = null;
            try
            {
                config = new Utils.IniFile(iniFilePath);

                //Set header values regarding the units used by the user
                config.SetValue("RVRMEANDER", "UserInterfaceUnits", "ENGLISH");
                config.SetValue("RVRMEANDER", "MapUnits", "ENGLISH");

                //Call specific export routines passing the required variables/strings.
                ExportSection_Channel(config, valleyFile, riverFile);
                ExportSection_PrepCurv(config);
                ExportSection_Hydrodynamics(config);
                ExportSection_BankErosion(config, "", "");
                ExportSection_BankErosionProperties(config);
                ExportSection_Migration(config);
                ExportSection_Smoothing(config);
                ExportSection_Plotting(dirPath, config);
            }
            catch (Exception ex)
            {
                //TODO: log error
                return(false);
            }
            finally
            {
                if (config != null)
                {
                    config.Dispose();
                }
            }

            return(true);
        }
Exemplo n.º 9
0
        private void ExportSection_Plotting(string dirPath, Utils.IniFile config)
        {
            string cat = "PLOTTING";

            config.SetValue(cat, "output_1D", Path.Combine(dirPath, "TecPlot" + "1D" + ".DAT"));
            config.SetValue(cat, "output_uv2D", Path.Combine(dirPath, "TecPlot" + "uv2D" + ".DAT"));
            config.SetValue(cat, "output_hde2D", Path.Combine(dirPath, "TecPlot" + "hde2D" + ".DAT"));
            config.SetValue(cat, "output_U1V12D", Path.Combine(dirPath, "TecPlot" + "U1V12D" + ".DAT"));
            config.SetValue(cat, "output_H1D1E12D", Path.Combine(dirPath, "TecPlot" + "H1D1E12D" + ".DAT"));
            config.SetValue(cat, "output_UUVV2D", Path.Combine(dirPath, "TecPlot" + "UUVV2D" + ".DAT"));
            config.SetValue(cat, "output_HHDDEE2D", Path.Combine(dirPath, "TecPlot" + "HHDDEE2D" + ".DAT"));
            config.SetValue(cat, "output_VELandTAU2D", Path.Combine(dirPath, "TecPlot" + "VELandTAU2D" + ".DAT"));
            config.SetValue(cat, "output_Sections2D", Path.Combine(dirPath, "TecPlot" + "Sections2D" + ".DAT"));
            config.SetValue(cat, "output_Hydro3D", Path.Combine(dirPath, "TecPlot" + "Hydro3D" + ".DAT"));
            config.SetValue(cat, "output_BedBanks3D", Path.Combine(dirPath, "TecPlot" + "BedBanks3D" + ".DAT"));
            config.SetValue(cat, "output_Floodplain", Path.Combine(dirPath, "TecPlot" + "Grid" + ".DAT"));
            config.SetValue(cat, "output_KarmorFile", Path.Combine(dirPath, "KarmorFile.DAT"));
            config.SetValue(cat, "output_IndicesFile", Path.Combine(dirPath, "IndicesFile.DAT"));
            config.SetValue(cat, "output_KarmorVisualizedFile", Path.Combine(dirPath, "KarmorVisualizedFile.DAT"));
        }