示例#1
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'):
     package.__init__(self, model, extension, 'PHC', 38) # Call ancestor's init to set self.parent, extension, name and unit number
     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)
示例#2
0
 def __init__(self, model, npln=1, istrat=1, iswizt=53, nprn=1, toeslope=0.05, tipslope=0.05, \
              zetamin=0.005, delzeta=0.05, nu=0.025, zeta=[], ssz=[], isource=0, extension='swi', fname_output='swi.zta'):
     package.__init__(self, model) # Call ancestor's init to set self.parent
     nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
     self.unit_number = [29,53]
     self.extension = extension
     self.file_name = [ self.parent.name + '.' + self.extension, fname_output ]
     self.name = [ 'SWI', 'DATA(BINARY)' ]
     self.heading = '# Salt Water Intrusion package file for MODFLOW-2000, generated by Flopy.'
     self.npln = npln
     self.istrat = istrat
     self.iswizt = iswizt
     self.nprn = nprn
     self.toeslope = toeslope
     self.tipslope = tipslope
     self.zetamin = zetamin
     self.delzeta = delzeta
     # Create arrays so that they have the correct size
     if self.istrat == 1:
         self.nu = empty( self.npln+1 )
     else:
         self.nu = empty( self.npln+2 )
     self.zeta = []
     for i in range(nlay):
         self.zeta.append( empty((nrow, ncol, self.npln)) )
     self.ssz = empty((nrow, ncol, nlay))
     self.isource = empty((nrow, ncol, nlay),dtype='int32')
     # Set values of arrays
     self.assignarray( self.nu, nu )
     for i in range(nlay):
         self.assignarray( self.zeta[i], zeta[i] )
     self.assignarray( self.ssz, ssz )
     self.assignarray( self.isource, isource )
     self.parent.add_package(self)
