IWFMModel#

Model Geometry#

Nodes#

get_n_nodes()

Return the number of nodes in an IWFM model

get_node_coordinates()

Return the x,y coordinates of the nodes in an IWFM model

get_node_ids()

Return an array of node ids in an IWFM model

get_node_info()

Return node id, x-, and y-coordinates for each node in an IWFM model

get_boundary_nodes([subregions, ...])

Return nodes that make up the boundary of an IWFM model

order_boundary_nodes(in_boundary_nodes, ...)

takes an unordered dataframe with two columns of node ids and orders them such that the start id of the next is equal to the end id of the previous.

Elements#

get_n_elements()

Return the number of elements in an IWFM model

get_element_config(element_id)

Return an array of node ids for an IWFM element.

get_element_ids()

Return an array of element ids in an IWFM model

get_element_info()

Return element configuration information for all elements in an IWFM model

get_element_spatial_info()

Return element configuration information including x-y coordinates for nodes

Subregions#

get_n_subregions()

Return the number of subregions in an IWFM model

get_subregion_ids()

Return an array of IDs for subregions identified in an IWFM model

get_subregion_name(subregion_id)

Return the name corresponding to the subregion_id in an IWFM model

get_subregion_names()

Return the subregions names specified in an IWFM model

get_subregions_by_element()

Return an array identifying the IWFM Model elements contained within each subregion.

Stratigraphy#

get_n_layers()

Return the number of layers in an IWFM model

get_ground_surface_elevation()

Return the ground surface elevation for each node specified in the IWFM model

get_aquifer_top_elevation()

Return the aquifer top elevations for each finite element node and each layer

get_aquifer_bottom_elevation()

Return the aquifer bottom elevations for each finite element node and each layer

get_stratigraphy_atXYcoordinate(x, y[, ...])

Return the stratigraphy at given X,Y coordinates

Lakes#

get_n_lakes()

Return the number of lakes in an IWFM model

get_lake_ids()

Return an array of lake IDs in an IWFM model

get_n_elements_in_lake(lake_id)

Return the number of finite element grid cells that make up a lake

get_elements_in_lake(lake_id)

Return the element ids with the specified lake ID

Streams#

get_n_stream_reaches()

Return the number of stream reaches in an IWFM model

get_stream_reach_ids()

Return an array of stream reach IDs in an IWFM Model stream reaches in an IWFM model

get_stream_reach_names()

Return the stream reach names specified in an IWFM model

get_n_nodes_in_stream_reach(reach_id)

Return the number of stream nodes in a stream reach

get_stream_reach_stream_nodes(reach_id)

Return the stream node IDs corresponding to stream nodes in a specified reach

get_stream_reach_groundwater_nodes(reach_id)

Return the groundwater node IDs corresponding to stream nodes in a specified reach

get_n_stream_nodes()

Return the number of stream nodes in an IWFM model

get_stream_node_ids()

Return an array of stream node IDs in the IWFM model

get_stream_bottom_elevations()

Return the stream channel bottom elevation at each stream node

get_n_rating_table_points(stream_node_id)

Return the number of data points in the stream flow rating table for a stream node

get_stream_rating_table(stream_node_id)

Return the stream rating table for a specified stream node

get_n_stream_nodes_upstream_of_stream_node(...)

Return the number of stream nodes immediately upstream of the provided stream node id

get_stream_nodes_upstream_of_stream_node(...)

Return an array of the stream node ids immediately upstream of the provided stream node id

get_upstream_nodes_in_stream_reaches()

Return the IDs for the upstream stream node in each stream reach

get_downstream_node_in_stream_reaches()

Return the IDs for the downstream stream node in each stream reach

get_reach_outflow_destination()

Return the destination index that each stream reach flows into.

get_reach_outflow_destination_types()

Return the outflow destination types that each stream reach flows into.

get_n_reaches_upstream_of_reach(reach_id)

Return the number of stream reaches immediately upstream of the specified reach

get_reaches_upstream_of_reach(reach_id)

Return the IDs of the reaches that are immediately upstream of the specified reach

is_stream_upstream_node(stream_node_1, ...)

checks if a specified stream node .is located upstream from another specified stream node within the stream network of the IWFM model

get_stream_network()

Return the stream nodes and groundwater nodes for every reach in an IWFM model

Bypasses#

get_n_bypasses()

Return the number of bypasses in an IWFM model

get_bypass_ids()

Return the bypass identification numbers specified in an IWFM model

get_bypass_export_nodes(bypass_list)

Return the stream node IDs corresponding to bypass locations

get_bypass_exports_destinations(bypass_list)

Return stream node IDs and destination types and IDS where bypass flows are delivered.

get_bypass_outflows([bypass_conversion_factor])

Return the bypass outflows for the current simulation timestep

