K2dGrFlow, 2-dimensional groundwater flow
Background
In 2001 I ended a master year at the VUB. For that I had to work out a thesis. Doing research in groundwaterflow,
a subject was quickly found : Aspects of the numerical modelling of flow-problems in poreous media.
In normal words : make a GUI programm, that's free, quick and easy to use, to model a certain type of groundwaterflow.
Since it's a good thing to start with the easy things, we took steady state flow (no time dependancy), under heavy asumptions :
- As said, it is steady-state, so no time variation.
- The longitudinal component of the flow is very small, so may be discarded.
This means that we only must consider 2 directions : an x-direction in the horizontal plane, and a z-direction vertically.
- Only two types of boundary conditions, the first: impenatrable walls.
Physically this means that the border has a conductivity several orders below the groundlayer we consider, or the border is
a symmetry boundary over which we assume no flow (eg a water divide in the landscape).
- The other possible boundary condition is a Dirichlet condition that makes sence.
If a border is given by the points (xb,zb), then
the hydraulic head in that point may be zb or a X xb +b with a and b constants.
The first possibility means the hydraulic head
is the atmospheric pressure on the boundary, wich means it's the water table.
The second condition means it's a linear function in the x term. Since our problem is time-independant, the
flow through these borders must be kept constant. This means eg a steady rainfall model for the domain so that this is possible.
The programm computes the hydraulic head in every point. This is the solution to the equation
Read my master thesis if you're not convinced.
Extensions
- MANY bug fixes - June 2001. Results for the designed use of the program are now 100% correct, also for d not 0. For
this an extra parameter was added to correct for abberations on the Dirichlet boundary. In short, the matrix can be made to
behave better by multiplication by a factor of the values that correspond to Dirichlet nodes.
- Possibility to select the number of contours in the figure - August 2001
- Different problem to be solved. The user can now select between two formulas that can be solved over the domain - August 2001
- Extension, semi-infinite rectangles added as an extra division of the domain. These elements are automatically selected if
the user marks the bottom boundary (which has to be a vertical line), as a imaginary boundary where the domain goes to -infinity in
the z coordinate. This option has a new, third, solver, that solves for the Infinite Element Method - October 2001.
Screenshots
Two screenshots. First the programm in action. We see the general layout of the programm, with on the right a mesh that has
been constructed for the domain.
The next screenshot is from the dialog to input the borders.
The code, application and galerkin solver
The code has been written for linux under the GPL licence. It's written with Kdevelop 1.4
for KDE 2.1.1.
There are two parts, a KDE application, and a general C++ solver for the galerkin finite element method. The last is still very basic, that is, it
suffices for the problem at hand.
Here is the old tarbal file of the code : k2dgrflow-0.2.tar.gz. CONTAINS MANY BUGS.
The bugs have now been removed but I haven't made a new tarbal yet. Mail me if you are interested.
To use the program, you first need to install the meschach 1.2b library, eg from netlib, or just
search it with yahoo.
Don't forget after construction to put it in /usr/lib with the name libmeschach.a. Normally the make doesn't do it
for you.
Secondly, you need the EasyMesh programm. For example on
www-dinma.univ.trieste.it/~nirftc/research/easymesh/ . This is the programm k2dgrFlow uses to generate a mesh
Everything is in the documentention/user manual that comes with the application. Just read the INSTALL and the
README files, and also look at the FAQ before mailing me.
If you want the use the galerkin library that's the engine of the programm, check out the
developers chapter in the user manual for the class diagramms, and check the
API reference manual for detailed information with the classes. The links to the header files
are broken in this manual. You can find these in the tarbal
ToDo List
K2dGrFlow is a beta version, because still a lot of things have to be added. Such as :
- EasyMesh is not working very performant for domains with many nodes. To be usefull it should still perform ok with 10000 nodes.
I would like to incorporate own code for the construction of the mesh.
In the same time, it should work with curves as borders, instead of lines. The mesh has a linear interpollant of the curve as a border,
but each time a node is
added on the boundary, the node should be again on the curve, and not on the interpollant line. (so the outer boundary of the domain changes when you add nodes)
- It must be possible to enter domains wich contain holes.
- A procedure must be added that refines the mesh. We should start with a crude mesh, and a test function to test if the result is ok in a
certain element of the mesh. If the result is not ok, the mesh should be refined in that element.
This way of working means an iterative loop of constructing the mesh, and solving the problem, until the desired correctness has been
reached
- Input of a border with a parmeter equation in stead of predefined functions. This will be difficult. Means a syntax of input like eg maple.
- A better way of working with borderconditions. Now this is a part of the K2dBorderBase class. A seperate class is better.
- A better file management. The files must be stored in the standard directory for data, not where the programm resides. On deletion
of a model, also generated files must be deleted.
- Better plot functions: zooming with the mouse, a density diagram, a flow field diagram, colorscale with the values of the head,
saving the figures as a .fig/.eps/.jpeg file
- Option to save the global matrices to a file. Usefull for testing