Beispiel #1
0
    def __init__(self, model, laytyp=0, layavg=0, chani=1.0, layvka=0, laywet=0, iupwcb = 53, hdry=-1E+30, iphdry = 0,\
                 hk=1.0, hani=1.0, vka=1.0, ss=1e-5, sy=0.15, vkcb=0.0, noparcheck=False,        \
                 extension='upw', unitnumber = 31):
        Package.__init__(self, model, extension, 'UPW', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = '# UPW for MODFLOW-NWT, generated by Flopy.'
        self.url = 'upw_upstream_weighting_package.htm'
        nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
        # item 1
        self.iupwcb = iupwcb # Unit number for file with cell-by-cell flow terms
        self.hdry = hdry # Head in cells that are converted to dry during a simulation
        self.npupw = 0 # number of UPW parameters
        self.iphdry = iphdry
        self.laytyp = util_2d(model,(nlay,),np.int,laytyp,name='laytyp')
        self.layavg = util_2d(model,(nlay,),np.int,layavg,name='layavg')
        self.chani = util_2d(model,(nlay,),np.int,chani,name='chani')
        self.layvka = util_2d(model,(nlay,),np.int,layvka,name='vka')
        self.laywet = util_2d(model,(nlay,),np.int,laywet,name='laywet')

        self.options = ' '
        if noparcheck: self.options = self.options + 'NOPARCHECK  '

        self.hk = util_3d(model,(nlay,nrow,ncol),np.float32,hk,name='hk',locat=self.unit_number[0])
        self.hani = util_3d(model,(nlay,nrow,ncol),np.float32,hani,name='hani',locat=self.unit_number[0])
        self.vka = util_3d(model,(nlay,nrow,ncol),np.float32,vka,name='vka',locat=self.unit_number[0])
        self.ss = util_3d(model,(nlay,nrow,ncol),np.float32,ss,name='ss',locat=self.unit_number[0])
        self.sy = util_3d(model,(nlay,nrow,ncol),np.float32,sy,name='sy',locat=self.unit_number[0])
        self.vkcb = util_3d(model,(nlay,nrow,ncol),np.float32,vkcb,name='vkcb',locat=self.unit_number[0])
        self.parent.add_package(self)
Beispiel #2
0
Datei: swt.py Projekt: visr/flopy
 def __init__(self, model, extension='list'):
     #Call ancestor's init to set self.parent, extension, name and 
     #unit number
     Package.__init__(self, model, extension, 'LIST', 7) 
     #self.parent.add_package(self) This package is not added to the base 
     #model so that it is not included in get_name_file_entries()
     return
Beispiel #3
0
    def __init__(self, model, nrchop=3, ipakcb=0, rech=1e-3, irch=0,
                 extension='rch', unitnumber=19):
        """
        Package constructor.

        """
        # Call parent init to set self.parent, extension, name and unit number
        Package.__init__(self, model, extension, 'RCH', unitnumber)
        nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
        self.heading = '# RCH for MODFLOW, generated by Flopy.'
        self.url = 'rch.htm'
        self.nrchop = nrchop
        if ipakcb != 0:
            self.ipakcb = 53
        else:
            self.ipakcb = 0  # 0: no cell by cell terms are written
        self.rech = Transient2d(model, (nrow, ncol), np.float32,
                                rech, name='rech_')
        if self.nrchop == 2:
            self.irch = Transient2d(model, (nrow, ncol), np.int,
                                    irch + 1, name='irch_')  # irch+1, as irch is zero based
        else:
            self.irch = None
        self.np = 0
        self.parent.add_package(self)
Beispiel #4
0
    def __init__(self, model, nevtop=3, ipakcb=0, surf=0., evtr=1e-3, exdp=1., ievt=1, 
                 extension ='evt', unitnumber=22, external=True):
        # Call ancestor's init to set self.parent, extension, name and unit number
        Package.__init__(self, model, extension, 'EVT', unitnumber)
        nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
        self.heading = '# EVT for MODFLOW, generated by Flopy.'
        self.url = 'evt.htm'
        self.nevtop = nevtop
        self.ipakcb = ipakcb
        self.external = external
        if self.external is False:
            load = True
        else:
            load = model.load            

        self.surf = transient_2d(model, (nrow, ncol), np.float32,
                                 surf, name='surf')
        self.evtr = transient_2d(model, (nrow, ncol), np.float32,
                                 evtr, name='etvr')
        self.exdp = transient_2d(model, (nrow, ncol), np.float32,
                                 exdp, name='exdp')
        self.ievt = transient_2d(model, (nrow, ncol), np.int,
                                 ievt, name='ievt')
        self.np = 0
        self.parent.add_package(self)
Beispiel #5
0
    def __init__(self,
                 model,
                 itmx=50,
                 mxup=0,
                 mxlow=0,
                 mxbw=0,
                 ifreq=3,
                 mutd4=0,
                 accl=1,
                 hclose=1e-5,
                 iprd4=1,
                 extension='de4',
                 unitnumber=28):
        """
        Package constructor.

        """
        Package.__init__(self, model, extension, 'de4', unitnumber)
        self.heading = '# DE4 for MODFLOW, generated by Flopy.'
        self.url = 'de4.htm'
        self.itmx = itmx
        self.mxup = mxup
        self.mxlow = mxlow
        self.mxbw = mxbw
        self.ifreq = ifreq
        self.mutd4 = mutd4
        self.accl = accl
        self.hclose = hclose
        self.iprd4 = iprd4
        self.parent.add_package(self)
        return
Beispiel #6
0
    def __init__(self, model, nrchop=3, irchcb=0, rech=1e-3, irch=1,
                 extension ='rch', unitnumber=19):
        """
        Package constructor.

        """
        # Call parent init to set self.parent, extension, name and unit number
        Package.__init__(self, model, extension, 'RCH', unitnumber)
        nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
        self.heading = '# RCH for MODFLOW, generated by Flopy.'
        self.url = 'rch.htm'
        self.nrchop = nrchop
        self.irchcb = irchcb
        self.rech = []
        self.irch = []
        if (not isinstance(rech, list)):
            rech = [rech]
        for i,a in enumerate(rech):
            r = util_2d(model,(nrow,ncol),np.float32,a,name='rech_'+str(i+1))
            self.rech = self.rech + [r]
        if (not isinstance(irch, list)):
            irch = [irch]
        for i,a in enumerate(irch):
            ir = util_2d(model,(nrow,ncol),np.int,a,name='irech_'+str(i+1))
            self.irch = self.irch + [ir]
        self.np = 0
        self.parent.add_package(self)
Beispiel #7
0
    def __init__(self, model, nevtop=3, ipakcb=0, surf=0., evtr=1e-3, exdp=1., ievt=1, 
                 extension ='evt', unitnumber=22, external=True):
        # Call ancestor's init to set self.parent, extension, name and unit number
        Package.__init__(self, model, extension, 'EVT', unitnumber)
        nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
        self.heading = '# EVT for MODFLOW, generated by Flopy.'
        self.url = 'evt.htm'
        self.nevtop = nevtop
        self.ipakcb = ipakcb
        self.external = external
        if self.external is False:
            load = True
        else:
            load = model.load            

        self.surf = transient_2d(model, (nrow, ncol), np.float32,
                                 surf, name='surf')
        self.evtr = transient_2d(model, (nrow, ncol), np.float32,
                                 evtr, name='etvr')
        self.exdp = transient_2d(model, (nrow, ncol), np.float32,
                                 exdp, name='exdp')
        self.ievt = transient_2d(model, (nrow, ncol), np.int,
                                 ievt, name='ievt')
        self.np = 0
        self.parent.add_package(self)
Beispiel #8
0
    def __init__(self,
                 model,
                 wel1flag=1,
                 qsumflag=1,
                 byndflag=1,
                 mnwobs=1,
                 wellid_unit_qndflag_qhbflag_concflag=None,
                 extension='mnwi',
                 unitnumber=58):
        Package.__init__(
            self, model, extension, 'MNWI', unitnumber
        )  # Call ancestor's init to set self.parent, extension, name, and unit number
        self.url = 'mnwi.htm'
        self.heading = '# Multi-node well information (MNWI) file for MODFLOW, generated by Flopy'
        self.wel1flag = wel1flag  #-integer flag indicating output to be written for each MNW node at the end of each stress period
        self.qsumflag = qsumflag  #-integer flag indicating output to be written for each multi-node well
        self.byndflag = byndflag  #-integer flag indicating output to be written for each MNW node
        self.mnwobs = mnwobs  #-number of multi-node wells for which detailed flow, head, and solute data re to be saved
        self.wellid_unit_qndflag_qhbflag_concflag = wellid_unit_qndflag_qhbflag_concflag  #-list of lists containing wells and related information to be output (length = [MNWOBS][4or5])

        #-input format checks:
        assert self.wel1flag >= 0, 'WEL1flag must be greater than or equal to zero.'
        assert self.qsumflag >= 0, 'QSUMflag must be greater than or equal to zero.'
        assert self.byndflag >= 0, 'BYNDflag must be greater than or equal to zero.'

        if len(self.wellid_unit_qndflag_qhbflag_concflag) != self.mnwobs:
            print(
                'WARNING: number of listed well ids to be monitored does not match MNWOBS.'
            )

        self.parent.add_package(self)
Beispiel #9
0
    def __init__(self, model, ipakcb=0, stress_period_data=None, dtype=None,
                 extension='wel', unitnumber=20, options=None):
        """
        Package constructor.

        """
        # Call parent init to set self.parent, extension, name and unit number
        Package.__init__(self, model, extension, 'WEL', unitnumber)
        self.heading = '# Well file for MODFLOW, generated by Flopy.'
        self.url = 'wel.htm'
        self.ipakcb = ipakcb # no cell by cell terms are written
        self.np = 0
        if options is None:
            options = []
        self.specify = False
        for idx, opt in enumerate(options):
            if 'specify' in opt:
                t = opt.strip().split()
                self.specify = True
                self.phiramp = np.float(t[1])
                self.phiramp_unit = np.int(t[2])
                options.pop(idx)
                break
        self.options = options
        self.parent.add_package(self)
        if dtype is not None:
            self.dtype = dtype
        else:
            self.dtype = self.get_default_dtype()
        self.stress_period_data = mflist(model, self.dtype, stress_period_data)
Beispiel #10
0
 def __init__(self, model, mixelm=3, percel=0.75, mxpart=800000, nadvfd=1, \
              itrack=3, wd=0.5, \
              dceps=1e-5, nplane=2, npl=10, nph=40, npmin=5, npmax=80, \
              nlsink=0, npsink=15,
              dchmoc=0.0001, extension='adv'):
     Package.__init__(
         self, model, extension, 'ADV', 32
     )  # Call ancestor's init to set self.parent, extension, name and unit number
     self.mixelm = mixelm
     self.percel = percel
     self.mxpart = mxpart
     self.nadvfd = nadvfd
     self.mixelm = mixelm
     self.itrack = itrack
     self.wd = wd
     self.dceps = dceps
     self.nplane = nplane
     self.npl = npl
     self.nph = nph
     self.npmin = npmin
     self.npmax = npmax
     self.interp = 1  # Command-line 'interp' might once be needed if MT3DMS is updated to include other interpolation method
     self.nlsink = nlsink
     self.npsink = npsink
     self.dchmoc = dchmoc
     self.parent.add_package(self)
Beispiel #11
0
    def __init__(self, model, ibound=1, strt=1.0, ifrefm=True, ixsec=False,
                 ichflg=False, stoper=None, hnoflo=-999.99, extension='bas',
                 unitnumber=13):
        """
        Package constructor.

        """
        # Call ancestor's init to set self.parent, extension, name and unit
        # number
        Package.__init__(self, model, extension, 'BAS6', unitnumber)
        self.url = 'bas6.htm'
        nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
        self.__ibound = util_3d(model, (nlay, nrow, ncol), np.int, ibound,
                                name='ibound', locat=self.unit_number[0])
        self.strt = util_3d(model, (nlay, nrow, ncol), np.float32, strt,
                            name='strt', locat=self.unit_number[0])
        self.heading = '# Basic package file for MODFLOW, generated by Flopy.'
        self.options = ''
        self.ixsec = ixsec
        self.ichflg = ichflg
        self.stoper = stoper
        self.ifrefm = ifrefm
        self.hnoflo = hnoflo
        self.parent.add_package(self)
        return
Beispiel #12
0
 def __init__(self, model, mixelm=3, percel=0.75, mxpart=800000, nadvfd=1,
              itrack=3, wd=0.5,
              dceps=1e-5, nplane=2, npl=10, nph=40, npmin=5, npmax=80,
              nlsink=0, npsink=15,
              dchmoc=0.0001, extension='adv', unitnumber=None):
     if unitnumber is None:
         unitnumber = self.unitnumber
     Package.__init__(self, model, extension, 'ADV', unitnumber)
     self.mixelm = mixelm
     self.percel = percel
     self.mxpart = mxpart
     self.nadvfd = nadvfd
     self.mixelm = mixelm
     self.itrack = itrack
     self.wd = wd
     self.dceps = dceps
     self.nplane = nplane
     self.npl = npl
     self.nph = nph
     self. npmin = npmin
     self.npmax = npmax
     self.interp = 1 # Command-line 'interp' might once be needed if MT3DMS is updated to include other interpolation method
     self.nlsink = nlsink
     self.npsink = npsink
     self.dchmoc = dchmoc
     self.parent.add_package(self)
     return
Beispiel #13
0
    def __init__(self,
                 model,
                 nrchop=3,
                 ipakcb=0,
                 rech=1e-3,
                 irch=0,
                 extension='rch',
                 unitnumber=19):
        """
        Package constructor.

        """
        # Call parent init to set self.parent, extension, name and unit number
        Package.__init__(self, model, extension, 'RCH', unitnumber)
        nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
        self.heading = '# RCH for MODFLOW, generated by Flopy.'
        self.url = 'rch.htm'
        self.nrchop = nrchop
        self.ipakcb = ipakcb
        self.rech = transient_2d(model, (nrow, ncol),
                                 np.float32,
                                 rech,
                                 name="rech_")
        if self.nrchop == 2:
            self.irch = transient_2d(
                model, (nrow, ncol), np.int, irch + 1,
                name="irch_")  # irch+1, as irch is zero based
        else:
            self.irch = None
        self.np = 0
        self.parent.add_package(self)
Beispiel #14
0
    def __init__(self, model, hnoflo=-9999., hdry=-8888.,
                 def_face_ct=0, bud_label=None, def_iface=None,
                 laytyp=0, ibound=1, prsity=0.30, prsityCB=0.30,
                 extension='mpbas', unitnumber = 86):
        """
        Package constructor.

        """
        Package.__init__(self, model, extension, 'MPBAS', unitnumber) 
        nrow, ncol, nlay, nper = self.parent.mf.nrow_ncol_nlay_nper
        self.parent.mf.get_name_file_entries()
        self.heading1 = '# MPBAS for Modpath, generated by Flopy.'
        self.heading2 = '#'
        self.hnoflo = hnoflo
        self.hdry = hdry
        self.def_face_ct = def_face_ct
        self.bud_label = bud_label
        self.def_iface = def_iface
        self.laytyp = laytyp
        self.__ibound = util_3d(model, (nlay, nrow, ncol), np.int, ibound,
                                name='ibound', locat=self.unit_number[0])
        
        self.prsity = prsity
        self.prsityCB = prsityCB
        self.prsity = util_3d(model,(nlay,nrow,ncol),np.float32,\
                              prsity,name='prsity',locat=self.unit_number[0])        
        self.prsityCB = util_3d(model,(nlay,nrow,ncol),np.float32,\
                                prsityCB,name='prsityCB',locat=self.unit_number[0])        
        self.parent.add_package(self)
Beispiel #15
0
    def __init__(self,
                 model,
                 ipakcb=0,
                 stress_period_data=None,
                 dtype=None,
                 no_print=False,
                 options=None,
                 extension='ghb',
                 unitnumber=23):
        """
        Package constructor.

        """
        Package.__init__(self, model, extension, 'GHB', unitnumber)
        self.heading = '# GHB for MODFLOW, generated by Flopy.'
        self.url = 'ghb.htm'
        self.ipakcb = ipakcb  # no cell by cell terms are written
        self.no_print = no_print
        self.np = 0
        if options is None:
            options = []
        if self.no_print:
            options.append('NOPRINT')
        self.options = options
        self.parent.add_package(self)
        if dtype is not None:
            self.dtype = dtype
        else:
            self.dtype = self.get_default_dtype()
        self.stress_period_data = mflist(model, self.dtype, stress_period_data)
Beispiel #16
0
 def __init__(self, model, mtdnconc=1, mfnadvfd=1, nswtcpl=1, iwtable=1,
              densemin=1.000, densemax=1.025, dnscrit=1e-2, denseref=1.000,
              denseslp=.025, crhoref=0, firstdt=0.001, indense=0,
              dense=1.000, nsrhoeos=1, drhodprhd=4.46e-3, prhdref=0.,
              extension='vdf', unitnumber=None, **kwargs):
     if unitnumber is None:
         unitnumber = self.unitnumber
     Package.__init__(self, model, extension, 'VDF', unitnumber)
     nrow, ncol, nlay, nper = self.parent.mf.nrow_ncol_nlay_nper
     self.mtdnconc = kwargs.pop('mt3drhoflag', mtdnconc)
     self.mfnadvfd = mfnadvfd
     self.nswtcpl = nswtcpl
     self.iwtable = iwtable
     self.densemin = densemin
     self.densemax = densemax
     self.dnscrit = dnscrit
     self.nsrhoeos = nsrhoeos
     self.denseref = denseref
     self.denseslp = kwargs.pop('drhodc', denseslp)
     self.crhoref = crhoref
     self.drhodprhd = drhodprhd
     self.prhdref = prhdref
     self.firstdt = firstdt
     self.indense = indense
     if dense is not None:
         self.dense = Util3d(model, (nlay, nrow, ncol), np.float32, dense,
                              name='dense')
     self.parent.add_package(self)
     return
Beispiel #17
0
    def __init__(self, model, iwelcb=0, layer_row_column_data=None,
                 layer_row_column_Q=None,
                 extension ='wel', unitnumber=20, options=None, naux=0):
        """
        Package constructor.

        """
        # Call parent init to set self.parent, extension, name and unit number
        Package.__init__(self, model, extension, 'WEL', unitnumber)
        self.heading = '# Well file for MODFLOW, generated by Flopy.'
        self.url = 'wel.htm'
        self.iwelcb = iwelcb # no cell by cell terms are written
        if layer_row_column_data is None:
          if layer_row_column_Q is not None:
            print '\nWARNING: ModflowWel - Do not use layer_row_column_Q!\n'+\
                  '                      Use layer_row_column_data instead.'
            layer_row_column_data = layer_row_column_Q
          else:
            raise Exception('Failed to specify layer_row_column_Q or layer_row_column_data.')

        self.mxactw = 0
        self.mxactw, self.layer_row_column_data = \
            self.assign_layer_row_column_data(layer_row_column_data, 4+naux)

        self.np = 0
        if options is None:
            options = []
        self.options = options
        self.parent.add_package(self)
Beispiel #18
0
    def __init__(self, model, layer_row_column_data=None,
                 layer_row_column_shead_ehead=None,
                 cosines=None, extension='pbc', unitnumber=30, zerobase=True):
        Package.__init__(self, model, extension, 'PBC',
                         unitnumber)  # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = '# PBC for MODFLOW, generated by Flopy.'
        self.mxactp = 0
        if layer_row_column_data is None:
            if layer_row_column_shead_ehead is not None:
                print('\nWARNING: ModflowPbc - Do not use layer_row_column_shead_ehead!\n' + \
                      '                      Use layer_row_column_data instead.')
                layer_row_column_data = layer_row_column_shead_ehead
            else:
                raise Exception('Failed to specify layer_row_column_shead_ehead or layer_row_column_data.')

        self.mxactp, self.layer_row_column_data = self.assign_layer_row_column_data(layer_row_column_data, 5,
                                                                                    zerobase=zerobase)
        self.mxcos, self.cosines = self.assign_layer_row_column_data(cosines, 3,
                                                                     zerobase=False)  # misuse of this function - zerobase needs to be False
        '''self.mxcos = 0
        if (cosines != None):
            error_message = 'cosines must have 3 columns'
            if (not isinstance(cosines, list)):
                cosines = [cosines]
            for a in cosines:
                a = np.atleast_2d(a)
                nr, nc = a.shape
                assert nc == 3, error_message
                if (nr > self.mxcos):
                    self.mxcos = nr
            self.cosines = cosines'''
        self.np = 0
        self.parent.add_package(self)
Beispiel #19
0
    def __init__(self, model, laytyp=0, layavg=0, chani=1.0, layvka=0, laywet=0, iupwcb = 53, hdry=-1E+30, iphdry = 0,\
                 hk=1.0, hani=1.0, vka=1.0, ss=1e-5, sy=0.15, vkcb=0.0, noparcheck=False,        \
                 extension='upw', unitnumber = 31):
        Package.__init__(self, model, extension, 'UPW', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = '# UPW for MODFLOW-NWT, generated by Flopy.'
        self.url = 'upw_upstream_weighting_package.htm'
        nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
        # item 1
        self.iupwcb = iupwcb # Unit number for file with cell-by-cell flow terms
        self.hdry = hdry # Head in cells that are converted to dry during a simulation
        self.npupw = 0 # number of UPW parameters
        self.iphdry = iphdry
        self.laytyp = util_2d(model,(nlay,),np.int,laytyp,name='laytyp')
        self.layavg = util_2d(model,(nlay,),np.int,layavg,name='layavg')
        self.chani = util_2d(model,(nlay,),np.int,chani,name='chani')
        self.layvka = util_2d(model,(nlay,),np.int,layvka,name='vka')
        self.laywet = util_2d(model,(nlay,),np.int,laywet,name='laywet')

        self.options = ' '
        if noparcheck: self.options = self.options + 'NOPARCHECK  '

        self.hk = util_3d(model,(nlay,nrow,ncol),np.float32,hk,name='hk',locat=self.unit_number[0])
        self.hani = util_3d(model,(nlay,nrow,ncol),np.float32,hani,name='hani',locat=self.unit_number[0])
        self.vka = util_3d(model,(nlay,nrow,ncol),np.float32,vka,name='vka',locat=self.unit_number[0])
        self.ss = util_3d(model,(nlay,nrow,ncol),np.float32,ss,name='ss',locat=self.unit_number[0])
        self.sy = util_3d(model,(nlay,nrow,ncol),np.float32,sy,name='sy',locat=self.unit_number[0])
        self.vkcb = util_3d(model,(nlay,nrow,ncol),np.float32,vkcb,name='vkcb',locat=self.unit_number[0])
        self.parent.add_package(self)
Beispiel #20
0
 def __init__(self, model, os=2, temp=25, asbin=0, eps_aqu=0, eps_ph=0, 
              scr_output=1, cb_offset=0, smse=['pH', 'pe'], mine=[], ie=[],
              surf=[], mobkin=[], minkin=[], surfkin=[], imobkin=[], 
              extension='phc'):
     #Call ancestor's init to set self.parent, extension, name and 
     #unit number
     Package.__init__(self, model, extension, 'PHC', 38) 
     self.os = os
     self.temp = temp
     self.asbin = asbin
     self.eps_aqu = eps_aqu
     self.eps_ph = eps_ph
     self.scr_output = scr_output
     self.cb_offset = cb_offset
     self.smse = smse
     self.nsmse = len(self.smse)
     self.mine = mine
     self.nmine = len(self.mine)
     self.ie = ie
     self.nie = len(self.ie)
     self.surf = surf
     self.nsurf = len(self.surf)
     self.mobkin = mobkin
     self.nmobkin = len(self.mobkin)
     self.minkin = minkin[0]
     self.nminkin = len(self.minkin)
     self.minkin_parms = minkin[1]
     self.surfkin = surfkin
     self.nsurfkin = len(self.surfkin)
     self.imobkin = imobkin
     self.nimobkin = len(self.imobkin)
     self.parent.add_package(self)
     return
Beispiel #21
0
    def __init__(self,
                 model,
                 ipakcb=0,
                 stress_period_data=None,
                 dtype=None,
                 extension='riv',
                 unitnumber=18,
                 options=None,
                 **kwargs):
        """
        Package constructor.

        """
        # Call parent init to set self.parent, extension, name and unit number
        Package.__init__(self, model, extension, 'RIV', unitnumber)
        self.heading = '# RIV for MODFLOW, generated by Flopy.'
        self.url = 'riv.htm'
        self.ipakcb = ipakcb
        self.mxactr = 0
        self.np = 0
        if options is None:
            options = []
        self.options = options
        if dtype is not None:
            self.dtype = dtype
        else:
            self.dtype = self.get_default_dtype(
                structured=self.parent.structured)
        #self.stress_period_data = mflist(model, self.dtype, stress_period_data)
        self.stress_period_data = mflist(self, stress_period_data)
        self.parent.add_package(self)
Beispiel #22
0
 def __init__(self, model, itrnsp=1, ibctcb=0, mcomp=1, ic_ibound_flg=1,
              itvd=1, iadsorb=0, ict=0, cinact=-999., ciclose=1.e-6,
              idisp=1, ixdisp=0, diffnc=0., izod=0, ifod=0, icbund=1,
              porosity=0.1, bulkd=1., dlh=0., dlv=0., dth=0., dtv=0.,
              sconc=0.,
              extension='bct', unitnumber=35):
     Package.__init__(self, model, extension, 'BCT', unitnumber)
     self.url = 'bct.htm'
     nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
     self.itrnsp = itrnsp
     self.ibctcb = ibctcb
     self.mcomp = mcomp
     self.ic_ibound_flg = ic_ibound_flg
     self.itvd = itvd
     self.iadsorb = iadsorb
     self.ict = ict
     self.cinact = cinact
     self.ciclose = ciclose
     self.idisp = idisp
     self.ixdisp = ixdisp
     self.diffnc = diffnc
     self.izod = izod
     self.ifod = ifod
     self.icbund = util_3d(model, (nlay, nrow, ncol), np.float32, icbund,
                           'icbund',)
     self.porosity = util_3d(model, (nlay, nrow, ncol), np.float32,
                             porosity, 'porosity')
     self.dlh = util_3d(model, (nlay, nrow, ncol), np.float32, dlh, 'dlh')
     self.dlv = util_3d(model, (nlay, nrow, ncol), np.float32, dlv, 'dlv')
     self.dth = util_3d(model, (nlay, nrow, ncol), np.float32, dth, 'dth')
     self.dtv = util_3d(model, (nlay, nrow, ncol), np.float32, dth, 'dtv')
     self.sconc = util_3d(model, (nlay, nrow, ncol), np.float32, sconc,
                          'sconc',)
     self.parent.add_package(self)
     return
Beispiel #23
0
    def __init__(self, model, ipakcb=0, stress_period_data=None, dtype=None,
                 no_print=False, options=None, extension='ghb', unitnumber=23):
        """
        Package constructor.

        """
        Package.__init__(self, model, extension, 'GHB',
                         unitnumber)
        self.heading = '# GHB for MODFLOW, generated by Flopy.'
        self.url = 'ghb.htm'
        if ipakcb != 0:
            self.ipakcb = 53
        else:
            self.ipakcb = 0  # 0: no cell by cell terms are written
        self.no_print = no_print
        self.np = 0
        if options is None:
            options = []
        if self.no_print:
            options.append('NOPRINT')
        self.options = options
        self.parent.add_package(self)
        if dtype is not None:
            self.dtype = dtype
        else:
            self.dtype = self.get_default_dtype(structured=self.parent.structured)
        self.stress_period_data = MfList(self, stress_period_data)
Beispiel #24
0
 def __init__(self, model, ighbcb=0, layer_row_column_data=None, 
              layer_row_column_head_cond=None, 
              no_print=False, options=None, naux=0,
              extension='ghb', unitnumber=23):
     Package.__init__(self, model, extension, 'GHB',
                      unitnumber)  # Call ancestor's init to set self.parent, extension, name and unit number
     self.heading = '# GHB for MODFLOW, generated by Flopy.'
     self.url = 'ghb.htm'
     self.ighbcb = ighbcb  # no cell by cell terms are written
     if layer_row_column_data is None:
       if layer_row_column_head_cond is not None:
         print '\nWARNING: ModflowGhb - Do not use layer_row_column_head_cond!\n'+\
               '                      Use layer_row_column_data instead.'
         layer_row_column_data = layer_row_column_head_cond
       else:
         raise Exception('Failed to specify layer_row_column_head_cond or layer_row_column_data.')
       
     self.mxactb, self.layer_row_column_data = self.assign_layer_row_column_data(layer_row_column_data,
                                                                                 5 + naux)
     self.no_print = no_print
     self.np = 0
     if options is None:
         options = []
     if self.no_print:
         options.append('NOPRINT')
     self.options = options
     self.parent.add_package(self)
Beispiel #25
0
    def __init__(self,
                 model,
                 ipakcb=0,
                 stress_period_data=None,
                 dtype=None,
                 extension='drn',
                 unitnumber=21,
                 options=None,
                 **kwargs):
        """
        Package constructor
        """
        Package.__init__(
            self, model, extension, 'DRN', unitnumber
        )  # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = '# DRN for MODFLOW, generated by Flopy.'
        self.url = 'drn.htm'
        self.ipakcb = ipakcb  # 0: no cell by cell terms are written

        self.np = 0
        if options is None:
            options = []
        self.options = options
        if dtype is not None:
            self.dtype = dtype
        else:
            self.dtype = self.get_default_dtype()
        self.stress_period_data = mflist(model, self.dtype, stress_period_data)
        self.parent.add_package(self)
Beispiel #26
0
 def __init__(self, model, extension='list', listunit=7):
     #Call ancestor's init to set self.parent, extension, name and
     #unit number
     Package.__init__(self, model, extension, 'LIST', listunit)
     #self.parent.add_package(self) This package is not added to the base
     #model so that it is not included in get_name_file_entries()
     return
Beispiel #27
0
    def __init__(self, model, mxiter=50, iiter=30, iadamp=0, hclose=1e-5, rclose=1e-5, relax=1.0, ioutgmg=0, iunitmhc=0,
                 ism=0, isc=0, damp=1.0, dup=0.75, dlow=0.01, chglimit=1.0, extension='gmg', unitnumber=27):
        """
        Package constructor.

        """
        Package.__init__(self, model, extension, 'GMG',
                         unitnumber)  # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = '# GMG for MODFLOW, generated by Flopy.'
        self.url = 'gmg.htm'
        self.mxiter = mxiter
        self.iiter = iiter
        self.iadamp = iadamp
        self.hclose = hclose
        self.rclose = rclose
        self.relax = relax
        self.ism = ism
        self.isc = isc
        self.dup = dup
        self.dlow = dlow
        self.chglimit = chglimit
        self.damp = damp
        self.ioutgmg = ioutgmg
        self.iunitmhc = iunitmhc
        self.parent.add_package(self)
Beispiel #28
0
    def __init__(self, model, ipakcb=0, stress_period_data=None, dtype=None,
                 extension='wel', unitnumber=20, options=None):
        """
        Package constructor.

        """
        # Call parent init to set self.parent, extension, name and unit number
        Package.__init__(self, model, extension, 'WEL', unitnumber)
        self.heading = '# Well file for MODFLOW, generated by Flopy.'
        self.url = 'wel.htm'
        self.ipakcb = ipakcb  # no cell by cell terms are written
        self.np = 0
        if options is None:
            options = []
        self.specify = False
        for idx, opt in enumerate(options):
            if 'specify' in opt:
                t = opt.strip().split()
                self.specify = True
                self.phiramp = np.float(t[1])
                self.phiramp_unit = np.int(t[2])
                options.pop(idx)
                break
        self.options = options
        self.parent.add_package(self)
        if dtype is not None:
            self.dtype = dtype
        else:
            self.dtype = self.get_default_dtype(structured=self.parent.structured)
        self.stress_period_data = mflist(model, self.dtype, stress_period_data)
Beispiel #29
0
    def __init__(self, model, ipakcb=0, stress_period_data=None, dtype=None,
                 extension='riv', unitnumber=18, options=None, **kwargs):
        """
        Package constructor.

        """
        # Call parent init to set self.parent, extension, name and unit number
        Package.__init__(self, model, extension, 'RIV', unitnumber)
        self.heading = '# RIV for MODFLOW, generated by Flopy.'
        self.url = 'riv.htm'
        if ipakcb != 0:
            self.ipakcb = 53
        else:
            self.ipakcb = 0  # 0: no cell by cell terms are written
        self.mxactr = 0
        self.np = 0
        if options is None:
            options = []
        self.options = options
        if dtype is not None:
            self.dtype = dtype
        else:
            self.dtype = self.get_default_dtype(structured=self.parent.structured)
        # self.stress_period_data = MfList(model, self.dtype, stress_period_data)
        self.stress_period_data = MfList(self, stress_period_data)
        self.parent.add_package(self)
Beispiel #30
0
 def __init__(self, model, mtdnconc=1, mfnadvfd=1, nswtcpl=1, iwtable=1,
              densemin=1.000, densemax=1.025,
              dnscrit=1e-2,
              denseref=1.000, denseslp=.025,
              firstdt=0.001,
              indense=0,
              dense=1.000, extension='vdf'):
     # Call ancestor's init to set self.parent, extension, name and 
     #unit number
     Package.__init__(self, model, extension, 'VDF', 37)
     nrow, ncol, nlay, nper = self.parent.mf.nrow_ncol_nlay_nper
     self.mtdnconc = mtdnconc 
     self.mfnadvfd = mfnadvfd
     self.nswtcpl = nswtcpl
     self.iwtable = iwtable
     self.densemin = densemin 
     self.densemax = densemax
     self.dnscrit = dnscrit
     self.denseref = denseref
     self.denseslp = denseslp
     self.firstdt = firstdt
     self.indense = indense
     #self.dense = self.assignarray((nlay,nrow,ncol), np.float, dense, 
     #                              name='dense',)
     self.dense = util_3d(model,(nlay,nrow,ncol),np.float32,dense,name='dense')
     self.parent.add_package(self)
     return
Beispiel #31
0
 def __init__(self, model, laytyp=0, layavg=0, chani=1.0, layvka=0,
              laywet=0, ipakcb=53, hdry=-1E+30, iwdflg=0, wetfct=0.1,
              iwetit=1, ihdwet=0, hk=1.0, hani=1.0, vka=1.0, ss=1e-5,
              sy=0.15, vkcb=0.0, wetdry=-0.01, storagecoefficient=False,
              constantcv=False, thickstrt=False, nocvcorrection=False,
              novfc=False, extension='lpf', unitnumber=15):
     Package.__init__(self, model, extension, 'LPF',
                      unitnumber)  # Call ancestor's init to set self.parent, extension, name and unit number
     self.heading = '# LPF for MODFLOW, generated by Flopy.'
     self.url = 'lpf.htm'
     nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
     # item 1
     if ipakcb != 0:
         self.ipakcb = 53
     else:
         self.ipakcb = 0  # 0: no cell by cell terms are written
     self.hdry = hdry  # Head in cells that are converted to dry during a simulation
     self.nplpf = 0  # number of LPF parameters
     self.laytyp = Util2d(model, (nlay,), np.int, laytyp, name='laytyp')
     self.layavg = Util2d(model, (nlay,), np.int, layavg, name='layavg')
     self.chani = Util2d(model, (nlay,), np.float32, chani, name='chani')
     self.layvka = Util2d(model, (nlay,), np.int, layvka, name='layvka')
     self.laywet = Util2d(model, (nlay,), np.int, laywet, name='laywet')
     self.wetfct = wetfct  # Factor that is included in the calculation of the head when a cell is converted from dry to wet
     self.iwetit = iwetit  # Iteration interval for attempting to wet cells
     self.ihdwet = ihdwet  # Flag that determines which equation is used to define the initial head at cells that become wet
     self.options = ' '
     if storagecoefficient:
         self.options = self.options + 'STORAGECOEFFICIENT '
     if constantcv: self.options = self.options + 'CONSTANTCV '
     if thickstrt: self.options = self.options + 'THICKSTRT '
     if nocvcorrection: self.options = self.options + 'NOCVCORRECTION '
     if novfc: self.options = self.options + 'NOVFC '
     self.hk = Util3d(model, (nlay, nrow, ncol), np.float32, hk, name='hk',
                       locat=self.unit_number[0])
     self.hani = Util3d(model, (nlay, nrow, ncol), np.float32, hani,
                         name='hani', locat=self.unit_number[0])
     keys = []
     for k in range(nlay):
         key = 'vka'
         if self.layvka[k] != 0:
             key = 'vani'
         keys.append(key)
     self.vka = Util3d(model, (nlay, nrow, ncol), np.float32, vka,
                        name=keys, locat=self.unit_number[0])
     tag = 'ss'
     if storagecoefficient:
         tag = 'storage'
     self.ss = Util3d(model, (nlay, nrow, ncol), np.float32, ss, name=tag,
                       locat=self.unit_number[0])
     self.sy = Util3d(model, (nlay, nrow, ncol), np.float32, sy, name='sy',
                       locat=self.unit_number[0])
     self.vkcb = Util3d(model, (nlay, nrow, ncol), np.float32, vkcb,
                         name='vkcb', locat=self.unit_number[0])
     self.wetdry = Util3d(model, (nlay, nrow, ncol), np.float32, wetdry,
                           name='wetdry', locat=self.unit_number[0])
     self.parent.add_package(self)
     return
Beispiel #32
0
 def __init__(
     self,
     model,
     itrnsp=1,
     ibctcb=0,
     mcomp=1,
     ic_ibound_flg=1,
     itvd=1,
     iadsorb=0,
     ict=0,
     cinact=-999.0,
     ciclose=1.0e-6,
     idisp=1,
     ixdisp=0,
     diffnc=0.0,
     izod=0,
     ifod=0,
     icbund=1,
     porosity=0.1,
     bulkd=1.0,
     arad=0.0,
     dlh=0.0,
     dlv=0.0,
     dth=0.0,
     dtv=0.0,
     sconc=0.0,
     extension="bct",
     unitnumber=35,
 ):
     Package.__init__(self, model, extension, "BCT", unitnumber)
     self.url = "bct.htm"
     nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
     self.itrnsp = itrnsp
     self.ibctcb = ibctcb
     self.mcomp = mcomp
     self.ic_ibound_flg = ic_ibound_flg
     self.itvd = itvd
     self.iadsorb = iadsorb
     self.ict = ict
     self.cinact = cinact
     self.ciclose = ciclose
     self.idisp = idisp
     self.ixdisp = ixdisp
     self.diffnc = diffnc
     self.izod = izod
     self.ifod = ifod
     self.icbund = util_3d(model, (nlay, nrow, ncol), np.float32, icbund, "icbund")
     self.porosity = util_3d(model, (nlay, nrow, ncol), np.float32, porosity, "porosity")
     # self.arad = util_2d(model, (1, nja), np.float32,
     #                        arad, 'arad')
     self.dlh = util_3d(model, (nlay, nrow, ncol), np.float32, dlh, "dlh")
     self.dlv = util_3d(model, (nlay, nrow, ncol), np.float32, dlv, "dlv")
     self.dth = util_3d(model, (nlay, nrow, ncol), np.float32, dth, "dth")
     self.dtv = util_3d(model, (nlay, nrow, ncol), np.float32, dth, "dtv")
     self.sconc = util_3d(model, (nlay, nrow, ncol), np.float32, sconc, "sconc")
     self.parent.add_package(self)
     return
Beispiel #33
0
 def __init__(self, model, output_file_name='mt3d_link.ftl', output_file_unit=54, output_file_header='extended', output_file_format='unformatted', extension ='lmt6', unitnumber=30):
     Package.__init__(self, model, extension, 'LMT6', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
     self.heading = '# Lmt input file for MODFLOW, generated by Flopy.'
     self.url = 'lmt.htm'
     self.output_file_name='mt3d_link.ftl'
     self.output_file_unit=54
     self.output_file_header='extended'
     self.output_file_format='unformatted'
     self.parent.add_package(self)
Beispiel #34
0
 def __init__(self, model, mxiter=200, \
              accl=1, hclose=1e-5, iprsor=0, extension='sor', unitnumber=26):
     Package.__init__(self, model, extension, 'sor', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
     self.url = 'sor.htm'
     self.mxiter = mxiter
     self.accl= accl
     self.hclose = hclose
     self.iprsor = iprsor
     self.parent.add_package(self)
Beispiel #35
0
    def __init__(self, model, nlay=1, nrow=2, ncol=2, nper=1, delr=1.0,
                 delc=1.0, laycbd=0, top=1, botm=0, perlen=1, nstp=1,
                 tsmult=1, steady=True, itmuni=4, lenuni=2, extension='dis',
                 unitnumber=11, xul=None, yul=None, rotation=0.0,
                 start_datetime="1/1/1970"):

        # Call ancestor's init to set self.parent, extension, name and unit
        # number
        Package.__init__(self, model, extension, 'DIS', unitnumber)
        self.url = 'dis.htm'
        self.nrow = nrow
        self.ncol = ncol
        self.nlay = nlay
        self.nper = nper

        # Set values of all parameters
        self.heading = '# Discretization file for MODFLOW, generated by Flopy.'
        self.laycbd = Util2d(model, (self.nlay,), np.int, laycbd,
                              name='laycbd')
        self.laycbd[-1] = 0  # bottom layer must be zero
        self.delr = Util2d(model, (self.ncol,), np.float32, delr, name='delr',
                            locat=self.unit_number[0])
        self.delc = Util2d(model, (self.nrow,), np.float32, delc, name='delc',
                            locat=self.unit_number[0])
        self.top = Util2d(model, (self.nrow, self.ncol), np.float32,
                           top, name='model_top', locat=self.unit_number[0])
        self.botm = Util3d(model, (self.nlay + sum(self.laycbd),
                                    self.nrow, self.ncol), np.float32, botm,
                            'botm', locat=self.unit_number[0])
        self.perlen = Util2d(model, (self.nper,), np.float32, perlen,
                              name='perlen')
        self.nstp = Util2d(model, (self.nper,), np.int, nstp, name='nstp')
        self.tsmult = Util2d(model, (self.nper,), np.float32, tsmult,
                              name='tsmult')
        self.steady = Util2d(model, (self.nper,), np.bool,
                              steady, name='steady')

        try:
            self.itmuni = int(itmuni)
        except:
            self.itmuni = ITMUNI[itmuni.lower()[0]]
        try:
            self.lenuni = int(lenuni)
        except:
            self.lenuni = LENUNI[lenuni.lower()[0]]

        self.parent.add_package(self)
        self.itmuni_dict = {0: "undefined", 1: "seconds", 2: "minutes",
                            3: "hours", 4: "days", 5: "years"}

        self.sr = reference.SpatialReference(self.delr.array, self.delc.array, self.lenuni, xul=xul,
                                             yul=yul, rotation=rotation)
        self.start_datetime = start_datetime
        # calculate layer thicknesses
        self.__calculate_thickness()
Beispiel #36
0
    def __init__(self, model, iter_mo=50, iter_mi=30, close_h=1e-5, close_r=1e-5, \
                 relax=1.0, ifill=0, unit_pc=0, unit_ts=0, \
                 adamp=0, damp=1.0, damp_lb=0.001, rate_d=0.1, chglimit=0., \
                 acnvg=0, cnvg_lb=0.001, mcnvg=2, rate_c=-1.0, ipunit=0, \
                 extension=['pcgn'], unit_number=27):
        """
        Package constructor.

        """
        name = ['PCGN']
        units = [unit_number]
        extra = ['']
        tu = (unit_pc, unit_ts, ipunit)
        ea = ('pcgni', 'pcgnt', 'pcgno')
        for [t, e] in zip(tu, ea):
            if t > 0:
                extension.append(e)
                name.append('DATA')
                units.append(t)
                extra.append('REPLACE')
        Package.__init__(
            self,
            model,
            extension=extension,
            name=name,
            unit_number=units,
            extra=extra
        )  # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = '# PCGN for MODFLOW, generated by Flopy.'
        self.url = 'pcgn.htm'
        self.iter_mo = iter_mo
        self.iter_mi = iter_mi
        self.close_h = close_h
        self.close_r = close_r
        self.relax = relax
        self.ifill = ifill
        self.unit_pc = unit_pc
        self.unit_ts = unit_ts
        self.adamp = adamp
        self.damp = damp
        self.damp_lb = damp_lb
        self.rate_d = rate_d
        self.chglimit = chglimit
        self.acnvg = acnvg
        self.cnvg_lb = cnvg_lb
        self.mcnvg = mcnvg
        self.rate_c = rate_c
        self.ipunit = ipunit
        # error trapping
        if self.ifill < 0 or self.ifill > 1:
            raise TypeError(
                'PCGN: ifill must be 0 or 1 - an ifill value of {0} was specified'
                .format(self.ifill))
        # add package
        self.parent.add_package(self)
Beispiel #37
0
 def __init__(self, model, al=0.01, trpt=0.1, trpv=0.01, dmcoef=1e-9, 
              extension='dsp', multiDiff=False,**kwargs):
     '''
     if dmcoef is passed as a list of (nlay, nrow, ncol) arrays,
     then the multicomponent diffusion is activated
     '''
     # Call ancestor's init to set self.parent, extension, name and 
     #unit number
     Package.__init__(self, model, extension, 'DSP', 33) 
     nrow, ncol, nlay, nper = self.parent.mf.nrow_ncol_nlay_nper
     ncomp = self.parent.get_ncomp()        
     # if multiDiff:
     #     assert isinstance(dmcoef,list),('using multicomponent diffusion '
     #                                     'requires dmcoef is list of '
     #                                     'length ncomp')
     #     if len(dmcoef) != ncomp:
     #         raise TypeError,('using multicomponent diffusion requires '
     #                          'dmcoef is list of length ncomp')
     self.multiDiff = multiDiff                                    
     #self.al = self.assignarray((nlay, nrow, ncol), np.float, al, 
     #                           name='al', load=model.load )
     self.al = util_3d(model,(nlay,nrow,ncol),np.float32,al,name='al',
                       locat=self.unit_number[0])
     #self.trpt = self.assignarray((nlay,), np.float, trpt, name='trpt', 
     #                             load=model.load)
     self.trpt = util_2d(model,(nlay,),np.float32,trpt,name='trpt',
                         locat=self.unit_number[0])
     #self.trpv = self.assignarray((nlay,), np.float, trpv, name='trpv', 
     #                             load=model.load)
     self.trpv = util_2d(model,(nlay,),np.float32,trpt,name='trpv',
                         locat=self.unit_number[0])
     self.dmcoef = []
     a = util_3d(model, (nlay, nrow, ncol), np.float32, dmcoef,
                 name='dmcoef1', locat=self.unit_number[0])
     self.dmcoef.append(a)
     if self.multiDiff:
         for icomp in range(2, ncomp+1):
             name = "dmcoef" + str(icomp)
             val = 0.0
             if name in list(kwargs.keys()):
                 val = kwargs[name]
                 kwargs.pop(name)
             else:
                 print("DSP: setting dmcoef for component " +\
                       str(icomp) + " to zero, kwarg name " +\
                       name)
             a = util_3d(model, (nlay, nrow, ncol), np.float32, val,
                         name=name, locat=self.unit_number[0])
             self.dmcoef.append(a)
     if len(list(kwargs.keys())) > 0:
         raise Exception("DSP error: unrecognized kwargs: " +
                         ' '.join(list(kwargs.keys())))
     self.parent.add_package(self)
     return
Beispiel #38
0
    def __init__(self, model, extension='swr', unitnumber=36):
        """
        Package constructor.

        """
        Package.__init__(self, model, extension, 'SWR',
                         unitnumber)  # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = '# SWR1 process for MODFLOW, generated by Flopy.'
        self.url = 'swr1.htm'

        self.parent.add_package(self)
Beispiel #39
0
 def __init__(self, model, mxiter=200, nparm=5, \
              accl=1, hclose=1e-5, ipcalc=1, wseed=0, iprsip=0, extension='sip', unitnumber=25):
     Package.__init__(self, model, extension, 'SIP', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
     self.url = 'sip.htm'
     self.mxiter = mxiter
     self.nparm = nparm
     self.accl = accl
     self.hclose = hclose
     self.ipcalc = ipcalc
     self.wseed = wseed
     self.iprsip = iprsip
     self.parent.add_package(self)
Beispiel #40
0
 def __init__(self, model, outnam='tob_output', CScale=1.0, FluxGroups=[], 
              FScale=1.0, iOutFlux=0, extension='tob'):
     #Call ancestor's init to set self.parent, extension, name and 
     #unit number
     Package.__init__(self, model, extension, 'TOB', 37)
     self.heading = '# TOB for MT3DMS, generated by Flopy.'
     self.outnam = outnam
     self.CScale = CScale
     self.FluxGroups = FluxGroups
     self.FScale = FScale
     self.iOutFlux = iOutFlux
     self.parent.add_package(self)
     return
Beispiel #41
0
 def __init__(self, model, headtol = 1E-4, fluxtol = 500, maxiterout = 100, \
              thickfact = 1E-5, linmeth = 1, iprnwt = 0, ibotav = 0, \
              options = 'COMPLEX', Continue=False, \
              dbtheta=0.4, dbkappa=1.e-5, dbgamma=0., momfact=0.1, \
              backflg=1, maxbackiter=50, backtol=1.1, backreduce=0.70, \
              maxitinner=50, ilumethod=2, levfill=5, stoptol=1.e-10, msdr=15, \
              iacl=2, norder=1, level=5, north=7, iredsys=0, rrctols=0.0, \
              idroptol=1, epsrn=1.e-4, hclosexmd=1e-4, mxiterxmd=50, \
              extension='nwt', unitnumber = 32):
     Package.__init__(
         self, model, extension, 'NWT', unitnumber
     )  # Call ancestor's init to set self.parent, extension, name and unit number
     self.heading = '# NWT for MODFLOW-NWT, generated by Flopy.'
     self.url = 'nwt_newton_solver.htm'
     self.headtol = headtol
     self.fluxtol = fluxtol
     self.maxiterout = maxiterout
     self.thickfact = thickfact
     self.linmeth = linmeth
     self.iprnwt = iprnwt
     self.ibotav = ibotav
     if isinstance(options, list):
         self.options = options
     else:
         self.options = [options.upper()]
     if Continue:
         self.options.append('CONTINUE')
     self.dbtheta = dbtheta
     self.dbkappa = dbkappa
     self.dbgamma = dbgamma
     self.momfact = momfact
     self.backflg = backflg
     self.maxbackiter = maxbackiter
     self.backtol = backtol
     self.backreduce = backreduce
     self.maxitinner = maxitinner
     self.ilumethod = ilumethod
     self.levfill = levfill
     self.stoptol = stoptol
     self.msdr = msdr
     self.iacl = iacl
     self.norder = norder
     self.level = level
     self.north = north
     self.iredsys = iredsys
     self.rrctols = rrctols
     self.idroptol = idroptol
     self.epsrn = epsrn
     self.hclosexmd = hclosexmd
     self.mxiterxmd = mxiterxmd
     self.parent.add_package(self)
Beispiel #42
0
    def __init__(
        self,
        model,
        nphfb=0,
        mxfb=0,
        nhfbnp=0,
        hfb_data=None,
        nacthfb=0,
        no_print=False,
        options=None,
        extension="hfb",
        unitnumber=17,
    ):
        Package.__init__(
            self, model, extension, "HFB6", unitnumber
        )  # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = "# HFB for MODFLOW, generated by Flopy."
        self.url = "hfb6.htm"

        self.nphfb = nphfb
        self.mxfb = mxfb

        self.nacthfb = nacthfb

        self.no_print = no_print
        self.np = 0
        if options is None:
            options = []
        if self.no_print:
            options.append("NOPRINT")
        self.options = options

        aux_names = []
        it = 0
        while it < len(options):
            print(it, options[it])
            if "aux" in options[it].lower():
                aux_names.append(options[it + 1].lower())
                it += 1
            it += 1

        if hfb_data is None:
            raise Exception("Failed to specify hfb_data.")

        self.nhfbnp = len(hfb_data)
        self.hfb_data = ModflowHfb.get_empty(self.nhfbnp)
        for ibnd, t in enumerate(hfb_data):
            self.hfb_data[ibnd] = tuple(t)

        self.parent.add_package(self)
Beispiel #43
0
    def __init__(
        self,
        model,
        al=0.01,
        trpt=0.1,
        trpv=0.01,
        dmcoef=1e-9,
        extension="dsp",
        multiDiff=False,
        unitnumber=None,
        **kwargs
    ):
        if unitnumber is None:
            unitnumber = self.unitnumber
        Package.__init__(self, model, extension, "DSP", unitnumber)
        nrow = model.nrow
        ncol = model.ncol
        nlay = model.nlay
        ncomp = model.ncomp
        mcomp = model.mcomp
        self.multiDiff = multiDiff
        self.al = Util3d(model, (nlay, nrow, ncol), np.float32, al, name="al", locat=self.unit_number[0])
        self.trpt = Util2d(model, (nlay,), np.float32, trpt, name="trpt", locat=self.unit_number[0])
        self.trpv = Util2d(model, (nlay,), np.float32, trpv, name="trpv", locat=self.unit_number[0])

        # Multi-species and multi-diffusion, hence the complexity
        self.dmcoef = []
        shape = (nlay, 1)
        utype = Util2d
        nmcomp = ncomp
        if multiDiff:
            shape = (nlay, nrow, ncol)
            utype = Util3d
            nmcomp = mcomp
        u2or3 = utype(model, shape, np.float32, dmcoef, name="dmcoef1", locat=self.unit_number[0])
        self.dmcoef.append(u2or3)
        for icomp in range(2, nmcomp + 1):
            name = "dmcoef" + str(icomp)
            val = 0.0
            if name in list(kwargs.keys()):
                val = kwargs.pop(name)
            else:
                print("DSP: setting dmcoef for component " + str(icomp) + " to zero, kwarg name " + name)
            u2or3 = utype(model, shape, np.float32, val, name=name, locat=self.unit_number[0])
            self.dmcoef.append(u2or3)

        if len(list(kwargs.keys())) > 0:
            raise Exception("DSP error: unrecognized kwargs: " + " ".join(list(kwargs.keys())))
        self.parent.add_package(self)
        return
Beispiel #44
0
    def __init__(self,
                 model,
                 mxmnw=0,
                 iwl2cb=0,
                 iwelpt=0,
                 nomoiter=0,
                 kspref=1,
                 wel1_bynode_qsum=None,
                 itmp=0,
                 lay_row_col_qdes_mn_multi=None,
                 mnwname=None,
                 extension='mnw1',
                 unitnumber=33):
        Package.__init__(
            self, model, extension, 'MNW1', unitnumber
        )  # Call ancestor's init to set self.parent, extension, name, and unit number
        self.url = 'mnw1.htm'
        self.nper = self.parent.nrow_ncol_nlay_nper[-1]
        self.heading = '# Multi-node well 1 (MNW1) file for MODFLOW, generated by Flopy'
        self.mxmnw = mxmnw  #-maximum number of multi-node wells to be simulated
        self.iwl2cb = iwl2cb  #-flag and unit number
        self.iwelpt = iwelpt  #-verbosity flag
        self.nomoiter = nomoiter  #-integer indicating the number of iterations for which flow in MNW wells is calculated
        self.kspref = kspref  #-alphanumeric key indicating which set of water levels are to be used as reference values for calculating drawdown
        self.losstype = 'SKIN'  #-string indicating head loss type for each well
        self.wel1_bynode_qsum = wel1_bynode_qsum  #-nested list containing file names, unit numbers, and ALLTIME flag for auxilary output, e.g. [['test.ByNode',92,'ALLTIME']]
        self.itmp = itmp  #-array containing # of wells to be simulated for each stress period (shape = (NPER))
        self.lay_row_col_qdes_mn_multi = lay_row_col_qdes_mn_multi  #-list of arrays containing lay, row, col, qdes, and MN or MULTI flag for all well nodes (length = NPER)
        self.mnwname = mnwname  #-string prefix name of file for outputting time series data from MNW1

        #-create empty arrays of the correct size
        self.itmp = zeros(self.nper, dtype='int32')

        #-assign values to arrays
        self.assignarray_old(self.itmp, itmp)

        #-input format checks:
        lossTypes = ['SKIN', 'LINEAR']
        assert self.losstype in lossTypes, 'LOSSTYPE (%s) must be one of the following: "%s" or "%s"' % (
            self.losstype, lossTypes[0], lossTypes[1])
        auxFileExtensions = ['wl1', 'ByNode', 'Qsum']
        for each in self.wel1_bynode_qsum:
            assert each[0].split(
                '.'
            )[1] in auxFileExtensions, 'File extensions in "wel1_bynode_qsum" must be one of the following: ".wl1", ".ByNode", or ".Qsum".'
        assert self.itmp.max(
        ) <= self.mxmnw, 'ITMP cannot exceed maximum number of wells to be simulated.'

        self.parent.add_package(self)
Beispiel #45
0
    def __init__(self, model, mxiter=200, \
                 accl=1, hclose=1e-5, iprsor=0, extension='sor', unitnumber=26):
        """
        Package constructor.

        """
        Package.__init__(
            self, model, extension, 'sor', unitnumber
        )  # Call ancestor's init to set self.parent, extension, name and unit number
        self.url = 'sor.htm'
        self.mxiter = mxiter
        self.accl = accl
        self.hclose = hclose
        self.iprsor = iprsor
        self.parent.add_package(self)
Beispiel #46
0
    def __init__(self, model, pval_dict=None,
                 extension ='pval', unitnumber=1005):
        """
        Package constructor.

        """
        Package.__init__(self, model, extension, 'PVAL', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = '# PVAL for MODFLOW, generated by Flopy.\n# Really...is this actually helpful?'
        self.url = 'pval.htm'

        self.npval = 0
        if pval_dict is not None:
            self.pval = len(pval_dict)
            self.pval_dict = pval_dict
        self.parent.add_package(self)
Beispiel #47
0
    def __init__(self,
                 model,
                 nphfb=0,
                 mxfb=0,
                 nhfbnp=0,
                 hfb_data=None,
                 nacthfb=0,
                 no_print=False,
                 options=None,
                 extension='hfb',
                 unitnumber=17):
        Package.__init__(
            self, model, extension, 'HFB6', unitnumber
        )  # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = '# HFB for MODFLOW, generated by Flopy.'
        self.url = 'hfb6.htm'

        self.nphfb = nphfb
        self.mxfb = mxfb

        self.nacthfb = nacthfb

        self.no_print = no_print
        self.np = 0
        if options is None:
            options = []
        if self.no_print:
            options.append('NOPRINT')
        self.options = options

        aux_names = []
        it = 0
        while it < len(options):
            print(it, options[it])
            if 'aux' in options[it].lower():
                aux_names.append(options[it + 1].lower())
                it += 1
            it += 1

        if hfb_data is None:
            raise Exception('Failed to specify hfb_data.')

        self.nhfbnp = len(hfb_data)
        self.hfb_data = ModflowHfb.get_empty(self.nhfbnp)
        for ibnd, t in enumerate(hfb_data):
            self.hfb_data[ibnd] = tuple(t)

        self.parent.add_package(self)
Beispiel #48
0
    def __init__(self, model, mxiter=200, nparm=5, \
                 accl=1, hclose=1e-5, ipcalc=1, wseed=0, iprsip=0, extension='sip', unitnumber=25):
        """
        Package constructor.

        """
        Package.__init__(self, model, extension, 'SIP', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
        self.url = 'sip.htm'
        self.mxiter = mxiter
        self.nparm = nparm
        self.accl = accl
        self.hclose = hclose
        self.ipcalc = ipcalc
        self.wseed = wseed
        self.iprsip = iprsip
        self.parent.add_package(self)
Beispiel #49
0
    def __init__(self, model, zone_dict=None,
                 extension='zon', unitnumber=1001):
        """
        Package constructor.

        """
        Package.__init__(self, model, extension, 'ZONE',
                         unitnumber)  # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = '# ZONE for MODFLOW, generated by Flopy.'
        self.url = 'zon.htm'

        self.nzn = 0
        if zone_dict is not None:
            self.nzn = len(zone_dict)
            self.zone_dict = zone_dict
        self.parent.add_package(self)
Beispiel #50
0
    def __init__(self, model, mult_dict=None,
                 extension='mlt', unitnumber=1002):
        """
        Package constructor.

        """
        Package.__init__(self, model, extension, 'MULT', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = '# MULT for MODFLOW, generated by Flopy.'
        self.url = 'zon.htm'

        self.nml = 0
        if mult_dict is not None:
          self.nml = len(mult_dict)
          self.mult_dict = mult_dict
          #print mult_dict
        self.parent.add_package(self)
Beispiel #51
0
 def __init__(self,
              model,
              output_file_name='mt3d_link.ftl',
              output_file_unit=54,
              output_file_header='extended',
              output_file_format='unformatted',
              extension='lmt6',
              unitnumber=30):
     # Call ancestor's init to set self.parent, extension, name and unit number
     Package.__init__(self, model, extension, 'LMT6', unitnumber)
     self.heading = '# Lmt input file for MODFLOW, generated by Flopy.'
     self.url = 'lmt.htm'
     self.output_file_name = output_file_name
     self.output_file_unit = output_file_unit
     self.output_file_header = output_file_header
     self.output_file_format = output_file_format
     self.parent.add_package(self)
Beispiel #52
0
    def __init__(self, model, mxiter=100, innerit=50, \
                 isolver=1, npc=2, iscl=0, iord=0, ncoresm=1, ncoresv=1, \
                 damp=1.0, dampt=1.0, relax=0.97, \
                 ifill=0, droptol=0.0, \
                 hclose=1e-3, rclose=1e-1, l2norm=None, \
                 iprpks=0, mutpks=3,
                 mpi=False, partopt=0, novlapimpsol=1, stenimpsol=2, verbose=0, partdata=None, \
                 extension='pks', unitnumber=27):
        """
        Package constructor.

        """
        Package.__init__(
            self, model, extension, 'PKS', unitnumber
        )  # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = '# PKS for MODFLOW, generated by Flopy.'
        self.url = 'pks.htm'
        self.mxiter = mxiter
        self.innerit = innerit
        self.isolver = isolver
        self.npc = npc
        self.iscl = iscl
        self.iord = iord
        self.ncoresm = ncoresm
        self.ncoresv = ncoresv
        self.damp = damp
        self.dampt = dampt
        self.relax = relax
        self.ifill = ifill
        self.droptol = droptol
        self.hclose = hclose
        self.rclose = rclose
        self.l2norm = l2norm
        self.iprpks = iprpks
        self.mutpks = mutpks
        # MPI
        self.mpi = mpi
        self.partopt = partopt
        self.novlapimpsol = novlapimpsol
        self.stenimpsol = stenimpsol
        self.verbose = verbose
        self.partdata = partdata

        self.parent.add_package(self)
Beispiel #53
0
 def __init__(self,
              model,
              outnam='tob_output',
              CScale=1.0,
              FluxGroups=[],
              FScale=1.0,
              iOutFlux=0,
              extension='tob'):
     #Call ancestor's init to set self.parent, extension, name and
     #unit number
     Package.__init__(self, model, extension, 'TOB', 37)
     self.heading = '# TOB for MT3DMS, generated by Flopy.'
     self.outnam = outnam
     self.CScale = CScale
     self.FluxGroups = FluxGroups
     self.FScale = FScale
     self.iOutFlux = iOutFlux
     self.parent.add_package(self)
     return
Beispiel #54
0
 def __init__(self, model, isothm=0, ireact=0, igetsc=1, rhob=1.8e3, 
              prsity2=0.1, srconc=0.0, sp1=0.0, sp2=0.0, rc1=0.0, rc2=0.0, 
              extension='rct'):
     #Call ancestor's init to set self.parent, extension, name and 
     #unit number
     Package.__init__(self, model, extension, 'RCT', 36) 
     nrow, ncol, nlay, nper = self.parent.mf.nrow_ncol_nlay_nper
     self.heading1 = '# RCT for MT3DMS, generated by Flopy.'
     self.isothm = isothm
     self.ireact = ireact
     self.irctop = 2 #All RCT vars are specified as 3D arrays
     self.igetsc = igetsc
     # Set values of all parameters
     #self.rhob = self.assignarray((nlay, nrow, ncol), np.float, rhob, 
     #                             name='rhob')
     self.rhob = util_3d(model,(nlay,nrow,ncol),np.float32,rhob,name='rhob',
                         locat=self.unit_number[0])
     #self.prsity2 = self.assignarray((nlay, nrow, ncol), np.float, prsity2, 
     #                                name='prsity2')
     self.prsity2 = util_3d(model,(nlay,nrow,ncol),np.float32,prsity2,
                            name='prsity2',locat=self.unit_number[0])
     #self.srconc = self.assignarray((nlay, nrow, ncol), np.float, srconc, 
     #                               name='srconc')
     self.srconc = util_3d(model,(nlay,nrow,ncol),np.float32,srconc,
                           name='srconc',locat=self.unit_number[0])
     #self.sp1 = self.assignarray((nlay, nrow, ncol), np.float, sp1, 
     #                            name='sp1')
     self.sp1 = util_3d(model,(nlay,nrow,ncol),np.float32,sp1,name='sp1',
                        locat=self.unit_number[0])
     #self.sp2 = self.assignarray((nlay, nrow, ncol), np.float, sp2, 
     #                            name='sp2')
     self.sp2 = util_3d(model,(nlay,nrow,ncol),np.float32,sp2,name='sp2',
                        locat=self.unit_number[0])
     #self.rc1 = self.assignarray((nlay, nrow, ncol), np.float, rc1, 
     #                            name='rc1')
     self.rc1 = util_3d(model,(nlay,nrow,ncol),np.float32,rc1,name='rc1',
                        locat=self.unit_number[0])
     #self.rc2 = self.assignarray((nlay, nrow, ncol), np.float, rc2,
     #                             name='rc2')
     self.rc2 = util_3d(model,(nlay,nrow,ncol),np.float32,rc2,name='rc2',
                        locat=self.unit_number[0])
     self.parent.add_package(self)
     return
Beispiel #55
0
    def __init__(self,
                 model,
                 layer_row_column_data=None,
                 layer_row_column_shead_ehead=None,
                 cosines=None,
                 extension='pbc',
                 unitnumber=30,
                 zerobase=True):
        Package.__init__(
            self, model, extension, 'PBC', unitnumber
        )  # Call ancestor's init to set self.parent, extension, name and unit number
        self.heading = '# PBC for MODFLOW, generated by Flopy.'
        self.mxactp = 0
        if layer_row_column_data is None:
            if layer_row_column_shead_ehead is not None:
                print('\nWARNING: ModflowPbc - Do not use layer_row_column_shead_ehead!\n'+\
                      '                      Use layer_row_column_data instead.')
                layer_row_column_data = layer_row_column_shead_ehead
            else:
                raise Exception(
                    'Failed to specify layer_row_column_shead_ehead or layer_row_column_data.'
                )

        self.mxactp, self.layer_row_column_data = self.assign_layer_row_column_data(
            layer_row_column_data, 5, zerobase=zerobase)
        self.mxcos, self.cosines = self.assign_layer_row_column_data(
            cosines, 3, zerobase=False
        )  # misuse of this function - zerobase needs to be False
        '''self.mxcos = 0
        if (cosines != None):
            error_message = 'cosines must have 3 columns'
            if (not isinstance(cosines, list)):
                cosines = [cosines]
            for a in cosines:
                a = np.atleast_2d(a)
                nr, nc = a.shape
                assert nc == 3, error_message
                if (nr > self.mxcos):
                    self.mxcos = nr
            self.cosines = cosines'''
        self.np = 0
        self.parent.add_package(self)
Beispiel #56
0
    def __init__(self,
                 model,
                 stress_period_data=None,
                 dtype=None,
                 extension='chd',
                 unitnumber=24,
                 **kwargs):
        # Call ancestor's init to set self.parent, extension, name and unit number
        Package.__init__(self, model, extension, 'CHD', unitnumber)
        self.url = 'chd.htm'
        self.heading = '# CHD for MODFLOW, generated by Flopy.'

        if dtype is not None:
            self.dtype = dtype
        else:
            self.dtype = self.get_default_dtype()
        self.stress_period_data = mflist(model, self.dtype, stress_period_data)

        self.np = 0
        self.parent.add_package(self)
Beispiel #57
0
    def __init__(self,
                 model,
                 hnoflo=-9999.,
                 hdry=-8888.,
                 def_face_ct=0,
                 bud_label=None,
                 def_iface=None,
                 laytyp=0,
                 ibound=1,
                 prsity=0.30,
                 prsityCB=0.30,
                 extension='mpbas',
                 unitnumber=86):
        """
        Package constructor.

        """
        Package.__init__(self, model, extension, 'MPBAS', unitnumber)
        nrow, ncol, nlay, nper = self.parent.mf.nrow_ncol_nlay_nper
        self.parent.mf.get_name_file_entries()
        self.heading1 = '# MPBAS for Modpath, generated by Flopy.'
        self.heading2 = '#'
        self.hnoflo = hnoflo
        self.hdry = hdry
        self.def_face_ct = def_face_ct
        self.bud_label = bud_label
        self.def_iface = def_iface
        self.laytyp = laytyp
        self.__ibound = util_3d(model, (nlay, nrow, ncol),
                                np.int,
                                ibound,
                                name='ibound',
                                locat=self.unit_number[0])

        self.prsity = prsity
        self.prsityCB = prsityCB
        self.prsity = util_3d(model,(nlay,nrow,ncol),np.float32,\
                              prsity,name='prsity',locat=self.unit_number[0])
        self.prsityCB = util_3d(model,(nlay,nrow,ncol),np.float32,\
                                prsityCB,name='prsityCB',locat=self.unit_number[0])
        self.parent.add_package(self)
Beispiel #58
0
 def __init__(self, model, mxiter=50, iiter=30, iadamp=0, \
              hclose=1e-5, rclose=1e-5, relax=1.0, ioutgmg=0, \
              ism=0, isc=0, damp=1.0,dup=0.75,dlow=0.01,\
              chglimit=1.0,extension='gmg', unitnumber=27):
     Package.__init__(self, model, extension, 'GMG', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
     self.heading = '# GMG for MODFLOW, generated by Flopy.'
     self.url = 'gmg.htm'
     self.mxiter = mxiter
     self.iiter = iiter
     self.iadamp = iadamp
     self.hclose = hclose
     self.rclose = rclose
     self.relax = relax
     self.ism = ism
     self.isc = isc
     self.dup = dup
     self.dlow = dlow
     self.chglimit = chglimit
     self.damp = damp
     self.ioutgmg = ioutgmg
     self.iunitmhc = 0
     self.parent.add_package(self)