{"id":22371715,"url":"https://github.com/upc-ghs/flopyrw","last_synced_at":"2025-07-30T20:32:21.270Z","repository":{"id":186791342,"uuid":"579954664","full_name":"upc-ghs/flopyrw","owner":"upc-ghs","description":"A Python interface based on FloPy to configure input files for MODPATH-RW","archived":false,"fork":false,"pushed_at":"2024-11-12T16:14:45.000Z","size":511,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-11-12T17:25:12.932Z","etag":null,"topics":["flopy","hydrogeology","modpath-rw","particles","python","solute-transport"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/upc-ghs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-19T11:06:00.000Z","updated_at":"2024-11-12T16:14:50.000Z","dependencies_parsed_at":"2023-10-12T17:43:44.592Z","dependency_job_id":"2e0068fa-8ab4-44cf-9d7e-53e3067f5f48","html_url":"https://github.com/upc-ghs/flopyrw","commit_stats":{"total_commits":191,"total_committers":2,"mean_commits":95.5,"dds":"0.010471204188481686","last_synced_commit":"500ec949581f4c319108c31690625b60f8520ffb"},"previous_names":["upc-ghs/flopyrw"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upc-ghs%2Fflopyrw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upc-ghs%2Fflopyrw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upc-ghs%2Fflopyrw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upc-ghs%2Fflopyrw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/upc-ghs","download_url":"https://codeload.github.com/upc-ghs/flopyrw/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228186879,"owners_count":17882212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flopy","hydrogeology","modpath-rw","particles","python","solute-transport"],"created_at":"2024-12-04T20:29:02.296Z","updated_at":"2024-12-04T20:29:03.154Z","avatar_url":"https://github.com/upc-ghs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## flopyrw\nAn extension of [FloPy](https://github.com/modflowpy/flopy) to write input simulation files for [MODPATH-RW](https://github.com/upc-ghs/modpath-rw) with Python.\n\n### Overview\nProvides classes extended from the `modpath` module in `flopy` adapted to specific structures required by MODPATH-RW. Also introduces new package writers required by the program, consistent with the [Documentation of Input-Output](https://github.com/upc-ghs/modpath-rw/blob/develop/doc/modpath-rw_IO_v100_.pdf). \n\n\n### Quickstart\n**Install**\n\nTo install the package from source, clone the repository:\n\n```\ngit clone https://github.com/upc-ghs/flopyrw\n```\nand install \n\n```\npip install -e /the/path/to/flopyrw/\n```\n\nYou can also install the current release from [PyPI](https://pypi.org/project/flopyrw/):\n\n```\npip install flopyrw\n```\n\n**Use it**\n\nClasses follow the same logic than `flopy`, configuring packages on top of a MODFLOW flow-model object. For example, the `flopy` quickstart case: \n\n```py\nimport os\nimport flopy\nfrom flopyrw import modpathrw\n\nws   = './mymodel'\nname = 'mymodel'\nsim  = flopy.mf6.MFSimulation(sim_name=name, sim_ws=ws, exe_name='mf6')\ntdis = flopy.mf6.ModflowTdis(sim)\nims  = flopy.mf6.ModflowIms(sim)\ngwf  = flopy.mf6.ModflowGwf(sim, modelname=name, save_flows=True)\ndis  = flopy.mf6.ModflowGwfdis(gwf, nrow=10, ncol=10)\nic   = flopy.mf6.ModflowGwfic(gwf)\nnpf  = flopy.mf6.ModflowGwfnpf(gwf, save_specific_discharge=True)\n# Same than in flopy quickstart,\n# but with an aux var for concentration.\nchd  = flopy.mf6.ModflowGwfchd(\n        gwf,\n        auxiliary=['CONCENTRATION'],\n        stress_period_data=[\n            [(0, 0, 0), 1.,1.],\n            [(0, 9, 9), 0.,0.]\n        ]\n    )\nbudget_file = name + '.bud'\nhead_file   = name + '.hds'\noc = flopy.mf6.ModflowGwfoc(gwf,\n        budget_filerecord=budget_file,\n        head_filerecord=head_file,\n        saverecord=[('HEAD', 'ALL'), ('BUDGET', 'ALL')]\n    )\nsim.write_simulation()\nsim.run_simulation()\n\n# Create a modpathrw model\n# By default executable is 'mpathrw'\nmprw = modpathrw.ModpathRW(flowmodel=gwf)\n\n# Random walk options\nmodpathrw.ModpathRWOpts(\n        mprw,\n        timestep = 'min',\n        ctdisp   = 0.1,\n        courant  = 0.1,\n        dimensionsmask=[1,1,0], # Random walk in x,y and not in z\n    )\n\n# Dispersion parameters \nmodpathrw.ModpathRWDsp( mprw, alphal=0.1, alphat=0.01,  dmeff=0.0 )\n\n# Basic package\nmodpathrw.ModpathRWBas( mprw, porosity=0.3 )\n\n# Define the solute source\n# In forward tracking, only cells with injecting flow-rate release particles\nmodpathrw.ModpathRWSrc(\n        mprw,\n        sources=(\n            'CHD', # package name\n            [            \n                [\n                    'CONCENTRATION', # aux variable\n                    0.001,           # particlesmass\n                    (4,4,1)          # template\n                ], \n            ],\n        ),\n    )\n\n# Configure the simulation \nsimconfig = {\n    'simulationtype'    : 'rwendpoint', \n    'trackingdirection' : 'forward',\n    'weaksinkoption'    : 'stop_at',\n    'weaksourceoption'  : 'pass_through',\n    'stoptimeoption'    : 'specified',\n    'stoptime'          : 20.0,\n}\nmprwsim = modpathrw.ModpathRWSim( mprw,  **simconfig )\n\n# Write the input files\nmprw.write_input()\n\n# And run \nmprw.run_model()\n\n# Get output and plot\nhead   = gwf.output.head().get_data()\nbud    = gwf.output.budget()\nepoint = flopy.utils.EndpointFile( os.path.join( ws, mprwsim.endpointfilename ) ) \nspdis  = bud.get_data(text='DATA-SPDIS')[0]\nqx, qy, qz = flopy.utils.postprocessing.get_specific_discharge(spdis, gwf)\npmv = flopy.plot.PlotMapView(gwf)\npmv.plot_array(head)\npmv.plot_grid(colors='white')\npmv.contour_array(head, levels=[.2, .4, .6, .8], linewidths=3.)\npmv.plot_vector(qx, qy, normalize=True, color=\"white\")\npmv.plot_endpoint( epoint.get_alldata(), zorder=10, s=4, linewidth=0.5, edgecolor='k' )\n```\n\u003cimg src=\"img/quickstart.png\" alt=\"plot\" style=\"width:30;height:30\"\u003e\n\n**Note**: In order to run a model via the interface a [MODPATH-RW](https://github.com/upc-ghs/modpath-rw) executable is required. \n\n\n### Testing\nA suite of [automated tests](autotest/) is available verifying different aspects of the interface and the program. In order to run these tests, some additional dependencies are required, which can be installed with:\n\n```\npip install \".[test]\"\n```\n\nYou can follow the [FloPy test guidelines](https://github.com/modflowpy/flopy/blob/develop/DEVELOPER.md#running-tests) for running and debugging tests. \n\nRun the complete test suite from the folder ``autotest`` with the command:\n\n```\npytest -s -v \n```\n\n## Resources\n* [flopy](https://github.com/modflowpy/flopy)\n* [MODPATH-RW](https://github.com/upc-ghs/modpath-rw)\n* [MODPATH](https://www.usgs.gov/software/modpath-particle-tracking-model-modflow)\n* [modpath-v7](https://github.com/MODFLOW-USGS/modpath-v7)\n* [modpath-omp](https://github.com/upc-ghs/modpath-omp)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupc-ghs%2Fflopyrw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fupc-ghs%2Fflopyrw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupc-ghs%2Fflopyrw/lists"}