示例#1
0
 def get_package(self, _mf):
     content = self.merge()
     return mf.ModflowRiv(_mf,
                          ipakcb=content['ipakcb'],
                          stress_period_data=content['stress_period_data'],
                          dtype=content['dtype'],
                          extension=content['extension'],
                          unitnumber=content['unitnumber'],
                          options=content['options'])
 def get_package(self, _mf):
     content = self.merge()
     return mf.ModflowRiv(_mf, **content)
示例#3
0
    def create_package(self, name, content):
        if name == 'mf':
            model_ws = os.path.realpath(os.path.join(self._data_folder, self._model_id, content['model_ws']))
            if not os.path.exists(model_ws):
                os.makedirs(model_ws)

            self._mf = mf.Modflow(
                modelname=content['modelname'],
                exe_name=content['exe_name'],
                version=content['version'],
                model_ws=model_ws
            )
        if name == 'dis':
            mf.ModflowDis(
                self._mf,
                nlay=content['nlay'],
                nrow=content['nrow'],
                ncol=content['ncol'],
                nper=content['nper'],
                delr=content['delr'],
                delc=content['delc'],
                laycbd=content['laycbd'],
                top=content['top'],
                botm=content['botm'],
                perlen=content['perlen'],
                nstp=content['nstp'],
                tsmult=content['tsmult'],
                steady=content['steady'],
                itmuni=content['itmuni'],
                lenuni=content['lenuni'],
                extension=content['extension'],
                unitnumber=content['unitnumber'],
                xul=content['xul'],
                yul=content['yul'],
                rotation=content['rotation'],
                proj4_str=content['proj4_str'],
                start_datetime=content['start_datetime']
            )
        if name == 'bas':
            mf.ModflowBas(
                self._mf,
                ibound=content['ibound'],
                strt=content['strt'],
                ifrefm=content['ifrefm'],
                ixsec=content['ixsec'],
                ichflg=content['ichflg'],
                stoper=content['stoper'],
                hnoflo=content['hnoflo'],
                extension=content['extension'],
                unitnumber=content['unitnumber']
            )
        if name == 'lpf':
            mf.ModflowLpf(
                self._mf,
                laytyp=content['laytyp'],
                layavg=content['layavg'],
                chani=content['chani'],
                layvka=content['layvka'],
                laywet=content['laywet'],
                ipakcb=content['ipakcb'],
                hdry=content['hdry'],
                iwdflg=content['iwdflg'],
                wetfct=content['wetfct'],
                iwetit=content['iwetit'],
                ihdwet=content['ihdwet'],
                hk=content['hk'],
                hani=content['hani'],
                vka=content['vka'],
                ss=content['ss'],
                sy=content['sy'],
                vkcb=content['vkcb'],
                wetdry=content['wetdry'],
                storagecoefficient=content['storagecoefficient'],
                constantcv=content['constantcv'],
                thickstrt=content['thickstrt'],
                nocvcorrection=content['nocvcorrection'],
                novfc=content['novfc'],
                extension=content['extension'],
                unitnumber=content['unitnumber']
            )
        if name == 'pcg':
            mf.ModflowPcg(
                self._mf,
                mxiter=content['mxiter'],
                iter1=content['iter1'],
                npcond=content['npcond'],
                hclose=content['hclose'],
                rclose=content['rclose'],
                relax=content['relax'],
                nbpol=content['nbpol'],
                iprpcg=content['iprpcg'],
                mutpcg=content['mutpcg'],
                damp=content['damp'],
                dampt=content['dampt'],
                ihcofadd=content['ihcofadd'],
                extension=content['extension'],
                unitnumber=content['unitnumber']
            )
        if name == 'oc':
            mf.ModflowOc(
                self._mf,
                ihedfm=content['ihedfm'],
                iddnfm=content['iddnfm'],
                chedfm=content['chedfm'],
                cddnfm=content['cddnfm'],
                cboufm=content['cboufm'],
                compact=content['compact'],
                stress_period_data=self.get_stress_period_data(content['stress_period_data']),
                extension=content['extension'],
                unitnumber=content['unitnumber']
            )
        if name == 'risdlkfjlv':
            mf.ModflowRiv(
                self._mf,
                ipakcb=content['ipakcb'],
                stress_period_data=content['stress_period_data'],
                dtype=content['dtype'],
                extension=content['extension'],
                unitnumber=content['unitnumber'],
                options=content['options'],
                naux=content['naux']
            )
        if name == 'wel':
            mf.ModflowWel(
                self._mf,
                ipakcb=content['ipakcb'],
                stress_period_data=content['stress_period_data'],
                dtype=content['dtype'],
                extension=content['extension'],
                unitnumber=content['unitnumber'],
                options=content['options']
            )
        if name == 'rch':
            mf.ModflowRch(
                self._mf,
                ipakcb=content['ipakcb'],
                nrchop=content['nrchop'],
                rech=content['rech'],
                extension=content['extension'],
                unitnumber=content['unitnumber']
            )
        if name == 'chd':
            mf.ModflowChd(
                self._mf,
                stress_period_data=content['stress_period_data'],
                dtype=content['dtype'],
                options=content['options'],
                extension=content['extension'],
                unitnumber=content['unitnumber']
            )

        if name == 'ghb':
            mf.ModflowGhb(
                self._mf,
                ipakcb=content['ipakcb'],
                stress_period_data=content['stress_period_data'],
                dtype=content['dtype'],
                options=content['options'],
                extension=content['extension'],
                unitnumber=content['unitnumber']
            )
