Source code for flopy.mf6.modflow.mfprtprp

# autogenerated file, do not modify

from os import PathLike, curdir
from typing import Union

from flopy.mf6.data.mfdatautil import ArrayTemplateGenerator, ListTemplateGenerator
from flopy.mf6.mfpackage import MFChildPackages, MFPackage


[docs]class ModflowPrtprp(MFPackage): """ ModflowPrtprp defines a PRP package. Parameters ---------- model Model that this package is a part of. Package is automatically added to model when it is initialized. loading_package : bool, default False Do not set this parameter. It is intended for debugging and internal processing purposes only. boundnames : keyword keyword to indicate that boundary names may be provided with the list of particle release points. print_input : keyword keyword to indicate that the list of all model stress package information will be written to the listing file immediately after it is read. dev_exit_solve_method : integer the method for iterative solution of particle exit location and time in the generalized pollock's method. 0 default, 1 brent, 2 chandrupatla. the default is brent's method. exit_solve_tolerance : double precision the convergence tolerance for iterative solution of particle exit location and time in the generalized pollock's method. the variable being solved for varies from 0 to 1. a tolerance of 0.00001 works well for many problems, but the value that strikes the best balance between accuracy and runtime is problem- dependent. local_z : keyword indicates that 'zrpt' defines the local z coordinate of the release point within the cell, with value of 0 at the bottom and 1 at the effective top of the cell. if the cell is convertible and partially saturated at release time, the effective top of the cell is considered to be the water table elevation (the head in the cell) rather than the top defined by the user, and is constrained to be no higher than the geometric top of the cell and no lower than the cell bottom. if the cell is confined, the effective top is the geometric top. extend_tracking : keyword indicates that particles should be tracked beyond the end of the simulation's final time step (using that time step's flows) until particles terminate or reach a specified stop time. by default, particles are terminated at the end of the simulation's final time step. track_filerecord : (trackfile) * trackfile : string name of the binary output file to write tracking information. trackcsv_filerecord : (trackcsvfile) * trackcsvfile : string name of the comma-separated value (CSV) file to write tracking information. stoptime : double precision real value defining the maximum simulation time to which particles in the package can be tracked. particles that have not terminated earlier due to another termination condition will terminate when simulation time stoptime is reached. if the last stress period in the simulation consists of more than one time step, particles will not be tracked past the ending time of the last stress period, regardless of stoptime. if the extend_tracking option is enabled and the last stress period in the simulation is steady-state, the simulation ending time will not limit the time to which particles can be tracked, but stoptime and stoptraveltime will continue to apply. if stoptime and stoptraveltime are both provided, particles will be stopped if either is reached. stoptraveltime : double precision real value defining the maximum travel time over which particles in the model can be tracked. particles that have not terminated earlier due to another termination condition will terminate when their travel time reaches stoptraveltime. if the last stress period in the simulation consists of more than one time step, particles will not be tracked past the ending time of the last stress period, regardless of stoptraveltime. if the extend_tracking option is enabled and the last stress period in the simulation is steady-state, the simulation ending time will not limit the time to which particles can be tracked, but stoptime and stoptraveltime will continue to apply. if stoptime and stoptraveltime are both provided, particles will be stopped if either is reached. stop_at_weak_sink : keyword is a text keyword to indicate that a particle is to terminate when it enters a cell that is a weak sink. by default, particles are allowed to pass though cells that are weak sinks. istopzone : integer integer value defining the stop zone number. if cells have been assigned izone values in the griddata block, a particle terminates if it enters a cell whose izone value matches istopzone. an istopzone value of zero indicates that there is no stop zone. the default value is zero. drape : keyword is a text keyword to indicate that if a particle's release point is in a cell that happens to be inactive at release time, the particle is to be moved to the topmost active cell below it, if any. by default, a particle is not released into the simulation if its release point's cell is inactive at release time. note that drape does not apply to attempted release into a cell for which idomain <= 0, which is considered not to exist in the simulation. attempted release into a such a cell results in an error. release_timesrecord : (release_times, times) * release_times : keyword keyword indicating release times will follow * times : [double precision] times to release, relative to the beginning of the simulation. RELEASE_TIMES and RELEASE_TIMESFILE are mutually exclusive. release_timesfilerecord : (timesfile) * timesfile : string name of the release times file. RELEASE_TIMES and RELEASE_TIMESFILE are mutually exclusive. dry_tracking_method : string is a string indicating how particles should behave in dry-but-active cells (as can occur with the newton formulation). the value can be 'drop', 'stop', or 'stay'. the default is 'drop', which passes particles vertically and instantaneously to the water table. 'stop' causes particles to terminate. 'stay' causes particles to remain stationary but active. dev_forceternary : keyword force use of the ternary tracking method regardless of cell type in disv grids. release_time_tolerance : double precision real number indicating the tolerance within which to consider consecutive release times coincident. coincident release times will be merged into a single release time. the default is :math:`epsilon times 10^{11}`, where :math:`epsilon` is machine precision. release_time_frequency : double precision real number indicating the time frequency at which to release particles. this option can be used to schedule releases at a regular interval for the duration of the simulation, starting at the simulation start time. the release schedule is the union of this option, the releasetimes block, and period block releasesetting selections. if none of these are provided, a single release time is configured at the beginning of the first time step of the simulation's first stress period. coordinate_check_method : string approach for verifying that release point coordinates are in the cell with the specified id. possible values are none and eager. by default, release point coordinates are checked at release time, i.e. eager. dev_cycle_detection_window : integer integer value defining the size of the window (number of consecutive exit events) used for cycle detection. defaults to 0, disabling cycle detection. with detection enabled, particle pathlines with duplicate cell exit events (i.e., exiting the same cell through the same face twice) will cause the program to terminate with an error. a larger window size provides more robust cycle detection at the cost of more runtime operations per cell exit. nreleasepts : integer is the number of particle release points. nreleasetimes : integer is the number of particle release times specified in the releasetimes block. this is not necessarily the total number of release times; release times are the union of release_time_frequency, releasetimes block, and period block releasesetting selections. packagedata : [(irptno, cellid, xrpt, yrpt, zrpt, boundname)] * irptno : integer integer value that defines the PRP release point number associated with the specified PACKAGEDATA data on the line. IRPTNO must be greater than zero and less than or equal to NRELEASEPTS. The program will terminate with an error if information for a PRP release point number is specified more than once. * cellid : [integer] is the cell identifier, and depends on the type of grid that is used for the simulation. For a structured grid that uses the DIS input file, CELLID is the layer, row, and column. For a grid that uses the DISV input file, CELLID is the layer and CELL2D number. If the model uses the unstructured discretization (DISU) input file, CELLID is the node number for the cell. * xrpt : double precision real value that defines the x coordinate of the release point in model coordinates. The (x, y, z) location specified for the release point must lie within the cell that is identified by the specified cellid. * yrpt : double precision real value that defines the y coordinate of the release point in model coordinates. The (x, y, z) location specified for the release point must lie within the cell that is identified by the specified cellid. * zrpt : double precision real value that defines the z coordinate of the release point in model coordinates or, if the LOCAL_Z option is active, in local cell coordinates. The (x, y, z) location specified for the release point must lie within the cell that is identified by the specified cellid. * boundname : string name of the particle release point. BOUNDNAME is an ASCII character variable that can contain as many as 40 characters. If BOUNDNAME contains spaces in it, then the entire name must be enclosed within single quotes. releasetimes : [(time)] * time : double precision real value that defines the release time with respect to the simulation start time. perioddata : [all | first | last | frequency | steps | fraction] * releasesetting : all | first | last | frequency | steps | fraction specifies time steps at which to release a particle. a particle is released at the beginning of each specified time step. for fine control over release timing, specify times explicitly using the releasetimes block. if the beginning of a specified time step coincides with a release time specified in the releasetimes block or configured via release_time_frequency, only one particle is released at that time. coincidence is evaluated up to the tolerance specified in release_time_tolerance, or :math:`epsilon times 10^{11}` by default, where :math:`epsilon` is machine precision. if no release times are configured via this setting, the releasetimes block, or the release_time_frequency option, a single release time is configured at the beginning of the first time step of the simulation's first stress period. * all : keyword keyword to indicate release at the start of all time steps in the period. * first : keyword keyword to indicate release at the start of the first time step in the period. this keyword may be used in conjunction with other releasesetting options. * last : keyword keyword to indicate release at the start of the last time step in the period. this keyword may be used in conjunction with other releasesetting options. * frequency : integer release at the specified time step frequency. this keyword may be used in conjunction with other releasesetting options. * steps : [integer] release at the start of each step specified in steps. this option may be used in conjunction with other releasesetting options. * fraction : [double precision] release particles after the specified fraction of the time step has elapsed. if fraction is not set, particles are released at the start of the specified time step(s). fraction must be a single value when used with all, first, or frequency. when used with steps, fraction may be a single value or an array of the same length as steps. if a single fraction value is provided with steps, the fraction applies to all steps. note: the fraction option has been removed. for fine control over release timing, specify times explicitly using the releasetimes block. filename : str or PathLike, optional Name or path of file where this package is stored. pname : str, optional Package name. **kwargs Extra keywords for :class:`flopy.mf6.mfpackage.MFPackage`. """ track_filerecord = ListTemplateGenerator( ("prt6", "prp", "options", "track_filerecord") ) trackcsv_filerecord = ListTemplateGenerator( ("prt6", "prp", "options", "trackcsv_filerecord") ) release_timesrecord = ListTemplateGenerator( ("prt6", "prp", "options", "release_timesrecord") ) release_timesfilerecord = ListTemplateGenerator( ("prt6", "prp", "options", "release_timesfilerecord") ) packagedata = ListTemplateGenerator(("prt6", "prp", "packagedata", "packagedata")) releasetimes = ListTemplateGenerator( ("prt6", "prp", "releasetimes", "releasetimes") ) perioddata = ListTemplateGenerator(("prt6", "prp", "period", "perioddata")) package_abbr = "prtprp" _package_type = "prp" dfn_file_name = "prt-prp.dfn" dfn = [ ["header", "multi-package"], [ "block options", "name boundnames", "type keyword", "shape", "reader urword", "optional true", ], [ "block options", "name print_input", "type keyword", "reader urword", "optional true", "mf6internal iprpak", ], [ "block options", "name dev_exit_solve_method", "type integer", "reader urword", "optional true", "mf6internal iexmeth", ], [ "block options", "name exit_solve_tolerance", "type double precision", "reader urword", "optional true", "mf6internal extol", "default 1e-5", ], [ "block options", "name local_z", "type keyword", "reader urword", "optional true", "mf6internal localz", ], [ "block options", "name extend_tracking", "type keyword", "reader urword", "optional true", "mf6internal extend", ], [ "block options", "name track_filerecord", "type record track fileout trackfile", "shape", "reader urword", "tagged true", "optional true", ], [ "block options", "name track", "type keyword", "shape", "in_record true", "reader urword", "tagged true", "optional false", ], [ "block options", "name fileout", "type keyword", "shape", "in_record true", "reader urword", "tagged true", "optional false", ], [ "block options", "name trackfile", "type string", "preserve_case true", "shape", "in_record true", "reader urword", "tagged false", "optional false", ], [ "block options", "name trackcsv_filerecord", "type record trackcsv fileout trackcsvfile", "shape", "reader urword", "tagged true", "mf6internal trackcsvfr", "optional true", ], [ "block options", "name trackcsv", "type keyword", "shape", "in_record true", "reader urword", "tagged true", "optional false", ], [ "block options", "name trackcsvfile", "type string", "preserve_case true", "shape", "in_record true", "reader urword", "tagged false", "optional false", ], [ "block options", "name stoptime", "type double precision", "reader urword", "optional true", ], [ "block options", "name stoptraveltime", "type double precision", "reader urword", "optional true", ], [ "block options", "name stop_at_weak_sink", "type keyword", "reader urword", "optional true", "mf6internal istopweaksink", ], [ "block options", "name istopzone", "type integer", "reader urword", "optional true", ], [ "block options", "name drape", "type keyword", "reader urword", "optional true", ], [ "block options", "name release_timesrecord", "type record release_times times", "shape", "reader urword", "tagged true", "optional true", "mf6internal releasetr", "removed 6.6.0", ], [ "block options", "name release_times", "type keyword", "reader urword", "in_record true", "tagged true", "shape", "removed 6.6.0", ], [ "block options", "name times", "type double precision", "shape (any1d)", "reader urword", "in_record true", "tagged false", "repeating true", "removed 6.6.0", ], [ "block options", "name release_timesfilerecord", "type record release_timesfile timesfile", "shape", "reader urword", "tagged true", "optional true", "mf6internal release_timesfr", "removed 6.6.0", ], [ "block options", "name release_timesfile", "type keyword", "reader urword", "in_record true", "tagged true", "shape", "mf6internal release_timesfn", "removed 6.6.0", ], [ "block options", "name timesfile", "type string", "preserve_case true", "shape", "in_record true", "reader urword", "tagged false", "optional false", "removed 6.6.0", ], [ "block options", "name dry_tracking_method", "type string", "valid drop stop stay", "reader urword", "optional true", "mf6internal idrymeth", ], [ "block options", "name dev_forceternary", "type keyword", "reader urword", "optional false", "mf6internal frctrn", ], [ "block options", "name release_time_tolerance", "type double precision", "reader urword", "optional true", "mf6internal rttol", ], [ "block options", "name release_time_frequency", "type double precision", "reader urword", "optional true", "mf6internal rtfreq", ], [ "block options", "name coordinate_check_method", "type string", "valid none eager", "reader urword", "optional true", "mf6internal ichkmeth", "default eager", ], [ "block options", "name dev_cycle_detection_window", "type integer", "reader urword", "optional true", "mf6internal icycwin", ], [ "block dimensions", "name nreleasepts", "type integer", "reader urword", "optional false", ], [ "block dimensions", "name nreleasetimes", "type integer", "reader urword", "optional false", ], [ "block packagedata", "name packagedata", "type recarray irptno cellid xrpt yrpt zrpt boundname", "shape (nreleasepts)", "reader urword", ], [ "block packagedata", "name irptno", "type integer", "shape", "tagged false", "in_record true", "reader urword", "numeric_index true", ], [ "block packagedata", "name cellid", "type integer", "shape (ncelldim)", "tagged false", "in_record true", "reader urword", ], [ "block packagedata", "name xrpt", "type double precision", "shape", "tagged false", "in_record true", "reader urword", ], [ "block packagedata", "name yrpt", "type double precision", "shape", "tagged false", "in_record true", "reader urword", ], [ "block packagedata", "name zrpt", "type double precision", "shape", "tagged false", "in_record true", "reader urword", ], [ "block packagedata", "name boundname", "type string", "shape", "tagged false", "in_record true", "reader urword", "optional true", ], [ "block releasetimes", "name releasetimes", "type recarray time", "shape (nreleasetimes)", "reader urword", "optional true", ], [ "block releasetimes", "name time", "type double precision", "shape", "tagged false", "in_record true", "reader urword", ], [ "block period", "name iper", "type integer", "block_variable true", "in_record true", "tagged false", "shape", "valid", "reader urword", "optional false", ], [ "block period", "name perioddata", "type recarray releasesetting", "shape", "reader urword", ], [ "block period", "name releasesetting", "type keystring all first last frequency steps fraction", "shape", "tagged false", "in_record true", "reader urword", ], [ "block period", "name all", "type keyword", "shape", "in_record true", "reader urword", ], [ "block period", "name first", "type keyword", "shape", "in_record true", "reader urword", ], [ "block period", "name last", "type keyword", "shape", "in_record true", "reader urword", ], [ "block period", "name frequency", "type integer", "shape", "tagged true", "in_record true", "reader urword", ], [ "block period", "name steps", "type integer", "shape (<nstp)", "tagged true", "in_record true", "reader urword", ], [ "block period", "name fraction", "type double precision", "shape (<nstp)", "tagged true", "in_record true", "reader urword", "optional true", "removed 6.6.0", ], ] def __init__( self, model, loading_package=False, boundnames=None, print_input=None, dev_exit_solve_method=None, exit_solve_tolerance=1e-05, local_z=None, extend_tracking=None, track_filerecord=None, trackcsv_filerecord=None, stoptime=None, stoptraveltime=None, stop_at_weak_sink=None, istopzone=None, drape=None, release_timesrecord=None, release_timesfilerecord=None, dry_tracking_method=None, dev_forceternary=None, release_time_tolerance=None, release_time_frequency=None, coordinate_check_method="eager", dev_cycle_detection_window=None, nreleasepts=None, nreleasetimes=None, packagedata=None, releasetimes=None, perioddata=None, filename=None, pname=None, **kwargs, ): """Initialize ModflowPrtprp.""" super().__init__( parent=model, package_type="prp", filename=filename, pname=pname, loading_package=loading_package, **kwargs, ) self.boundnames = self.build_mfdata("boundnames", boundnames) self.print_input = self.build_mfdata("print_input", print_input) self.dev_exit_solve_method = self.build_mfdata( "dev_exit_solve_method", dev_exit_solve_method ) self.exit_solve_tolerance = self.build_mfdata( "exit_solve_tolerance", exit_solve_tolerance ) self.local_z = self.build_mfdata("local_z", local_z) self.extend_tracking = self.build_mfdata("extend_tracking", extend_tracking) self.track_filerecord = self.build_mfdata("track_filerecord", track_filerecord) self.trackcsv_filerecord = self.build_mfdata( "trackcsv_filerecord", trackcsv_filerecord ) self.stoptime = self.build_mfdata("stoptime", stoptime) self.stoptraveltime = self.build_mfdata("stoptraveltime", stoptraveltime) self.stop_at_weak_sink = self.build_mfdata( "stop_at_weak_sink", stop_at_weak_sink ) self.istopzone = self.build_mfdata("istopzone", istopzone) self.drape = self.build_mfdata("drape", drape) self.release_timesrecord = self.build_mfdata( "release_timesrecord", release_timesrecord ) self.release_timesfilerecord = self.build_mfdata( "release_timesfilerecord", release_timesfilerecord ) self.dry_tracking_method = self.build_mfdata( "dry_tracking_method", dry_tracking_method ) self.dev_forceternary = self.build_mfdata("dev_forceternary", dev_forceternary) self.release_time_tolerance = self.build_mfdata( "release_time_tolerance", release_time_tolerance ) self.release_time_frequency = self.build_mfdata( "release_time_frequency", release_time_frequency ) self.coordinate_check_method = self.build_mfdata( "coordinate_check_method", coordinate_check_method ) self.dev_cycle_detection_window = self.build_mfdata( "dev_cycle_detection_window", dev_cycle_detection_window ) self.nreleasepts = self.build_mfdata("nreleasepts", nreleasepts) self.nreleasetimes = self.build_mfdata("nreleasetimes", nreleasetimes) self.packagedata = self.build_mfdata("packagedata", packagedata) self.releasetimes = self.build_mfdata("releasetimes", releasetimes) self.perioddata = self.build_mfdata("perioddata", perioddata) self._init_complete = True