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.prsity2 = self.assignarray((nlay, nrow, ncol), np.float, prsity2, name='prsity2') self.srconc = self.assignarray((nlay, nrow, ncol), np.float, srconc, name='srconc') self.sp1 = self.assignarray((nlay, nrow, ncol), np.float, sp1, name='sp1') self.sp2 = self.assignarray((nlay, nrow, ncol), np.float, sp2, name='sp2') self.rc1 = self.assignarray((nlay, nrow, ncol), np.float, rc1, name='rc1') self.rc2 = self.assignarray((nlay, nrow, ncol), np.float, rc2, name='rc2') self.parent.add_package(self) return
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
def __init__(self, model, nlay=1, nrow=2, ncol=2, nper=1, delr=1.0, delc=1.0, laycbd=1, top=1, botm=0, perlen=1, nstp=1, tsmult=1, steady=True, itmuni=4, lenuni=2, extension='dis', unitnumber=11): Package.__init__(self, model, extension, 'DIS', unitnumber) # Call ancestor's init to set self.parent, extension, name and unit number 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 = self.assignarray((self.nlay,), np.int, laycbd, name='laycbd') self.laycbd = util_2d(model,(self.nlay,),np.int,laycbd,name='laycbd') self.laycbd[-1] = 0 # bottom layer must be zero self.delr = util_2d(model,(self.ncol,),np.float32,delr,name='delr',locat=self.unit_number[0]) self.delc = util_2d(model,(self.nrow,),np.float32,delc,name='delc',locat=self.unit_number[0]) self.top = util_2d(model,(self.nrow,self.ncol),np.float32,top,name='model_top',locat=self.unit_number[0]) self.botm = util_3d(model,(self.nlay+sum(self.laycbd),self.nrow,self.ncol),np.float32,botm,'botm',locat=self.unit_number[0]) #if (not self.checklayerthickness()): # if self.parent.silent == 0: print 'Warning: Cells with zero-layer thickness encountered!' self.perlen = util_2d(model,(self.nper,),np.float32,perlen,name='perlen') self.nstp = util_2d(model,(self.nper,),np.int,nstp,name='nstp') self.tsmult = util_2d(model,(self.nper,),np.float32,tsmult,name='tsmult') self.steady = util_2d(model,(self.nper,),np.bool,steady,name='steady') self.itmuni = itmuni self.lenuni = lenuni self.parent.add_package(self)
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)
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.parent.add_package(self) return
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 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.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 = 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,hk,name='hani',locat=self.unit_number[0]) self.vka = util_3d(model,(nlay,nrow,ncol),np.float32,hk,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.wetdry = util_3d(model,(nlay,nrow,ncol),np.float32,wetdry,name='wetdry',locat=self.unit_number[0]) self.parent.add_package(self)
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)
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)
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_old( self.nu, nu ) for i in range(nlay): self.assignarray_old( self.zeta[i], zeta[i] ) self.assignarray_old( self.ssz, ssz ) self.assignarray_old( self.isource, isource ) self.parent.add_package(self)
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
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 (SWI2) 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_old(self.nu, nu) for i in range(nlay): self.assignarray_old(self.zeta[i], zeta[i]) self.assignarray_old(self.ssz, ssz) self.assignarray_old(self.isource, isource) # self.obsnam = obsnam self.obslrc = obslrc # self.parent.add_package(self)
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)
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)
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)
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 (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.trpt = self.assignarray((nlay, ), np.float, trpt, name='trpt', load=model.load) self.trpv = self.assignarray((nlay, ), np.float, trpv, name='trpv', load=model.load) if self.multiDiff: self.dmcoef = [] for c in range(ncomp): self.dmcoef.append( self.assignarray((nlay, nrow, ncol), np.float, dmcoef[c], name='dmcoef_sp_' + str(c), load=model.load)) else: self.dmcoef = self.assignarray((nlay, ), np.float, dmcoef, name='dmcoef', load=model.load) self.parent.add_package(self) return
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)
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)
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)
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)
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 # Set values of all parameters self.intercellt = self.assignarray( (nlay, ), np.int, intercellt, name='intercellt' ) # Specifies how to compute intercell conductance self.laycon = self.assignarray( (nlay, ), np.int, laycon, name='laycon') # Specifies the layer type (LAYCON) self.trpy = self.assignarray( (nlay, ), np.float, trpy, name='trpy') # Horizontal anisotropy factor for each layer 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 = self.assignarray((nlay, nrow, ncol), np.float, tran, name='tran', load=True) self.hy = self.assignarray((nlay, nrow, ncol), np.float, hy, name='hy', load=True) self.vcont = self.assignarray((nlay - 1, nrow, ncol), np.float, vcont, name='vcont', load=True) self.sf1 = self.assignarray((nlay, nrow, ncol), np.float, sf1, name='sf1', load=True) self.sf2 = self.assignarray((nlay, nrow, ncol), np.float, sf2, name='sf2', load=True) self.wetdry = self.assignarray((nlay, nrow, ncol), np.float, wetdry, name='wetdry', load=True) self.parent.add_package(self)
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)
def __init__(self, model, ncomp=None, 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) 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 self.prsity = util_3d(model,(nlay,nrow,ncol),np.float32,\ prsity,name='prsity',locat=self.unit_number[0]) self.icbund = util_3d(model,(nlay,nrow,ncol),np.int,\ icbund,name='icbund',locat=self.unit_number[0]) # Starting concentrations #--some defense if np.isscalar(sconc) and ncomp is None: print 'setting ncomp == 1 and tiling scalar-valued sconc to nlay' sconc = [sconc] ncomp = 1 elif ncomp != len(sconc): raise Exception('BTN input error - ncomp not equal to len(sconc)') self.ncomp = ncomp self.sconc = [] for i in range(ncomp): u3d = util_3d(model,(nlay,nrow,ncol),np.float32,sconc[i],\ name='sconc'+str(i+1),locat=self.unit_number[0]) self.sconc.append(u3d) self.dt0 = util_2d(model,(nper,),np.float32,dt0,name='dt0') self.mxstrn = util_2d(model,(nper,),np.int,mxstrn,name='mxstrn') self.ttsmult = util_2d(model,(nper,),np.float32,ttsmult,name='ttmult') self.ttsmax = util_2d(model,(nper,),np.float32,ttsmax,name='ttsmax') self.parent.add_package(self)
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 (SWI2) 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_old( self.nu, nu ) for i in range(nlay): self.assignarray_old( self.zeta[i], zeta[i] ) self.assignarray_old( self.ssz, ssz ) self.assignarray_old( self.isource, isource ) # self.obsnam = obsnam self.obslrc = obslrc # self.parent.add_package(self)
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
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)
def __init__(self, model, mxiter=1, iter1=50, isolve=3, ncrs=0, accl=1, cclose=1e-5, iprgcg=0, extension='gcg'): #Call ancestor's init to set self.parent, extension, name and #unit number Package.__init__(self, model, extension, 'GCG', 35) self.mxiter = mxiter self.iter1 = iter1 self.isolve = isolve self.ncrs = ncrs self.accl = accl self.cclose = cclose self.iprgcg = iprgcg self.parent.add_package(self) return
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)
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)
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)
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)
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_old(self.laytyp, laytyp) self.assignarray_old(self.layavg, layavg) self.assignarray_old(self.chani, chani) self.assignarray_old(self.layvka, layvka) self.assignarray_old(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_old(self.hk, hk) self.assignarray_old(self.hani, hani) self.assignarray_old(self.vka, vka) self.assignarray_old(self.ss, ss) self.assignarray_old(self.sy, sy) self.assignarray_old(self.vkcb, vkcb) self.parent.add_package(self)
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)
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)
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)
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 i,a in enumerate(surf): s = util_2d(model,(nrow,ncol),np.float32,a,name='surf_'+str(i+1)) self.surf = self.surf + [s] if (not isinstance(evtr, list)): evtr = [evtr] for i,a in enumerate(evtr): e = util_2d(model,(nrow,ncol),np.float32,a,name='etvr_'+str(i+1)) self.evtr = self.evtr + [e] if (not isinstance(exdp, list)): exdp = [exdp] for i,a in enumerate(exdp): e = util_2d(model,(nrow,ncol),np.float32,a,name='exdp_'+str(i+1)) self.exdp = self.exdp + [e] if (not isinstance(ievt, list)): ievt = [ievt] for i,a in enumerate(ievt): iv = util_2d(model,(nrow,ncol),np.int,a,name='ievt_'+str(i+1)) self.ievt = self.ievt + [iv] self.np = 0 self.parent.add_package(self)
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)
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)
def __init__(self, model, nrchop=3, irchcb=0, rech=1e-3, irch=1, extension='rch', unitnumber=19, bin=False): ''' ''' 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.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), bin=bin) 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)
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 = np.empty((nrow, ncol, nlay), dtype='int32') # IBOUND array self.strt = np.empty((nrow, ncol, nlay)) # Starting heads # Set values of all parameters #self.__ibound = self.assignarray((nlay,nrow,ncol), np.int, ibound, name='ibound', load=True) self.__ibound = util_3d(model, (nlay, nrow, ncol), np.int, ibound, name='ibound', locat=self.unit_number[0]) #self.strt = self.assignarray((nlay,nrow,ncol), np.float, strt, name='strt', load=model.load) 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 = '' # 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)
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)
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 # Set values of all parameters self.intercellt = self.assignarray((nlay,), np.int, intercellt, name='intercellt') # Specifies how to compute intercell conductance self.laycon = self.assignarray((nlay,), np.int, laycon, name='laycon') # Specifies the layer type (LAYCON) self.trpy = self.assignarray((nlay,), np.float, trpy, name='trpy') # Horizontal anisotropy factor for each layer 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 = self.assignarray((nlay,nrow,ncol), np.float, tran, name='tran', load=True) self.hy = self.assignarray((nlay,nrow,ncol), np.float, hy, name='hy', load=True) self.vcont = self.assignarray((nlay-1,nrow,ncol), np.float, vcont, name='vcont', load=True) self.sf1 = self.assignarray((nlay,nrow,ncol), np.float, sf1, name='sf1', load=True) self.sf2 = self.assignarray((nlay,nrow,ncol), np.float, sf2, name='sf2', load=True) self.wetdry = self.assignarray((nlay,nrow,ncol), np.float, wetdry, name='wetdry', load=True) self.parent.add_package(self)
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_old( self.laytyp, laytyp ) self.assignarray_old( self.layavg, layavg ) self.assignarray_old( self.chani, chani ) self.assignarray_old( self.layvka, layvka ) self.assignarray_old( 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_old( self.hk, hk ) self.assignarray_old( self.hani, hani ) self.assignarray_old( self.vka, vka ) self.assignarray_old( self.ss, ss ) self.assignarray_old( self.sy, sy ) self.assignarray_old( self.vkcb, vkcb ) self.parent.add_package(self)
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.parent.add_package(self) return
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_old(self.nu, nu) for i in range(nlay): self.assignarray_old(self.zeta[i], zeta[i]) self.assignarray_old(self.ssz, ssz) self.assignarray_old(self.isource, isource) self.parent.add_package(self)
def __init__(self, model, nrchop=3, irchcb=0, rech=1e-3, irch=1, extension ='rch', unitnumber=19,bin=False): ''' ''' 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.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),bin=bin) 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)
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)
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)
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 (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.trpt = self.assignarray((nlay,), np.float, trpt, name='trpt', load=model.load) self.trpv = self.assignarray((nlay,), np.float, trpv, name='trpv', load=model.load) if self.multiDiff: self.dmcoef = [] for c in range(ncomp): self.dmcoef.append(self.assignarray( (nlay, nrow, ncol), np.float, dmcoef[c], name='dmcoef_sp_'+str(c), load=model.load)) else: self.dmcoef = self.assignarray((nlay,), np.float, dmcoef, name='dmcoef', load=model.load) self.parent.add_package(self) return
def __init__(self, model,ihedfm=0,iddnfm=0,item2=[[0,1,0,1]], \ item3=[[0,0,1,0]],extension=['oc','hds','ddn','cbc'],\ unitnumber=[14, 51, 52, 53],save_head_every=None,\ words=None,compact=False,chedfm=None,cddnfm=None): ''' words = list containing any of ['head','drawdown','budget'] optionally, words in a 2-D list of shape: [[per,stp,'head','drawdown','budget']], where per,stp is the stress period,time step of output. To print heads/drawdowns, ihedfm/iddnfm must be non-zero ''' # Call ancestor's init to set self.parent, # extension, name and unit number Package.__init__(self, model, extension, \ ['OC', 'DATA(BINARY)', 'DATA(BINARY)',\ 'DATA(BINARY)'], unitnumber, \ extra=['','REPLACE','REPLACE','REPLACE']) self.heading = '# Output control package file'+\ ' for MODFLOW, generated by Flopy.' if words is not None: self.heading += ' Output control by words option' self.url = 'oc.htm' self.ihedfm = ihedfm self.iddnfm = iddnfm self.chedfm = chedfm self.cddnfm = cddnfm #--using words if words is not None: if save_head_every is None: raise TypeError,\ 'to use the words OC option, save_head_every must be used' hflag, dflag = False, False if 'head' in words and ihedfm != 0: hflag = True if 'drawdown' in words and iddnfm != 0: dflat = True self.words = [] self.compact = compact #--first try for simple 1-d list try: for w in words: self.words.append(w.upper()) #--build a list of word output options word_list = [] nstp = self.parent.get_package('DIS').nstp for p in range(len(nstp)): for s in range(nstp[p]): if s % save_head_every == 0: word_list.append('PERIOD {0:5.0f} STEP {1:5.0f}\n'\ .format(p+1,s+1)) for w in words: word_list.append(' SAVE ' + w.upper() + '\n') if hflag: word_list.append(' PRINT HEAD\n') if dflag: word_list.append(' PRINT DRAWDOWN\n') word_list.append('\n') self.word_list = word_list #--try for a 2-d list except: word_list = [] self.words = [] for i in words: p, s = int(i[0]), int(i[1]) wwords = i[2:] word_list.append('PERIOD {0:5.0f} STEP {1:45.0f}\n'\ .format(p,s)) for w in wwords: word_list.append(' SAVE ' + w.upper() + '\n') if w.upper() not in self.words: self.words.append(w.upper()) if hflag: word_list.append(' PRINT HEAD\n') if dflag: word_list.append(' PRINT DRAWDOWN\n') word_list.append('\n') self.word_list = (word_list) #--numeric codes else: self.words = None dummy, self.item2 = self.assign_layer_row_column_data(item2, 4) if (item2 != None): error_message = 'item2 must have 4 columns' if (not isinstance(item2, list)): item2 = [item2] for a in item2: assert len(a) == 4, error_message self.item2 = item2 if (item3 != None): error_message = 'item3 must have 4 columns' if (not isinstance(item3, list)): item3 = [item3] for a in item3: assert len(a) == 4, error_message self.item3 = item3 if save_head_every is not None: nstp = self.parent.get_package('DIS').nstp self.item3 = [] #len(nstp) is the number of stress periods for p in range(len(nstp)): for s in range(1, nstp[p] + 1): if s % save_head_every == 0: self.item3.append([0, 0, 1, 0]) else: self.item3.append([0, 0, 0, 0]) self.parent.add_package(self)