示例#3
0
 def __init__(self, model, ibcfcb = 0, intercellt=0,laycon=3, trpy=1.0, hdry=-1E+30, iwdflg=0, wetfct=0.1, iwetit=1, ihdwet=0, \
              tran=1.0, hy=1.0, vcont=1.0, sf1=1e-5, sf2=0.15, wetdry=-0.01, extension='bcf', unitnumber=15):
     package.__init__(self, model, extension, 'BCF6', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
     self.url = 'bcf.htm'
     nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
     # First create arrays so that they have the correct size
     self.intercellt = np.empty(nlay, dtype='int32') # Specifies how to compute intercell conductance
     self.laycon = np.empty(nlay, dtype='int32') # Specifies the layer type (LAYCON) 
     self.trpy = np.ones(nlay) # Horizontal anisotropy factor for each layer
     # Set values of all parameters
     self.assignarray( self.intercellt, intercellt )
     self.assignarray( self.laycon, laycon )
     self.assignarray( self.trpy, trpy )
     self.ibcfcb = ibcfcb # 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.iwdflg = iwdflg # Flag that determines if the wetting capability is active
     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.tran = np.empty((nrow, ncol, nlay))
     self.hy = np.empty((nrow, ncol, nlay))
     self.vcont = np.empty((nrow, ncol, nlay - 1))
     self.sf1 = np.empty((nrow, ncol, nlay))
     self.sf2 = np.empty((nrow, ncol, nlay))
     self.wetdry = np.empty((nrow, ncol, nlay))
     self.tran = self.assignarray( self.tran, tran,load=True)
     self.hy = self.assignarray( self.hy, hy, load=True )
     self.vcont = self.assignarray( self.vcont, vcont,load=True )
     self.sf1 = self.assignarray( self.sf1, sf1, load=True )
     self.sf2 = self.assignarray( self.sf2, sf2,load=True )
     self.wetdry = self.assignarray( self.wetdry, wetdry,load=True )
     self.parent.add_package(self)
示例#4
0
 def __init__(self, model, nrchop=3, irchcb=0, rech=1e-3, irch=1, extension ='rch', unitnumber=19,external=True):
     '''
     external flag is used to control writing external arrays of constant values
     since this package has the potential to create a lot of external arrays
     '''
     package.__init__(self, model, extension, 'RCH', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
     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.external = external
     if self.external is False:
         load = True
     else:
         load = model.load
     self.rech = []
     self.irch = []
     if (not isinstance(rech, list)):
         rech = [rech]
     for a in rech:
         b = empty((nrow, ncol))
         b = self.assignarray(b , a,load=load )
         #print self.rech, b
         self.rech = self.rech + [b]
     if (not isinstance(irch, list)):
         irch = [irch]
     for a in irch:
         b = ones((nrow, ncol), dtype='int32')
         b = self.assignarray(b , a, load=load )
         self.irch = self.irch + [b]
     self.np = 0
     self.parent.add_package(self)
示例#5
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'):
     package.__init__(self, model, extension, 'RCT', 36) # Call ancestor's init to set self.parent, extension, name and unit number
     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 reaction variables are specified as 3-D arrays on a cell-by-cell basis
     self.igetsc = igetsc
     # First create arrays so that they have the correct size
     self.rhob = empty((nrow, ncol, nlay))
     self.prsity2 = empty((nrow, ncol, nlay))
     self.srconc = empty((nrow, ncol, nlay))
     self.sp1 = empty((nrow, ncol, nlay))
     self.sp2 = empty((nrow, ncol, nlay))
     self.rc1 = empty((nrow, ncol, nlay))
     self.rc2 = empty((nrow, ncol, nlay))
     # Set values of all parameters
     self.assignarray(self.rhob , rhob )
     self.assignarray(self.prsity2 , prsity2 )
     self.assignarray(self.srconc , srconc )
     self.assignarray(self.sp1 , sp1 )
     self.assignarray(self.sp2 , sp2 )
     self.assignarray(self.rc1 , rc1 )
     self.assignarray(self.rc2 , rc2 )
     self.parent.add_package(self)
示例#6
0
 def __init__(self, model, layer_row_column_shead_ehead=None, cosines=None, extension ='chd', unitnumber=24):
     package.__init__(self, model, extension, 'CHD', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
     self.url = 'chd.htm'
     self.heading = '# CHD for MODFLOW, generated by Flopy.'
     self.mxactc, self.layer_row_column_shead_ehead = self.assign_layer_row_column_data(layer_row_column_shead_ehead, 5)
     self.np = 0
     self.parent.add_package(self)
示例#7
0
 def __init__(self, model, al=0.01, trpt=0.1, trpv=0.01, dmcoef=1e-9, extension='dsp',multiDiff=False):
     '''
     if dmcoef is passed as a list of (nrow,ncol,nlay) arrays,
     then the multicomponent diffusion is activated
     '''
     package.__init__(self, model, extension, 'DSP', 33) # Call ancestor's init to set self.parent, extension, name and unit number
     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                                    
     # First create arrays so that they have the correct size
     self.al = empty((nrow, ncol, nlay))
     self.trpt = empty((nlay))
     self.trpv = empty((nlay))
     if self.multiDiff:
         self.dmcoef = []
         for c in range(ncomp):
             self.dmcoef.append(empty((nrow,ncol,nlay)))
     else:
         self.dmcoef = empty((nlay))
     # Set values of all parameters
     self.al = self.assignarray( self.al, al,load=model.load )  
     self.trpt = self.assignarray( self.trpt, trpt,load=model.load )
     self.trpv = self.assignarray( self.trpv, trpv,load=model.load )
     if self.multiDiff:
         for c in range(ncomp):
             self.dmcoef[c] = self.assignarray( self.dmcoef[c], dmcoef[c],load=model.load )    
     else:
         self.dmcoef = self.assignarray( self.dmcoef, dmcoef,load=model.load )
     self.parent.add_package(self)
示例#8
0
 def __init__(self, model, idrncb = 0, layer_row_column_elevation_cond=None, extension ='drn', unitnumber=21):
     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.idrncb = idrncb  # 0: no cell by cell terms are written
     self.mxactd, self.layer_row_column_elevation_cond = self.assign_layer_row_column_data(layer_row_column_elevation_cond, 5)
     self.np = 0
     self.parent.add_package(self)
示例#9
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)
示例#10
0
 def __init__(self, model, iwelcb=0, layer_row_column_Q=None, extension ='wel', unitnumber=20):
     package.__init__(self, model, extension, 'WEL', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
     self.heading = '# Well file for MODFLOW, generated by Flopy.'
     self.url = 'wel.htm'
     self.iwelcb = iwelcb # no cell by cell terms are written
     self.mxactw = 0
     self.mxactw, self.layer_row_column_Q = self.assign_layer_row_column_data(layer_row_column_Q, 4)
     self.np = 0
     self.parent.add_package(self)
示例#11
0
 def __init__(self, model, ighbcb=0, layer_row_column_head_cond=None, no_print=False, 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
     self.mxactb, self.layer_row_column_head_cond = self.assign_layer_row_column_data(layer_row_column_head_cond, 5)
     self.no_print = no_print
     self.np = 0
     self.parent.add_package(self)
示例#12
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)
示例#13
0
 def __init__(self, model, irivcb=0, layer_row_column_Q=None, extension ='riv', unitnumber=18):
     package.__init__(self, model, extension, 'RIV', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
     self.heading = '# RIV for MODFLOW, generated by Flopy.'
     self.url = 'riv.htm'
     self.irivcb = irivcb
     self.mxactr = 0
     self.mxactr, self.layer_row_column_Q = self.assign_layer_row_column_data(layer_row_column_Q, 6)
     self.np = 0
     self.parent.add_package(self)
示例#14
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)
示例#15
0
 def __init__(self, model, ncomp=1, mcomp=1, tunit='D', lunit='M', munit='KG', prsity=0.30, icbund=1, sconc=0.0, \
              cinact=1e30, thkmin=0.01, ifmtcn=0, ifmtnp=0, ifmtrf=0, ifmtdp=0, savucn=True, nprs=0, timprs=None, obs=None,
              nprobs=1, chkmas=True, nprmas=1, dt0=0, mxstrn=50000, ttsmult=1.0, ttsmax=0, species_names = [], extension='btn'):
     package.__init__(self, model, extension, 'BTN', 31) # Call ancestor's init to set self.parent, extension, name and unit number
     nrow, ncol, nlay, nper = self.parent.mf.nrow_ncol_nlay_nper
     self.heading1 = '# BTN for MT3DMS, generated by Flopy.'
     self.heading2 = '#'
     self.mcomp = mcomp
     self.tunit = tunit
     self.lunit = lunit
     self.munit = munit
     self.cinact = cinact
     self.thkmin = thkmin
     self.ifmtcn = ifmtcn
     self.ifmtnp = ifmtnp
     self.ifmtrf = ifmtrf
     self.ifmtdp = ifmtdp
     self.savucn = savucn
     self.nprs = nprs
     self.timprs = timprs
     self.obs = obs
     self.nprobs = nprobs
     self.chkmas = chkmas
     self.nprmas = nprmas
     self.species_names = species_names
     # First create arrays so that they have the correct size
     self.dt0 = empty(nper)
     self.mxstrn = empty(nper, 'int')
     self.ttsmult = empty(nper)
     self.ttsmax = empty(nper)
     self.prsity = empty((nrow, ncol, nlay)) # Porosity
     self.icbund = empty((nrow, ncol, nlay), dtype='int32') # ICBUND array
     # Set values of all parameters
     self.prsity = self.assignarray( self.prsity, prsity,load=model.load )
     self.icbund = self.assignarray( self.icbund, icbund ,load=True)
     # Starting concentrations
     self.ncomp = 0
     self.sconc = []
     if (sconc != None):
         if (not isinstance(sconc, list)):
             sconc = [sconc]
         for s in sconc:
             new_sconc = empty((nrow, ncol, nlay))
             new_sconc = self.assignarray( new_sconc, s,load=model.load )                                                
             self.sconc.append(new_sconc)                
             self.ncomp = self.ncomp + 1       
     #assert self.ncomp >= self.mcomp, 'NCOMP must be equal to or larger than MCOMP'
     self.assignarray( self.dt0, dt0 )
     self.assignarray( self.mxstrn, mxstrn )
     self.assignarray( self.ttsmult, ttsmult )
     self.assignarray( self.ttsmax, ttsmax )
     self.parent.add_package(self)
示例#16
0
 def __init__(self, model, npln=1, istrat=1, nobs=0, iswizt=55, iswibd=56, iswiobs=0, fsssopt=False, adaptive=False, \
              nsolver=1, iprsol=0, mutsol=3, \
              solver2params = {'mxiter':100, 'iter1':20, 'npcond':1, 'zclose':1e-3, 'rclose':1e-4, 'relax':1.0, 'nbpol':2, 'damp':1.0, 'dampt':1.0}, \
              toeslope=0.05, tipslope=0.05, alpha=None, beta=0.1, nadptmx=1, nadptmn=1, adptfct=1.0, \
              nu=0.025, zeta=[], ssz=[], isource=0, \
              obsnam=[], obslrc=[],
              extension=['swi','zta','swb'], unit_number=29):
     name = ['SWI', 'DATA(BINARY)', 'DATA(BINARY)']
     units = [unit_number,iswizt,iswibd]
     extra = ['','REPLACE','REPLACE']
     if nobs > 0:
         extension = name.append('zobs')
         name = name.append('DATA')
         units = units.append(iswiobs)
         extra = extra.append('')
     #package.__init__(self, model, ) # Call ancestor's init to set self.parent
     #package.__init__(self, model, extension, ['SWI', 'DATA(BINARY)', 'DATA(BINARY)'], [unit_number,iswizt,iswibd], extra=['','REPLACE','REPLACE']) # Call ancestor's init to set self.parent, extension, name and unit number
     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
     nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
     self.heading = '# Salt Water Intrusion package file for MODFLOW-2005, generated by Flopy.'
     #
     self.fsssopt, self.adaptive = fsssopt, adaptive
     #
     self.npln, self.istrat, self.nobs, self.iswizt, self.iswibd, self.iswiobs = npln, istrat, nobs, iswizt, iswibd, iswiobs
     #
     self.nsolver, self.iprsol, self.mutsol = nsolver, iprsol, mutsol
     #
     self.solver2params = solver2params
     #        
     self.toeslope, self.tipslope, self.alpha, self.beta = toeslope, tipslope, alpha, beta
     self.nadptmx, self.nadptmn, self.adptfct = nadptmx, nadptmn, adptfct
     # Create arrays so that they have the correct size
     if self.istrat == 1:
         self.nu = empty( self.npln+1 )
     else:
         self.nu = empty( self.npln+2 )
     self.zeta = []
     for i in range(nlay):
         self.zeta.append( empty((nrow, ncol, self.npln)) )
     self.ssz = empty((nrow, ncol, nlay))
     self.isource = empty((nrow, ncol, nlay),dtype='int32')
     # Set values of arrays
     self.assignarray( self.nu, nu )
     for i in range(nlay):
         self.assignarray( self.zeta[i], zeta[i] )
     self.assignarray( self.ssz, ssz )
     self.assignarray( self.isource, isource )
     #
     self.obsnam = obsnam
     self.obslrc = obslrc
     #
     self.parent.add_package(self)
示例#17
0
 def __init__(self, model, headtol = 1E-4, fluxtol = 500, maxiterout = 100, \
              thickfact = 1E-5, linmeth = 1, iprnwt = 0, ibotav = 0, options = 'COMPLEX', \
              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
     self.options = options
     self.parent.add_package(self)
示例#18
0
 def __init__(self, model, laytyp=0, layavg=0, chani=1.0, layvka=0, laywet=0, ilpfcb = 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
     self.ilpfcb = ilpfcb # 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.nplpf = 0 # number of LPF parameters
     # First create arrays so that they have the correct size
     self.laytyp = np.empty(nlay, dtype='int32') # Specifies both the layer type (LAYCON) and the method of computing interblock conductance
     self.layavg = np.ones(nlay, dtype='int32') # Interblock transmissivity flag for each layer
     self.chani = np.ones(nlay) # Horizontal anisotropy flag for each layer
     self.layvka = np.ones(nlay, dtype='int32') # vertical hydraulic conductivity flag for each layer
     self.laywet = np.ones(nlay, dtype='int32') # wet dry flag for each layer
     #self.laycbd = np.ones(nlay, dtype='int32') # confining bed flag for each layer
     # Set values of all parameters
     self.assignarray( self.laytyp, laytyp )
     self.assignarray( self.layavg, layavg )
     self.assignarray( self.chani, chani )
     self.assignarray( self.layvka, layvka )
     self.assignarray( self.laywet, 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.hk = np.empty((nrow, ncol, nlay))
     self.hani = np.empty((nrow, ncol, nlay))
     self.vka = np.empty((nrow, ncol, nlay))
     self.ss = np.empty((nrow, ncol, nlay))
     self.sy = np.empty((nrow, ncol, nlay))
     self.vkcb = np.empty((nrow, ncol, nlay))
     self.wetdry = np.empty((nrow, ncol, nlay))
     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 = self.assignarray( self.hk, hk,load=True )
     self.hani = self.assignarray( self.hani, hani,load=True )
     self.vka = self.assignarray( self.vka, vka,load=True )
     self.ss = self.assignarray( self.ss, ss,load=True )
     self.sy = self.assignarray( self.sy, sy,load=True )
     self.vkcb = self.assignarray( self.vkcb, vkcb,load=True )
     self.wetdry = self.assignarray( self.wetdry, wetdry,load=True )
     self.parent.add_package(self)
示例#19
0
 def __init__(self, model, mxiter=50, iter1=30, npcond=1, \
              hclose=1e-5, rclose=1e-5, relax=1.0, nbpol=0, iprpcg=0, mutpcg=3, damp=1.0, extension='pcg', unitnumber=27):
     package.__init__(self, model, extension, 'PCG', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
     self.heading = '# PCG for MODFLOW, generated by Flopy.'
     self.url = 'pcg.htm'
     self.mxiter = mxiter
     self.iter1 = iter1
     self.npcond = npcond
     self.hclose = hclose
     self.rclose = rclose
     self.relax = relax
     self.nbpol = nbpol
     self.iprpcg = iprpcg
     self.mutpcg = mutpcg
     self.damp = damp
     self.parent.add_package(self)
示例#20
0
 def __init__(self, model, nevtop=3, ievtcb=0, surf=0., evtr=1e-3, exdp=1., ievt=1, extension ='evt', unitnumber=22,external=True):
     '''
     external flag is used to control writing external arrays of constant value
     since this package has the potential to create a lot of external arrays
     '''
     package.__init__(self, model, extension, 'EVT', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
     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.ievtcb = ievtcb
     self.surf = []
     self.evtr = []
     self.exdp = []
     self.ievt = []        
     self.external = external
     if self.external is False:
         load = True
     else:
         load = model.load            
     if (not isinstance(surf, list)):
         surf = [surf]
     for a in surf:
         b = empty((nrow, ncol))
         b = self.assignarray(b , a, load=load )
         self.surf = self.surf + [b]
     if (not isinstance(evtr, list)):
         evtr = [evtr]
     for a in evtr:
         b = empty((nrow, ncol))
         b = self.assignarray(b , a,load=load )
         self.evtr = self.evtr + [b]
     if (not isinstance(exdp, list)):
         exdp = [exdp]
     for a in exdp:
         b = empty((nrow, ncol))
         b = self.assignarray(b , a,load=load )
         self.exdp = self.exdp + [b]
     if (not isinstance(ievt, list)):
         ievt = [ievt]
     for a in ievt:
         b = ones((nrow, ncol), dtype='int32')
         b = self.assignarray(b , a,load=load )
         self.ievt = self.ievt + [b]
     self.np = 0
     self.parent.add_package(self)
示例#21
0
 def __init__(self, model, ibound=1, strt=1.0, ixsec=False, ichflg=False, hnoflo=-999.99, extension='bas', unitnumber=13):
     package.__init__(self, model, extension, 'BAS6', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
     self.url = 'bas6.htm'
     nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
     # First create arrays so that they have the correct size
     self.__ibound = empty((nrow, ncol, nlay), dtype='int32') # IBOUND array
     self.strt = empty((nrow, ncol, nlay)) # Starting heads
     # Set values of all parameters
     
     self.assignarray( self.__ibound, ibound,load=True )       
     self.strt = self.assignarray( self.strt, strt,load=model.load )                
     self.heading = '# Basic package file for MODFLOW, generated by Flopy.'
     self.options = '' # Can be either or a combination of XSECTION, CHTOCH or FREE
     self.ixsec = ixsec # Flag for use of cross-section option
     self.ichflg = ichflg # Flag for calculation of flow between constant head cells
     self.ifrefm = True # Free format specifier is set to True, as other packages depend on that
     self.hnoflo = hnoflo # Head in no-flow cells
     self.parent.add_package(self)
示例#22
0
 def __init__(self, model, layer_row_column_shead_ehead=None, cosines=None, extension ='pbc', unitnumber=30):
     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
     self.mxactp, self.layer_row_column_shead_ehead = self.assign_layer_row_column_data(layer_row_column_shead_ehead, 5)
     self.mxcos, self.cosines = self.assign_layer_row_column_data(cosines, 3)
     '''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)
示例#23
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)
示例#24
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, wetdry=-0.01, storagecoefficient=False, constantcv=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 LPF parameters
     self.iphdry = iphdry
     # First create arrays so that they have the correct size
     self.laytyp = np.empty(nlay, dtype='int32') # Specifies both the layer type (LAYCON) and the method of computing interblock conductance
     self.layavg = np.ones(nlay, dtype='int32') # Interblock transmissivity flag for each layer
     self.chani = np.ones(nlay) # Horizontal anisotropy flag for each layer
     self.layvka = np.ones(nlay, dtype='int32') # vertical hydraulic conductivity flag for each layer
     self.laywet = np.ones(nlay, dtype='int32') # wet dry flag for each layer
     #self.laycbd = np.ones(nlay, dtype='int32') # confining bed flag for each layer
     # Set values of all parameters
     self.assignarray( self.laytyp, laytyp )
     self.assignarray( self.layavg, layavg )
     self.assignarray( self.chani, chani )
     self.assignarray( self.layvka, layvka )
     self.assignarray( self.laywet, laywet )
     self.hk = np.empty((nrow, ncol, nlay))
     self.hani = np.empty((nrow, ncol, nlay))
     self.vka = np.empty((nrow, ncol, nlay))
     self.ss = np.empty((nrow, ncol, nlay))
     self.sy = np.empty((nrow, ncol, nlay))
     self.vkcb = np.empty((nrow, ncol, nlay))
     self.assignarray( self.hk, hk )
     self.assignarray( self.hani, hani )
     self.assignarray( self.vka, vka )
     self.assignarray( self.ss, ss )
     self.assignarray( self.sy, sy )
     self.assignarray( self.vkcb, vkcb )
     self.parent.add_package(self)
示例#25
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'):
     package.__init__(self, model, extension, 'VDF', 37) # Call ancestor's init to set self.parent, extension, name and unit number
     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 = empty((nrow, ncol, nlay))
     self.assignarray( self.dense, dense )
     self.parent.add_package(self)
示例#26
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)
示例#27
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( 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)
示例#28
0
文件: mf.py 项目: jdhughes/PyClassMat
 def __init__(self, model, extension='list', unitnumber=2):
     package.__init__(self, model, extension, 'LIST', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number
示例#29
0
文件: mf.py 项目: jdhughes/PyClassMat
 def __init__(self, model, extension='glo'):
     package.__init__(self, model, extension, 'GLOBAL', 1) # Call ancestor's init to set self.parent, extension, name and unit number
示例#30
0
文件: mt.py 项目: jdhughes/PyClassMat
 def __init__(self, model, extension="list"):
     package.__init__(
         self, model, extension, "LIST", 7
     )  # Call ancestor's init to set self.parent, extension, name and unit number