def __init__(self): Section.__init__(self) ## str: Descriptive title self.title = "" self.notes = ""
def __init__(self): Section.__init__(self) ## Name of rainfall data file to use self.use_rainfall = None ## Name of rainfall data file to save self.save_rainfall = None ## Name of runoff data file to use self.use_runoff = None ## Name of runoff data file to save self.save_runoff = None ## Name of hot start data file to use self.use_hotstart = None ## Name of hot start data file to save self.save_hotstart = None ## Name of RDII data file to use self.use_rdii = None ## Name of RDII data file to save self.save_rdii = None ## Name of inflows data file to use self.use_inflows = None ## Name of outflows data file to save self.save_outflows = None
def __init__(self): Section.__init__(self) self.skip_steady_state = False ## bool: True to skip flow routing computations during steady state periods ## of a simulation. The last set of computed flows will be used. self.report_step = "00:15:00" ## str: Time interval for reporting of computed results. self.wet_step = "00:05:00" ## str: Time step length used to compute runoff from subcatchments during ## periods of rainfall or when ponded water remains on the surface. self.dry_step = "01:00:00" ## str: Time step length used for runoff computations ## (consisting essentially of pollutant buildup) ## during periods when there is no rainfall and no ponded water. self.routing_step = "00:05:00" ## str: Time step used for routing flows and ## water quality constituents through the conveyance system self.rule_step = "00:00:00" ## periodic time step for control rule evaluation self.system_flow_tolerance = "5" ## the maximum percent difference between total system inflow and ## total system outflow which can occur in order for the SKIP_STEADY_STATE ## option to take effect. The default is 5 percent. self.lateral_inflow_tolerance = "5"
def __init__(self): Section.__init__(self) self.subcatchment_name = '' """Name of the Subcatchment defined in [SUBCATCHMENTS] where this usage occurs""" self.control_name = '' """Name of the LID control defined in [LID_CONTROLS] to be used in the subcatchment""" self.number_replicate_units = '0' """Number of equal size units of the LID practice deployed within the subcatchment""" self.area_each_unit = '' """Surface area devoted to each replicate LID unit""" self.top_width_overland_flow_surface = '' """Width of the outflow face of each identical LID unit""" self.percent_initially_saturated = '' """Degree to which storage zone is initially filled with water""" self.percent_impervious_area_treated = '' """Percent of the impervious portion of the subcatchment's non-LID area whose runoff is treated by the LID practice""" self.send_outflow_pervious_area = '0' """1 if the outflow from the LID is returned onto the subcatchment's pervious area rather than going to the subcatchment's outlet""" self.detailed_report_file = "" """Name of an optional file where detailed time series results for the LID will be written""" self.subcatchment_drains_to = "" """ID of a subcatchment that this LID drains to"""
def __init__(self): Section.__init__(self) ## Whether report includes a summary of the input data self.input = False ## Whether to report continuity checks self.continuity = True ## Whether to report summary flow statistics self.flow_stats = True ## Whether to list all control actions taken during a simulation self.controls = False ## List of subcatchments whose results are to be reported, or ALL or NONE self.subcatchments = Report.ALL_LIST ## List of nodes whose results are to be reported, or ALL or NONE self.nodes = Report.ALL_LIST ## List of links whose results are to be reported, or ALL or NONE self.links = Report.ALL_LIST ## List of lid specifications whose results are to be reported. ## Includes LID control name, subcatchment id and file name. self.lids = []
def __init__(self): Section.__init__(self) ## duration of the simulation; the default of zero runs a single period snapshot analysis. self.duration = "0" # hours:minutes ## determines how often a new hydraulic state of the network is computed self.hydraulic_timestep = "1:00" # hours:minutes ## time step used to track changes in water quality throughout the network self.quality_timestep = "0:05" # hours:minutes ## ime step used to check for changes in system status due to activation of rule-based controls self.rule_timestep = "0:05" # hours:minutes ## interval between time periods in all time patterns self.pattern_timestep = "1:00" # hours:minutes ## time offset at which all patterns will start self.pattern_start = "0:00" # hours:minutes ## time interval between which output results are reported self.report_timestep = "1:00" # hours:minutes ## length of time into the simulation at which output results begin to be reported self.report_start = "0:00" # hours:minutes ## time of day (e.g., 3:00 PM) at which the simulation begins self.start_clocktime = "12 am" # hours:minutes AM/PM ## determines what kind of statistical post-processing to do on simulation results self.statistic = StatisticOptions.NONE # NONE/AVERAGED/MINIMUM/MAXIMUM/RANGE
def read(new_text, project): section_map = {"NODE": project.nodes_groups(), "LINK": project.links_groups()} disposable_tags = Section() disposable_tags.SECTION_NAME = "[TAGS]" for line in new_text.splitlines(): line = SectionReader.set_comment_check_section(disposable_tags, line) fields = line.split() if len(fields) > 2: object_type_name = fields[0].upper() object_name = fields[1].upper() tag = ' '.join(fields[2:]) sections = section_map[object_type_name] found = False for section in sections: for candidate in section.values: if candidate.name.upper() == object_name: candidate.tag = tag found = True # print "Tagged: " + type(candidate).__name__ + ' ' + candidate.name + ' = ' + tag break if found: break if not found: print "Tag not applied: " + line
def __init__(self, afilename): Section.__init__(self) self.name = '' """???just an identifier???""" self.etype = ECalibrationType.NONE """category of calibration data""" self.is_flow = None self.filename = afilename """calibration data file name""" self.hobjects = {} """object-calibration dataset collection""" self.quality = None """calibration data chemical collection""" self.headers = None """calibration data file header line collection""" self.status = ECalibrationFileStatus.NeedToRead """calibration data file access status""" self.netsum_obs = 0.0 #Sums[2] self.netsum_sim = 0.0 #Sums[3] self.netsum_err = 0.0 #Sums[4] e = Abs(sim-obs) self.netsum_err2 = 0.0 #Sums[5] e*e self.netsum_sim_stats_ctr = 0 #Sum[1] self.netsum_obs_non0_ctr = 0 #Sum[7] self.netsum_err_relative = 0.0 #Sum[8] e/obs self.meansum_ctr = 0 # s[1] # of values self.meansum_obs = 0.0 # s[2] obs mean: Sum of X self.meansum_sim = 0.0 # s[3] sim mean: Sum of Y self.meansum_obs2 = 0.0 # s[4] Sum of X*X self.meansum_sim2 = 0.0 # s[5] Sum of Y*Y self.meansum_os = 0.0 # s[6] Sum of X*Y self.netmean_obs = 0.0 self.netmean_sim = 0.0 self.netmean_err = 0.0 # stats[4] mean error self.netmean_rms = 0.0 # stats[5] RMS (root-mean-square) error self.read_data()
def __init__(self): Section.__init__(self) self.quality = QualityAnalysisType.NONE """Type of water quality analysis to perform""" self.chemical_name = "" """Name of chemical to be analyzed in quality section""" self.mass_units = "" """Units of chemical to be analyzed in quality section""" self.diffusivity = 1.0 """Molecular diffusivity of the chemical being analyzed relative to that of chlorine in water""" self.trace_node = "" """Node id to use in a quality trace""" self.tolerance = 0.0 """Difference in water quality level below one parcel of water is essentially the same as another""" #things to come for multispecies self.AREA_UNITS = 'M2' """Surface concentration is mass/m2""" self.RATE_UNITS = 'HR' """Reaction rates are concentration/hour""" self.SOLVER = 'RK5' """5-th order Runge-Kutta integrator""" self.TIMESTEP = 360 """360 sec (5 min) solution time step""" self.RTOL = 0.001 """Relative concentration tolerance""" self.ATOL = 0.0001 """Absolute concentration tolerance"""
def __init__(self): Section.__init__(self) ## Transect Name self.name = '' ## Manning's n of left overbank portion of channel. Use 0 if no change from previous NC line. self.n_left = '0' ## Manning's n of right overbank portion of channel. Use 0 if no change from previous NC line. self.n_right = '0' ## Manning's n of main channel portion of channel. Use 0 if no change from previous NC line. self.n_channel = '0' ## station position which ends the left overbank portion of the channel (ft or m). self.overbank_left = '0' ## station position which begins the right overbank portion of the channel (ft or m). self.overbank_right = '0' ## factor by which distances between stations should be multiplied to increase (or decrease) the width of the channel (enter 0 if not applicable). self.stations_modifier = '0' ## amount added (or subtracted) from the elevation of each station (ft or m). self.elevations_modifier = '0' ## the ratio of the length of a meandering main channel to the length of the overbank area that surrounds it (use 0 if not applicable). self.meander_modifier = '0' ## list of (station, elevation) pairs self.stations = []
def __init__(self): Section.__init__(self) self.link = "None" """name of the conduit, orifice, or weir this is a cross-section of.""" self.shape = CrossSectionShape.NotSet """cross-section shape""" self.geometry1 = '0.0' """float as str: full height of the cross-section (ft or m)""" self.geometry2 = '0.0' """float as str: auxiliary parameters (width, side slopes, etc.)""" self.geometry3 = '0.0' """float as str: auxiliary parameters (width, side slopes, etc.)""" self.geometry4 = '0.0' """float as str: auxiliary parameters (width, side slopes, etc.)""" self.barrels = '0.0' """float: number of barrels (i.e., number of parallel pipes of equal size, slope, and roughness) associated with a conduit (default is 1).""" self.culvert_code = '' """code number for the conduits inlet geometry if it is a culvert subject to possible inlet flow control""" self.curve = "None" """str: name of associated Shape Curve that defines how width varies with depth."""
def __init__(self): Section.__init__(self) ## set the order of reactions occurring in the bulk fluid self.order_bulk = 1.0 # real ## set the order of reactions occurring in the pipe wall self.order_wall = 1.0 # real ## set the order of reactions occurring in the tanks self.order_tank = 1.0 # real ## set a global value for all bulk reaction coefficients self.global_bulk = 0.0 # real ## set a global value for all wall reaction coefficients self.global_wall = 0.0 # real ## specifies that reaction rates are proportional to difference between concentration and potential value self.limiting_potential = 0.0 # real ## make all default pipe wall reaction coefficients be related to pipe roughness self.roughness_correlation = 0.0 # real ## pipe/tank specific reaction coefficients self.value = []
def __init__(self): Section.__init__(self) ## land use name self.land_use_name = "None" ## str: Pollutant name self.pollutant = "None" ## BuildupFunction: Type of buildup function to use for the pollutant self.function = BuildupFunction.POW ## float: Time constant that governs the rate of pollutant buildup self.rate_constant = '0.0' ## float: Exponent C3 used in the Power buildup formula, or the half-saturation constant C2 used in the ## Saturation buildup formula self.power_sat_constant = '0.0' ## float: Maximum buildup that can occur self.max_buildup = '0.0' ## float: Multiplier used to adjust the buildup rates listed in the time series self.scaling_factor = '1.0' ## str: ID of Time Series that contains buildup rates self.timeseries = "None" ## Variable to which buildup is normalized on a per unit basis self.normalizer = Normalizer.AREA
def __init__(self): Section.__init__(self) Coordinate.__init__(self) """Text of label is saved in name attribute defined in Coordinate base class.""" ## ID label of an anchor node (optional) self.anchor_name = '' # string ## type of object being metered by the label self.meter_type = MeterType.NONE ## ID of the object (Node or Link) being metered self.meter_name = '' ## label font self.font = "" ## label size self.size = 10.0 ## True to use bold self.bold = False ## True to use italics self.italic = False
def __init__(self): Section.__init__(self) self.node = "None" """str: name of node where external inflow enters.""" self.timeseries = "None" """str: Name of the time series describing how flow or constituent loading to this node varies with time.""" self.constituent = "FLOW" """str: Name of constituent (pollutant) or FLOW""" self.format = DirectInflowType.CONCEN """DirectInflowType: Type of data contained in constituent_timeseries, concentration or mass flow rate""" self.conversion_factor = '1.0' """float: Numerical factor used to convert the units of pollutant mass flow rate in constituent_timeseries into project mass units per second as specified in [POLLUTANTS]""" self.scale_factor = '1.0' """float: Scaling factor that multiplies the recorded time series values.""" self.baseline = '0.0' """float: Constant baseline added to the time series values.""" self.baseline_pattern = '' """str: ID of Time Pattern whose factors adjust the baseline inflow on an hourly, daily, or monthly basis"""
def __init__(self): Section.__init__(self) ## sets the number of lines written per page of the output report self.pagesize = '' ## supplies the name of a file to which the output report will be written; ## don't write by default""" self.file = '' # string ## determines whether a hydraulic status report should be generated self.status = StatusWrite.NO # YES/NO/FULL ## determines whether a summary table of number of network components and key analysis options is generated self.summary = True # YES/NO ## determines if a table reporting average energy usage and cost for each pump is provided; ## don't write by default""" self.energy = False # YES/NO ## identifies which nodes will be reported on. List individual IDs or use NONE or ALL self.nodes = [] ## identifies which links will be reported on. List individual IDs or use NONE or ALL self.links = [] ## used to identify which quantities are reported on; ## don't write if blank self.parameters = [] # list of strings
def read_section(self, project, section_name, section_text): """ Read the section named section_name whose complete text is section_text into project. """ # old_section = project.find_section(section_name) # if old_section: # project.sections.remove(old_section) new_section = None attr_name = project.format_as_attribute_name(section_name) reader_name = "read_" + attr_name if hasattr(self, reader_name): reader = self.__getattribute__(reader_name) try: new_section = reader.read(section_text) except Exception as e: print("Exception calling " + reader_name + " for " + section_name + ":\n" + str(e) + '\n' + str(traceback.print_exc())) if new_section is None: print("Default Section for " + section_name) new_section = Section() new_section.SECTION_NAME = section_name new_section.value = section_text project.__setattr__(attr_name, new_section) if new_section not in project.sections: project.sections.append(new_section)
def __init__(self): Section.__init__(self) self.start_date = "1/1/2002" """Date when the simulation begins""" self.start_time = "0:00" """Time of day on the starting date when the simulation begins""" self.end_date = "1/1/2002" """Date when the simulation is to end""" self.end_time = "24:00" """Time of day on the ending date when the simulation will end""" self.report_start_date = "1/1/2002" """Date when reporting of results is to begin""" self.report_start_time = "0:00" """Time of day on the report starting date when reporting is to begin""" self.sweep_start = "1/1" """Day of the year (month/day) when street sweeping operations begin""" self.sweep_end = "12/31" """Day of the year (month/day) when street sweeping operations end""" self.dry_days = 0 """Number of days with no rainfall prior to the start of the simulation"""
def __init__(self): Section.__init__(self) self.input = False """Whether report includes a summary of the input data""" self.continuity = True """Whether to report continuity checks""" self.flow_stats = True """Whether to report summary flow statistics""" self.controls = False """Whether to list all control actions taken during a simulation""" self.subcatchments = ["ALL"] """List of subcatchments whose results are to be reported, or ALL or NONE""" self.nodes = ["ALL"] """List of nodes whose results are to be reported, or ALL or NONE""" self.links = ["ALL"] """List of links whose results are to be reported, or ALL or NONE""" self.lids = [] """List of lid specifications whose results are to be reported.
def read_section(self, project, section_name, section_text): """ Read the section named section_name whose complete text is section_text into project. """ old_section = project.find_section(section_name) #if old_section: # project.sections.remove(old_section) new_section = None attr_name = project.format_as_attribute_name(section_name) reader_name = "read_" + attr_name if hasattr(self, reader_name): reader = self.__getattribute__(reader_name) try: new_section = reader.read(section_text) except Exception as e: print("Exception calling " + reader_name + " for " + section_name + ":\n" + str(e) + '\n' + str(traceback.print_exc())) if new_section is None: print("Default Section for " + section_name) new_section = Section() new_section.SECTION_NAME = section_name if not section_name == section_text: new_section.value = section_text if "REACTION" in new_section.SECTION_NAME.upper() and old_section: for vmdata in old_section.metadata: old_section.__setattr__(vmdata.attribute, new_section.__getattribute__(vmdata.attribute)) if new_section.value and len(new_section.value) > 0: for spec in new_section.value: old_section.value.append(spec) else: project.__setattr__(attr_name, new_section) if old_section is None: #new_section not in project.sections: project.sections.append(new_section)
def __init__(self): Section.__init__(self) self.format = EvaporationFormat.UNSET """format used for evaporation data""" self.constant = '0' """a constant evaporation rate""" self.monthly = () """twelve monthly evaporation rates""" self.timeseries = '' """name of time series in [TIMESERIES] section with evaporation data""" self.monthly_pan_coefficients = () """twelve monthly pan coefficients used with file option and file name in temperature section""" self.recovery_pattern = '' # time pattern ID """name of a monthly time pattern""" self.dry_only = False """determines if evaporation only occurs during periods with no precipitation.""" self.dry_only_specified = False """ True if DRY_ONLY was included when read from text.
def __init__(self): Section.__init__(self) ## format used for evaporation data self.format = EvaporationFormat.UNSET ## a constant evaporation rate self.constant = '0' ## twelve monthly evaporation rates self.monthly = () ## name of time series in [TIMESERIES] section with evaporation data self.timeseries = '' ## twelve monthly pan coefficients used with file option and file name in temperature section self.monthly_pan_coefficients = () ## name of a monthly time pattern self.recovery_pattern = '' # time pattern ID ## determines if evaporation only occurs during periods with no precipitation. self.dry_only = False ## True if DRY_ONLY was included when read from text; ## If dry_only_specified == False, then DRY_ONLY is skipped in get_text if self.dry_only_specified == False; ## If dry_only_specified == True, DRY_ONLY will be included in get_text even if self.dry_only == False. self.dry_only_specified = False
def __init__(self): Section.__init__(self) ## Identifier of link whose initial status is being specified self.name = '' ## Initial status of link self.status = ''
def __init__(self): Section.__init__(self) ## Current value of the item as it appears in an InputFile self.value = "" ## A user-specified header and/or comment about the section" self.comment = ""
def __init__(self): Section.__init__(self) self.name = '' """Identifier of link whose initial status is being specified""" self.status = '' """Initial status of link"""
def __init__(self): Section.__init__(self) ## Identifier of pump self.name = '' ## Indicator whether this pump energy specification is entered as price, pattern, or efficiency self.PricePatternEfficiency = PumpEnergyType.PRICE # PRICE, PATTERN, or EFFICIENCY
def __init__(self): """Initialize or reset section""" Section.__init__(self) self.value = "" """Current value of the item as it appears in an InputFile""" self.comment = "" """A user-specified header and/or comment about the section"""
def __init__(self): Section.__init__(self) ## Name of a file containing coordinates of the network's nodes; ## Don't write by default self.map = "" ## crs information self.crs_name = None self.crs_unit = None
def __init__(self): Section.__init__(self) ## Subcatchment name self.subcatchment = "None" ## Aquifer that supplies groundwater. None = no groundwater flow. self.aquifer = "None" ## Node that receives groundwater from the aquifer. self.receiving_node = "None" ## Elevation of ground surface for the subcatchment ## that lies above the aquifer (feet or meters). self.surface_elevation = '0.0' ## Value of A1 in the groundwater flow formula. self.groundwater_flow_coefficient = '0.0' ## Value of B1 in the groundwater flow formula. self.groundwater_flow_exponent = '0.0' ## Value of A2 in the groundwater flow formula. self.surface_water_flow_coefficient = '0.0' ## Value of B2 in the groundwater flow formula. self.surface_water_flow_exponent = '0.0' ## Value of A3 in the groundwater flow formula. self.surface_gw_interaction_coefficient = '0.0' ## Fixed depth of surface water at the receiving node (feet or meters) ## (set to zero if surface water depth will vary ## as computed by flow routing). ## This value is used to compute HSW. self.fixed_surface_water_depth = '0.0' ## Groundwater elevation that must be reached before any flow occurs ## (feet or meters). ## Leave blank to use the receiving node's invert elevation. self.threshold_groundwater_elevation = '*' ## override bottom elevation aquifer parameter self.bottom_elevation = '' ## override initial water table elevation aquifer parameter self.water_table_elevation = '' ## override initial upper moisture content aquifer parameter self.unsaturated_zone_moisture = '' ## expression for lateral groundwater flow (to a node of the conveyance network) self.custom_lateral_flow_equation = '' ## expression for vertical loss to deep groundwater self.custom_deep_flow_equation = ''
def __init__(self): Section.__init__(self) ## User-assigned name self.name = "Unnamed" ## Volume of voids / total soil volume (volumetric fraction) self.porosity = "0.5" ## Soil moisture content at which plants cannot survive ## (volumetric fraction) self.wilting_point = "0.15" ## Soil moisture content after all free water has drained off ## (volumetric fraction) self.field_capacity = "0.30" ## Soil's saturated hydraulic conductivity (in/hr or mm/hr) self.conductivity = "5.0" ## Average slope of log(conductivity) versus soil moisture deficit ## (porosity minus moisture content) curve (unitless) self.conductivity_slope = "10.0" ## Average slope of soil tension versus soil moisture content curve ## (inches or mm) self.tension_slope = "15.0" ## Fraction of total evaporation available for evapotranspiration ## in the upper unsaturated zone self.upper_evaporation_fraction = "0.35" ## Maximum depth into the lower saturated zone over which ## evapotranspiration can occur (ft or m) self.lower_evaporation_depth = "14.0" ## Rate of percolation from saturated zone to deep groundwater (in/hr or mm/hr) self.lower_groundwater_loss_rate = "0.002" ## Elevation of the bottom of the aquifer (ft or m) self.bottom_elevation = "0.0" ## Elevation of the water table in the aquifer ## at the start of the simulation (ft or m) self.water_table_elevation = "10.0" ## Moisture content of the unsaturated upper zone of the aquifer ## at the start of the simulation (volumetric fraction) ## (cannot exceed soil porosity) self.unsaturated_zone_moisture = "0.30" ## ID of monthly pattern of adjustments to upper evaporation fraction (optional) self.upper_evaporation_pattern = '' ## monthly pattern object self.upper_evaporation_pattern_object = None