get_bypass_recoverable_loss_factor(bypass_id)

Return the recoverable loss factor for a bypass

get_bypass_nonrecoverable_loss_factor(bypass_id)

Return the nonrecoverable loss factor for a bypass

Inflows and Small Watersheds#

get_n_stream_inflows()

Return the number of stream boundary inflows specified by the user as timeseries input data

get_stream_inflow_ids()

Return the identification numbers for the stream boundary inflows specified by the user as timeseries input data

get_stream_inflow_nodes()

Return the stream node IDs that receive boundary inflows specified by the user as timeseries input data

get_n_small_watersheds()

Return the number of small watersheds specified in an IWFM model

get_small_watershed_ids()

Return the small watershed identification numbers specified in the IWFM model

Tile Drains#

get_n_tile_drains()

Return the number of tile drain nodes in an IWFM model

get_tile_drain_ids()

Return the user-specified IDs for tile drains simulated in an IWFM model

get_tile_drain_nodes()

Return the node ids where tile drains are specified

Land Use#

get_n_ag_crops()

Return the number of agricultural crops simulated in an IWFM model

Stream and Bypass Flows#

get_stream_flow_at_location(stream_node_id)

Return stream flow at a stream node for the current time step in a simulation

get_stream_flows([flow_conversion_factor])

Return stream flows at every stream node for the current timestep

get_stream_gain_from_groundwater([...])

Return gain from groundwater for every stream node for the current timestep

get_stream_gain_from_lakes([...])

Return gain from lakes for every stream node for the current timestep

get_stream_inflows_at_some_locations([...])

Return stream boundary inflows at a specified set of inflow locations listed by their indices for the current simulation timestep

get_stream_rainfall_runoff([...])

Return rainfall runoff at every stream node for the current timestep

get_stream_reaches_for_stream_nodes([...])

Return the stream reach IDs that correspond to one or more stream node IDs

get_stream_return_flows([...])

Return agricultural and urban return flows at every stream node for the current timestep

get_stream_riparian_evapotranspiration([...])

Return riparian evapotranspiration from every stream node for the current timestep

get_stream_stages([stage_conversion_factor])

Return stream stages at every stream node for the current timestep

get_stream_tile_drain_flows([...])

Return tile drain flows into every stream node for the current timestep

get_stream_tributary_inflows([...])

Return small watershed inflows at every stream node for the current timestep

get_net_bypass_inflows([...])

Return net bypass inflows for every stream node for the current timestep

get_actual_stream_diversions_at_some_locations([...])

Return actual diversion amounts for a list of diversions during a model simulation

Diversions and Pumping#

get_n_diversions()

Return the number of surface water diversions in an IWFM model

get_diversion_ids()

Return the surface water diversion identification numbers specified in an IWFM model

get_diversion_purpose([diversions])

Return the flags for the initial purpose of the diversions as ag, urban, or both

get_stream_diversion_locations([...])

Return the stream node IDs corresponding to diversion locations

get_n_wells()

Return the number of wells simulated in an IWFM model

get_well_ids()

Return the pumping well IDs specified in an IWFM model

get_well_pumping_purpose([wells])

Return the flags for the initial purpose of the well pumping as ag, urban, or both

get_n_element_pumps()

Return the number of element pumps simulated in an IWFM model

get_element_pump_ids()

Return the element pump IDs specified in an IWFM model

get_element_pump_purpose([element_pumps])

Return the flags for the initial purpose of the element pumping as ag, urban, or both

get_urban_diversion_supply_shortage_at_origin([...])

Return the supply shortage for urban diversions at the destination of those supplies plus any conveyance losses

get_urban_elempump_supply_shortage_at_origin([...])

Return the supply shortage for urban element pumping at the destination of those supplies plus any conveyance losses

get_urban_well_supply_shortage_at_origin([...])

Return the supply shortage for urban wells at the destination of those supplies plus any conveyance losses

get_ag_diversion_supply_shortage_at_origin([...])

Return the supply shortage for agricultural diversions at the destination of those supplies plus any conveyance losses

get_ag_elempump_supply_shortage_at_origin([...])

Return the supply shortage for agricultural element pumping at the destination of those supplies plus any conveyance losses

get_ag_well_supply_shortage_at_origin([...])

Return the supply shortage for agricultural wells at the destination of those supplies plus any conveyance losses

get_supply_requirement_ag_elements([...])

Return the agricultural supply requirement for one or more model elements

get_supply_requirement_ag_subregions([...])

Return the agricultural supply requirement for one or more model subregions

get_supply_requirement_urban_elements([...])

Return the urban supply requirement for one or more model elements

get_supply_requirement_urban_subregions([...])

Return the urban supply requirement for one or more model subregions

Aquifer Properties#

get_aquifer_horizontal_k()

