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.2.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.2-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: damflownet-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 48113123277fa5c0e9c209a474bd350a5e3d41d1bd1445fd88934a5584f929c0
MD5 df4ce1452b60f545c1b658aa9b651f11
BLAKE2b-256 20f8deb3002d034da219308a9401d094667a97c196db5c42f8eeffe323b8b956

See more details on using hashes here.

File details

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

File metadata

  • Download URL: damflownet-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 71fe9aac324e21511b2633d40c14391be243c8dee1be5efcd7ec58b3dd0e036c
MD5 74b2a8f8f731323c664c38b820ae7d75
BLAKE2b-256 b46a0b217585c2be13ce28ad5c57795385be942368f865a11957263a344ce0a3

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