示例#4
0
riv_bot = -5.7
conductance = int(sys.argv[1])
sp =  [
		[0, 0, 0, stage, conductance, riv_bot],
		[0, 0, 1, stage, conductance, riv_bot],
		[0, 0, 2, stage, conductance, riv_bot],
		[0, 0, 3, stage, conductance, riv_bot],
		[0, 0, 4, stage, conductance, riv_bot],
		[0, 0, 5, stage, conductance, riv_bot],
		[0, 0, 6, stage, conductance, riv_bot],
		[0, 0, 7, stage, conductance, riv_bot],
		[0, 0, 8, stage, conductance, riv_bot],
		[0, 0, 9, stage, conductance, riv_bot],
		[0, 0, 10, stage, conductance, riv_bot],
       ] 
riv = mf.ModflowRiv(ml, stress_period_data=sp)
 
# instantiation of the solver with default values
pcg = mf.ModflowPcg(ml)

# instantiation of the output control with default values
oc = mf.ModflowOc(ml)

timeStartWritingInput = datetime.now()
ml.write_input()
timeStartRunningModel = datetime.now()
ml.run_model()
timeEndRunningModel = datetime.now()
print "Time writing input: "+str(timeStartRunningModel-timeStartWritingInput)
print "Calculation Time: "+str(timeEndRunningModel-timeStartRunningModel)
示例#5
0
文件: GGOR.py 项目: jonathanqv/GGOR
                    nper=NPER,
                    perlen=PERLEN,
                    nstp=NSTP,
                    steady=STEADY)
bas = fm.ModflowBas(mf, ibound=IBOUND, strt=STRTHD)
lpf = fm.ModflowLpf(mf,
                    hk=HK,
                    vka=VKA,
                    chani=[1.e-20, 1.e-20],
                    sy=SY,
                    ss=SS,
                    laytyp=LAYTYP,
                    vkcb=VKCB,
                    ipakcb=53)
ghb = fm.ModflowGhb(mf, stress_period_data=GHB, ipakcb=53)
riv = fm.ModflowRiv(mf, stress_period_data=RIV, ipakcb=53)
drn = fm.ModflowDrn(mf, stress_period_data=DRN, ipakcb=53)
wel = fm.ModflowWel(mf, stress_period_data=SEEP, ipakcb=53)
rch = fm.ModflowRch(mf, nrchop=3, rech=RECH, ipakcb=53)
evt = fm.ModflowEvt(mf, nevtop=3, evtr=EVTR, ipakcb=53)
oc = fm.ModflowOc(mf, stress_period_data=OC, compact=True)
#pcg = fm.ModflowPcg(mf, mxiter=200, iter1=200, hclose=0.001, rclose=0.001)
sms = fm.ModflowSms(mf)  #, mxiter=200, iter1=200, hclose=0.001, rclose=0.001)

#%% Write the model input files and run MODFLOW
mf.write_input()
success, mfoutput = mf.run_model(silent=False, pause=False)

print('Running success = {}'.format(success))
if not success:
    raise Exception('MODFLOW did not terminate normally.')