Return the aquifer horizontal hydraulic conductivity for each finite element node and each layer

get_aquifer_vertical_k()

Return the aquifer vertical hydraulic conductivity for each finite element node and each layer

get_aquitard_vertical_k()

Return the aquitard vertical hydraulic conductivity for each finite element node and each layer

get_aquifer_specific_storage()

Return the aquifer specific storage for each finite element node and each layer

get_aquifer_specific_yield()

Return the aquifer specific yield for each finite element node and each layer

get_aquifer_parameters()

Return all aquifer parameters at each model node and layer

Simulation Results#

get_gwheads_foralayer(layer_number[, ...])

Return the simulated groundwater heads for a single user-specified model layer for every model node over a user-specified time interval.

get_depth_to_water(layer_number[, ...])

calculates a depth to water for an IWFM model layer for all dates between the provided start date and end date.

get_gwheads_all([end_of_timestep, ...])

Return the groundwater heads at all nodes in every aquifer layer for the current simulation time step

get_subsidence_all([...])

Return the simulated subsidence at all nodes in every aquifer layer for the current simulation time step

get_subregion_ag_pumping_average_depth_to_water()

Return subregional depth-to-groundwater values that are weighted-averaged with respect to agricultural pumping rates during a model run

get_zone_ag_pumping_average_depth_to_water(...)

Return zonal depth-to-groundwater values that are weighted-averaged with respect to agricultural pumping rates during a model run

Simulation Hydrographs#

get_n_subsidence_hydrographs()

Return the number of subsidence hydrographs specified in an IWFM model

get_subsidence_hydrograph_ids()

Return the ids for the subsidence hydrographs specified in an IWFM model

get_subsidence_hydrograph_coordinates()

Return the x,y-coordinates for the subsidence hydrograph locations specified in an IWFM model

get_subsidence_hydrograph_names()

Return the subsidence hydrograph location names specified in an IWFM model

get_subsidence_hydrograph(...[, begin_date, ...])

Return the simulated subsidence hydrograph for the provided subsidence hydrograph ID

get_n_tile_drain_hydrographs()

Return the number of tile drain hydrographs specified in an IWFM model

get_tile_drain_hydrograph_ids()

Return the ids for the tile drain hydrographs specified in an IWFM model

get_tile_drain_hydrograph_coordinates()

Return the x,y-coordinates for the tile drain observations specified in an IWFM model

get_n_groundwater_hydrographs()

Return the number of groundwater hydrographs specified in an IWFM model

get_groundwater_hydrograph_ids()

Return the ids for the groundwater hydrographs specified in an IWFM model

get_groundwater_hydrograph_coordinates()

Return the x,y-coordinates for the groundwater hydrographs specified in an IWFM model

get_groundwater_hydrograph_names()

Return the groundwater hydrograph location names specified in an IWFM model

get_groundwater_hydrograph_info()

Return model information for the groundwater hydrographs, including hydrograph ID, x- and y- coordinates, name, and stratigraphy.

get_groundwater_hydrograph(...[, ...])

Return the simulated groundwater hydrograph for the provided groundwater hydrograph ID

get_groundwater_hydrograph_at_node_and_layer(...)

Return a simulated groundwater hydrograph for a node and layer

get_n_stream_hydrographs()

Return the number of stream flow hydrographs specified in an IWFM model

get_stream_hydrograph_ids()

Return the ids for the stream hydrographs specified in an IWFM model

get_stream_hydrograph_coordinates()

Return the x,y-coordinates for the stream flow observation locations specified in an IWFM model

get_stream_hydrograph_names()

Return the stream flow hydrograph location names specified in an IWFM model

get_stream_hydrograph(stream_hydrograph_id)

Return the simulated stream hydrograph for the provided stream hydrograph id

get_n_hydrograph_types()

Return the number of different hydrograph types being printed by the IWFM model

get_hydrograph_type_list()

Return a list of different hydrograph types being printed by the IWFM model

Plotting#

plot_nodes(axes[, values, cmap, ...])

plots model nodes on predefined axes

plot_elements(axes[, values, cmap, ...])

plots model elements on predefined axes

Model Simulation#

advance_state()

advances the state of the hydrologic system in time (e.g. groundwater heads at current timestep are switched to groundwater heads at previous timestep) during a model run.

advance_time()

advances the simulation time step by one simulation time step

read_timeseries_data()

reads in all of the time series data for the current simulation time step

read_timeseries_data_overwrite(...)

reads time series data for the current simulation time step and allows overwriting certain time series data

restore_pumping_to_read_values()

restores the pumping rates to the values read from the Pumping Rate input file during a model run.

set_log_file([file_name])

opens a text log file to print out error and warning messages

close_log_file()

get_last_message()

the error message in case a procedure call from IWFM API returns an error code (status) other than 0

