USGS Banner

Title: Implementation of the SWIG2D Groundwater/Salt Water Intrusion Code in MATLAB for Application to Island Aquifer Modeling to Guam and Saipan

Focus Category: MOD, MET, GW

Keyword Numbers: Aquifer Parameters, Groundwater Modeling, Groundwater Management, Groundwater Movement, Hydrobiology

Duration: March 1, 2000-Feb 28, 2001

Fiscal Year 2000 Federal Funds: $16,954

Non-Federal Funds Allocated: N/A

Principal Investigator:

J. W. Jenson
Water & Environmental Research Institute of the Western Pacific (WERI)
University of Guam
Mangilao, GU 96923


D. N. Contractor
Department of Civil Engineering and Engineering Mechanics
University of Arizona
Tucson, AZ 85721

Non-Funded Collaborating Scientists:

R.L. Carruth
USGS Field Office
P.O. Box 5783 CHRB
Saipan, MP 96950

Congress. Dist. of Univ. Performing Research: N/A

Statement of the Critical State or Regional Water Problem

Groundwater is the most important source of drinking water on Guam and Saipan. Well placement and pumping rates must be managed carefully to ensure that fresh water is extracted at rates modest enough to preclude salt water from entering wells. To successfully manage production and protect water quality therefore requires reliable estimates of how the fresh water lens responds to pumping and changes in recharge. Saltwater intrusion has been a serious problem on Saipan for many years. On Guam, several wells have exhibited increased chloride concentrations in recent years. Separate work is ongoing to document the incidence of saltwater intrusion and determine the causes. The drought that accompanied the 1997-1998 El Nino has prompted concerns by water managers in the western Pacific over the implications that global warming and/or future extended droughts might have for aquifer recharge. To make reliable estimates of aquifer behavior, hydrologists need accurate data on aquifer characteristics and realistic, valid, and up-to-date models that can incorporate the essential geological characteristics and accurately simulate hydrologic processes in the aquifer. Numerical models have become a standard tool for predicting well responses to changes in pumping rates, the number or density of wells, the effects of prolonged drought, storm water disposal strategies, alteration of surface vegetation, or changes in land use practices. One of the outcomes of the $3.5M Northern Guam Lens Study (NGLS) in 1980-82, was the construction of a two-dimensional numerical model specifically designed to simulate Guam’s fresh water lens, and in particular its interaction with the underlying sea water (CDM, 1982). The computer code for the model, named SWIG2D (for Salt Water Intrusion/Groundwater Flow—Two Dimensional), uses the finite element method to simultaneously solve the two-dimensional Darcian groundwater flow equations (Sa da Costa and Wilson, 1979) for both the fresh water lens and underlying saltwater (Contractor, 1981; Contractor, 1983). The model was first used during the NGLS to evaluate the island-scale response of the lens to pumping and natural changes in recharge, though field data against which to test simulated results were very limited.

The current version of the code is used by WERI for its groundwater modeling program, and has been a powerful and accurate tool for predicting and explaining aquifer behavior (Contractor, 1981; Contractor, 1983; Contractor and Jenson, in press; Contractor and Srivastava, 1990; Jocson, 1998; Jocson et al., 1999). Fewer software companies, however, are supporting FORTRAN compilers that run on desktop computer operating systems. Moreover, the advent of powerful advanced computing application software such as Mathematica, MathCad, and MATLAB has made it possible to write numerical models in very simple code and utilize tested built-in functions and algorithms for standard tasks such as integration and curve-fitting. It is now no longer necessary for programmers to write their own algorithms to solve integrals or compute statistical parameters. This reduces errors in programming and makes it easier to configure the model with input data and to test and verify results. To keep SWIG2D compatible with today’s desktop operating systems and take full advantage of the power and efficiency of current computing software, we propose to re-implement the code in the MATLAB computing language and package it for efficient application in the Windows operating system environment.

Results, Benefits, and Information Expected

