Skip to main content

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 damflownet

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 solver
  • api.py — Public API functions
  • plotting.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

damflownet-0.1.3.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

damflownet-0.1.3-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file damflownet-0.1.3.tar.gz.

File metadata

  • Download URL: damflownet-0.1.3.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

Hashes for damflownet-0.1.3.tar.gz
Algorithm Hash digest
SHA256 365012caa014d6871cc5736f308d064e7e836fb40f3f9fdf713240ababae5ca0
MD5 ddc676a547c6f07964216647559ad1aa
BLAKE2b-256 eebc598bc5c84cf35cbee8a65c1ea6f7ae0cba165a9c70bc987f63c8e15ffbf4

See more details on using hashes here.

File details

Details for the file damflownet-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: damflownet-0.1.3-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

Hashes for damflownet-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 29c5da1beb50fe47fbe436b611420f4c6bb1c03952495ac242d35f8f235fa7fa
MD5 a77a9c26adc60a8f59b9c7efe2160080
BLAKE2b-256 a6227f2e4b1ec7da6cd0f8b20dd078d74bb1dc6975bb9cda91256d92316c78e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page