log_last_message()

prints the last error message (generated when a procedure call from IWFM API returns an error code (status) other than 0) to the message log file

set_preprocessor_path(preprocessor_path)

sets the path to the directory where the preprocessor main input file is located

set_simulation_path(simulation_path)

sets the path to the directory where the simulation main input file is located

turn_supply_adjustment_on_off(...)

turns the automatic supply adjustment of diversions and pumping to meet agricultural and/or urban water demands on or off during a model run

set_supply_adjustment_max_iterations(...)

sets the maximum number of iterations that will be used in automatic supply adjustment

set_supply_adjustment_tolerance(tolerance)

sets the tolerance, given as a fraction of the water demand that will be used in automatic supply adjustment

simulate_all()

performs all of the computations for the entire simulation period

simulate_for_an_interval(time_interval)

simulates the model application for a specified time interval

simulate_for_one_timestep()

simulates a single timestep of the model application

print_results()

prints out all the simulation results at the end of a simulation

is_end_of_simulation()

check if the end of simulation period has been reached during a model run

General#

new()

Instantiate the IWFM Model Object.

kill()

Terminate the IWFM Model Object.

is_model_instantiated()

check if a Model object is instantiated

delete_inquiry_data_file()

deletes the binary file, IW_ModelData_ForInquiry.bin, generated by the IWFM DLL when the Model Object is instantiated

get_version()

returns the version of the IWFM DLL

Private Methods#

_is_time_interval_greater_or_equal(...)

determines if a provided time_interval is greater than or equal to the simulation_time_interval

_get_names(location_type_id)

Return the available names for a given location_type

_get_n_hydrographs(location_type_id)

private method returning the number of hydrographs for a given IWFM feature type

_get_hydrograph_ids(location_type_id)

private method returning the ids of the hydrographs for a provided location type

_get_hydrograph_coordinates(location_type_id)

private method returning the hydrograph coordinates for a provided feature type

_get_hydrograph(hydrograph_type, ...)

private method returning a simulated hydrograph for a selected hydrograph type and hydrograph index

_string_to_list_by_array(in_string, ...)

converts a string to a list of strings based on an array of the starting character position (index).

_validate_iwfm_date(dt)

performs validation that a provided value is an IWFM-format date string based on string length and format MM/DD/YYYY_HH:MM

_validate_time_interval(time_interval)

performs validation that a provided value is an IWFM-format time-interval string

_get_supply_purpose(supply_type_id, ...)

private method returning the flags for the initial assignment of water supplies (diversions, well pumping, element pumping) designating if they serve agricultural, urban, or both

_get_supply_requirement_ag(location_type_id, ...)

Return the agricultural water supply requirement at a specified set of locations

_get_supply_requirement_urban(...)

Return the urban water supply requirement at a specified set of locations

_get_supply_shortage_at_origin_ag(...)

private method returning the supply shortage for agriculture at the destination of those supplies plus any conveyance losses

_get_supply_shortage_at_origin_urban(...)

Return the supply shortage for agriculture at the destination of those supplies plus any conveyance losses

_get_n_locations(location_type_id)

private method returning the number of locations for a specified location type

_get_location_ids(location_type_id)

private method returning the location identification numbers used by the model for a specified location type

IWFM-Internal#

get_data_unit_type_id_area()

get_data_unit_type_id_length()

get_data_unit_type_ids()

get_data_unit_type_volume()

get_flow_destination_type_id()

get_flow_destination_type_id_element()

get_flow_destination_type_id_elementset()

get_flow_destination_type_id_gwelement()

get_flow_destination_type_id_lake()

get_flow_destination_type_id_outside()

get_flow_destination_type_id_streamnode()

get_flow_destination_type_id_subregion()

get_land_use_type_ids()

get_land_use_type_id_gen_ag()

get_land_use_type_id_native_riparian()

get_land_use_type_id_nonponded_ag()

get_land_use_type_id_refuge()

get_land_use_type_id_rice()

get_land_use_type_id_urban()

get_location_type_id_element()

get_location_type_id_gwheadobs()

get_location_type_id_lake()

get_location_type_id_node()

get_location_type_id_smallwatershed()

get_location_type_id_streamhydobs()

get_location_type_id_streamnode()

get_location_type_id_streamnodebud()

get_location_type_id_streamreach()

get_location_type_id_subregion()

get_location_type_id_subsidenceobs()

get_location_type_id_tiledrainobs()

get_location_type_id_zone()

get_location_type_ids()

get_supply_type_id_diversion()

get_supply_type_id_elempump()

get_supply_type_id_well()

get_zone_extent_id_horizontal()

get_zone_extent_id_vertical()

get_zone_extent_ids()

get_budget_type_ids()

get_zbudget_type_ids()