The proposed project will produce a new computer program for SWIG2D, written in MATLAB, a state-of-the-art advanced computing language specially designed for numerical problem solving. The program will be useful not only for simulating the movement of freshwater and saltwater in the Northern Guam Lens Aquifer, but other island/coastal aquifers as well, including Saipan’s. Groundwater modeling for island and coastal aquifers requires very specialized modeling software since it must account for the coupled dynamics of both fresh water and salt water, as well as the influence of tidal conditions. Commercial modeling programs are mostly written for inland continental systems, in which only a single phase must be modeled, and boundary conditions are relatively simple. Limestone, or karst, aquifers present additional challenges since they are dual-porosity systems. Island karst aquifers in young Cenozoic limestones such as on Guam and Saipan are still more complex because of their extremely high porosity and close hydraulic connection with tidal forcing. To acquire and maintain an accurate and useful model of carbonate aquifers of Guam and Saipan, and similar ones elsewhere, therefore requires a specialized computer program designed specifically for the geologic and hydrologic conditions of island aquifers. Advances in computing technology have made sufficiently powerful computing platforms readily accessible, but keeping software up to date so that it can take full advantage of the available computing power is an ongoing challenge. Modeling of island aquifers therefore presents a double challenge. Not only must specialized software be prepared to handle the complex hydrogeological conditions, but it must be kept current so that it can be run efficiently on the rapidly evolving operating systems and computing platforms.

Once tested and proofed, the code will be available for application in subsequent projects to model groundwater flow and well dynamics in the limestone aquifers of Guam and Saipan. In addition to the code, we will prepare a user’s manual and publish it in an international journal so that the code will be code widely available to groundwater hydrologists everywhere. This will provide hydrologists working in island/coastal environments with a new and reliable tool for predicting the long-term response of the lenses to pumping and changes in recharge, whether natural or human-induced. The proposed project thus directly supports two the stated Water Quantity objectives of the local Advisory Council: (1) Assess effects of pumping on the thickness of the northern Guam lens, (2) Determine how global warming might affect sustainable yield. Beyond the local benefits, re-implementation of SWIG2D in MATLAB will make it available in a powerful new language that is coming to dominate instruction and computing in mathematics, computer science, and engineering around the country. Moreover, the new program will be more efficient and run faster, and modifications and updates to will much easier.


Nature, Scope, and Objectives of Research

The nature of this project is simply to maintain and improve an already well-tested research tool so the WERI and other institutions working on groundwater/saltwater problems can have a reliable, efficient, and easy-to-use code for constructing numerical models. The original SWIG2D code was written in the FORTRAN programming language. The computing demands for processor speed and memory required execution on mainframe computers until desktop computers became sufficiently powerful to execute the code within practical time limits. FORTRAN compilers were readily available for mainframe computers, which were the standard platform when the language was developed. By 1989, desktop computers had displace the mainframe as the dominant platform, so the SWIG2D code was updated, adapted to run on PCs, and applied to new data on the Northern Guam Lens Aquifer that had accumulated in the decade following the NGLS (Contractor and Srivastava, 1990). Simulations of the phreatic surface and fresh-water/salt-water interface matched well with observations, and confirmed the utility of the model for groundwater research. Since then the code has been validated against numerous analytical solutions. In recent work at WERI, it has been applied to help determine likely upper and lower limits for infiltration rates, recharge, and discharge from the aquifer and to estimate regional hydraulic conductivity, flow rates, and lens thickness (Jocson, 1998; Jocson et al., 1999). To support such work, the code was updated again in 1994-95 to incorporate a state-of-the-art numerical solution of sparse-matrix linear equations. It was also refined to accommodate a two-dimensional hydraulic conductivity tensor, thereby allowing simulation of anisotropic conditions. In its most recent application to the Northern Guam Lens Aquifer, it has been coupled with a model of vadose flow to evaluate vadose storage capacity and the effect of vadose storage on rates of infiltration through the vadose zone to the fresh water lens (Contractor and Jenson, in press).

Advances in the speed and memory of desktop computers have allowed SWIG2D to be used for increasingly complex problems. SWIG2D has been well tested over the years and has become a powerful tool to address island and coastal aquifer problems. It continues to have important advantages over groundwater modeling software for modeling island and coastal aquifers. First, it is a two-phase code that can accommodate both fresh water and salt water. Commonly used groundwater modeling codes such as MODFLOW are one-phase codes, which cannot model the interaction of the fresh water with the salt water. Second, since it is a finite element code, it has greater geometric flexibility and numerical stability than finite difference codes such as SHARP. This is especially important in applications on Guam, which must incorporate complex geographical and geological boundaries. Third, it is simple and easy to configure and debug. More complex codes such as SUTRA have flexibility for a wide variety of problems but require greater effort to configure and are more demanding of processor speed and memory than SWIGD.

