Finite-difference flownet seepage solver for dam–foundation problems.
Project description
flownetpy
Finite-difference flownet seepage solver for dam–foundation problems.
flownetpy solves the steady-state groundwater flow equation:
∇ · (K ∇h) = 0
using a structured 2D finite-difference formulation with optional upstream and downstream cutoff walls.
Features
- 2D finite-difference solver for steady-state seepage
- Upstream and/or downstream vertical cutoff walls
- Darcy velocity field computation
- Seepage discharge calculation
- Equipotential contours and streamline plotting
- Clean object-oriented API
Installation
Install from PyPI:
pip install flownetpy
Development install (from project root):
pip install -e .
Quick Example
The example below solves a dam foundation seepage problem with both upstream and downstream cutoffs and generates a flownet plot.
import flownetpy as fn
# Geometry definition
geom = fn.Geometry(
dam_height=5.0,
base_width=10.0,
top_width=4.0,
embed_depth=0.5,
left_domain=20.0,
right_domain=20.0,
bottom_domain=10.0,
grid_x=1.0,
grid_y=1.0,
)
# Boundary conditions
bc = fn.BoundaryConditions(
us_head=4.0,
ds_head=1.0,
)
# Cutoff wall configuration
cutoffs = fn.CutoffConfig(
us_cutoff_width=1.0,
us_cutoff_depth=5.0,
ds_cutoff_width=1.0,
ds_cutoff_depth=5.0,
)
# Solver configuration
solver = fn.SolverConfig(
k=1e-5,
tol=1e-4,
max_iter=500,
)
# Run seepage analysis
result = fn.run_seepage(
geom,
bc,
cutoffs,
solver,
compute_velocity=True,
)
print("Seepage discharge Q' =", result.Q, "m²/s")
# Plot flownet
fn.plot_flownet(
result,
geom,
bc,
cutoffs,
savepath="flow_net.png",
)
Package Structure
types.py— Core data structures (Geometry, BoundaryConditions, CutoffConfig, SolverConfig, Result)solver.py— Finite-difference numerical solverapi.py— Public API functionsplotting.py— Visualization utilities
Mathematical Model
The solver computes hydraulic head distribution under steady-state conditions:
∇ · (K ∇h) = 0
For homogeneous hydraulic conductivity, this reduces to the Laplace equation:
∇²h = 0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file damflownet-0.1.1.tar.gz.
File metadata
- Download URL: damflownet-0.1.1.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6f4d67d4804451923367abd85f054324db998bb0d965d2ece46480d1a270f56
|
|
| MD5 |
37e67034c1d0db8e79b76ee8abe9972e
|
|
| BLAKE2b-256 |
34e7c1f70eab97ad385a3ec0755412e874eef0c93871d81b0fa6bc07e0a78211
|
File details
Details for the file damflownet-0.1.1-py3-none-any.whl.
File metadata
- Download URL: damflownet-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
697bc6681daed2a4f3b560fc353e8fcd6f10590917f45a335aff3fb02117946f
|
|
| MD5 |
3844ea656960fbfb75d36f79173c8ad1
|
|
| BLAKE2b-256 |
c3b26b181f4f17fe3c8a18a11986acffde7cb557c3013dc7ce74b08b619db5b3
|