Although the FORTRAN version of the code is becoming more difficult to maintain and operate, it has been thoroughly tested. The differential equations implemented in the code embody the basic physical processes of two-phase fluid flow through porous media (Sa da Costa and Wilson, 1979) and the solution of them through the Galerkin finite-element method has been shown to be numerically stable and accurate. The fundamental design and structure of the code are simple and transparent, and the code has been demonstrated to be efficient and reliable in execution. We therefore have the important advantage of not having to develop a new program from scratch, but rather being able to begin with a well-tested and efficient algorithm that need merely be translated from one language to another and then tested and debugged only for programming errors.

The scope of this project is therefore well-defined: to translate a code implementing a well-tested and reliable algorithm with a straightforward design and familiar structure from one language with which the investigators have had long experience to a new, simpler, and more powerful language. The number of textbooks that have proliferated in just the last few years to solve engineering and scientific problems attest to the power and versatility, as well as the growing popularity of MATLAB as the language of choice for scientific and engineering computing. A small sample that indicates how widespread the applications of MATLAB have become includes Penny (1995), Kwon (1996), Marchand (1996), Cooper (1998), and Wilson (1998). Introductory texts on MATLAB itself include Hahn (1997), Hanselmen (1998), and Sigmon (1998). Some of these textbooks will be added to the collection at the UOG library to support this project.

The specific, immediate objectives are thus to produce a thoroughly documented MATLAB program, along with a concise and easy-to-read user manual that will enable students, instructors, and researchers to apply SWIG2D for instruction and research on island and coastal aquifers. The MATLAB program will be checked for accuracy, convergence and stability against the same analytical solutions that SWIG2D was checked against. These tests will also be a measure of the speed of execution of the MATLAB program compared with the speed of SWIG2D. Our ultimate objective is to follow-up this project with applications of the new code to these types of problems. The code will be extremely fast, reliable, and user-friendly; applications of the code to simulating effects of pumping or seasonal changes in recharge, for example, will be simple and less demanding on labor and computing resources.

Methods, procedures, and facilities

Dr. Contractor and Dr. Jenson both have up-to-date Pentium II desktop computers and reliable access to Internet for email and use of the web. WERI maintains a research laboratory in which student research assistants can have full-time, dedicated access to computing platforms and software. During the July and August 2000, Drs. Jenson and Contractor will work with one another over the Internet to break the existing code into its constituent parts and identify the most effective MATLAB techniques and tools for re-implementing the algorithm in MATLAB. During this time they will also consult with Mr. Carruth regarding program design and capabilities that should be built into the code to improve its utility for practical applications. The summer’s work will culminate in a new program design with the optimum MATLAB functions and tools identified. Beginning fall semester, Dr. Jenson will supervise an advanced undergraduate student who is already trained in MATLAB to prepare and test the new program. Both Dr. Jenson and the student research assistant will be in daily contact with Dr. Contractor via email. They will transfer test versions of the code back and forth between Guam and Arizona to test and debug them throughout the development process.

Related Research

Both Dr. Jenson and Dr. Contractor have completed recent research using SWIG2D. These include simulation of groundwater recharge, phreatic flow, and discharge (Jocson, 1998; Jocson et al., 1999) and vadose infiltration (Contractor and Jenson, in press) in the central subbasins of the Northern Guam Lens Aquifer. These projects provide recently tested applications of the existing code. The new code can therefore be tested by re-accomplishing the same simulations to check for duplicate results.


Progress Review

Work will begin in summer, 2000. A synopsis of the work to date will be prepared in the fall. Student assistance will be begin in the late summer and continue through the spring semester 2001. We will prepare a user manual for the program as the program evolves. In late spring, 2001, we will print the code and user manual in WERI technical report, which will subsequently be prepared for submission to an appropriate journal.

Investigator's Qualifications

Dr. Jenson is a hydrogeologist specializing in groundwater modeling. He administers an active modeling research program at WERI, where he and his students have applied SWIG2D in collaboration with Dr. Contractor for nearly six years. Dr. Jenson is thoroughly familiar with the existing code and its structure. His work with SWIG2D has included leading a recent successful Masters thesis project (Jocson, 1998; Jocson et al., 1999) at UOG to model the largest and most important subbasins of the Northern Guam Lens Aquifer.

Dr. Contractor is the original author of SWIG2D and has an extensive background in numerical modeling, and has previously constructed a finite-element model of salt-water/fresh-water interaction in the Northern Guam Lens Aquifer. Many individuals in the USA and foreign countries have requested copies of SWIG2D. Dr. Contractor has been the external examiner for many Ph.D. students from Universities in India. Their topics of research are related to saltwater intrusion in aquifers, and Contractor was selected to be the external examiner because of his publications on saltwater intrusion based on SWIG2D. Contractor has used SWIG2D as a part of many graduate courses, e.g. Groundwater Flow, Finite Element Theory, etc.

Training Potential

The investigators will train an advanced undergraduate student who has taken the basic numerical methods course offered at UOG, which is now taught in MATLAB. Dr. Jenson has been corresponding with the instructor, Dr. Stanoyevitch, and has solicited applications from a junior or senior undergraduate for the research assistant position. The student will encode the program in MATLAB and test and debug it with the advice of Drs. Jenson and Contractor. The completed program will be used by Dr. Jenson at WERI and Dr. Contractor at the University of Arizona to support the hydrogeology and groundwater modeling courses they teach as well as subsequent graduate thesis projects in applied modeling. It will also be published, along with a user manual, in a journal as well as the University of Arizona and University of Guam web sites, from which it will be accessible to any instructor or researcher who wants to use it.

Professional Publication Plan

Findings will be described in a WERI technical report. They will also be presented at regional and national scientific meetings, and submitted for publication in peer-reviewed journals in geoscience, hydrology, environmental engineering, or water resource management (e.g., Computers in Geosciences, Ground Water, Journal of Hydrology, Water Resources Research).


Contractor, D.N., 1981. A two-dimensional, finite-element model of salt water intrusion in groundwater systems. Technical Report #26, Water and Energy Research Institute of the Western Pacific, University of Guam, Mangilao.

Contractor, D.N., 1983. Numerical modeling of saltwater intrusion in the Northern Guam Lens. Water Resources Bulletin, 19: 745-751.

Contractor, D.N. and Jenson, J.W., in press. Simulated Effect of Vadose Infiltration on Water Levels in the Northern Guam Lens Aquifer. Journal of Hydrology.

Contractor, D.N. and Srivastava, R., 1990. Simulation of saltwater intrusion in the Northern Guam Lens using a microcomputer. Journal of Hydrology, 118: 87-106.

Cooper, J., 1998. Introduction to Partial Differential Equations with MATLAB. Birkhauser.

Hahn, B.D., 1997. Essential MATLAB for Scientists and Engineers. J. Wiley.

Hanselmen, D.C., 1998. Mastering MATLAB. Prentice Hall.

Jocson, J.M.U., 1998. Hydrologic model for the Yigo-Tumon and Finegayan subbasins of the Northern Guam Lens Aquifer, Guam. Masters Thesis, University of Guam, Mangilao, 95 pp.

Jocson, J.M.U., Jenson, J.W. and Contractor, D.N., 1999. An Integrated Numerical Modeling Study and Field Investigation of Infiltration, Recharge, and Discharge in the Northern Guam Lens Aquifer. Technical Report #88, Water and Environmental Research Institute of the Western Pacific, University of Guam, Mangilao.

Kwon, Y.W. and Bang, H., 1996. The Finite Element Method Using MATLAB. CRC Press.

Marchand, P., 1996. Graphics and GUI With MATLAB. CRC Press.

Penny, J.E.T., 1995. Numerical Methods Using MATLAB, Ellis Horwood Co.

Sa da Costa, A.A.G. and Wilson, J.L., 1979. Numerical model of seawater intrusion in aquifers. 247, Massachusetts Institute of Technology Technical Report.

Sigmon, K. and Mathworks, 1998. MATLAB Primer. CRC Press.

Wilson, H.B., Jr. and Turcotte, L.H., 1998. Advanced Mathematics and Mechanics Applications Using MATLAB. CRC Press.

U.S. Department of the Interior, U.S. Geological Survey
Maintained by: John Schefter
Last Updated: Friday October 28, 2005 1:27 PM
Privacy Statement || Disclaimer
|| Accessibility