You are on page 1of 501

Groundwater Modeling

by the
Finite Element
Water Resources Monograph 13

Groundwater Modeling
by the
Finite Element Method

Jonathan !stok

American Geophysical
Published
underthe aegisof the AGU WaterResources
Monograph
Board.

Library of CongressCataloging-in-PublicationData

Istok, J. D.
Groundwatermodelingby the finite elementmethod
Jonathan Istok
p. cm.- (Water resourcesmonograph; 13)
Includesbibliographical
references.
ISBN 0-87590-317-7
1. Groundwater flow--Mathematical models. 2. Finite element
method. I. Title. II. Series.
TC176.I79 1989
551.49'01 '5118--dc20 89-18404
CIP

Copyright1989by the AmericanGeophysical


Union, 2000FloridaAvenue,
NW, Washington,DC 20009

Figures,tables,and shortexcerptsmay be reprintedin scientific


booksand
journalsif the sourceis properlycited.
Authorizationto photocopyitems for internalor personaluse, or the
internalor personaluse of specificclients,is grantedby the American
GeophysicalUnionforlibraries
andotherusersregistered withtheCopyright
ClearanceCenter (CCC) TransactionalReportingService,providedthat the
basefee of $1.00per copy,plus $0.10 per page is paid directlyto CCC, 21
CongressStreet,Salem,MA 01970.0065-8448/89/$01. + .10.
Thisconsentdoesnotextendto otherkindsof copying,suchascopyingfor
creatingnew collectiveworks or for resale.The reproductionof multiple
copiesandtheuseof full articlesor theuseof extracts,
includingfiguresand
tables,for commercialpu.rposesrequirespermissionfrom AGU.
Printed in the United States of
To my wife andfriendJoanwhoneverlet meforgetthat
thereis moreto life than"a bunchof stupid
Contents

Preface xiii

PART ONE BASIC CONCE•S

Chapter I INTRODUCHON
1.1 GroundwaterFlow and SoluteTransportModels 3
1.2 BoundaryValueProblems 5
1.3 Initial Value Problems 5
1.4 AnalyticalMethodsfor SolvingtheEquations 5
1.5 NumericalMethodsfor SolvingtheEquations 9
NotesandAdditionalReading 12

Chapter 2 STEP 1- DISCRE'177•. TIlE PROBLEM DOMAFN 13

2.1 Rules for Nodal Point Placement 16


2.2 Rulesfor Selecting
ElementSize,Shape,andPlacement 19
2.3 ExampleMeshes 22
Problems 28

Chapter 3 STEP 2: DERIVE THE APPROXIMATING EQUATIONS 3O

3.1 TheMethodof WeightedResiduals 3O


3.1.1 Subdomain Method 33
3.1.2 Collocation Method 33
3.1.3 Galerkin's Method 34
3.2 A FiniteElementExample 35
3.3 Steady-State,
SaturatedFlow Equation 42
'3.4 Steady-State,
UnsaturatedFlowEquation 48
3.5 Transient,Saturated
FlowEquation 5O
3.5.1 Consistent Element Formulation 52
3.5.2 LumpedElementFormulation 53
3.5.3 Finite Difference Formulation for
Time-Derivativeof theApproximate
Solution 55
3.5.4 A FiniteElementExample 57
3.6 Transient,Unsaturated
Flow Equation 60
3.7 SoluteTransportEquation 64
3.7.1 Steady-StateGroundwaterFlow 65
3.7.2 A FiniteElementExample 69
3.7.3 Transient Groundwater Flow 73
3.7.4 Saturated Groundwater Flow 76
NotesandAdditionalReading 79

.o
viii Contents

Chapter 4 STEP 3: DEVELOP SYSTEM OF EQUATIONS 80

4.1 Required
Propertiesof ElementInterpolation
Functions 80
4.1.1 Continuity 80
4.1.2 Convergence 81
4.2 Subparametric,
Superparametric,
andIsoparametric
Elements 82
4.3 Evaluation of Element Matrices 85
4.3.1 Analytical
Method 88
4.3.2 Numerical Methods 101
4.4 Assembling theGlobalSystemof Equations 142
4.5 Modificationof GlobalSystemof Equationsto
Incorporate
Boundary Conditions 152
4.5.1 DirichletBoundaryConditions 152
4.5.2 Neumann Boundary
Conditions 155
NotesandAdditional
Reading 166
Problems 168

Chapter 5 STEP 4: SOLVE SYSTEM OF EQUATIONS 176

5.1 Procedurefor SolvingSystemof LinearEquations 177


5.1.1 Cholesld Methodfor NonsymmetricMatrix
in Full MatrixStorage 177
5.1.2 CholeskiMethodfor Symmetric Man-ix
in Full Matrix Storage 181
5.1.3 CholeskiMethodfor NonsymmetricMatrix
in VectorStorage 185
5.1.4 Choleski Methodfor Symmetric
Matrix
in VectorStorage 189
5.2 Applicationof CholeskiMethod 191
5.2.1 Steady-State,
SaturatedFlow Equation- 191
5.2.2 Transient,
Saturated
FlowEquation 191
5.2.3 SoluteTransport
Equation 198
5.3 Procedure
for SolvingSystemof NonlinearEquations 201
5.3.1 Picard Iteration 202
5.3.2 Newton-Raphson Method 208
5.4 Application
of PicardIteration 213
5.4.1 Steady-State,Unsaturated Flow Equation 213
5.4.2 Transient,Unsaturated Flow Equation 217
5.4.3 Modification of Solution Procedure for
RelativelyDry PorousMedia 220
NotesandAdditionalReading 222
Problems 223

Chapter 6 STEP5: CALCULATE REQUIRED ELEMENT RESULTANTS 226


6.1 Linear Elements 226
6.2 Isoparametric
Elements 237
Problems
Contents ix

PART TWO COMPUTER IMPLE••A•ON

Chapter 7 FINFFE ELEMENT COMPUq•R PROGRAMS 255

7.1 Introduction 255


7.2 Steady-State,SaturatedGroundwaterFlow, ProgramGW1 257
7.3 Steady-State,
Unsaturated GroundwaterFlow, ProgramGW2 262
7.4 Transient,SaturatedGroundwaterFlow, ProgramGW3 267
7.5 Transient,UnsaturatedGroundwaterFlow, ProgramGW4 280
7.6 SoluteTransport,
ProgramST1 283

Chapter 8 SUBROUTINE NODES 303

8.1 Purpose 303


8.2 Input 303
8.3 Output 303
8.4 Definitions of Variables 303
8.5 Usage 305
8.6 SourceCodeListing 309

Chapter 9 SUBROUTINE ELEMENT 311

9.1 Purpose 311


9.2 Input 311
9.3 Output 311
9.4 Definitions of Variables 311
9.5 Usage 311
9.6 Source
CodeListing 316

Chapter 10 SUBROUTINE MATERL 318

10.1 Purpose 318


10.2 Input 318
10.3 Output 318
10.4 Def'mitions of Variables 318
10.5 Usage 320
10.6 SourceCodeListing 323

Chapter 11 SUBROUTINE BOUND 325

11.1 Purpose 325


11.2 Input 325
11.3 Output 325
11.4 Definitions of Variables 325
11.5 Usage 326
11.6 Source
CodeListing
x Contents

Chapter 12 SUBROUTINE ASMBK 331

12.1 Purpose 331


12.2 Input 331
12.3 Output 331
12.4 Definitions of Variables 331
12.5 Usage 332
12.6 SourceCodeListing 340

Chapter 13 SUBROUTINES DECO• AND SOLVE 363

13.1 Purpose 363


13.2 Input 363
13.3 Output 363
13.4 Definitions of Variables 363
13.5 Usage 363
13.6 SourceCodeListing 367

Chapter 14 SUBROUTINE VEIx•rrY 371

14.1 Purpose 371


14.2 Input 371
14.3 Output 371
14.4 Definitions of Variables 371
14.5 Usage 372
14.6 SourceCodeListing 375

Chapter 15 SUBROUTINE DUMP 393

15.1 Purpose 393


15.2 Input 393
15.3 Output 393
15.4 Definitions of Variables 393
15.5 Usage 394
15.6 SourceCodeListing 397

Chapter 16 SUBROUTINE INITI• 400

16.1 Purpose 400


16.2 Input 400
16.3 Output 400
16.4 Definitions of Variables 400
16.5 Usage 401
16.6 SourceCodeListing
Contents xi

Chapter 17 SUBROUTINE ASMBKC 406

17.1 Purpose 406


17.2 Input 406
17.3 Output 406
17.4 Definitions of Variables 406
17.5 Usage 407
17.6 SourceCodeListing 411

Chapter 18 SUBROUTINE RHS 420

18.1 Purpose 420


18.2 Input 420
18.3 Output 420
18.4 Definitions of Variables 420
18.5 Usage 421
18.6 SourceCodeListing 421

Chapter 19 SUBROUTINE ASMBAD 423

19.1 Purpose 423


19.2 Input 423
19.3 Output 423
19.4 Definitions of Variables 423
19.5 Usage 424
19.6 SourceCodeListing 426

PART THREE APPLICATIONS

Chapter 20 MODELING REGION• GROUNDWATER H..OW 445

20.1 Purpose
of Groundwater
FlowModeling 445
20.2 Typesof Groundwater
FlowModels 445
20.3 ConfinedvsUnconf'med Aquifers 446
20.4 Sensitivity
Analysis 450
20.5 Calibration,VerificationandPm3iction 451
20.6 Mass Balance Calculations 452
20.7 Reporting
ModelResults 452

Chapter 21 MODELING SOLU'I• TRANSPORT 454

21.1 Purposeof SoluteTransport


Modeling 454
21.2 Typesof SoluteTransport
Models 454
21.3 SensitivityAnalysis 455
21.4 Calibration,VerificationandPrediction 456
21.5 Mass Balance Calculations 456
21.6 Reporting
ModelResults
xii Contents

APPENDICES

Appendix I Derivationof Equations


of Steady-State
Groundwater
Flow 458

Problems 462

Appendix II Derivationof Equations


of Transient
Groundwater
Flow 464

Problems 468

Appendix III Derivation


of Equations
of SoluteTransport 469

Problems 477

Appendix IV Concepts
fromLinearAlgebrausedin theFiniteElementMethod 478

Problems 484

Appendix V Properties
of Selected
AquiferMaterials 485

REFERENCES 487

INDEX
Preface

The f'miteelementmethodis now widelyusedto solvea varietyof importantproblems


in the field of groundwaterhydrology. Thus a clear understanding of the methodis
essentialto scientistsand engineersworkingin this field. The goal of this book is to
providethereaderwith thebasicskiRsneededto usethe finite elementmethodto solve
"real-world" problems.Examplesareusedthroughout thetextto illustrateeachstepin the
solutionprocess.
The text is divided into threeparts. In the Part 1, the basicconceptsof the finite
elementmethodarepresented.Chapters 2 to 6 presenta step-by-stepapplicationof the
finiteelementmethodtoproblems of groundwater flowandsolutetransport.
Techniques
fordividinganaquifersystem intoa suitable
finiteelementmesharedescr;,• in Chapter
2. A numberof practical"rules"arepresented for locatingandnumberingnodesandfor
selectingtheproperelementtype,size,andshape.In Chapter3, themethodof weighted
residualsis usedto derivetheintegralformulations of theequations governingsteady-state
and transientgroundwater flow and solutetransportthroughsaturatedand unsaturated
porousmedia. The derivationsare presentedfor one-, two-, and three-dimensional
problems;theintegralformulations for axisymmetric problemsarcderivedin an exercise.
The derivationsare uniquein that they do not requirethe readerto be familiar with
advanced mathematics; althougha basicunderstanding of differentialandintegralcalculus
is assumed.In Chapter4, theimportantproperties of elementinterpolation functionsare
discussed at length. Expressions arepresented for computing theelementconductance,
capacitance, advection-dispersion, andsorptionmatricesfor eachelementtypeandfor
assembling theelementmatrices intoa system of linearor nonlinear equations.Procedures
arealsopresented for modifyingthissystemof equations for differenttypesof boundary
conditions(suchas constanthead or no-flow boundaries) Proceduresfor solvingthe
systemof equations arepresented in Chapter5. In Chapter6, procedures arcpresented for
usingcomputedvaluesof hydraulichead(or pressureheador soluteconcentration) to
computeratesof groundwater flow andsoluteflux.
In Part2, thecomputerimplementation of thefiniteelementmethodis discussed.Each
chaptercontains a description of oneor moreFORTRANsubroutines, exampleinputdata
andoutput,andthe completesourcecodelisting. The samesubroutines are alsoavailable
ondiskette.Thesesubroutines, although intended for instructionalpurposes, containmany
advanced features.Mostimportantly the"modular" designof thesesubroutines meansthat
theyformconvenient"buildingblocks"for severaldifferentfinite elementcomputer
programs.
Part3 is concernedwith applications
of the materialin Parts1 and2 to "real-world"
problems.Chapter20 discusses applications
to problemsof regionalgroundwaterflow.
Chapter21 discusses solutetransportwith applicationto problemsof groundwater
contamination frompointanddiffusesources.
Usefulsupplementaryinformationis containedin theAppendices. Detailedderivations
of theequations of groundwaterflow andsolutetransport arepresentedin Appendices I,
H, andHI. A concisereviewof importanttopicsfromlinearalgebrais in AppendixIV.
Typicalvaluesof physical
properties
forselectedaquifermaterials
arein Appendix
V.
The authorwouldlLketo thankthemanyindividualsandinstitutions whohelpedto
makethisbookpossible.Formergraduatestudents RichardCooper,JeffreySmithand
Alan Rea helpedwith the development of the computerprograms.SangBongLee
carefullyread (and reread)early versionsof the manuscriptand helpedme correct
Prefac• xiv

computationalerrorsin the exampleproblems. JanetLee helpedme with the computer


programming(but anyremainingbugsare my fault!). JoanIstokdrew theexamplef'mite
elementmeshes in Chapter2. I alsowishto thankling Leung,Jonathan Yap, andElvina
Lim - whotypesettheentirebookon a Macintosh computer.Theydid a terrificjob!
The OregonAgricultta'alExperiment StationandtheU.S. GeologicalSurveyprovided
financialsupportfor this project. I alsowish to thankthe studentsin my groundwater
modeling classes whotaughtmea lotaboutthefirriteelementmethodwhileI wastryingto
explainit to them. I alsowish to thankFrancisHall for his interestin thisproject. It
provideda neededlift whenmy enthusiasm hadalmostrunout.

Jonathan Istok

Department of Civil Engineering


OregonStateUniversity
Corvallis,Oregon
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter I

INTRODUCTION

1.1 GROUNDWATER FLOW AND SOLUTE TRANSPORT MODELS

Groundwater is an importantnaturalresource.Many agricultural, domestic,and


industrialwaterusersrely on groundwater as thesolesourceof low-cost,high-quality
water.However,in recentyearsit hasbecome apparent thatmanyhumanactivities can
havea negative impactonboththequantity andqualityof thegroundwater resource. Two
examples arethedepletion of thegroundwater resource by excessivepumping andthe
contamination of thegroundwater resourcebywastedisposal andotheractivities.Oneway
toobjectively assess theimpact of existing
orproposed activities
ongroundwater quantity
andqualityisthrough theuseof groundwater flowandsolute transport
models.
In developing a groundwater flow or solutetransport modeltheanalystbeginsby
preparing a conceptual modelconsisting of a listof thephysical andchemical processes
suspected of governing the behavior of the systembeingstudied(e.g.,groundwater
seepage through soilandrockpores,laminarandturbulent waterflowthrough largepores
androckfractures, andsolutetransport by advection, dispersion,anddiffusion).The next
stepis to translate theconceptual modelintomathematical termsandtheresultis a
mathematical model consisting of oneor morepartial differentialequationsanda setof
auxiliaryconditions. Solutions
of theequations subjecttotheauxilliaryconditions canbe
obtainedby oneof severalmethods (seebelow). If numericalmethods areused,the
collectionof partialdifferential
equations, auxilliaryconditions, andnumerical algorithms
arereferredto as a numericalmodel. If a computerprogramis usedto implementthe
numerical model(asis usuallydone)thecomputer programis sometimes referredto asa
computermodel.
Existingmathematical modelsof groundwater flow andsolutetransport arenecessarily
greatlysimplifieddescriptions of reality. Themovement of waterandsolutesfromthe
surfaceof the earthto the aquifer,andthroughthe aquiferto a pointof wateruseis an
extremelycomplexphenomenom and many of the physicaland chemicalprocesses
involvedarepoorlyunderstood. It is thereforedifficultto translate
all of theseprocesses.
intoa singlesetof equationsthatapplyequallywelltoall situations encountered in practice.
Insteadthe usualapproachhasbeento classifygroundwater flow and solutetransport
problems intocategories andto developmathematical andnumericalmodelsfor each
category separately.In thisbookwe will consider five suchcategories: (1) steady-state,
saturatedgroundwater flow, (2) steady-state, unsaturated groundwater flow, (3) transient
(or time-dependent),saturated groundwater flow, (4) transient,unsaturated groundwater
flow, and(5) solutetransport.The partialdifferentialequations usedin mathematical
models of groundwater flowandsolutetransport foreachproblem category are:

1, The Steady.State. Saturated Flow Equation:

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

4 Introduction

The Steady-State. Unsaturated Flow Equation:

(1.2)

The Transient. Saturated Flow Eauation:

3/ 3h'• 3/ 3h• 3/ 3h• s3h

4, The Transient. Unsaturated Flow Eouation:


_

(1.4)

The Solute Transport Eo_uation:

32 •2 32
3(OC)
=Dx•x2(OC
)+Dy•y•(OC)+
Dz•z2(OC)
(1.5)

whereh is hydraulic
head,Kx,Ky,andKz arethecomponents
of saturated
hydraulic
conductivity
in thex, y, andz coordinate
directions,
t is time,• is pressure
head,Kx0l/),
Ky(•i/),
andKz(•) arethecomponents
ofunsaturated
hydraulic
conductivity,
Ssisspecific
storage,
C(•i/)isspecific
moisture
capacity,
Cissolute
concentration,
Dx,Dy,andDz are
dispersion coefficients, 0 is thevolumetricwatercontent,vx is apparentgroundwater
velocityin thex coordinate direction,
Pbis bulkdensity,Kd is theequilibrium
distribution
coefficientfor a particular
sorpfion/desorpfion
reactioninvolvingthesoluteandtheporous
media,and•. is thesolutedecaycoefficient.
Equations1.1 to 1.5 arederivedin Appendices I, II, andHI. Thesederivationsshould
be studiedcarefullyandthesimplifying assumptionsusedin thederivations shouldalways
be kept in mind whenusingtheseequationsto solvea particulargroundwater flow or
solutetransportproblem. Partialdifferentialequationscanalsobe derivedfor additional
categoriesof problemsincludingenergyflow (e.g., the flow of heat in a geothermal
reservoir),multiphasefluid flow (e.g.,thesimultaneous flow of air, water,oil, andnatural
gasin a petroleum reservoir),aquiferdeformation(e.g.,theconsolidation of anaquiferdue
to excessivegroundwater withdrawl),andmorecomplexformsof solutetransport(e.g.,
solutetransportsubjectto microbialdegradation).Althoughthisbookis concerned only
with theapplication of thefiniteelementmethodto thesolutionof equations 1.1 to 1.5,
manyof thesameprocedures alsocanbeusedto solveequations derivedforothertypesof
problems.
The mathematical modelfor eachcategoryof groundwater flow andsolutetransport
problemsconsistsof one of the partialdifferentialequationslistedaboveand a set of
auxilliaryconditions.The auxilliaryconditions
for equations1.1 to 1.5 areclassifiedas

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter1 5

either boundary conditionsor initial conditions(defined in sections1.2 and 1.3,


respectively).
A mathematical
modelconsistingof oneormorepartialdifferential
equations
and a set of boundaryconditionsis referredto as a boundary value problem; a
mathematicalmodel consistingof one or more partial differential equations,a set of'
boundary
conditions,
anda setof initialconditions
isreferredto asaninitialvalueproblem.

1.2 BOUNDARY VALUE PROBLEMS

Mathematical
modelsof groundwater flowbasedonequations 1.1or 1.2 areclassified
as boundaryvalueproblems.In boundary valueproblems,the analystcan specifythe
valueof the unknownquantityorfleld variable (i.e., hydraulicheador pressurehead)
alongportions of theaquiferboundaries. Derivatives
of thefieldvariable(i.e.,ratesof
groundwater flow)alsocanbespecified alongportionsof theaquiferboundaries (e.g.to
representgroundwater recharge) oratspecial points
withintheaquifercalledpointsources
or sinks (e.g.to represent groundwater withdrawlfromwells). Thesespecified values
are collectivelyreferredto asboundary conditionsandwhentheyarecombined with
equation1.1or 1.2theresultisa mathematical modelthatcanbesolvedfor valuesof the
fieldvariableat anypointwithintheaquifer.Examples of boundary valueproblems and
boundary conditions arein Fi•ttre1.1. In boundaryvalueproblems, boundary conditions
andcomputed
values
ofthef•eld
variable
donotchange
withtimeandtheminimum
and
maximumvaluesof thefieldvariablealwaysoccuron theboundaries
of the aquiferor at
pointsources
or sinks.

1.3 INITIAL VALUE PROBLEMS

Mathematical modelsof goundwater flowandsolutetransport basedonequations 1.3,


1.4, or 1.5 areclassifiedasinitialvalueproblems.In initial valueproblems,boundary
conditions, i.e., specifiedvaluesof thefieldvariable(hydraulichead,pressure head,or
soluteconcentration) anditsderivatives(ratesof groundwater flow or soluteflux), are
specified in thesamewayasforboundary valueproblems. In addition,
valuesof thefield
variablemustbe specified atallpointswithintheaquiferat someinitialtimetoandthese
specifiedvaluesarecollectively referredto asinitialconditions.Whenthe boundary
conditions andinitialconditions arecombined withequation1.3, 1.4,or 1.5, theresultis a
mathematical modelthatcanbe solvedfor valuesof thefield variableat anypointin the
aquiferat anytimet > to. Someexamples of initialvalueproblems,boundary conditions,
andinitialconditions arein Fi•tre 1.2. In initialvalueproblems, boundary conditionsand
computed valuesof thefieldvariable canchange withtimeandtheminimum andmaximum
valuesof thefieldvariableattimet canoccurat anypointwithintheaquifer.

1.4 ANALYTICAL METHODS FOR SOLVING THE EQUATIONS

In generalwecanusetwotypesofmethods toobtainsolutions to a mathematical


model
of groundwater flow or solute•ansport:analyticalmethodsandnumericalmethods.
When usinganalyticalmethodswe seekto obtaina functionalrepresentation for the
solutionof the partialdifferentialequation(e.g, a mathematical expressionthat gives
hydraulicheadas a functionof positionandtime withinthe aquifer). The accuracyof
analyticalsolutionscanbe verygood(exactin manycases)andanalyticalsolutions to
equations1.1 to 1.5 are widelyusedto studythe behaviorof groundwater flow and
•ansportprocesses underhypothetical conditions (e.g.,to determinethe sensitivity
of
computed valuesof hydraulic headto valuesof saturated hydraulicconductivity),to

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

6 Introduction

Plan View of Alluvial Aauifer


__

River
(Constant
headboundary) ValleyWalls
* (No flow boundaries)

,L'¾oss-Secti0nal
View of EarthDam

UpstreamFaceof Dam Water Table


*(Constantheadboundary) *(Pressurehead= 0)
Downstream Face of Dam
*(Constant
headboundary)

Low Permeability
Bedrock
*(No flow boundaries)

Figure 1.1 Examplesof boundaryvalue problemsand boundaryconditionsfor


steady-state,saturatedgroundwaterflow, * = boundarycondition.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
1 7

Cross-Sectional View of Aauifer _

PumpingWell, ** Initial Position of Water


*(Specified
rateof Tableatt --.to
groundwater
4'//////

******************************

Position of Water
Tableat tl > to
Position of Water
Tableat t2 > t 1

Low Permeability
Bedrock
*(No flow boundary)

(7ross-Sectional
View of Aquifer

LeakingLandfill ** InitiallyNo Contaminant


* (Specified
rateof soluteflux) Presentin Aquifer

Position of Plume
at t 1 > t o

Position of Plume
at t2> t I

Figure 1.2 Examplesof initial value problems,* = boundarycondition,** = initial


condition.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

8 lmroducfion

intcrprctdatafromlaboratoryandficld experiments(c.g.,to computevalucsof dispersion


cocfficicntsfor a soil samplcin a laboratorycolumn from thc resultsof a miscible
displacement experiment),andto verifythe accuracyof solutionsobtainedby numerical
methods(e.g.,by comparingcomputed soluteconcentrationsobtainedusinganalyticaland
numericaltacthodsfor a wide rangeof apparentgroundwater vclocitiesanddispersion
coefficients).

Example
Problem Statement:

One-dimensional,
steady-state,
groundwater
flow throughisotropicandhomogeneous
aquifer
(vx= 0.01m/d;Dx= 1m2/d). "
Solutetransport by advection anddispersion only. No solutedecay(•. -- 0) or sorption
of soluteto porousmedia(Kd-- 0).
Initiallyno soluteis present.At timet -- 0, soluteconcentration
at oneendof aquiferis
increased
instantaneously
to 100mg/l.
Computesoluteconcentration
at x -- 100m,t -- 500 days
Mathematical Model:

PartialDifferentialEquation

•C _ •2C •C
Vx•xx (seeAppendixIll)
X' = •Xax--•-

BoundaryConditions
C (x = O,t • O) = 100mg/l

Initial Conditions

C(x>O,t=O) = 0

Solution Obtained bv Analytical Method (O•ata.


_ _ _
1970•:

C(x,t
) = C(x
--O,t>O)erfc
[ (X-Vxt)
(VxX
• (x+v•t)]
+exp effe

c(loo,500)
=• 2•(1)(•
'• ( •+0.01(5•))]
2•(•)(•
= 50 [effc (2.124)+ exp(1) effc (2.348)]

(values of the complementmye•or function, effc( ) •e tabulatedin Freeze and


Che• (1979))

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter1 9

-- 50[0.002711
+ 2.718(0.000925)]
-- 0.26mg/l

The principallimitationof analyticalmethodsis thatsolutionscanonly be obtainedby


imposingseverelyrestrictiveassumptions aboutaquiferproperties, boundaryconditions,
or initial conditions.For example,an assumption commonlymadeto obtainanalytical
solutionsto equation1.1 is that the aquiferis isotropicand homogeneous for hydraulic
conductivity
(i.e.,thatthecomponents
of saturated
hydraulic
conductivity,
Kx,Ky,and
Kz, arethesameanddo notchangefrompointto pointwithintheaquifer).In mostfield
situations,
however,the assumptions
requiredto obtainsolutionsto groundwater
flow or
solutetransport
problemsusinganalyticalmethodsarenotvalid.

1.5 NUMERICAL METHODS FOR SOLVING THE EQUATIONS

Numericalmethodsdo not requiresuchrestrictiveassumptions.For example,it is


possible
to obtainnumericalsolutions
for thecaseof anisotropic
andnonhomogeneous
aquiferpropertiesand for problemswith complexand time-dependent boundary
conditions.When usingnumericalmethodswe seeka discreteapproximationfor the
solutioni.e., computedvaluesof the field variableat a setof specifiedpointswithin the
aquiferat a setof specified times;thenumberandlocationof thepointsandthenumberand
choiceof timesis determined in advance by theanalyst.The accuracy of solutions obtained
by numericalmethodscanbe very good(exactin somecases)but dependson several
factorsincluding: thetypeof numerical methodused,thecomplexity of theboundary and
initialconditions, andthecomputational precisionof thecomputerusedto implementthe
method.In general,it is easierto obtainhigh-accuracy numericalsolutionsfor steady-state
groundwater flow problemsthan for transientgroundwater flow and solutetransport
problemsandfor saturated groundwater flow problemsthanfor unsaturated groundwater
flow problems.
Severaltypesof numericalmethodshavebeenusedto solvegroundwaterflow and
solutetransport problems,thetwoprincipalonesbeingthefinite differencemethodand
thefinite elementmethod.Althoughtheword"method"is singular,thesetermsactually
referto two ratherlargegroupsof numericalprocedures.
The finite differencemethodwasinitiallyappliedto the flow of fluidsin petroleum
reservoirs (Table1.1). Themethodwasfirstappliedto problems of groundwater flow and
solutetransport in themid-1960's.Themethodhasa numberof advantages thatcontribute
to its continuedwidespreaduse and popularity:(1) for simpleproblems(e.g., one-
dimensional, steady-state groundwater flow in anisotropicandhomogeneous aquifer)the
mathematicalformulationand computerimplementationare easilyunderstoodby those
withoutadvanced trainingin mathematics or computer programming, (2) goodtextbooks
areavailableto helpthebeginner, (3) efficientnumerical algorithms havebeendeveloped
for implementing thefinitedifferencemethodoncomputers, (4) well-documented computer
programsfor solvingproblemsof groundwater flow and solutetransportare widely
availableat little or no cost, (5) the accuracyof solutionsto steady-stateand transient
groundwater flow problemsis generallyquitegood,and(6) severalcasehistorieshave
beenpublishedthat describesuccessful applicationsof the methodto the solutionof
practicalproblems.
Unfortunatelythe finite differencemethodalsohasdisadvantages: (1) the method
worksbestfor rectangularor prismaticaquifersof uniformcomposition; it is difficult to
incorporate irregularor curvedaquiferboundaries, anisotropicandheterogeneous aquifer
properties, or slopingsoilandrocklayersintothenumericalmodelwithoutintroducing
numerousmathematicalandcomputerprogramming complexities,(2) the accuracyof
solutionsto solutetransportproblemsis lower thancanbe obtainedby thefiniteelement

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

10 Introduction

Tovic
_
Referenq:gs

Early Developmentsin Petroleum Bruce et al. (1953), Peaceman and Rachford


ReservoirModeling (1962).

Saturated Groundwater Flow Remsonet al. (1965), FreezeandWhitherspoon


(1966), PinderandBredehoeft(1968).
Unsaturated Groundwater Flow Philip(195?), Aschroft et al. (1962), Freeze
(1971), Brutsaert(1973).

SoluteTransport Stone and Brian (1963), Oster et al. (1970),


Tanji et al. (1967),Wierenga(1977).

Applicationto field problems Orlob and Woods (1967), Gambolaft et al.


(1973), Fleck and McDonald (1978).

Comprehensive
References Trescott and Larson (1977), Ames (1977),
Mitchell and Griffiths (1980), Lapidus and
Pinder (1982).

ComputerPrograms Trescott et al. (1976), Konikow and Bredehoeft


(1978).

Table 1.1 Selected references for the finite difference method.

method(which is now widely usedin place of the finite differencemethodfor this


purpose).
The finite element method was first used to solve groundwaterflow and solute
transportproblemsin theearly1970's(Table1.2). The methodhasseveraladvantages: (1)
irregularor curvedaquiferboundaries, anisotropicandheterogeneousaquiferproperties,
andslopingsoilandrocklayerscanbeeasilyincorporated intothenumericalmodel,(2) the
accuracyof solutionsto groundwater flow and solutetransportproblemsis very good
(exactin somecases),(3) solutionsto the solutetransportequationare generallymore
accuratethansolutions obtainedby thefinitedifferencemethod,and(4) thefiniteelement
methodlendsitself to modularcomputerprogrammingwhereina widevarietyof typesof
problems canbesolvedusinga smallsetof identicalcomputer procedures.
The principaldisadvantages of the finite elementmethodfor solvingproblemsof
groundwaterflow and solutetransportare (1) for simpleproblems,the finite element
method requires a greater amount of mathematicaland computerprogramming
sophisticationthandoesthefinitedifferencemethod(althoughthisdisadvantagedisappears
for morecomplicated problems),(2) therearefewerwell-documented computerprograms
and case histories available for the finite element method than for the finite difference
method,and(3) therearefew textbooks availableto assistthebeginner.
The purposeof thisbookis to helpremovesomeof thesedisadvantages. Part 1
describesthe basicprinciplesof the finite elementmethodas it appliesto mathematical
modelsof groundwater flow andsolutetransport basedon equations1.1 to 1.5. Obtaining
a numericalsolutionto a groundwaterflow or solutetransportproblemusingthe finite
elementmethodis performedin five basicstepsthatwill bedescribedin detailin thenext
five chapters.Computer implementation of eachof thesestepsandcomputer programsfor
solvingequations1.1 to 1.5 arein Part2. The application of thefiniteelementmethodto
the solutionof practicalgroundwater flow andsolutetransportproblemsis discussed an
Part 3.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter1 11

To•ic
_
References

EarlyDevelopmentsin Petroleum Price et al. (1968).


ReservoirModeling
Saturated Groundwater Flow Zienkiewicz et al. (1966), Javandel and
Witherspoon(1968), Zienkiewicz and Parekh
(1970), Pinderand Frind (1972).
Unsaturated Groundwater Flow Neuman (1973), Gureghian et al. (1979),
PickensandGillham (1980).

Solute Transport Price et al. (1968), Guymon et al. (1970),


Neuman (1973), Van Genuchtenet al. (1977),
Kh'kneret al. (1984).

Application
to fieldproblems Pinder(1973), GuptaandTanji (1976), Senget
andFogg(1987).

Comprehensive
References Ziekiewicz (1971), Pinder and Gray (1977),
Lapidus and Pinder (1982), Huyakom and
Pinder(1983).

ComputerPrograms Neumanand Witherspoon(1970), Reevesand


Duguid (1975), Segol et al. (1975), Pickenset
al. (•979)

Table 1.2 Selected references for the finite element method.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

12 Introduction

NOTES AND ADDITIONAL READING

1. This textassumes thereaderhasa thoroughunderstanding of thebasicterminologyand


principlesof groundwaterhydrology.Readerswithoutthisbackground shouldreview
thesesubjectsbefore.proceeding.Excellentbooksfor thispurposeare Freezeand
Cherry(1979), de Marsily (1986), de Wiest (1969) andBear (1979). The readeris
alsoassumed to havea basicknowledge of differentialandintegralcalculusandlinear
algebrabutnopriorknowledge of numericalmethods is required(a concise
reviewof
theconceptsfromlinearalgebra
usedin thefiniteelementmethodisin Appendix Fv').
2. Reviewsof thehistorical
development
of groundwaterflow andsolutetransport
models
arein HuyacomandPinder(1983) andPrickett(1975).

3. Analyticalsolutionsto selected groundwater flow andsolutetransport


problemsarein
Bear (1979), Javandelet al. (1984), andBearandVerruijt (1987).

4. Reviews of existingcomputermodelsfor solvinggroundwaterflow and solute


transport problemsby thefinitedifferenceandfiniteelementmethodarein Bachmatet
al. (1978) and Oster (1982). Thesereportscomparemodel capabilitiesand give
referencesfor the numericalalgorithmsused,user documentation,and program
listings.

5. An excellent
introduction totheuseof thefinitedifference
methodforsolving
problems
of groundwaterflow is in Bennett(1978)whichis designedasa programmedguidefor
self study.

6. Segerlind
(1984)is anexcellent
introduction
tothefiniteelement
method.
7. Other references for the use of finite difference and finite element methods to solve
groundwaterflow and solutetransportproblemsare Remsonet al. (1971) (advanced
treatmentof finite differencemethod,introductionto finite elementmethod),Pinderand
Gray (1977) (intermediatetreatmentof bothmethods),Wang and Anderson(1982)
(introductory
treatment
of bothmethods,
contains
computer
programs
in FORTRAN),
Huyakorn and Pinder (1983) (advancedtreatmentof both methods),and Bear and
Vernalit(1987)(intermediate
treatment
of bothmethods,
contains
computer
programs
in
BASIC).

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 2

STEP 1: DISCRETIZE THE PROBLEM DOMAIN

The first stepin thesolutionof a groundwater flow or solutetransportproblemby the


finiteelementmethodis to discretizetheproblemdomain(aquifer,soilprofile,etc.). This
is doneby replacingtheproblemdomainwith a collectionof nodes (or nodalpoints)and
elementsreferredto asthefinite elementmesh.(Figure2.1). Elementsconsistof twoor
morenodesjoinedtogether by line(or arc)segments.Therearedifferentelementtypesfor
one-,two-, andthree-dimensional problems andfor problemswith axisymmetry (Figure
2.2). Elementsmaybeof anysize,thesizeandshapeof eachelementin themeshcanbe
different,and severaldifferenttypesof elementscan be usedin a singlemesh. The
materialpropertiesof the aquifer(e.g.,hydraulicconductivityor dispersivity)mustbe
specified foreachelement.Thevaluesof thematerialproperties areusuallyassumed tobe
constantwithineachelementbutareallowedto varyfromoneelementto thenext.
The first stepin the finite elementmethodthen,is to draw the finite elementmesh.
Althoughcomputerprogramsaxeavailablefor this purpose,it has been the author's
experience thatexceptfor verylargeproblems(i.e.,problemswith morethanoneor two
hundrednodes)or for three-dimensional problemswithcomplexgeometry, little(if any)
timeis savedby theiruse. Thefollowingprocedure will be satisfactory
for mostproblems
encountered in practice. First, preparea drawingof the problemdomainto some
convenient scaleon a pieceof graphpaper.It is desirable thatthedrawingscalebethe
samein eachof the coordinatedirectionsalthoughthisis not necessary.Next, thefinite
elementmeshis addedto theoriginaldrawingor to a transparent overlayby drawingin the
positionsof the nodesandtheelementboundaries.Then, eachriodeis assigneda node
numberandeachelementis assigned anelementnumber(seebelow). As a final'step, an
inputdatafile for thefiniteelementcomputerprogramcanbe prepaxed directlyfromthis
drawing.
Whenpreparing thef'miteelement meshit isimportant toremember thattheprecision of
thesolution obtained andthelevelof computational effortrequiredto obtaina solution will
bedeten'nined to a greatextentby thenumberof nodesin themesh.A coarsemeshhasa
smallernumberof nodesandwill givea lowerprecisionthanafine mesh. However,the
largerthenumberof nodesin themesh,thegreaterwill betherequiredcomputational effort
andcost. Unfortunately, it is usuallynotpossible to determinein advancethenumberof
nodesrequired to achievea givenlevelof precision. Lr•fact,theonlywayto determine the
precisionof a solutionobtained by theœmite elementmethodis to repeatthecalculations
with a finermeshto seeif theresultschangesignificantly.For thisreason,it is bestto start
with a coarsemeshconsisting of onlya few nodes.The inputdatafor sucha meshcanbe
preparedeasilyanda solutioncanbeobtained with little computational effort. A second,
finermeshis thenpreparedthathasa greaternumberof nodesin thosepartsof themesh
wherethe first solutionindicatesthefield variableis varyingrapidlyor wherethemost
preciseresultsarerequired.A secondsolutionis thenobtainedandcompared withthe
first. If computednodalvaluesaresignificantly differentfrom thoseobtainedfromthe
coarsermesh,the meshis againrefinedanda thirdsolutionis obtained.This process is
repeateduntiltherearenosignificant changes in computed valuesof thefieldvariable(at
leastin thepartsof thedomainof mostinterest).Usuallynomorethantwoor threemesh
refinements
arerequired.

13
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

14 Step1: Discretize
•e Problem
Domain

one-dimension
rainfall

soil surface

two-dimensions
soil surface

water table

element

thrc½-dimcn$iQn•
element

Figure 2.1 Discretization of one-, two-, and three-dimensionalproblem domains.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter2 15

One-dimensional
elements

Two-dimensional
elements

Three-dimensional
elements

Axisymmetric
elements

Figure 2.2 Some types of finite elements.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

16 Step1: DiscretizetheProblemDomain

To preparea f'miteelementmeshthatprovidessolutionswith an acceptable level of


precisionwith a reasonable amountof computional effortrequiresconsiderablepracticeand
for this reason,this stepof the finite elementmethodis still consideredan "art"by most
modelers. It helps considerablyif the person drawing the mesh is familiar with
groundwater
flow and solutetransport processes.Beingable to visualizethe flow or
lransport
processis especiallyhelpfulandtheuseof roughlysketched flow netsis to be
encouraged.It is importantto remembe.
r that solutionswith'similaraccuracycan be
obtainedfrom two meshesthatappearquitedifferentand,for thisreasonthereis no single
"correct"choiceof meshfor a particularproblem.The followingsetof "rules"describe
someof theprocedures usedby theauthorto preparea finite elementmesh. Theserules
are by no means definitive but they should provide some initial guidanceto the
inexperienced
modeler.

2.1 RULES FOR NODAL POINT PLACEMENT

The finite elementmeshconsists of severalnodes(problemshavebeensolvedwith as


manyasonemillionnodesbuttypicallyonlya few hundrednodesareused).Eachnodeis
assigned a uniquenodenumber. Nodenumbersrangefrom oneto thenumberof nodesin
themesh;no "skips"in thenodenumbersareallowedandno two nodescanhavethe same
nodenumber. Eachnodealsois assigned a setof nodal coordinates.Theseare the (x),
(x,y), (x,y,z), or (r,z) coordinates
of thenode.

1. Placenodesalongtheboundaries of theproblemdomain,at thelocationof pumping


wellsor otherpointsources or sinks,andat anypointwherea computed valueof the
fieldvariableis desired(Figure2.3). Nodeslocatedatpointswithknownvaluesof the
fieldvariablearesometimes calledDirichletnodes,becausetheyareusedto represent
Dirichletboundary conditions(seesection 4.5). Examplesarenodesalongconstant-
headboundaries or at pointsof knownsoluteconcentration (alsoseeChapter20).
Nodes locatedat points with known rates of groundwaterflow or soluteflux are
sometimescalledNeumannnodes,becausethey are usedto representNeumann
boundary conditions(seesection
4.5). Examplesarenodeslocatedatproduction
and
injectionwellsor recharge
boundaries(alsoseeChapter20).
2. Placenodesclosesttogetherin thosepartsof the problemdomainwherethe field
variableis expected to changemostrapidly. This will includeregionsnearpoint
sourcesor sinks,andin anyotherpartof theproblemdomainwheregradients in head
or soluteconcentration
areexpected
to belarge(Figure2.4).
3. Placenodesalongtheinterfacebetweentwodifferentmaterials, for examplealongthe
interfacebetweentwo soil or rock layersthathavedifferenthydraulicconductivities
(Figure 2.5). Becausematerialpropertiesmust be constantwithin an element,an
interfacebetweentwodifferentmaterialswill alsobeanelementboundary (seebelow).

4. Numberthe nodesto minimizethesemi-bandwidthof theresultingsystemof linear


equations.Minimizationof the semi-bandwidth
is desirablebecausethe size of the
system of linearequations
created
bythefiniteelementmethodcanbequitelarge(see
section4.5). Whenthissystems of equations
is operated
onin matrixform,thestorage
capacityof manycomputers canbe quicklyexceeded.The semi-bandwidth for any
meshcanbecomputed from:SBW= R+1, whereR is themaximumdifference in any
two nodenumberswithina singleelementin themesh(ff thevalueof thefield variable
is specifiedat a nodehoweverthatnodeis not usedin the calculationof R, seesection
4.4). The minimumbandwidth for a particularmeshcanusuallybe achievedby
numbering nodesacrossthenarrowdimension of theproblemdomain(Figure2.6).
For problemswith verycomplexgeometry,a computerprogrammaybe requiredto
minimize the semi-bandwidth of the man-ix.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
2 17

impermeable
boundary

constant
head ,, . ./' .. constant
head

. .../I..
r-'"'"'
•','- ß
pumpingwell,pumpingrate= Q

Figure2.3 Placenodesalongboundaries
of problemdomainand at point sources
and sinks.

pumpingwell

impermeable
boundaries

Figure 2.4 Place nodesclosetogetherwhere valuesof the field variable are expected
to change rapidly.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

15 S•½p1' Discr½fiz½
theProblemDomain

silt

correct material interface incorrect

Figure2.5 Correctnodalplacement
at the interfaceor two differentmaterials.

node numbers

3 6 9 12 15 18

SBW = R+I
=4+1
CO1TCCt
5 8 11 14 17 =5

1 4 7 10 13 16

13 14 15 16 17 18

$BW = R+I
=7+1
inCOlTeCt
=8

1 2 3 4 5 6

Figure 2.6 Numbering nodes to minimize semi-bandwidth of system of equations.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
2 19

2.2 ,RULES FOR SELECTING ELEMENT SIZE, SHAPE, AND


PLACEMENT

The size and shapeof theelements


in a meshis determinedprimarilyby the sizeand
shapeof theproblemdomain, thenumber of different
typesof aquifermaterials,andby the
numberof nodesin themesh.In problems thathavea complexgeometry(e.g.,causedby
an irregulardepthto bedrock)or geologicstructure (e.g.,dueto thepresence of faults)
many elementswill be required. In problemswith a simplegeometry(e.g., shallow
alluvialaquiferunderlainby horizontalbedrock)fewerelementswill be required.If the
problemdomaincontains curvedboumdaries orinterfacesdifferenttypesof elements may
be usedthanif theboundaries andinterfacesconsist
of straightlinesor planes.Elements
will generallybe smallerin pansof themeshwherethefieldvariableis changing rapidly,
becausenodeswill be placedclosesttogetherin theseareas. When drawingthe finite
elementmesh,eachelementis assigned a uniqueelementnumber. In mostcomputer
programs, theelementnumbers beginwithoneandcontinuesequentially to thenumberof
elementsin the mesh. However,theway thatelementnumbersareassigned
will haveno
effectonthesizeor semi-bandwidth
ofthematrices
generated
duringthesolution
process.
Eachelementis der'reed usingtwoormorenodes;thenodalcoordinates definethesizeand
shapeof theelement.Forthisreason thenodenumbers for eachelementarelisted.Some
convention is usedto insurethatnocl•numbers for all elements of a giventypein themesh
arelistedin thesameway (seeChap:er 4). Thematerialproperties alsomustbe specified
for eachelementin themesh. Because, in mostcases,thematerialproperties for several
elementswill be the same(e.g., all elementswithin a particular.geologicstrata)it is
commonto assignall elements withthesamematerialproperties to a commonmaterialset.
Theproperties for eachmaterialset•,• thenlistedonce.

1. Use the simplesttype(s)of elen:entrequiredfor a particularproblem. This usually


meansthatwe uselinearbarelements for one-dimensional problems,lineartriangleor
rectangleelementsfortwo-dimem'ionalproblems, andlinearparallelepiped
elements for
three-dimensionalproblems(seeChapter4). Howeverwe shouldnot hesitateto use
more complex elements,especiallywhen curved boundariesor interfacesare
encountered.The biggestdisadvantage in usingcomplexelements,whichcanhaveas
manyas32 nodes,is thattheirusecangreatlyincrease thechanceof errorsoccurring
duringthepreparationof theinputdata.
2. The edgesof adjacentelementsshouldneveroverlap,nor should"gaps"appear
betweenelementsin themesh(1=,• 2.7).

3. Materialproperties
areusuallyassumed tobeconstant withinanelement,buttheycan
vary from oneelementto thenext. Thereforenoelementsshouldoverlapaninterface
betweentwo differenttypesof w.aterials(Figure2.5).

4. The shapeof theelementscanaffecttheaccuracy of theresultingsolution.In general,


theuseof highlydistortedelementsshouldbe avoided.Thisis particularlyimportant
when solvingtransientgroundwater flow or solutetransportproblemsbecausethe
elementshapeinfluences thesizeof thetimesteprequiredto obtaina stablesolution
(seeChapter5).

5. Do notchangeelementsizeabru?tly; instead
usea transition
regionto achievea gradual
changein elementsize(Figure2.$).

6. Takeadvantage
of s'ymmetry
in theproblem
domain
toreduce
thenumber
ofelements
(and nodes)in the mesh(Figure2.9). Keep in mind, however,that the boundary
conditions,
initialconditions,
materialproperdes
anddomaingeometry all mustdisplay
symmetryto usethisapproach.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

20 Step1: DiscrefizetheProblemDomain

element 1
gap

element 2

gaps overlapping
edges

Figure 2.7 Gaps and overlappingedgesfor adjacent elementsare not permitted.

triangularelements Iriangularandrectangular
elements

two typesof rectangularelements quadrilateralelements

Figure 2.8 Example transition regions for changing from a coarse mesh to a fine
mesh.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter2 21

constant head impermeableconstant


head constant
head impermeable
boundary
boundary boundary

/
well with pumpingrate-- Q
x
well withpumpingrate-- Q/4

} silt

Three-dimensional, Two-dimensional,
cartesiancoordinatesystem axisymmetric
coordinatesystem

Figure 2.9 Use symmetry to reduce the number of elements and nodes in the mesh.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

22 Step1' DiscretizetheProblemDomain

2.3 EXAMPLE MESHES

I I !1

II I

I I I I • I

I \1111
I ! i /t

I !

I/I I

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
2 23

km

380 Nodes
•_60 Elements
2 Element Types
(linear triangle, linear
quadrilateral)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

24 Step1: Diseretizethe ProblemDomain

I I I I I I
0 melers 500

150 Nodes
92 Elements
3 Element Types
(lineor quodriloterol,
quodr(3tic quodriloterol,
mixed lineor-quodrotic
qu(]driloterel )

,.

feet

185 Nodes
312 Elemenls
I Elemenl Type
(lineor Irlongle),

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapte•
2 25

70 Nodes
I?_" Elements
I Element Type
(lineor triangle

l•;111!
II1 I I I ! I I I
L'lli ill I I i I', ! I I
i:•till II I I i I, I I I
l'lllil ii ! i ! , i I I
•'•!1111i!lil !. I I, I I
H•ilIII II !1 J I I I ! ' I .I I

i:'•111I ! I i I ! I I
•iill ! I III i I I I I

o IO
i i
492 Nodes .feet
456 Elements
2 Element Types
(oxisymmetric lineor triangle,
(oxisymmetriclineor rectongle)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

26 Step1: DiscretizetheProblemDomain

0 10
I ' I I
meters

450 Nodes
437 Elements
2 Element Types
(linear triangle,
linear quadrilateral)

'' I III I I I III


'q'T[l•IIIII I I I I I I I I I I I I ! I I I
50:5 Nodes
'•50 Elements
I Element Type
(linear quadrilateral)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
2 27

I 54 Nodes
130 Elements
2_.Element Types
(linear triangle,linear
quadrilateral )

160 Elements
I Element Type (Linear triangle)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

28 Step1: DiscrefizetheProblemDomain

Problems

For problems1 to 5, drawa finite elementmeshfor the aquiferusingthe elementtypes


givenin theproblem, labelnodeandelement numbers, andcompute thesemi-bandwidth.

1. Planview of alluvialaquifer

River
( Constant
head
boundary
Well •2
ImpermeableValleyWalls Well #1
(No flow boundary)

2. Planview of sedimentary
aquifer

River
(Constantheadboundary)

Low permeability
basalt
(No flow boundary)

3. Cross-sectional
viewof sedimentary
aquifer

PumpingWell
Groundwater Divide
ow boundary)

shale

sandsto

Impermeable Bedrock
(No flow boundary)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
2 29

4. Planviewof alluvialaquifer

Impermeable ValleyWalls Groundwater Divide


(No flow boundary) (No flow boundary)

(Constanthead

boundary ßWell
#3

a) Pumpingratesfor all wellsareequal


b) Pumpingratesfor all wellsarenotequal

5. Planview andthreecross-sections
for alluvialaquifer

ImpermeableValley Walls
(No flow boundary)
River
( Constant
A' B' head
boundary)

A B

A A' B B'C !

6. Obtaina geologic
mapfor anaquiferin yourarea.Drawa finiteelementmeshusinga
mixtureof two-dimensional
elements,label nodeandelementnumbers,andcompute
thesemi-bandwidth.
Speculate
aboutap•opriateboundary
conditions
to usewithyour
mesh.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 3

STEP 2: DERIVE THE APPROXIMATING


EQUATIONS

THE METHOD OF WEIGHTED RESIDUALS

The second
stepin thefiniteelementmethodis to deriveanintegralformulationfor the
governing
groundwaterflow or solutetransport
equation.Thisintegralformulation leads
to a systemof algebraicequationsthat can be solvedfor valuesof the field variable
(hydraulichead,pressure head,or soluteconcentration)at eachnodein themesh. Several
methods canbe usedto derivetheintegralformulation for a particular
differentialequation.
The variational method hasbeenusedto deriveintegralformulationsfor the differential
equations thatgovernthe behaviorof mechanical systemse.g.,in the fieldsof elasticity
andstructural mechanics.The methodof weightedresidualsis a moregeneralapproach
thatis widelyusedin groundwater flow andsolutetransport modeling.
In themethodof weightedresiduals,anapproximatesolutionto theboundaryor initial
valueproblemis defined.Whenthisapproximate solutionis substituted
intothegoverning
differentialequation,anerroror residualoccursat eachpointin theproblemdomain.We
thenforcetheweightedaverageof theresiduals for eachnodein thefiniteelementmeshto
equalzero.
Consider a differential
equationof theform

L(q•(x,y,z))- F(x,y,z) = 0 (3.1)

where L is thedifferentialoperator,q) is thefield variable,andF is a knownfunction.


Definean approximate solutionq)of theform

•(x,y,z)
= Z Ni(x'Y'Z)
q}i
i--1
(3.2)
whereNi areinterpolation
functions,
q•iarethe(unknown)
valuesof thefieldvariableat the
nodes,and m is the numberof nodesin the mesh. When the approximatesolutionis
substituted
intoequation3.1 thedifferentialequationis no longersatisfiedexactly

L($(x,y,z))-F(x,y,z)
= R(x,y,z)
•: 0 (3.3)

whereR is theresidual or errordueto theapproximate solution.The residualvariesfrom


point-to-pointwithin the problemdomain. At somepointsit may be large and at other
pointsit may be small (the sign of the residualalso can vary from point-to-point).
Thereforewe cannotforceR to bezeroat certainspecified pointsbecause theresidualmay
thenbecomeunacceptably largeelsewhere in theproblemdomain.
In themethodof weighted residuals,
we forcetheweighted average of theresidualsat
thenodesto beequalto zero

30

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter3 31

W(x,y,z)
R(x,y,z)
dgl
=0 (3.4)
whereW(x,y,z) is a weighting
function and/1 represents
theproblemdomain./1 will be a
lengthin one-dimensional
problems, anareain two-dimensional
problems, anda volumein
three-dimensionalproblems.Substituting
equation3.3 intoequation3.4 we have

(3.5)

To evaluate
equation(3.5) we mustspecifythemathematical
formof theapproximate
solution
• and
theweighting
function
W. Inthefinite
element
method• isdefined
inapiece
-wisefashion
overtheproblem
domain.Thevalueof •, within
anyelemente, •(e),is
givenby'
n

i=l

whereNi(e)aretheelement
interpolation
functions(oneinterpolation
function
pernode),(•i
are the (unknown)valuesof the field variable at eachnode,and n is the numberof nodes
withintheelement.Forexample,theapproximate solutionfor a one-dimensional
element
withtwo nodesi andj (Figure3.1) canbewritten

•(e)(x)
: N?(x)
•)i+N?)(x)
•j (3.7)

or in mauix form

$(•)(x):[ N(•)]{•} (3.8)


where

[ N(")I:[ l•i")(x)
•")(x)l (3.9)

{,} : •j (3.•0)
• • •(•)(x)

•-• L(•)

nOdexit)
(x:) nodej
(x:x•))

Figure 3.1 Approximate solution for one-dimensional element with two nodes.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

32 Step2: Derive the Approximating


Equations

Fortheelementin Figure3.1 theinterpolation


functions
arelinear functions
of x

N?'(x)
=x•e)-
L(,)
x Nje)(x
)-_x-x?'
L(,)
(3.•)

where xi(e)
andxj(,)arethecoordinates
ofthenodes,andL(e)istheelement
length(L(O=
xj(e)
- xi(e)).These interpolation
functions
areplotted
inFigure3.2.ThevalueofNi(e)is
oneatnode i anddecreaseslinem'ly
tozeroatnode
j, while
thevalueofNj(Oisoneatnode
j anddecreases
linearlyto zeroat nodei.
At nodei (x = xi(•))
1 0

•(e)(x•)
=N-(e)••)
,,+Nj(e•t•,j
= q•i (3.12)

atnode
j (x= xj(e))

N.(•j)
0+N(.• (3.13)

and
atthemidpoint
oftheelement

(3.14)

N?)(x)
1

1/2
N•')(x)
0

nodei nodej
x

Figure 3.2 Linear interpolation functions for one-dimensional element with two
nodes.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 33

Severalothertypesof interpolation
functions
thatcanbeusedto obtainanapproximate
solution
forq•forusein solving
one-,two-,andthree-dimensional
problems aredescribed
in Chapter4.
In additionto theinterpolation
functions,
theformof theweightingfunctionW in
equation
3.5 alsomustbespecified. Several
subsetsof themethod
of weighted
residuals
aredefinedby thechoiceof weighting
functionused.

3.1.1 Subdomain Method

In the subdomainmethodthe value of W is equalto one within a small part of the


problemdomainsurroundinga node(thesubdomain) andzeroelsewhere.The sizeof
subdomain
is usually
chosen
tobeequaltothesizeof theelement
containing
thenode.For
a one-dimensional
element
theweighting
functionfora nodeis givenby

0 otherwise

where
L(e)is
thelength
oftheelement
(Figure
3.3)

L(•)
_-x•)- x?)
1

node nodej

(x=x
I
I

Figure 3.3 Weightingfunctionfor node i in the subdomainmethod.

3.1.2 Collocation Method

Thecollocation
methodis a special
caseof thesubdomain
method
whenthesubdomain
is chosen
to beverysrnnll_
Fora one-dimensionalelement
Wi(x) = õ(xi _+Ax) (3.16)

where 8 is the Dirac delta function and Ax is some small distance. This notation means that
withina distance
fix of nodei Wi(x)= 1,otherwise
Wi(x)= 0 (Figure3.4)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

34 Step2: Derivethe Approximating


Equations

lm

O' : :
nodei nodej

Figure 3.4 Weighting function for node i in the collocation method.

3.1.3 Galerkin's Method

In Galerkin'sMethodtheweighting
function
for a nodeis identicalto theinterpolation
function
used
todefine
theapproximate
solution
•. Fortheone-dimensional
element
with
two nodes

Wi(x= xiL- x forx> xi


Wj(x)= L forx>xi (3.18)
whichis plottedin Figure3.5.
1--

W(x)

nodei nodej

Figure 3.5 Weighting function for node i in Galerkin's Method.

Galerkin'sMethod is the subsetof the methodof weightedresidualsthat is most


commonlyusedto solvegroundwater flow andsolutetransport problems.
After specifying theformof theapproximate solutionandweightingfunction,we can
evaluatetheintegralin equation3.5 to obtaina systemof linearequations
of theform

[K] {•} = {F} (3.19)


that can be solved for the values of the field variable at each node in the mesh, We will
illustrate
theentireprocess
withanexample.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter3 35

3.2 A FINITE ELEMENT EXAMPLE

The columnof soilin Figure3.6 is saturatedandwateris flowing verticallydownward


at a constantrate Q. Hydraulicheadis heldconstantat theupperandlowerendsof the
columnand we wishto calculatethe valuesof headat pointsA andB. The problem
domainhasbeendividedinto a meshwithfourelementsandfive nodes.The governing
differentialequationis theone-dimensional
formof thesteady-state,
saturated
groundwater
flow equationderivedin AppendixI

(3.20)

whereKx is thesaturated
hydraulic
conductivity
in thex direction
andh is hydraulichead.
Using
themethod
ofweighted
residuals
wewilldefine
anapproximate
solution
•. Ifthis
approximate
solution
issubstituted
intoequation
3.20,thedifferential
equation
is nolonger
satisfied
exactly

wheretheresidualwill vary frompoint-to-point


withintheproblemdomain. Define the
vector[ R} to be thevalueof residualat eachnodein thefinite elementmesh

element numbers node numbers

h:12 •2 1 (x=0)
Kx=l'
{ (1)
• 2 (x:2)

Kx=2 2 (2)
! 3 (x=4)

(3)

Kx=l • 4 (x=7)

(4)
DATUlVl • 5 (x=10)
Q
Finite Element Mesh

Figure 3.6 Example problem for method of weighted residuals.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

36 Step2: DerivetheApproximating
Equations

{R} =
R(x
=0)
R(x = 2 )
Rix=4) =
R2
Ra (3.22)

R(x
=7) R4]
R(x = 10) Rs

whereRl, forexample is thevalueof theresidual atnode1. Theresidual atanynodei, Ri


represents
theerrorbetween thetruevalueof hydraulic headandtheapproximate solution
h
at thatnode.Theapproximatc solutionat a nodeis dctcrminedby thcvaluesof hydraulic
hcadat thenodesin all elemcnts thatarejoinedto nodei, For example,elements2 and3
arejoinedto node3. Thusthe valucsof hydraulichcadfor thc othernodesin these
elemcnts contribute to thc residual at node 3. We can write this as

where the fret term is the contribution of clcment 2 to the residual at node 3 and the second
termis thecontribution
of elcmcnt3 to thcresidualat node3. In gcncral,we canwrite
P

Ri= Z R?) (3.24)


wherep is thcnumberof clements
thatarejoinedto nodei.
The conlributionof elemcnte to theresidualat nodei can be obtainedfrom the integral
formulation
for thatnode.For theone-dimensional elementsin ourexample

R?
)=_j,x,
•1•i
') I•ø)
•.2•.!e)
ax dx (3.2:5
where
xi(e)andxj(e)arethecoordinates
ofthenodes
ateach
endoftheclcmcnt,
Ni(e)isthe
weighting functionfor nodei in element
e (whichis identicalto theinterpolation
function
fornodei in elemente because weareusingGalerkin's Method), andKx(e)is thesaturated
hydraulic
conductivity fortheelement (Kx(e)is assumedto beconstant withinanelement
butcanvaryfromoneelementto thenext).The equation wasmultipliedby a negativeone
for later convenience.
A similarequation canbewrittenfor thecontribution
of elemente to theresidualat any
othernodej joinedto theelement

= N? ax2
Lngeneral,if anelementhasn nodesit will contribute
to theresidualat n nodes.
Theinterpolationfunctionsfor thetypeof elements in Figure3.6 arein equation3.11.
From
equations
3.?and3.11theapproximate
solution
• isgiven
by

(3.27)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter3 37

Because
theapproximate
solution
isalinear
function
ofx,•x2 isnotdefined.
The
approximatesolutiondoes havea continuous
firstderivative,however, sowe canevaluate

equation
3.25ifwerewrite
itinteauus
of•-•.
Usingintegration
by partswe canwrite

.28)

wherethesecondtermon theright-handsideof equation3.28represents


groundwater
flow
across the element's surface. For elements on the exterior of the mesh this term will be
usedto representspecifiedratesof groundwater
flow (Neumannboundary
conditions).
Wewillgive
this
term
thesymbol
•iie)

F?)(N?)
K?) (3.29)

F?)willbepositive
ifwater
isenterLug
themesh.
If noflows
arespecified
oratimpermeable
aquifer
boundaries
•e)willbezero.
Forelements
ontheinterior
ofthemesh,
theterm F?) for
adjacent
elements
willhaveopposite
signscancelling
outthecontribution
ofl•ie)forthetwo
elementsfor thenode(s)theyshare.In two- or three-dimensions
we have

(3.30)

where
S(•)
isthesurface
area
oftheelement
along
thespecified
flowboundary
(see
Section
3.3).
Substituting
equation3.28intoequation
3.25we have

zi

= ax -•-•-x
dx (3.31)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

38 Step2: DerivetheApproximating
Equations

From
theclef'tuition
for• (equation
3.27)wecanwrite

a•(½)(x)
ax =3-•(
N?)hi+N•
½)
hj) (3.32)

Promthedefinitions
of theinterpolation
functions
we canwrite

(3.33)
•x' = L(½) =

(3.34)

a/•) -lh. •h.


•x L(½)' L(½)
J
1

•;$(-h•
+h) (3.35)

Substituting
equations
3.34and3.35intoequation
3.32gives

1 1

= -L(eJ2(
- )(-hi+hj)
but
x?)- x? = L(•)and
wehave

(3.36a)
L(½)
(hi- hj)

Sin:fil•ly for the contribution


of elemente to theresidualat nodej

R?= •'•(-h
K?)i+hj) (3.36b)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 39

Equations
3.36aand3.36bcanbecombined
andwritten
inmatrixformas

where

(3.39)

2x2

is called the element conductance matrix.


Theelementconductance
matrixdepends
onthehydraulic
conductivity
of theaquifer
material
withintheelement
(Kx(e)),
andthesize(L(e))andshape
(through
theinterpolation
functions
fortheelement)
of theelement.[K(e)]is alwaysa square,
symmetric
matrixwith
a size nxn where n is the number of nodes in the element. Thus for a one-dimensional
elementwithtwonodesthesizeof [K(e)]is 2x2,fora two-dimensional
elementwiththree
nodesthesizeof [K(e)]is 3x3, andsoon.
We cancompute theelement conductance
matrixforeachelement
in themeshin Figure
3.6onceweassign
nodenumbers
tothei thandj thnodes
foreachelement.
Thisisdone
in Figure
3.7where
thei thnode
forelement
1 isassigned
tonode1,thej thnodefor
element
1 isassigned
tonode2, thei thnodeforelement
2 is assigned
to node2, andso
on.

node numbers element numbers

,1 node numbers

(2) element
number, e i j K•) L(e)
1 1 2 1 2

2 2 3 2 2
(3)
3 3 4 1 3

4 4 5 1 3
(4)

Figure 3.7 Assigningnode numbersto element nodes i and j

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

40 Step2: DerivetheApproximating
Equations

The elementconductance
matrices
canthenbecomputed
asfollows

[K0)]
= 1 - = -1/2
-1
1/'21/2

We cancombinetheelementconductance
matricesto obtaina systemof linearequationsof
the form

JR} = [K] {hi - {F} = {0l (3.40)

where{R} is theglobalresidualmatrix, [K] is theglobalconductancematrix, {h] is the


vectorof unknownhydraulicheads,and {F} is a vectorcontainingthe specifiedfluxesat
Neumannnodes(seesection3.3). For ourexampleno fluxeswerespecified,{F} = {0 },
and we can write

hi 0

{R} = R•
R2
Ra {h} = ha 0=} = (3.41)

Rs $xlh4 h5 $xl •
The entriesof the globalconductancematrix can be obtainedby combiningthe element
conductance matricesfor all theelementsin themesh. An easyway to do thiswhenthe
numberof elements
is smallis toexpandeachelementconductance
matrixto thesamesize
asthe globalconductance
matrix. Thesecan thenbe addedtogetherto form the global
conductance
matrixusingtheformula
m

[K]= E [ (3.42)
gld•al ½---1•

where m is the numberof elementsin the mesh. For the elementsin our example,the
expandedformof theelementconductance matrices
are
1/2 -1/2 0 0 0 0 0 0 0 0

[K0)] = -1/2
0 1/2
0 0
0 0
0 • [K(2)I= 0
0 -11-1 0•
1 0

0 0 0 0•
0 0 0 0 0000•
0 0 0 0

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 41

o o o o o o
o o o
[ = o 1/3 -1/3 [K = o o
o o
o -1/3 1/3 0 1/3 -1/3
o o o o -1/3 1/3j

andtheglobalconductance
matrixis

[K]
global

1/2 -1/2 o o o
-1/2
--! o •
1+]/3 -1/3

-- i -1 0
0 o -1/3 1/3

1/2 -1/2 0 0 0

-1/23/2-1 o •
= i -14/3
-1/3 0-1/3
0 o
2/3-1/3
-1/3 1/3

Thesystem
of equations
thatresultwhenthisglobalconductance
matrixis substituted
into
equation3.40 is

1/2 -1/2 0 0 0 hi 0
h2
-1 0 • h3 _-•
-1/23/'2 (3.43)

-14/3
0-1/3
0-1/3
0-1/3
2/3-1/3
1/31

Butwe knowhi = 12andh5= 0 (nodes1 and5 aresometimes


calledDirichlctnodes)
fromtheboundary
conditions
andwecanusethisinformation
tomodifyequadon3.43(the
procedure
is explainedin section4.5)

3/2 4/3 -1
-1/3 2/3J•.h4
h3 (3.44)

fromwhichweobtainh2 = hA = 9.33,h3 = 8.0,andh4= ha = 4.0.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

42 Step2: DerivetheApproximating
Equations

This examplehasillustratedeachof the majorstepsof the finite elementmethod. To


review we first discretizedthe problemdomaininto a collectionof nodesandelements
(Figure 3.6). We then usedthe methodof weightedresidualsto obtainan integral
formulationfor the residualat each node. This integral formulationcontainedthe
differential
equation
written
interms
oftheapproximate
solution
•. Because
thesecond
derivativeof approximate solutionwasnotdefinedfor ourchoiceof element,we usedthe
product ruleto obtainanintegralformulation
for theresidualat a nodein termsof thefh'st
derivativeof the elementinterpolationfunctionsandthe valuesof hydraulicheadat the
nodes.Whentheseintegralswereevaluatedwe obtainedan expression for the element
conductance matrix [K(e)]. The conductance matrix was then computedfor all of the
elementsand,by combiningthesematrices, theglobalconductance matrixwasobtainedfor
the finite elementmesh. The golbalconductance matrixis onepartof a systemof linear
equations [K] {h} -- {F} where{F] containsanyspecifiedflow ratesat Neumannnodes
(seeSection3.3). Finallythissystemof equations wasmodifiedusingtheknownvalues
of hydraulichead on the boundaryof the mesh and then solvedto obtainvaluesof
hydraulicheadat theremainingnodes.
The procedureusedfor this examplecan be generalizedto includetwo- and three-
dimensional problemsaswell asproblems of unsaturatedflow, transientflow, andsolute
transport.

3.3 STEADY-STATE, SATURATED FLOW EQUATION

The three-dimensional
formof theequationfor steady-state
groundwater
flow through
saturated
porousmediais writtenas

(3.45)

where
Kx,Ky,andKzarethesaturated
hydraulic
conductivities
oftheporous
media
inthe
x, y, andz coordinatedirections,andh is hydraulichead(AppendixI). As in theprevious
section,we will assumeanapproximate solutionfor h of theform

(3.46)

where
•(e)istheapproximate
solution
forhydraulic
headwithin
element
e,N!e)arethe
interpolation
functions
for eachnodewithinelemente, n is thenhmberof nodeswithin
elemente, andhi aretheunknownvaluesof hydraulicheadfor eachnodewithinelemente.
Whentheapproximate solutionis substituted
intoequation3.45, thedifferentialequationis
notsatisfied
exactlyandanerroror residualoccursat everypointin theproblemdomain.
Thecontributionof anyelemente to theresidualat a nodei to whichtheelementisjoinedis

v(½)
(3.47)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapte•
3 43

whereWi(e)istheweighting
function
fornodei andthelimitsof theintegration
arechosen
to represent
thevolumeof elemente.
In Galerkin'smethodwe choosetheweightingfunctionfor eachnodein theelementto
beequaltotheinterpolation
function
forthatnode,
Wi(c)-- Ni(e).If wealsoassume
that
valuesof saturated
hydraulicconductivity
in thethreecoordinate
directionsare constant
withinan element (butcanvaryfrom oneelementto the next),equation3.47 canbe
written as

V(c)
x••x-•
•-+I•j •y• •,_•z• j dx
dydz
(3.48)

where,forexample,
Kx(e)isthevalueof sanu'ated
hydraulic
conductivity
in thex direction
within element e.
Becausethesecondderivative
of theapproximate solutionis notder'metformosttypes
of elements,we canusetheresultsof equations3.29 to 3.32 to reducetheorderof the
derivatives
of• appearing
inequation
3.48.

Equation3.49 is theintegralformulationfor thethree-dimensional,


steady-state,
saturated
groundwaterHow equation. If the problemdomainis two-dimensional, equation3.49
reduces to

x •N
.(•)
8x •x Y •y 'By
'Jdxdy (3.50)

wherethelimitsof integration
arechosento represent
thearea of elemente. If theproblem
domainis one-dimensional,equation3.49reducesto

(3.51)

wherethelimitsof integration
arechosento representthelengthof elemente.
Beforewe can evaluatetheseintegralequationswe mustfirst choosethe type of
elementandinterpolation functionsto use. In the examplein Figure3.6, theproblem
domainwas one-dimensional and eachelementhad two nodesi andj. In this casethe
interpolation
functionsusedwerefunctionsonlyof x

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

44 Step2: DerivetheApproximating
Equations

N?)(x)
--x••(e)
x andl•j•)(x)--
xL(x?
0) (3.52)

where
x••)and
x?)are
the
coordinates
ofthe
two
nodes
used
todefine
the
element
and
L(e)
is
theelementlength. Becauseeachclementhadtwo nodes,it contributedto theresidualat
twonodes,
Ri(e)andRj(e).In theexample
wcrepresented
these
residuals
asseparate
integralequations

(3.53)

(3.54)

Afterevaluating
theseintegrals
theresultswerecombined
to obtaintheelementconductance
matrix,[ K(½)].A moredirectapproach
is tocombineequations
3.53and3.54toobtaina
matrix-integral
fo•7nulation
for [ K(½)].Fora one-dimensional
element
withtwonodes
[K(e)]isgivenby

(3.55)

If theone-dimensional
problemhadbeensolvedusingelements
with 3 nodes,i, j, k,
equation3.55 wouldbe written

,(•)
,j

[K(e)]-_ ,

dx (3.56)
-•x lxl
axaxax
J
3x3

•)N(k:e) •x3
ax J
3xl

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter3 45

If a two-dimensional
problemwasbeingsolvedusingelements
withthreenodes,i, j
and
k,thematrix-integral
formulation
fortheelement
conductance
matrix
[K(e)]
would
be

[K( =

3x3 •(e) 2x2 2x3 (3.57)


Where
A(e)isthearea
oftheelement
e. Themost
general
formulation
for[K(e)]canbe
writtenfor thecaseof a three-dimensional
problembeingsolvedusingelementswithn
nodes.

[ K(e)]=
• 8.y
8x
8.z
'!K(y
e)

8y 8z J
dx dy dz

V(e) nx3 3x• 3xn (3.58)

where
x•e)isthevolme
ofelement
e. InChapter
4wewilllearn
how
toevaluate
equation
3.58 for severaldifferenttypesof elements.

If we combineequations
3.58 andequation
3.47 we canwrite

(3.59)

nxl nxn

Equation3.59is writtenforeachelement
in themesh.Theseequations
arethencombined
to obtain

(3.60)

pxl pxp

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

46 Step2: DerivetheApproximating
Equations

andby settingtheresiduals
equalto zerowehave
ix] (h) -- (0)
global
pxp p•l px1

Beforewe cansolvethissystemof equations


for thevaluesof hydraulicheadat the
nodes,equation3.61 mustbc modifiedto incorporate knownboundaryconditions.
Procedures
for modifyingequation
3.61forknownvaluesof hydraulicheadarein section
4.5.
If flow ratesare specifiedon the boundaryof the mesh(for exampleto represent
seepage fromlakesof rivers,orrechargefromthesoilsurface)
oratpointswithinthemesh
(forexample torepresentgroundwater withdrawl
bypumping) thesteady-state,
saturated
flow equationbecomes

(3.62)
Kx•-
• +•-•[Ky•)+•'•[,Kz•,J
+qTM0
whereq is the specifiedflow rate. q is positiveif wateris flowinginto themeshand
negative
if waterisflowing
outofthemesh.Thespecified
flowratewithinclement
e,
contributesto the residualat all nodesin elementc. Substitutingequation3.62 into
equation3.49 gives

= -•x• 8x+"Y-i•y8y+K(*)
z 8zi ___
8z +q(e)
clx
dydz
v (•) (3.63)

Theonlynewtermis theintegral

IIIN?)
q(•)dxdy
dz=•) (3.64)

where
F!e)isthe
integrated
specified
flow
rate
fornode
i inelement
e.Ifq(•)represents
a
specified
flowratealongtheboundary
ofelement
e wecanwrite(Section
3.2)

-•- ds
=$s(•
)l•ie)
qds (3.6:5)

where
S(e)isthesurface
area
ofdement
e. Theevaluation
ofthese
integrals
foreach
node
inelement
e gives
thecomponents
ofthespecified
flowman'ix
forelement
e,{F(e)}

{ F(•)3= ß (3.66)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter3 47

Combiningequation
3.66withequation3.59gives

(3.6?)

Wecan
combine
the{ F(e)}foreach
element
inthemesh
toobtain
theglobal
specified
flow
mau'ix {F}
m

(F) ='Z {
gldxil ß= !
(3.68)

andequation3.61becomes

[K] {h} = (3.69)


global global
pxp px1 p•l

If thereare no specifiedflow rates(i.e., no NeumannBoundaryConditions){F} = {0 }.


The evaluationof the integralsin equations3.64 and 3.65 and the assemblyof {F} are
illustrated
for a one-dimensionalproblemin thefollowingexample.

Example
Compute
{ F(e)}foreach
element
inthemesh
shown
below.
Assemble
{F}
10m3/d
(inflow•
'-'-• *
I
'(1) -
2
(2)
3
- (3)
_.4
_••10m3/d
(outflow)

The node numbers for the elements are

element nodei nodej


1 1 2
2 2 3
3 3 4

For node i, element 1

ButNi = 1atnode
i andwithS(e)equal
tounity
inaone-dimension
problem

{F!
1)}
=l•ii
l)qO)
fs ds
=qO)=
lOrnaid

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

48 Step2: DerivetheApproximating
Equations

Nodes2 and3 arenoton thespecifiedflow boundary


andwe canwrite

For nodej, element3

{F• fs•3•q•ds
=-10m•/d
and we have

2 3 { F(•)•
-- --104
and IF ) is givenby

iF)-- {F
global

= lO
i oo ø
+o 1
o i 0
0
+
-10 -10j

3.4 STEADY-STATE, UNSATURATED FLOW EQUATION

The three-dimensionalform of the equationfor steady-stateflow through an


unsaturated
porousmediais

•-•(Kx(•)•••x)
+•-•lKr(•)•-'••y)+'
•--•IKz(•)I•
+11)--0 (3.70,
where
Kx(Xlt),
Ky(¾),
andKz(w)arethecomponents
ofunsaturated
hydraulic
conductivity
(whicharefunctionsof thepressurehead•) in thethreecoordinate directionsandthez
coordinate
directionis assumed
to bevertical(seeAppendixI). The unknownquantityat
eachnodesis thepressurehead¾. We will assume anapproximatesolutionfor •, •, of the
form
I!

= Ni vi (3.71)
i=l

Where
•e) istheapproximate
solution
forpressure
head
within
element
e, N? are
the
interpolation
functionsfor eachnodewithinelemente, n is thenumberof nodeswithin
elemente, and•giaretheunknown valuesof pressure
headfor eachnodewithinelemente.
When the approximatesolutionis substitutedinto equation3.70, the differential
equationis notsatisfied
exactlyandanerroror residualoccursat everypointin theproblem
domain. The contributionof any elemente to theresidualat a nodei to which the element
isjoinedis

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 49

v(•) o
• •
+•IlCz(•)l•
+1))]
dxdy
dz (3.72)

WhereWi(e)istheelement's
weighting
function
fornodei andthelimitsofintegration
are
chosen torepresent
thevolumeof element
e.
In Galerkin's
methodwechoose theweighting
functionfor eachnodein theelementto
beequalto theelement's
interpolation
function
for thatnodeWi(e)-- Ni(e).If wealso
assumethatunsaturated
hydraulic
conductivity
functionsareconstant
withinan element
(butcanvaryfromoneelementtothenext),equation
3.72canbewritten

(3.73)

where,for example,
Kx(e)(•)is theunsaturated
hydraulic
conductivity
function
in thex
direction within element e.
Becausethesecond
derivative
of theapproximatesolutionis notdefinedfor sometypes
of elements,we canusetheresultsof equations
3.28 to 3.32 toreducetheorderof the
derivatives
of• appearing
in equation
3.73

(3.74)

Equation
3.74is theintegral
formulation
forthesteady-state,
unsaturated
flowequation.
a,i
When
theporous
media
isrelatively
dry,
theterm•:, (•) willbesmall
i.e.,capillary
forces

are
much
larger
than
grav•onal
forces
-•-. Inthis
case
the
last
term
within
the
integral
canbeneglected
in thecalculation
of [ K(e)0F)]. We will assume
thisis truefor the
remainder
of thissection(alsoseesection5.4.3). If necessary
theintegralcanbeevaluated
bydeveloping
a functional
formforKz(e)(•) withinelement
e. Ofcourse
forproblems
of
horizontalflowthelasttwotermsin theintegralin equation 3.74arealwayszero.
From previouswork we know that we can write a matrix expressionfor the
contribution
of elemente to theresiduals
at all nodesthatjoin theelement

(3.75)

nxl n•n n•l

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

50 Step2: DerivetheApproximating
Equations

where
theelement
hasn nodes
and[ Kie)(•)]is theunsaturated
formof theelement
conductance
matrixgivenby

o•x o•x

[ _-_ "ax
: ay
: : 0 K•)(V) ø
0 "ay
...... aY
dx dy dz

ax •y 0
V(") nx3 3x3 (3.76)

where
V(0isthevolume
ofelement
e. InChapter
4wewilllearn
how
toevaluate
equation
3.76 for severaldifferenttypesof elements.
When we combine the element conductance matrices for all the elements of the mesh we
canobtainanunsaturated
formof theglobalconductance
matrix
In

[KCv)]
= •.,[K(':)Cv)] (3.77)
glol•! e=l •

wheretherearem elementsin themesh. The dependence


of theglobalconductance
matrix
onthepressurehead• isemphasized because in thesolution
process
wewill beconcerned
witha systemof nonlinear
equations
of theform

[K(¾)] = (3.78)
global

where
•o• • are
mesh). the
values
ofpressure
*' p
head
ateach
node
(there
the caseof unsaturated are
pnodes
inthe
flow, {F} will containspecifiedratesof groundwater
flow at boundariesand at sourcesandsinks.If we wishto includegravitationalforces,

additional
contributions
to{F}inequation
3.78
result
from
theintegration
of -•-z(•). The
solutionof equation3.78 is discussed
in Chapter5.

3.5 TRANSIENT, SATURATED FLOW EQUATION

The three-dimensional
form of the equationfor transientgroundwaterflow through
saturated
porousmediais

(3.79)

whereSsis thespecificstorage
of theporousmediaandt is time(AppendixII). The only
differencebetweenthe integralformulationsfor steady-stateand transientgroundwater
ah
flow
equations
istheaddition
oftheterm
Ss•. When
theapproximate
solution
forhydraulic
head,
fiissubstituted
intoeqution
3.79,thecontribution
ofelement
etotheresidual
atnode
i is

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter3 51

(3.80)

where
•i e)istheweighting
function
fornode
i and
thelimits
oftheintegration
arechosen
to represent
thevolumeof elemente.
InOalerkin's
method
W?= N?). If weassume
that
values
ofK(e)
x,Ky(e)
,K (e)..• •(e)
z ,-,,uos
areconstant
withinanelement
(butcanvaryfromoneelement
tothenext),equation
3.80
can be written

LKx
'•X2'+Ky
•y2+Kzaz2 -Ss-•-- dxdydz

=-IIIN!*)[-(,)a2•'(')
K, ax -(.)a2fi(')
2 +K•y
aY -(')a2•'(')]dx
2 +I• 2 dydz
az

(3.8])
V(e.)

whereSs(e)is thespecific
storage
forelement
e. We knowthatthefirstintegralonthe
right-hand
sideof equation
3.81canbewritten

R?
1 hi
ß = [ K(')] (3.82)

where
[K(e)]istheelement
conductance
matrix.Similarly,
theevaluation
of thesecond
integralontheright-hand
sideof equation
3.81canbewritten

ß = [ C(')1 : (3.83)

where
[C(•)]iscalled
theelement
capacitance
matrix.
The subscriptsK andC in equations 3.82and3.83 areusedto indicatetheportionof
theresidualmatrixrepresentedby thefirst andsecondintegralson theright-handsideof
equation3.81.
To evaluatethe secondintegralrequiresthatthet/mederivativeof the approximate
solutionbe definedoverthe volumeof the element.We cando thisusinginterpolation
functions and the values of the time derivativeat the nodes, in the samemannerthat we
defined
• overthevolume
oftheelement
using
theinterpolation
functions
andthevalues
of

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

52 Step2: Derivethe Approximating


Equations

fi atthenodes.
Depending
onthetypeofinterpolation
functions
weuse,theprocedure
is
calledeit•hera consg•tent
element
formula•on or a lumpedelementformulmion.
Both formulationsare usedin practice. However, the lumpedformulationis less
susceptibleto problemsof numericaloscillation(seeChapter'5) thanis the consistent
formulation(alsoseeSegerlind,1984).

3.5.1 Consistent Element Formulation

We usedinterpolation
functionstoobtainanapproximate
solution
forhydraulichead
within
anelement,
•(c)insection
3.3.Foranelement
withnnodes
theapproximate
solution
can be written in man-ix form as

(3.84)

whereNi(c)istheinterpolation
function
atnodei andhi isthe(unknown)
hydraulic
headat
nodei. In theconsistent
elementformulation,we usethe same interpolationfunctionsto
definethetime-derivative
of theapproximate
solutionfor hydraulicheadwithinanelement,

8--[-'
For anelement
with
nnodes,
the
time-derivative
canbewritten
inmatrix
formas

--[ (3.85)

where
N?
) arethe
interpolation
functions
and
•- arethe
(unknown)
time
derivatives
of
hydraulicheadat eachnode,
If equation3.85 is substitutedinto the secondintegralon the fight-handside of
equation3.81we have

dx dy dz (3.86)

We canwriteequation3.86 for eachnode(i = 1, 2...... n) in elemente. Thissetof


equations
canalsobe writtenin man'ixform

R•e)
Jc :[C(½)]
•:hn
(3.87)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chnpter
3 53

where

[C(•)]= S?)][N?'"
N?]dx
dydz
JJJLNff'J
1x1 1x•
V(e) nxl ,

Fortwo-dimensional
problems
equation
3.88becomes

a:m A(•) uxl Ix1 (3.89)

where
A(½)
isthearea
ofelement
c. Forone-dimcnsionaJ
problems
equation
3.88becomes
N(e)

L(e)nxt lxl lxn (:3.90)

where
L(e)isthelength
ofelement
c.

3.5.2 Lumped Element Formulation

In thelumped clementformulation
wealsodefinethetime-derivative
of theapproximate
solutionfor hydraulic
headwithinanelementusinginterpolation
functions andthe.values
of the time derivativeat the element'snodes. However, in this casewe used[f'ferent

interpolation
functions
todefine
• than
arc
used
toder'me
•(e)
ahll

-•--(x,y,z)
=[ N?)(x,y,z)"'
N?)(x,y,z)] (3.91)

where
N?) aretheinterpolation
functions
forthetime
derivative
ofhydraulic
head ateach
node.Theseinterpolation
functions
aredefinedsothat

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

54 Step2: DerivetheApproximating
Equations

ßß 1 if i=j
0 if icj (3.92)

wheren is thenumberof nodesin theelement.If we rewriteequation3.88 usingthese


intexpolation
functions

. N?)J

= S?) ' ' dxdydz

[d'>] : s? '.
o
(3.93)

Forexarnple,for thecaseof a one-dimensional


elementwith two nodes(n = 2) equation
3.93 becomes

(3.94)

where
L(e)isthelength
oftheelement.
Foratwo-dimensional
element
with
three
nodes
(n--3), equation3.93 becomes

(3.95)

where
A(e)istheareaofelement
e.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 55

3.5.3 Finite. Difference Formulation for Time.Derivative of the


Approximate Solution
A globalcapacitance
matrix[C]canbeobtained
bycombining
theelement
capacitance
matrices
forall theelements
in themeshin thesamewaythattheglobalconductance
matrix
wasobtained
bycombining
theelement
conductance
matrices
in section
3.2

global m=!•
Theglobalcapacitance matl'ix
is a square,
symmc•cmatrixwithsizepxpwherep is the
numberof nodesin themesh.By substituting theappropriate
matrixformulation
foreach
of theintegrals
ontheright-hand sideof equadon3.81,theweighted
residual
formulation
for thetransient,
saturated
Howequation
becomes

(3.97)

If wedefine
thetwovectors
{•} and
{h}as

•[. h•

{•}:•p {h}:
•p
equation
3.97canbeWritten

[C]{•}+global
global
[K]{h}:global
{F} (3.98)

Equation3.98 is a systemof ordinarydifferential½•io•, whosesolution


provides
•h
values
ofhand• ateach
node
inthe
finite
element
mesh.
Although
several
methods
are
availablefor solvingthis systemof equations,it has becomestandardpracticein
groundwaterflowandsolutetransport
modelingtousethefinitedifference
method.
Fromthemeanvaluetheoremof elementarycalculuswe knowthatwe cancomputethe
time derivativeof a functionh at somepointe on theintervalt to t+At by thedifference
betweenthevalueof thefunctionat thetwoendpointsof theinterval(Figure3.8)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

56 Step2: DerivetheApproximating
Equations

-•(e)
--h(t•t)-
h,(t)
At

h(t+ •t) .-.

h(O

t e t+At
4,•A t•

Figure 3.8 Finite difference approximation to the time derivative for hydraulic head.

Unfortunatelythepositionof e on theintervalt to t+At is not knownanddifferentsubsets


of thefinitedifference
methods
haveevolvedbasedondifferentchoicesfor thepositionof
e. From Figure 3.8

or
-•(e)
=h(t
+At)
- h(t) At (3.99)

•h
h(e)= h(t)+ ( e-t)•'(e) (3.•00)

If we define a variable co

'At (3.101)

we can write

h(e) = ( l-co ) h(t)+ coh ( t + At ) (3.102)


whichcanbeextended
to thevectorof unknown
hydraulic
heads[ h} andto thevectorIF]
{h} = ( 1-m ){h}t + co{h}t+&
t (3.103)

{F} = ( 1-co){F}t + co{F}t+A


t (3.104)
If we substitute
equations3.103and3.104intoequation3.98we havethefinitedifference
formulationforthetransient,
saturated
flowequation

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 57
, ,

( [C] + mAt [K] ) {h}t+At


= ( [C] - (l-m) At [K] ) {h}t + At ( (1 - m)fF}t + m {F}t+At )
(3.105)

Thesolution procedure begins


byspecifying
theinitialvaluesof (h) (i.e.,thevaluesof
headat timet -- to -- O)

(h},ø= specified
values
Then the systemof linearequations
(equation
3.105)is solvedtoobtainvaluesof {h} at
theendoftheFirst
timestep,
[h•to
+at.Wethen
set
{h}, = {h}r•+A
t
andrepeatthesolution
process
forthenexttimestep,andsoon. Depending
onthechoice
of coseveral different subsetsof the finite difference formulation are der'reed:

co=0 --+ Forward DifferenceMethod

[C]{h}t+At= ( It] - At [K] ){h}t + At {F}t (3.106)

1
co=• --+ CentralDifferenceor Crank--Nicholson
Method

At
([C]+
•-•t[K]){h}t+At
=([C]--•[K]){h}t
+-•-(
{F}t+
{F}t+At
) (a.o7)
m=l --) BackwardDifferenceMethod

( [C] + At [K] ){h}t+A


t = [C]{h}t + At {F}t+At (3.108)

3.5.4 A Finite Element Example

To illustratetheuseof equation3.105we will againconsider


thecolumnof soilfrom
theexamplein Section3.2. Initiallythecolumnis in steady-state
saturatedflow witha
distribution
of hydraulicheadcomputed fromtheprevious example(Figure3.9). Thenat
timet = 0 weincrease thevalueof hydraulic
headattheupperboundary (node1) from12
to 20 cm. We wish to find thevalueof hydraulicheadat eachnodeat time t = 1, 2....
seconds.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

58 Step2: DerivetheApproximating
Equations

Steady-state
solution initial conditions(t = 0)
hydraulichead,h (cm) hydratfiic
head,h (cm)

.312.0 '•• 20.00


•h--12

/.00
I0.00 1/4'00
4.00W
0.00
Figure 3.9 Initial conditions for example transient, saturated flow problem.

The governing
differentialequationis theone-dimensional
formof equation3.79

a(K ah• Sah

where Kx is the saturatedhydraulicconductivityin the directionof flow (the x axis is


directed
verticallydownward
in thiscase).We will usethelumpedelementformulation
to
solvethisproblem.LetSs(1)= 0.02,Ss(2)= 0.01,andSs(:•)= Ss(4)= 0.02. Forone-
dimensional
elementswith two nodes,theelementcapacitance
matricesare givenby
equation3.94

(0.02)(2)
[••1=[0.02
2 0.002] 0

[C(2)3
= 2 = 2 =[o.o,.
o1
0 0.01

2 = 0 0.03

The globalcapacitance
matrixis obtained
by addingtheexpanded
formof theelement
capacitance
matrices

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 59

[C]=
0.020 0.024-0.01
0
0
0
0

0 0.014.0.03
0
0 0 0
0
0.034-0.03
0 o.o3.•

0.02 0 0 0 0

00.03
0
0
o
00 0
0
o
0.04
0
o
0.06
0

o 0.03]
(3.•o9)

Fromtheprevious
example,
theglobalconductance
matfixis
1/2 -1/2 o o o

-1/23/2-1 o ø
o
[K]
= ! -14/3
-1/3 o-1/3
0 0-1/3
2/3-1/3
I/3.1 (3.11
The initialvaluesof hydraulicheadat thenodesare

hi 20.001
h2 9.33
!
{h}t=0 = (3.111)

h3--8.00
h4
hs •0l 4.00
0.00

We will usethebackw• differenceformulation(equation3.108), with a time stepAt -- 1


sec.By settingIF] -- 0 (nospecified
flowrates)thesystem
of equations
for theendof the
firsttimestepbecomes

([C]
+At
[K]
){h}t__
1=[C]{h}t__
0+,,••t•l
0 (3.112)

Substituting
egluations
3.109, 3.110, and3.111 into equation3.112 gives

0.02 0 0 0 0 1/2 -1/2 0 0 0 hi


h2

00.03
0
o
0
00!0
o
0
0.04
oo.o
0
0

0 0.033
+(1)
-1/2
3/2-1
0
o
0
0 O0
-1
o
0
4/3 -1/3

0 -1/3 1/3J
h3
h4
h5 t=l

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Step2: DerivetheApproximating
Equations

o.o2
o o o o 2o.oo
1
o.o•
o o
--I 00.04! •.•
0 8.00['0
o
0 0.06
o o
4.00[
o.o3.1!,o.ooj

whichsimplifiesto

0 0 h• [0.041

r[-0.50
_11i30
-•1i•73
0.73
3h
4 [0.24
I0 -0.33 0.36Jh •l !,0.00J
(3.113)

Buthl -- 20andh5 = 0 forallvalues


oft (because
thehydraulic
headattheupper
and
lowerendsof thecolumnareheldconstant).Modifyingequations
3.113for theseknown
values(seeSection4.5) gives

1.53-1.00
-1.00
0 0]{ha]
10.281
1.37 -0.33
-0.33 0.73
h3
h4

whichcanbesolvedto obtainthevaluesof hydraulic


0.32
[
0.24 j

headattheendof thefirsttimestep

h1 20.00]
h2 14.95
/
h3 = 12.60•
h4 6.02
/
h5 •l 0.00J
Thisprocess
isrepeated
foreach
subsequent
timestepuntilasolution
isobtained
foreach
required
valueof t.

3.6 TRANSIENT, UNSATURATED FLOW EQUATION


The three-dimensional
formof theequation
for transient
groundwater
flow through
unsaturated
porousmediais writtenas

•x(Kx(¾)•-••x
)+•-•(Ky(¾)•--•)+
•(Kz(¾)(•-•z
+1))=
C(¾).••
t (3.114)
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 61

where
Kx(W),
Ky(W),
andKz(W)
aretheunsaturated
hydraulic
conductivities
(which
are
functionsof the pressurehead¾) in the threecoordinate directions(the z coordinate
directionis assumed
to bevertical),andC(¾)is thespecificmoisturecapacity
dO
C(•t)
= •-• (3.i15)
where0 is thevolumefficwatercontent(AppendixII). The unknownquantityat eachnode
is thepressure
head•. Asbeforeweassume
anapproximate
solution
for•, • of theform

i=l

where
½(e)
istheapproximate
solution
forpressure
head
within
element
e and
N?amthe
interpolation
functionsforeachnodewithinelement e.
Whenthe approximate solution
is substituted
intoequation 3.114,thedifferential
equation isnotsatisfied
exactlyandanerrororresidualoccursateverypointintheproblem
domain.Thecontribution of anyelemente totheresidual
at nodei towhichtheelementis
joinedis

whereWi(•)is theclcment's
weighting
function
fornodei andthelimitsof integTation
arc
chosen to represent
thevolumeof element
e.
In Galcrkin'smethodwe choosetheweightingfunctionfor eachnodein theelementto
beequalto theelement's
interpolation
function
forthatnodeWi(e)-- Ni(e).If wealso
assumethat the unsaturated
hydraulicconductivity
and specificmoisturecapacityare
constantwithin an element(but can vary from one element to the next), and that
gravitational
forcesamsmall,equation
3.117canbewritten

+ i (V)•"dxdYdz
(3.118)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

62 Step2: Derive the Approximating


Equations

where
C(e)(¾)
isthespecific
moisture
capacity
within
element
e.
We knowfrom theresultsof sections
3.4 and3.5 thattheintegralsin equation3.118
can be written

(3.119)

ß = ß (3.120)

where
[K(•)(¾)]
and[C(e)(•)]
aretheunsaturated
formsoftheelement
conductance
and
capacitance
matricesfor elemente. Justasin thecaseof transient,saturated
flow, we can
usetwodifferenttypesinterpolation
functions
toevaluatetheintegral

•'•i',- •v•-dxdydz (3.121)

and
obtain
thecomputational
formfor[c(e)oI/)].
Intheconsistent
element
formulation
we
usethe same interpolation
functionsto definethe time-derivative
of the approximate
solution
for
pressure
head
within
anelement,
• asthose
-•., used
todefine
theapproximation
solutionfor pressure
head•

•(•)
• (x,y,z)
= [N?)(x,y,z)'"
N(ne)(x,y,z)] (3.122)

where
N?
) are
theinterpolation
functions
and
-•-are
the
(unknown)time
derivatives
of
pressure
headat eachnodewithinelemente. For thischoiceof interpolation
functions,
we
canwritetheunsaturated
formof theelementcapacitance
matrixas

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 63

(3.123)

Inthelumped
element
formulation,
weusedifferent
inflation functions
todefine
a4?')
than
,,•us.d
todm,,e
•')

4h•
(") = [N;(,)(x,y,z)
•t-(x,y,z) ... N?)(x,y,z)] (3.124)

whereNi*(e)istheinterpolation
function
forthetimederivative
atnodei withinelement
e.
Theseinterpolation
functions
weredefinedin equation
3.92andusingequation 3.93we
canimmediatelywrite

where
V(e)isthevolume
oftheelement.
The unsaturated
formof theglobalcapacitance
matrixis obtainedby combiningthe
element
capacitance
man•eesforallelements
in themesh
m

(3.126)
global e=l •

where there are m elementsin the mesh. By substitutingthe appropriatematrix


formulationsfor eachof the integralson the right-handsideof equation3.118, the
weightedresidualformulation
fortheuansient,unsaturated
flowequation
becomes

[c(¾)] + [K(v)] = {F} (3.127)


global global global

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

64 Step2: DerivetheApproximating
Equations

[c(v)]{{t)+ [K(•_)]
(v) = (F) (3.
global global global

Using theresultsof Section3.53 we canalsowrite the finite differenceformulationfor


thewangent,unsaowated flow equation

( [C(w)]+ •t [K(W)])(W}t+At= ( [C(v)]- (1-•)At


+ At ((1-o)){F}t+ o)[F}t+A
t) (3.129)
,,

Equation3.129 is a system
of ordinarydifferential
equations,
whosesolution
provides
values
ofWand
•t ateach
node
inthe
finite
element
mesh
ateach
time.
Amodification
of
the finite difference method describedin section3.5.3 can be used to obtain this solution.
The modifiedprocedure
will bedescribed
in Chapter:5.

3.7 SOLUTE TRANSPORT EQUATION

Thethree-dimensional
formof thesolutewansport
equation
for uniformgroundwater
flow in the x direction is

(3.•3o)

where0 isthevolumetric
watercontent
oftheporousmedia, Cissoluteconcentration,
Dx,
Dy,andDz arethedispersion
coefficients
oftheporous media inthex, y,andz coordinate
directions,
vx istheapparent
groundwater
velocity
in thex coordinate
direction,
Pbis the
bulkdensityof theporous
media,Kd is thedistribution
coefficient,
and•. is thesolute
decayconstant
(AppendixliT).
Whenwe solvea solutewansport
problemby thefiniteelementmethod,theunknown
quantity
ateachnodeisthesolute
concentration
C. We beginbyassuming
anapproximate
solution
forC,• oftheform

&(')(x,y,z)
=• N?
)c• i=l
(3.131)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 65

where
•(e)istheapproximate
solution
forsolute
concentration
within
element
e,N?) arethe
interpolation
functions
for eachnodewithinelemente, andCi aretheunknownsolute
concentrationsfor each node within element e. When the approximatesolution is
substituted
intoequation3.130,thedifferential
equation
is notsatisfied
exactlyandanerror
or residualoccursat everypointin theproblemdomain.Thecontribution
of elemente to
the residual at node i is

(3.132)

where
Wi(e)istheelement's
weighting
function
fornode
i andthelimitsofintegration
are
chosen to represent
thevolumeof theelement.
In Galerkin'smethodwe choosetheweightingfunctionfor eachnodein theelementto
beequalto theelement's
interpolation
function
for thatnode,wi(e)= Ni(e).If wealso
assumethattheproperties
of theporousmediaandtheapparentg•oundwatervelocityare
constant
withinanelement(butcanvaryfromoneelementto thenext)equation3.132can
be written

(3.133)

where,
forexample,
e(e)isthevolumetric
watercontent
oftheporous
media
within
element
e. • is not superscripted
because
it is a property
of thesolute(nottheporous
media)and
is therefore
constant
fromoneelement to thenext.Because
watercontent
9(e)andthe
apparentgroundwater
velocityvx(e)mayor maynotchangewithtime,twoseparate
formulationsof equation3.133 arepossible.

3.7.1 Steady-State Groundwater Flow

In steady-state
groundwater flow (saturatedor unsaturated),
the water contentand
apparent
groundwatervelocityareconstantfromonetimestepto thenext. Theyarealso
constantwithin an element(but can vary from one elementto the nex0. In this case
equation3.133 becomes

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

66 Step2: DerivetheApproximating
Equations

= D•0 •)x2 •)y2


+

Vx •)xjaxdydz

+•fl•½"
p,Kd
"'b'•JaX
dy
dz

(3.134)
t 0 o•
t Jdx
dydz

Fromour previouswork with the transientgroundwaterflow equationswe knowthat


we canwrite equation3.134 in matrixformby combiningtheintegralexpressions
for each
nodein elemente. Specificallywe canwrite

ac,l

(3.135)

where
[ D½c)]
istheelement
advectfon-dispersion
marr/x
and[ A(•1]
istheelement
sorption
matr/x.Theelementadvection-dispersion
matrixisdefinedas

[ D(c)]: ß ,
dx dy dz

ax •y •

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 67

JJJ
Lx•,j
[•,
(•<•>
•?'•?•]
[Md
Vle) nxl
"'•21
d•
dy
dz lxl Ixn (3.136)

where
V(e)is thevolume
of element
e. Thereader
should
recognize
theterms
inthese
equations ascomingfromthefirst,second andfourthintegralsontheright-hand sideof
equation 3.134.Thevalidityof these
equationscanbechecked bymultiplying a fewof the
termsandcomparing theresultswiththeintegralsin equation
3.134. If thegroundwater
flow is notuniform(seeAppendix HI), equation
3.136becomes

c•x •y •
[ D(e)]= dx dy dz

•x •y •

o o v?
v(•) nx3 3x3 3xn

+ ' [•(p?)K•
e)+O(e))]
[N?)'"N?]
dxdydz
JLN?J
V(e) nxI Ix I Ix n (3.137)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

68 Step2: DerivetheApproximating
Equations

Theclement
sorption
matrixisdefined
as

(3.138)

if a consistentclementformulationis usedfor the time derivativeof the approximate

solution
.•.. If alumped
clement
formulation
isused
for•., theclement
sorption
matrix
is
defined as

[A(e)]
--(@•e)K(c•)
+OCe))
\T•LO'.i
(3.139)

whereV(e)isthevolume
ofelement
e andn isthenumber
of nodes
withinelement
e.
A global advection-dispersion
matrix [D] anda global sorptionmatrix [A] can be
obtainedby combiningtheelementmatricesfor all the elementsin the meshin the same
way that the global conductancematrix was obtainedby combiningthe element
conductance matrices in Section 3.2

[D]=E[D(½)] (3.140)
global ß= • •
pxp nxn

In

(3.141)
global e=l •
px p nxn

where m is the numberof elementsand p is the numberof nodesin the mesh. The
weightedresidualformulationfor thesolutetransport
equationbecomes

ac,]
[D] + [A] ' -- {F} (3.142)
global global
•)•p global

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter3 69

If wedefine
thetwovectors
{C}and

(3.143)

equation3.142canbc writtenas

global global global

Equation3.144 is a systemof ordinarydifferentialequations,


the solutionof which
•C
provides
values
of C and•. ateach
node
inthefinite
element
meshateach
time.This
equation
canbesolvedusingthef'tnitedifference
methoddescribed in section3.5.3. Using
equation3.105,we canimmediately writethefinitedifferenceformulation for equation
3.144

(3.145)

The solutionprocedure
beginsby specifying
theinitialvaluesof {C}

[C}t0= specified
values
Thenwe solvethesystemof linearequations
toobtainvaluesof {C} at theendof thefirst
timestep,
(C}to
+at-Wethen
set
(C)t =
in equation3.145 andrepeatthesolutionprocess
for thenexttime step,andso on (see
Chapter5).

3.7.2 A Finite Element Example

Theuseof equation 3.145is illustratedwiththeone-dimensionalproblemin Figure


3.10. Steady-state,
saturatedgroundwater flowisoccmvingin a conf'medaquifer.Initially
nosoluteis present.At timezero,thesoluteconcentration alongtheleft boundary of the
aquiferis increased
to 10 rag/1andremainsconstant thereafter.The problemdomainis
discrefized into a mesh with five elements and six nodes. Each element has two nodes so

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

70 Step2: Derivethe Approximating


Equations

thedispersion-advection
matrixfor eachelementis givenby theone-dimensional
formof
equation3.136 (n--2)

[ D(e)]=
ax ax j
•)

+ ax 'ax J
lxl

(3.146)

2xl lxl

Y'//////////////////////////////////////////////' clcmentnumbers
• Direction
ofGroundwater
Flow

Impermeable
/ •i (1)
Botmdaxies

(2) (3) (4) (5)
j•i j•i j•i j•i

• ...... node
numbers
--//rjj/////////•ff/////,/./r///////////////////////,•
,

v}•) = 0.03m/d,Die)=1rn2/d,L(e)= 10m 0(c)=n(e)= 0.3 forallelements

Figure 3.10 Example one-dimensionalsolute transport problem.

Now if we usetheinterpolation
functionsof theexamplein section3.2 we have

x?)- x •N• -1
N•= L(•) , •)x L(•) (3.147a)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 71

x- x?) i•N2
N2= L(e)
, , -• = L(e) (3.147b)
for all five elementsin the mesh.Sincethe aquiferis saturated,
equation3.146canbe
divided
by0(e)(Appendix
1II). If weassume
thatthesolute
does
notreact
withtheporous
mediaanddoes
notdecayi.e.,I• e)=0 forallelements
and•.=0,andsince
theporous
mediaissaturated
0(e)=n(e),
equation 3.146
canbewritten

: , v•
L(•) + -1

Fortheelements
in Figure3.10thesematrices
are

[."']:k[_, o.o,
[:l
=i6[_•• +
1

111-1] DO)i
• thisproblemw, electto use•e lump• elementfomulafionof theelem,nt so•fion
m•, •ua•on 3.139(•tten h•e for samt• flow)

(' L(') 1

For •e ele•nm in Fi• 3.10 •ese mffices •

[A(i)]
: ,1½[•
•]
: 5110
•]: CA(2']
: [A0)]
: CA(4)]
: [A
(5)]
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

72 Step2: Derive
theApproximating
Equations

We cannowassemble
theglobalmatrices[D] and[A] asfollows

-1/20-1/20 0 0 0 0

-3/20
(3+3)/20
-1/200 0
-3/20 (3+3•0 -1/20 0

0 -3/20
(3+3y20
-1/20
global
6x6
0 0 -3/20(3+3¾20
-1/20]
0 0 0 -3/20 3/20J

.O5 -.05 0 0 0 o

-.15
__ .30
-.05
! -.15
.30 00
-.05 0 0 -.15 .30 -.05

0 0 -.15.30
-.05
L 0 0 0 0 -.15 .05

5 0 0 0 0 0

[A] =
0 5+5 o
0 0

0 0 0 5+5
0 0 0 0

'5O 0 0 00'
0 10 0 0 0 0
0 0 10 0 0 0
0 0 0 10 0 0
0 0 0 0 10 0
0 0 0 0 05.

We will usethebackward
difference
formof equation
3.145(co= 1)

([A]
+At
[D]
){C}t+at
=[AI{C}t
+At,•}•.•t
0 (3.149)
The soluteconcentrationsat the nodesat time t--Oare

CI 1œ
C2 o
C3 = 0
{C}l=O
= C4 0
C5 0
C6 •o 0

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 73

With a timestepof 10 days(at=10) equation


3.149canbe solvedfor the solute
concentrations
at theendof thefirsttimestep(t=10)
( [AI + coat[DI ){C},:•o -- [AI{C}•-o

3.0-0.5 0 0 0 0 C• 5 0 0 0 0 0 50

-1.5
8.0-0.5
_0•5
0 i C2•10
0 -1.5 8.0
000 0 C• = 0 10 0 0

o 0
0 ioooo
0
0 0
-1 8.0
-1.• 3.0 c• t=o 0 0 0 0 •J
However,
thissystem
of equations
mustbemodified
because
of theboundary
condition
{C1]•0--10. Modifying
thissystem
ofequations
(seeSection
4.5)gives
8.0 --0.5 0 0 0 C2 75.0
C3
-1.58.0
-0.50 •
0 -1.5 8.0 -0.5 124
0 0 -1.5 8.0 -0.5
0 0 0 -1.5 3.0 C6 •o
whichcanbe solvedto givevaluesof C2 to C6 at theendof thefirsttimestep. The
solution is

el
tO.000]
9.488
1.800
C,•
0.342
C•
0.066
C6 0.033

This solutionis thensubstitutedinto the fight handsideof equation3.149 and the


procedureisrepeatedforthenexttimestep.

3.7.3 Transient Groundwater Flow

In transient
groundwater
flow,thevolumeu'ic
watercontent
0 andthecomponents
of
apparent
groundwater
velocity
vx,Vy,andvzarefunctions
oftimet
0 -- O(t)
v: = v:(t)
Vy= Vy(O (3.150)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

74 Step2: Derive•e Approximating


Equations

Thedispersion
coefficients
Dx,Dy,andDz (•orDxx,Dxy,etc)arecomputed
using
vx,
Vy,andvz (seeAppendix
Ill) andtherefore
arealsofunctions
oftime
Dx = Dx(t)
Dr = Dr(t) (3.151)
Dz = Dz(0

if groundwater
flow is uniform,or

Dxx = Dxx(t)
Dxy= Dxy(t) (3.152)
.

Dzz= Dzz(t)

if groundwater
flow is notuniform.
Theadvection-dispersion
matrix[D(c)]andtheelement
sorpfion
matrix
[A(e)]axe
computed
using
O(•),v?,etc.,
D?),etc.,
andaretherefore
also
functions
oftime
[D(•)1= [D(•)(t)]
[A(e)]= [A(½)(t)] (3.153)

Matrix
integral
formulations
for [D(•)(t
)] can
beobtained
bysubstituting
equations
3.150,
3.151,and3.152 intoequations
3.136and3.137
[ D(C)(t)]
=

V(½) nx3 3>0 3xn

+ i [vx(t)]
'Sx "' iJxjdxdydz
v(e) nXl Ix1 lxn

N?)
+ ß [X(O(•)(t)
+ ..(•)u'(•),,
•b •"d•, iN?)... N?]dxdydz
JJ['qJ
V(½) uxl lxl (3.154)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 75

if groundwater
flow is uniformand

[ D½•)(t)]
=

: : :
dx dy dz

. ilx i)y
3x3

0 v(=')(t)
V(c) nx3 3x3 3xa

+ ß [• (O(•)(t)
+ •'(')•(")'•
r• ,-,•n IN?) '"N?)1(ixdydz
N?.I
V(•) nxl Ixl lxn (3.155)

if thegroundwater
Howisnotuniform.
Thematrix
integral
formulation
for[A(e)(t)]
can be
obtained
by substituting
equation
3.150intoequation
3.138

[,.,(O•r(")
•'b'"a+ O(O(t)]
[N? )'" N(•)1(ixdydr,.

[A(e)(O]
(3.156)

lxl lxn

The globaladvection-dispersion
matrixandtheglobalsorptionmatrixarealsofunctions
of timeandtheweightedresidualformulation
for thesolutetransport
equationfor transient
groundwater flow becomes

[A(O]{&}
global
+[IXO][C}:
global
{F}
global
(3.157)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

76 Step2: DerivetheApproximating
Equations

The œmite
differenceformulation
for equation
3.158is

( [A(t + aO] + mat [O(t+ aO]) {C},+•,,


= (A(O- (• - m)at [•01 ) {C}, + at ((• - m){Vh+ m{F},+•,,))
(3.158)

To solveequation(3.158),we first solvethe transientgroundwater


flowproblem
(either
saturated
orunsaturated)
toobtain
thevalues
of O(=)(t),
v?)(t)
etc.,
andD?(t)etc.,
for eachelementfor eachchoiceof timestepusedin (3.158). Thenwe specifytheinitial
valuesof {C}

{C3t
ø= specified
values
and compute [D(to)], [A(to)], [D(to+At)] and [A(to+At)]. These are substitutedinto
equation3.158 whichisthensolved
forthevalues
of {C} attheendof thefirsttimestep,
{C}to
+at.Wethen
set
{c}, = {c}•+ a,
compute
[D(t+At)]and[A(t+At)],
substitute
these
matrices
intoequation
3.158'and
repeat
the solutionprocedure.It shouldbe obviousthat computingeachelementmatrix and
assemblingand modifyingthe global systemof equationscan be extremely time
consuming.
It shouldbe notedthat the procedurej.u.
st describedis only valid when changesin
•oundwaterdensi _tyduetochanongsoluteconcentrations in theaquifercanbeassumed to
be negli•bly small(seeAppendixIll). Whenthisis not nine,the groundwater flow and
solutetransport
equationsarecoupledandmustbesolvedsimultaneously.

3.7.4 Saturated Groundwater Flow

Thesolutetransport
equation
forsaturated
groundwater
flowis (Appendix
m)

(3.159)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 ??

if thegroundwater
flowis notuniform.If theporous
mediais saturated8 = n -- constant
withinanelementandtheelementadvection-dispersion
matrixfor steady-state
groundwater
flow is

[ D(")]_- dx dy dz

N Lax axJ
V(•) wO. lxl l>cu

dx dy dz (3.161)

JJJLN?J
V(0 uxl lxl lxn

for uniform flow and

ß •

•)N(ne)
'

+
'N•
)N?
)N?
) n•v•
' ' '•0
) 0 a•/)
•x
•Y "'
....
•N•)
•y

0 0 n•.. • "'
v(e) n• 3• 3•

+ • •l+ ... (3.162)


•) nI:)JJ
V(•) nxl lxl lxn

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

78 Step2: Derivethe Approximating


Equations

for nonuniform
flow. Theelementsorption
matfixis

(3.163)

Similarequations
can be writtenfor transient
groundwater
flow for a lumped

formulation.
Theterm1+ n(e) isfrequently
called
the
retardation
factor
for the element.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
3 79
NOTES AND ADDITIONAL READING

1. For problems
with axisymmetry
equations
3.1 to 3.5 can be writtenin an (r,z)
coordinatesystem:

Steady-State,
Saturated
FlowEquation

3•(K•
r•) +•[Kz•J
--0 (3.164)
Steady-State,
Unsaturated
FlowEquation

r •(Kz(•)(•- (3.165)

Transient,SaturatedFlow Equation

}) Oh, (3.166)

Transient,UnsaturatedFlow Equation

3•r(Kr(llt)
r•?)+
•(Kz(•)(•--•-•z
+1))=C(•/')-•t (3.167)

SoluteTransport
Equation
(UniformGroundwater
Flow)

•(OC)
at ' = 1•)(Dr
•--[(0C,)+
Dr•z2(0C)--•-(vrC'
-•w• d •-[(0C+v•a• (3.168)
wherer is •e ra&fl c•r&nate •cfion (•ected ou•d •om •e •is of syme•)
•d z is •e vefficflc••ate •efion (see,for ex•ple Fi• 2.9)

2. Matrix-integral
formulation
for theelementconductance,capacitance,
advection
dispersion,
andsorpfion
matrices canalsobederivedforequations3.164to3.168.
Forexample,theelement
conductancematrixfor saturated
flowin anaxisymmetric
coordinate
systemis

(3.169)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 4

STEP 3: DEVELOP SYSTEM OF EQUATIONS

4.1 REQUIRED PROPERTIES OF ELEMENT INTERPOLATION


FUNCTIONS

As we sawin theprevious
chapter,
application
of themethodof weighted
residualsto
the groundwaterflow andsolutetransport
equations leadsto severalmatrix-integral
expressions
(i.e., the equationsfor the saturatedand unsaturated
formsof the element
conductance
matrix,thesaturated
andunsaturated
formsof theelement
capacitance
matrix,
the elementdispersion-advection
matrix,andtheelementsorptionmatrix)thatmustbe
evaluatedfor eachelementin the mesh. To evaluatetheseexpressionsthe element

interpolation
functions
N?,
and
their
derivatives
of thethreecoordinate
'•x'x
"•'and
.•.must
directions
beknown
functions
x, y, andz.
Recallthattheinterpolation
functions areusedto definetheapproximate
solutionfor
hydraulic
head(orpress• head,orsolute
concentration)
at anypointwithinanelement.
Forexample

i=l

where
•(e)istheapproximate
solution
forhydraulic
head within
element
e,N?) arethe
interpolation
functionsfor thenodesof elemente, hi are the unknownvaluesof hydraulic
head at the nodes of element e, and n are the number of nodesin element e. Becausethe
interpolation functions
aredefinedusingtheelement's sizeandshapetheyaregenerally
differentfor eachelementin themesh.For example,theinterpolation functions for one-
dimensional elementswith two nodeswill be differentif the lengthsof theelementsare
different(equation3.11). The set of interpolationfunctions for all elementsin themesh
define
anapproximate
solution
forf•(or• or•) throughout
theproblem
domain.

4.1.1 Continuity

Theneedtointegrate
thissolution
(oritsderivatives)
places
a res•ctio•n
onthetypesof
interpolation.
functions
thatmaybeused:
theinterpolated
value
of h(or• or½)must
be
continuousalongtheboundary betweenadjacent
elements.
Thatisthevalueofh computed
ateachpointontheboundary betweentwoadjacent
elements
mustbethesameregardless
ofwhichelement's set of interpolation
functions
areused(Figure4.1)•,Beca•use.the
approximatesolutioniscontinuous
fromoneelement
tothenext,wesaythath (or•l/orC)
is interpolated
in a "piecewisecontinuous"
mannerover the problemdomain. The
derivatives of the approximatesolutiondo not have to be continuousacrosselement
boundaries,
however.Thisis sobecause
fortheintegral

Bxp

8O

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter

tobedefined,
•(x)must
becontinuous
tothe
order
(p-l).
Because
allthe
integral
eq.uation.
s
forelement
matrices
in Chapter3 contain(atmost)onlythefirstderivative(p=l) of h (or•

orC),hmust
becontinuous
but
•, •, and
•. donot
have
tobe(p-l--0).

(1) (2)
Xl x2 x3

Figure 4.1 Approximate solution must be continuous along adjacent element's


boundaries.

4.1.2 Convergence

Whenthefiniteelementmethodis usedto solvea groundwater flow or solutetransport


problem,the solutionconsistsof theapproximatevalueof hydraulichead(or pressurehead
or soluteconcentration)
at eachnode. If suitable interpolation
functionsare usedin the
solutionprocedure,the accuracyof theapproximate solutionwill improveasthenumber
of nodesandelementsin themeshincreases (whichusuallyis equivalentto a decrease
in
thesizeof elementsin themesh). We saythatthe solutionconvergesto the true solution
asthenumberof nodesandelements in themeshincreases.Fortunately thereis a simple
rule that allows us to determinewhich typesof interpolationfunctionspossessthis
convergence property.
Thisrulehasitsoriginin theapproximate solution(equation
4.1). Consider
thecaseof
anelemente that is in a portionof theproblemdomainwherehydraulicheadis constant.
Inthis
case,
thevalue
of•(e)(x,
y,z) isconstant and
should also
beequal
tothevalue
ofh
atany
node
intheelement,
•(e)= hi' i = 1ton.If wecallthis
constant
value
h0andsubstitute
it intoequation4.1 we have

(4.2)

whichis onlytrueif thevaluesof all theclementinterpolation


functions
sumto oneat every
pointwithintheelement

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

82 Step3: DevelopSystem
of Equations

N?)(x,
y,z) = 1 forall(x,y,z)inV(•) (4.3)

Where
V(e)isthevolume
ofclement
c. This
ruleinsures
that
theelements
arecapable
of
modelinga constantheadregionwithinthemeshwhensucha conditionexists.This rule
alsoinsuresthatthe approximate
solutionconverges
to the macsolutionasthe numberof
nodes in the mesh increases.

4.2 SUBPARAMETRIC, SUPERPARAMETRIC, AND


ISOPARAMETRIC ELEMENTS

Theapproximate
solutionfor hydraulicheadis givenby
n

(4.4)
i=l

where
N? aretheinterpolation
functions
and
hi aretheunknown
values
ofhydraulic
head
at theelement'snodes. It is alsopossibleto describethe shape of theelementusingthe
coordinates
of eachnodein theelementandanothersetof interpolation functions
for the
element.To seehowthisisdone,let P represent anarbitrarypointontheboundary of an
element
andletxi,Yi,andzi represent
thecoordinates
oftheithnode
fortheelement
(Figure
4.2). Then we can describethepositionof elementboundaries
usingthe coordinates
of
eachnodeandanother
setofinterpolation
functions
fortheelement
Si(e)

x(v)
= i=l
(4.5a)

(4.5b)
i:l

z(P)
--E S?)(P)
Zi
i=l
(4.5c)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 83

Figure 4.2 P is any point on an elementboundary.

whereequation4.5a, for example,saysthatthex coordinateof pointP is equalto the sum


of the productof the interpolationfunctionfor a nodeevaluatedat point P and the x
coordinateof the node,for all nodesin the element.
Because
theinterpolation
functions
Si(e)areusedtodefinetheshapeof theelement
theyareoftencalledshapefunctions.Linear,quadratic,andcubicpolynomials arethe
mostcommontype of shapefunctionsusedin groundwaterflow and solutetransport
modeling. For example,linear shapefunctionsare usedwhen the boundariesof the
elementcanberepresented by straightline segments.Quadraticshapefunctionsareused
whenthe boundaries of theelementcanbe represented by quadraticcurves.Similarly,
linearinterpolationfunctionsareusedwhenvaluesof hydraulic headcanbeconsidered to
varyin a linearfashionwithintheelement.Quadratic interpolation
functionsareusedwhen
valuesof hydraulicheadcan be considered to vary in a (quadratic)curvilinearfashion
within the element.
The orderof thepolynomialsusedfor theinterpolation
andshapefunctionswithinan
elementdo nothaveto be the same. For example,an elementwith straightedges(linear
shapefunctions)canhavea curvilinear variationin head(quadratic
or cubicinterpolation
functions)
(Figure4.3). Theorderof polynomials usedfor theinterpolationandshape
functions
areusedto classifytypesof elements intothreegroups,whichareillustratedfor
one-dimensionalelementsin Figure4.4. Subparametric elementsusepolynomials forthe
shapefunctions thatarea lowerorderthanthepolynomials usedfor theinterpolation
functions.
In isoparametricelements theorders of thepolynomialsusedfor theshapeand
interpolation
functions
arethesame.Superparametric elementsusepolynomials for the
shapefunctions thatarea higherorderthanthepolynomials usedfor theinterpolation
functions.
It isimportant
torealize
thatwhen
subparamelric
orsuperparameffic
element
types
are
used,notall of thenodesmayhavea valueof hydraulichead(orpressure heador solute
concentration)assigned to them.Thusin a one-dimensional,
superparame•c elementwith
threenodes,quadratic shapefunctions,andlinearinterpolation
functions,
hydraulichead
will onlybecomputed at twoof thethreenodes.Thesenodeswill alsobe theoneswhere
boundaryconditionsare specifiedif the elementis on the boundaryof the mesh. The
coordinatesof all threenodeswouldhaveto bespecified,however.Thesecoordinates are
usedwith the three shapefunctionsto define the quadraticcurve that describesthe
element'sshape.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

84 Step3: DevelopSystem
of Equations

linearinterpolation
functions,
linearshapefunctions

........................... interpolation
functions
•,(•(x)

ß - S,•x)
x(P) ß x,ß j (x)xj
- • : • shapefunctions

quadratic
interpolation
functions.
linearshapefunctions

hk
x)-'-N?)(x)
hi + N.(½)(x)
h.4-N•)(x)hk
•,(•)(x)
h{
interpolation
functions

hi
_ .._ functions
(•)x•)
xi x
x••

Figure 4.3 Interpolation and shape functions for two types of one-dimensional
elements.

At present,isoparametric
elementsareusedalmostexclusivelyin groundwater
flow and
solutetransport
modeling.Because in isoparametric
elements theorderof thepolynomials
usedfor theshapefunctionsandinterpolationfunctions areidenticalwe will referto both
typesof functionsas interpolationfunctionsin the remainderof Chapter4. The next
sectiondescribesthemostcommonlyusedinterpolation functions
for a varietyof one-,
two-,andthree-dimensional
elements
andtheprocedures
need• tocompute
theelement
rna•ceso

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 85

Examole Suboarametric Element


_ _

hk

...... •,•• shape


(nodes
i,j,and
function
(nodes
k)
i and
k)

_Exan•_ole
Isoparametric
Element
linearshapefunctions
(nodes
i andj)

hj..........J• linear
interpolation
functions
• (nodes
iand
j)
hi .....
• •' : •
Y4
') x ')

ExampleSuperparametric
Element
quadratic
shapefunctions(nodesi, j, andk)

hk
............................
S.a/(x?,y•e))
' Y(k½))
hi
[" linear
interpolation
functions
(nodes
iand
k)
Figure 4.4 Illustration of definitionsof subparametric,isoparametric,and
superparametric one-dimensional elements.

4.3 EVALUATION OF ELEMENT MATRICES

In Chapter3 we appliedthe Methodof WeightedResidualsto the equationsof


groundwater
flowandsolute•'ansport.
Theresultwasa series
of matrixintegralequations
for eachelementin themesh.Theseequations
arelistedherefor reference

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

86 Step3: DevelopSystem
of Equations

Element Conductance Matrix (Saturated Flow)

[ K?)1= dx dy dz (4.6)

'a•'
V(") •o

Element Conductance Matrix (Unsaturated Flow)

•)x •)x

dx dy dz
0y 0y

(4.7)

Element Capacitance Matrix (Saturated Flow, Consistent Formulation)

(4.8)

Element Capacitance Matrix (Saturated Flow, Lumped Formulation)

(4.9)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 87

Element Capacitance Matrix (Unsaturated Flow, Consistent Formulation)

[ C(')(¾)]
-- ' [C(')(¾)]
[N?) -.-lq(,•
)1(Ixdydz (4.10)

v(") nx•

Element CapacitanceMatrix (Unsaturated Flow, Lumped Formulation)

(4.11)

Element Advection. Dispersion Matrix

ax ax

[ D(")]=_
ay ay ß

V(") n xn 3 x3 3 xn

v (") nx3 3x3 3xn

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

88 Step3: DevelopSystemof Equations

[ •.(O
(•)+ •'b"-d•.• '
JL?J
V(e) Ix3 lxl 3xn (4.12)

Element $orption Matrix (Consistent Formulation)

[^(')]= ß [ •b •-d + o(,)][ N?)... dxdydz

V(e) nxl lxl lxn (4.13)

Element $orption Matrix (Lumped Formulation)

(4.14)
•,Pb
•'d n/Lo

We canevaluateeachof thesema•ces for any typeof elementoncewe specifythe


interpolationfunctionsand their derivativesfor eachnodein the element. When the
interpolationfunctionshave a simple form and the number of nodes is small, the
integrations
canbeperformed analytically.If theinterpolation
functions
arecomplexor if
thenumberof nodesis large,theintegrationsmustbeperformed numerically.

4.3.1 Analytical Method

Certain one- and two-dimensionalelementshave relatively simple interpolation


functionsandit is possibleto useanalyticalmethodsto performthe integrationsrequired
for theelementmatrices.The mostcommonlyusedone-dimensional elementis thelinear
barelementusedin theexamples in Chapter3 (Figure4.5)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapt•4 89

Theelement
matrices
forthistypeofelement
werecomputed
intheexamples
in Chapter
3. The results are

•-•[_11
•l] (4.15a)
,K(')(¾)]:
'K'
?(qt)[_11
•1
] (4.15b
sa•t• flow ••t• flow

[c(•)]
=s?)L(") ,['0

3
saturated flow saturated flow
consistent
formulation lumpedformulation

[c(")(v)]
= c(")(•)
6L(,) [C(*)(qt)]
[•• (4.17a) =C(e)(•)
2 L(e)
[0101]
(4.17b)

unsaturated flow unsaturated flow


consistent formulation lumpe•formulation

[D
(e)]
=D•
2•2 )O(e)
i.,(e) V(x
e) I]
[-11-•]
+T[-I
..(.),.,(•)
+ •.(0•')
+•,b L(e)[2
•-,•)•' 112]
consistent formulation (4.18a)

or
-I-•(0(e)-I-
Pb•"d)T 0 lumpedformulation (4.18b)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

90 Step3: Develop
System
of Equations

2•2
•,["b
•d + '•- 1 consistent
formuhtion (4.19a)

or -- ,,,,(e)v.(•)
•Vb•d + 0(e))
L(e)
-•- [01(]]
1 lumped
formulation
(4.19b
A commonlyusedtwo-dimensional elementis thelineartriangle (Figurc4.6). The
interpolation
functions
forthistypeof clementarederivedin Scgerlind(1984).

(x?,
y?) N?)(x'Y)
=2-•(ai
+bix
+ciy
)
1

Y•' N?(x,y)
=•AI(½)(aj+
bjx+½jy)
(x?,y?') (x•
'),y?)
Figure 4.6 Interpolationfunctionsfor the linear triangle element.

In Figure4.6

bi= y•O_y•)
½i= Xi•)
--x••)
and

A(e)= Areaofelement

( Anequationtocompute thisdetermin•tis in
=• 1 AppendixIV Pan 12c.)

Thederivatives
of theinterpolation
functions
are

8N? _--bi 8N
,j = aN? bk
o•x 2A(e) o•x 2A(e) 2A(•)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 91

•}y 2Ate) ay 2At,) i}y


The elementmatricesfor the lineartriangleelementcanbe easilycomputedusingan
integration
formulain Segerlind
(1984). Fora lineartriangle
element

a!b!c! 2A(e)
(a+b•c + ;•)i

where
a,b,andc aleexponents
ofthe
interpolation
functions
N?), N?),and
N(k
e).For
exampleconsida'theintegral

IA(e)
N(e)N
e)
In thiscasea = 1, b = 1, andc = 0 andwe canimmediatelywrite

•A(.)
•.f•')aA=(]+1!
1!
]+00! 2A(e)
+=)! =-•-
A
whereO!-- 1. As anotherexampleconsider
theintegral

•A•
•.,•aN•
o•
x dA
In this case a = 1, b = c = 0 and we have

ß'i •)xdA-- l•.f) dA

_ bi •,•N?)dA=
- 2A(e)(.) bi(14-1!1!0!
2Ai.) 2)i2A(e)
14-0'4-
bi
6

Example
Evaluate
theman-ix
integral
formulation
for[A(')](consistent
formulation)
forthelinear
triangle
element.Fromequation
4.13

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

92 Step3: DevelopSystem
of Equations

=[p?K?
+O
(")]
N•ii][N(•
")
1'4(2
")
_
- r..,(½)v(m)
L•'b •Xd +

Now

2! 0! 0!
= (2+o4-o+'•)!
2A
(e)= A6(•)

Similarly

fA = (1+11
,)N?)N?dA 110!2A(.
1+0+2)! )=A
fA•a(e)•,(e)
½,)
,,• ,-3 dA
=(1+10'+
!0!11!
+ 2)!2A(e)
=A(e)
1--•'

andsoonfor eachtermin theintegral.The finalresultis

[A(*)]
= • t•b•d + 2
1

A similarprocedure
canbeusedto compute
theotherelementmatrices.Theresultsare:

[ K(')] = K?)
[bill
bib
j bibk]
K•)ci2
ci½
j CiCk]
4A(e) 4A(e) 4 (4.20)

tbkbi
bkb
j qJ. CkC
i clJ
saunated flow

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 93

3x3--4A
(•) bib
i b•bjbk/
4-4A(•
)'
bkbi
bkbjq J LCkCi
CkCj
4J
unsaturated flow

[C(•)]
=S?)A(•)[2
3• 1!] (4.22a)[C(•)]--
12 12
1 1 3x3
3 0 1
0 0

saturated flow
(4.22b)

saturatexlflow
consistent formulation lumpedformulation

3x3
-- ' 12 2 (4.23a)
[C(½)(•g)]
1
--C(•)(•)
' 3 1
3x3 0 0
(4.23b)

unsaturated flow unsaturated flow


consistent formulation lumpedformulation

[D(•)]-._
D(x•
e(')
bibj bibk 13(•)
O(e) I ½i½i½j
½i½k
3 x3
4A(•) 4A(e) cjci
c•cica,
c•,ci
c•c•c•

---yx- ½ibjcit•l
-",- /b,½•
4A(e) b.
icj
Lbkci hck
/ +
•cj•ck.I 4A(.
) Lckbi
ckbj
ckl•.[

v•
)bibj
bk] V0,e
)C
iCj
-•- bi bjbk
Ck
bi bjb k
+ 6 ci ½jck
ci cj c

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

94 Step
3: Develop
System
ofEquations

consistent
formulation(4.24a)

lumped
formuladon (4.24b)

[A(e)]
__
A(•)t•,(•)•(•)0(e))[2
3x3 1il 1"•'•Vb•d + 12
1 1
consistent
formhlation(4.25a)

or = -•-•Vb •d + 1 lumpedformulation (4.25b)


0

Example
Theclement
conductance
matrix
forthelinear
triangle
element
isgiven
by

[K½•)]
= dx dy

bk Ck
A(e)

1 0 bi bjb
k A(e)
bjcj 0
4A(e)•
b
kck Ci cjC
k

Ci
2CiC
j CiCk]
4A(e) /bjbi bjb
/+ 4A(e)
Lbkbi
bkbjb•

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 95

Example

Compute
[ K(e)]
forthe
clement
shown
bclow
(l•• --1,KSe)-
- 2)
(3,8) (8,8)

132
A(e)
=:
1 188 =15, 4A(•)=60
138

b•-- y•- y? -- s- • = •
•,-- y?•-yl'•-
- •-s -- -6
(0)(0) (0)(6) (0)(-6)]
[K•"•]
1[
= • (6)(0)
(6)(6)(6)(-6){•-
(-6)(0) (-6)(6) (-6)(-6).J

6/10-6/10!
L-5/6 -6/10 43/301

Example

Compute
[D(e)]
forthe
½lcrncnt
inthe
previous
example
(vi
e) 2, v•)=3,D(•= r•(e)
- 10,D•=n(e)0,1.=0,K(d
e) 0,0(•)=0.3)

[D(")]
= 60 36-36 lO(O.3) o
-36 36 6O L-250 25.]

6 + • 0
+• 6 0

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

96 Step3: Develop
System
of Equations

1.8- 8 0 0
-1.8 1.8J -1.25 0 1.25J

+
02.0
-2.(]
1 -2.5
0 2.0
02.51
0 2.0-2.0
-2.0 + -2.5
-2.5
0 2.5
0 2.5

-1.25 2.00--0.75]
-2.50 3.80-1.30I
-3.75 0.20 3.55J

Anothercommonly usedtwo-dimensional clementis thelinearrectangle(Figure4.7).


Forthistypeof element,thefidesof theelementarerequiredto beparallelto thex andy
coordinate
axes(a moreflexibletypeof element,
thelinearquadrilateral,isdescribed
in the
next section).

y?b (x[

(x?),
y?)) ß .•))

Figure 4.7 The linear rectangleelement.

Theinterpolation
functions
forthistypeof element
arederived
in Segefiind
(1984).Using
thelocal(s,t)coordinate
system

N?)(s,t)
= (.2b
(e)
- s)(2a
4a(½)b
•)- t)
(•)

s(2a
<•)-t)
N?•(s,0
= 4a(e)b
(e)

4a(e)b
(e)

N?)(s,t)
=(2b
(e)-
4a(•)b
s)t
(•)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 97

Because
the
sand
xaxes
arc
parallel
and
thetand
yaxes
arc
parallel
• =• and
•-•=• and
thederivatives
of theinterpolation
functions
are

ax 4a(e)b(e) ax 4a(e)b(ei

ax 4a(e•b(e) ax 4a(e)b(•)

s-2b(e) aN•j
e) -s
4aCe)b(e) ay = 4aCe)bee)
s aN?) 2bc')- s
4a(e)b(e) ay 4a(e)b(e)

Theelementmatricesarecomputed
in anexercise.Theresultsare

2 -2 -1 1 2 1 -1 -2

[K(,)]
4x4
satura•
= K•)a
(')-221_-221
flow
,K•'b(:
' 12-2-211
6b(e)-1 I 2
! -1 -2
6a(e) -1-2
-2 -1
2
1
(4.26a)

2 -2 -1 1 2 1 -1 -2

[K(')(V)]=
4X4
unsamta•i
6b
(,) -1 K•)(V)
a(e)
-221• IC•)(V)
1 2 +"
! --1 --2
flow
b(e) -2
-1
2
1
(4.26b)

4212

i 42
[ c(')] = 9 24
(4.27a)
4x4
12
saturat• flow
consistent formulation

lOOO

[ cøø] o 1o
OOl
(4.27b)
4x4
ooo
samra• flow
lumpedformu!odon

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

98 Step3: Develop
System
of Equations

4212

[C(C)(•)]
= C(')(•)a(')b
9 (')
' 2 42
124 (4.28a)
4x4 2 12
uammmlexlflow
consistentformulation

lOOO

4x4 ]= 0! o (4.28b)
000
• flow
lump•l fonn-!•don

2-2-1 1 r•(Oa(Oh(c)
2 1 -1 -2
[ m(,)]=
4x4
Dtx•0(')a(')
-22
6b(e)
-1 1-1
I2 +-yy--
-22 ---11-22-2:
6a(0I -! 2 -2 -2 -1 1

1 -1 -1 1

D•x)O
4
½0
I-1-1
:!-1
-1
1
I
1
1

6 1 2 + '6 - -1 -2 2
1 2 -2 -1 1

4 2 1 2
2 4 2
+ )'.(
o(')+pb
Ka) 9' 1 2 4 consistent
formulation(4.29a)
2 1 2

1000

•(•)[r(•)•(').(') 0 10
or +1-(
O(')+
Wb'•a•', ,, 00 1 lumpedformulation (4.29b)
0 0.0

4 2 1 2

[A(,)]
4x4
= ,.,(,)v.(,),
tFbaXd'r 0(•))a(•)b
' 9 (•) 2 4 42
1 2 consistent
formulation
(4.30a)
2 1 2

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 99

1000

or+ (P?)K•')+
0('))
a(')b(e)
i 10 lumped
formulat
(4.30 01
00

Example

Thesecond
integral
in theequation
foradvection-dispersion
matrix(equation
4.12)for
thelinearrectangle
elementis

jjL?,
A(,)
0 v•') Lay ...ayJ
The matrixthatresultsfrom theintegrationis

1 4-2 2

6 -4 4 3
$-2 2

Theentryin thefirstww andcolumn


isobtained
byevaluating
theintegral

• •s

=v?),•:b("•02a("(2b(e)-
t)(t-2a½½))
dtds
4a(e)b
(e) 4a(')b
(')

--(4a(•)b(•))2Yo
J'o
(2b(•)-s)(2a(•)-t)(

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

100 Step3: DevelopSystemof Equations

2e(½)

½"r
--(4a(•)b(e))
2Jok(s
- 2b (,,,,.,,,,,,,.,,,+,;
(e)) - 0

-__j (e)!t'2b(•)/
vx )ds
/2bte)(2a('))
k 3 3- s.(2a•))3
(4a(•)b(e))•Jo
3 2b•½)
-_-(4a(e3b(e)):•
v•) (2b(e)s(2a(e))3 s• (2a(e))
"'3 2 3

_
- _ v•) [(2b(e))(2b(e))
(4a(e)b(e))2 (2a(e))
3 3 (2b(e))
2(2a(i))3
]
v•) a(e) v?a(•)
---(4a(½)b(e))2(4a(½)b(e))2
'•-=- 3

Example

Verify theentryin thesecondrow andthirdcolumnof equation4.27a.


Fromequation4.8 we canwrite

[C(')1= ' [S?


)1[•?)'" N?)1dxdy

Theintegral
fortheenn'y
inthesecond
rowandthird
column
of[C(e)]is
2b(') ,2b
(½)

SsJ•
.• 2'•1-2a(e))4a(e)b(e)
dt
ds
=(4a(e)b(e))
z (2a(e)s
-st'
st
dt
ds
Ss2•,2b
(e)'
-_(4a(e')b(e)) l:2a
0(e)
/a(e)s2t2-
S2t3
-•- ds

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 I01

(4a(e)b(e))
2 •a•(e)s2ds
_ s,
-(4a(,)bi;•i)2 s
T
2Ssa(e)b
(e)
9
(4a(e)b(e))
2

4.3.2 Numerical Methods

In theprevioussectionwepresented equations
forcomputing theelement matrices
for
threesimple(butcommonly used)element types,
thelinearbar,thelineartriangle,
andthe
linearrectangle.Becausethenumber of nodeswassmallandtheinterpolation functions
wererelativelysimple(i.e.,linearfunctions
of x or x andy), theintegrations
couldbe
performedanalytically.
Forelements withmorecomplex interpolation
functions
ora larger
number of nodes,
performing
therequired
integrations
analyticall.y
isawkward.
Instead,
theintegrations
areperformed
numerically.
Thenumerical
integration
procedure
isgrea.
tly
simplified
if theinterpolation
functions
andtheirderivatives
foreachnodearedefined
using
a local coordinatesystem as was done for the linear rectangleelement. In a local
coordinatesystem a pointwithinanelementis assigned coordinates usinga coordinate
systemoriginattachedto theelement(e.g.,theoriginof thes-tcoordinate systemin
Figure4.7is attachedtonodei). Lna globalcoordinate
systema pointwithinanelement
isassignedcoordinatesusinganarbitrarycoordinate
systemorigin.Interpolation
functions
andtheirderivatives
canbedefinedusingeitherglobalor localcoordinates.Forexample,
the interpolation
functionsfor the linearbar elementcan be writtenusingthe global
coordinatex (wherethe originof the x axiscan be anywhere)or the localcoordinatee
(wheretheoriginof thee axisis at thecenterof theelement)(Figure4.8).

Global Coordinates

=xj)-
L(')
x

N)(x
ß1 =
x-x?
)
Oa

originof global
coordinatesystem

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

102 Step3: DevelopSystem


of Equations

Local Coordinates
1

1 N?)(•)
=•(1-•)

0a

originof local
•=-1 •--0 •_•j=
1
coordinate
system
Figure 4.8 Element interpolation functions can be defined using global or local
coordinates.

The interpolation
functions
definedusinglocalcoordinates
havethesameproperties
as
interpolation
functions
definedusingglobalcoordinates
namely

1.•=1 at e=•i •--1 at


=0 at e=•j =0 at

2.E ei(e)
i=l
=1 for all e, -1 •e_• 1

However, when we usea local coordinatesystem,the integrationsfor the element


matricescaneasilybe performednumerically, evenwhentheelementhascurvededges.
The shapesof severalisoparamctricelementsin thelocalandglobalcoordinate systems as
well astheinterpolationfunctionsandtheirderivatives areshownin Figures4.9 to 4.15.
Derivationsof theinterpolation
functionsfor theseelement typesarein LapidusandPinder
(1982) andDhattandTouzot(1984). The derivatives of theinterpolationfunctions,
and
thevalueof thederivativesat thecenterof eachclementarealsogivenin thefigures.The
notationcan best be illustratedby an example. Considerthe two-dimensional,linear
quadrilateralelementshownin Figure 4.10. The interpolationfunctionsand their
derivatives for the element's four nodes are

•)Ni 1
•hl = -•(l-e)

•)N2
= -•(1+•)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 103

N•--•.(1+•)(1+•)
•N3

1
= •(•+n) •)N•
=•(1+•)
N•=•(•-•)(•+n)
aN4
-•- =-•(1+•) aN4
an=-•(1-•)
The choiceof elementtypeto usefor a particularproblemis not alwaysclear. The
calculation
of theelementmatricesrequireslesscomputational
forthelinearelementsthan
for the quadratic andcubicelements.Alsocurvilinear variationsin heador solute
concentration canusuallybe adequately representedby manysmall,linearelements.
However,whengradients of heador concentration
arelarge,quadratic or cubicelements
maybepreferable tolinearelements
because thequadratic
orcubicinterpolationfunctions
canapproximatecurvilinear
variations
in thefieldvariable
withfewernodesthanlinear
interpolation
functions.
Alsoquadratic
andcubicelements areusefulwhentheproblem
domainhascurvedboundaries
(e.g.,neara well or a buriedstructure
suchas a tunnel,
etc.).
In thelocalcoordinate
system,
theisoparametric
elements
in Figures4.9 to 4.15 have
straight
edges
andsymmetry
about
the•, •1,and• axes.However,
in theglobalcoordinate
system
(which
is thecoordinate
system
of t_he
.problem
domain)
theelements
canhave
curved
edgesandasymmelxicshapes.
Thisisanunportant property
because
it means
that,
whenwe discretize
theproblemdomain,we canbetterrepresent
curvedboundaries
or
curvedinterfacesbetweensoil or rock layers. However, becausethe interpolation
functionsandtheirderivativesare definedin a localcoordinatesystemwhile the integral
formulations
for theelementmatricesaredefinedin a globalcoordinatesystem,we must
usea coordinate
tratu•formationtoevaluatetheintegrals.

(a) linearbarelement

localsystem globalsystem

for nodes 1 and 2'

1
N• = •( 1+ •e )
•Ni •
-•- = •- 8• e•o 2

where

i 1 2
• -I 1

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

104 Step3: Develop


System
of Equations

(b) quadratic
barelement

localsystem globalsystem

for nodes 1 and 3'

where

1
-1

for node 2'

Ni -- (l+e)(1-g)
•)N•
o• =-2e =o

(c) cubicbarclement

localsystem globalsystem

x
I

for nodes 1 and 4'

9•

aNi 9•i(.. 2

aNi
a• •=o 16

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 105

where

i 1 4
• -1 1

for nodes 2 and 3 ß

where

i 2 3
e• 1 -1

Figure 4.9 Interpolationfunctionsand their derivativesfor three types of


one.dimensional elements.

localsystem globalsystem

for nodes 1, 2, 3, and 4'

N•=¬(1
+e•e)(1
+q•tl)
•}Ni
aNi
•- = •(El)
ß ( 1+•]iTI
)
aNi 1
i•q= • ('rli)(1
+EiE)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

106 Step3: Develop


System
of Equations

where

i I 2 3 4
• -1 1 1 -1
•li -1 -1 1 1

Figure 4.10 Interpolationfunctionsand their derivativesfor linear quadrilateral


elements.

localsystem globalsystem
), ©

) c) G
for nodes 1, 3, 5, and 7 ß

=0
• q--o

=0
•q=o

where

i 1 3 5 7
•i -1 1 1 -1

qi -1 -1 1 1
,

for nodes 2 and 6'

1 82)(l+qiq)
Ni = •(1-
•Ni •N i
0

•Ni= qi
•,- •(1- E2
) 3Ni
8q •=oq=o 2

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 107

where

i 2
0

qi -1

for nodes 4 and 8'

Ei

--o

where

i 4 8
g 1 -1
Tli 0 0

Figure 4.11 Interpolationfunctionsand their derivativesfor quadraticquadrilateral


elements.

localsystem ,global
system

for nodes 1, 4, 7, and 10-

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

108 Step3' DevelopSystemof Equations

where

i 1 4 7 10
g -1 1 1 -1
qi -1 -1 1 1
ß ii ii i

for nodes 2, 3, 8, and 9 ß

9
= •TI i
where

ii

i 2 3 8 9

c• -1/3 1/3 1/3 -1/3

Tli -1 -1 1 1

for nodes5, 6, 11, and 12'

81

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 109
where

5 6 11 12

1 1 -1 -1
-1/3 1/3 1/3 -1/3

Figure 4.12 Interpolationfunctionsand their derivativesfor cubic quadrilateral


elements.

localsystem globalsystem

for nodes 1 to 8'

Tli
•-oq=o g--o 8

wher•

i 1 2 3 4 5 6 7 8
gi -1 1 1 -1 -1 1 1 -1
Tli -1 -1 1 1 -1 -1 1 1
• -1 -1 -1 -1 I 1 I 1

Figure 4.13 Interpolationfunctionsand their derivativesfor linear parallelepiped


elements.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

110 Step3: DevelopSystemof F.,quatiom

localsystem globalsystem

for nodes 1, 3, 5, 7, 13, 15, 17, and 19'

+ • )( 1+ qiq )( • + K• )( • + q•q+ • - • )

•)Ni
a•

where

i i i i i ß

i 1 3 5 7 13 15 17 19
• -1 1 1 -1 -1 1 1 -1
qi -1 -1 1 1 -1 -1 1 1
•i -1 -1 -1 -1 1 1 1 1
ß is i i i = ß i

for nobles2, 6, 14, and 18 ß

• =•(•- )(•+•tq)(•+•)
•}Ni

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 111

where

i 2 6 14 18
• o o o o
vii -1 1 -1 1

for nodes4, 8, 16, and 20'

•}Ni
=0.
ß=on=o•=o
- 4

where

i 4 8 16 20

• 1 -1 1 -1

•li 0 0 0 0
•i --1 --1 1 1
i

for nodes9, 10, 11, and 12'

Ni -- •( 1- )( 1+ •ie)(1+Yli•)
•)Ni
• -- • ( 1- •2
)( 1+TliT
I)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

112 Step3: DevelopSystemof Equations

•)Ni

aN,
Og= - ( t +ge)(t +q• )
•)Ni •4 •Ni •)Ni
=o
•-oq=o
g--o 4 '•' •=oq=og--o 4 •=0 q=Og=O

where
, ,

i 9 10 11 12
c• -1 1 1 -!
qi -1 -1 1 1
• 0 0 0 0

Figure 4.14 Interpolation functions and their derivatives for quadratic


parallelepiped elements.

localsystem globalsystem

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 113

for nodes 1, 4, ?, 10, 21, 24, 2?, and 30 ß

Ni --•(l+•..ie)(l+niq)(l'•i•)
(e2+q2+•2)
_•
• = •( 1+nin)(
l +•i•)• ---+ 3ea+n2+•
2+

• =•( 1+q•)(1+•) n•---+d+3•2+•2+2n


• =•( 1+g•)(
1+q•q)
g•---+e=+q=+
3g
• +2g
8Ni[ 19
19

• q=O
•=0= -• 'rli
19

•--'0
•1=0
•--0 i
where

i 1 4 7 10 21 24 27 30

• -1 1 1 -1 -1 1 1 -1

lli -1 -1 1 1 -1 -1 1 1

• -1 -1 -1 -1 I 1 1

for nodes2, 3, 8, 9, 22, 23, 28, and 29 ß

81

9
=

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

114 Step3: DevelopSystemof Equations

where

i 2 3 8 9 22 23 28 29
• -1/3 1/3 1/3 -1/3 -1/3 1/3 1/'3 -1/'3
vii -1 -1 1 1 -1 -1 1 1

• -1 -1 -1 --1 1 1 1 1

for nodes5, 6, 11, 12, 25, 26, 31, and 32 ß

8Ni 9

n--o =
81
•--o
n=o
;--o-
•=o
n---o
g=o
=
where

5 6 11 12 25 26 31 32
1 I -1 -1 1 1 -1 -1
-1/3 1/3 1/3 -1/3 -1/3 1/3 1/3 -1/3
-1 -1 -1 -1 1 1 1 1

for nodes 13, 14, 15, 16, 17, 18, 19, and 20'

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 115

•)Ni
'•' -_ •9
[•,•=o•=o
•)Ni]
'•' •9
•=Oq--Ot•=O----
aNi[
'•' •---o;=o 81
= •;i
where

i 13 14 15 16 17 18 19 20
•i -1 1 1 -1 -1 1 1 -1
qi -1 -1 1 1 -1 -1 1 1

Figure 4.15 Interpolationfunctionsand their derivativesfor cubic parallelepiped


elements.

To illustratethecoordinate
transformation
process
consider
theone-dimensional
form
of the element conductancematfix for saturatedflow

The derivatives
of theinterpolation
functionsare givenin termsof x, but we canusea
coordinate wansformationof the form

x = f(e)

torewritetheinterpolation
functions
andtheirderivatives
in termsof thelocalcoordinate
e.
For thelinear,barelement(Figure4.9a)

Nx =«(l-e) N2=«(l+e)
and
•)Nx 1 3N2 1

Usingthechainruleof calculus
wecanimmediately
3Nx •Nx3x 3N2 3N•3x
a• = 'T•'• a• = •-•-•
3N1_ 3N2
: -3Tp] : -•T[J]

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

116 Step3: Develop


System
of Equations

•x
Thequantity
• iscalled
theJacobian
mauix
ofthecoordinate
transformation
and,fora
one-dimensional
element,the$acobian
matrix[J] is a squarematrixwith a sizeof one

(4.32)

Wc can also wn'm the inversecoordinatetransformation

•N1 1 •N1 •N2 1 •N2

=[.r-•]?•e• =[.C't].•
where
[j-l]istheinverse
oftheJacobian
matrix
(foramatrix
ofsizelxl, [j-l]= 1/[J],
see
AppendixP¾).

The limits of the integrationin equation4.31 alsochangeduringthe coordinate


transformation
(sccFigure4.8)

x--x?) -'>E = -1

Wecannowrewriteequation
4.31as

(4.33)

2xl
where]$] isthcdeterminant
ofthc$acobian
matrix.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapier
4 117

Example
Consider
theone-dimensional
element
inFigure
4.8andletxi(e)-- 1nndxj(e)--2.
Then

"• ..(e)ø'•2
x(2
e)
= - (1)+ (2)= • =l;I (seeAppendixIV, Part 12a)

[J"•]= 2 (seeAppendixIV, Part13a)

I -]1 d,: •?[•1•]


: •-L-• 1
(4.34)

whichis identicalto the conductance


matrixobtainedfor thesameelementin the global
coordinate
system,
equation
4.15a( L(e)=x•
e)-x{
-e)
=2-1--1)
Foratwo-dimensional
element
[J]and[T'l] aresquare
man'ices
ofsize2><2.
Fora
two-dimensional
elementwith n nodes,theentriesof [I] aregivenby

[J]:[31X
J•]
J21
J22] (4.35)
where

• = •x• + '" +-•-x.,


3N• •)Nn
ll2 = '•"Yl + "' + •"Y.

• = •-• + ... +•-•


aN• aN,,
•=: •n + "' +•s.
or morecompactly

,!ßßaN[l
[J]=]ON• ann
2x n
1IX•
IY•i
1 nx 2
(4.36)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

118 Step
3: Develop
System
ofEquations

Thc
value
of[JIand
the
cntdcs
of[j-l]can
bcdetermined
using
the
equations
inAppendix
IV, pans 12band 13b.
Forathree-dimensional
element
[•] and[j-t]aresquare
matrices
ofsize
3x3.Fora
three-dimensional
element
withnnodes,
theentries
of[YJ
aregiven
by

Jll J12J]'131
[J]-- J21J22J25/ (4.37)
J31J32J33J

where

or morecompactly

(4.38)
3x3

3xn

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 119

Thevalue
of ]JI andtheentries
of [ j-i] canbedetemfined
using
theequations
in
AppendixIV parts12cand 13c.
Ingeneral
[J],[j-l],andIJ[ vary
from
point-to-point
within
theelement
(because
the
interpolation
function
derivatives
arethemselves
functions
of E,Eand•1,ore..,
•1,and•).

Example

Compute
[J],[]-1],andl$] atthepoint
• = 0,•l = 1fortheelement
shown
below

7 6 5 node x y
1 0 0
2 5 0
3 10 0
8 4 7.5 2.5
$ $.0 $.0
6 2.5 5.0
7 0 5.0
8 -1 2.5

The elementis a quadraticquadrilateral.From Figure4.11, the interpolationfunction


derivativesat E = 0, •1= 1 are

8• = (1- •)(2(o)+ 1) = o
•}N2 •}N3 •}N•
•,=o -•-T=o •, =o
•N5 1 •N6 •N7 1
a• = • a• = o • = -•

•}N• 1 1
-•- = •(• - o)(2(•)
+o) = •
•N2 1 •}N3 1

•}N• 1 •Ns 1 •N? 1

aNs
---- --1

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

120 Step3: DevelopSystem


of Equations

• 0 0
10 0

[•] = I1/2-1/2
o 0 1/2-1
0 0 1/2
1/21/20 -1/2
1/2 _01]
7.5
5.0 2.•
5.•
2.5 5.•

.01
5.12.:

L-0.25 2.50

-- (2.50)(2.50)
- (0)(-0.25)
-- 6.25

[J-•]
= 6.--•0.25
2.5=k0.04
0.40
The coordinate
transformation
canbe usedto rewritetheintegralsin Chapter3. These
transformed
integralequations
canbeusedto computetheelementmatrices foreachtypeof
elementshownin Figures4.9 to 4.15.

Element Conductance Matrix (Saturated flow)

Qn• dimensionalelements:

[K("]= (4.39)

Two-dimensional elements:

[ K(•)]=
[Kff
)K•
[j-1]T
2x2
0)][j-l]
2x2 2x2
IJldd

2xn (4.40)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 121

Three-dimensional elements:

al "' a'"•'

[•-I]T0 I•) [j-•]


•x• 0 0 3x3

3x3 at• a•.


•xn (4.41)

Element Conductance Matrix (Unsaturated flow)

•e-dimensional elements:

(4.42)

nxl

Two-dimensional elements:

2x2 •hl •)• J


nx2 2xn (4.43)

Thre•-dimcnsional
elements:

nxIi
=

[•-I]T 0
3x3 O
1 1 aE al•
ux3
(4.44)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

122 Step3: Develop


System
of •iuafions

Element Capacitance Matrix (Saturated Flow, Consistent Formulation)

One-dimensional elements:

[c•,] -- (4.45)
n•n .N•)Jlxl lXll
nxl

Two-dimensionalelements;

[c•,,]-- ß [s•,][•,•,... •;,] I•{• •,, (4.46)


•, 1 I LN•)j 1X1 Ixll

Three-dimensional elements:

I I l iN?)
l
[o*"]= l' lxn
(4.47)
""' I I 1 Lm[yJ
nxl

Element CapacitanceMatrix (SaturatedFlow, Lumped Formulation)

One-. Two-. or Three-dimensional elements:

[d')]= . I:1 ' (4.48)


nxn O'
nxn

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 123

Element Capacitance Matrix (Unsaturated Flow, Consistent Formulation)

One-dimensional elements:

(4.49)

,,x,,, [N•)J lxl lxa


•x!

Two-dimensional elements:

(4.50)

nxl

Three-•mensional elements:

Element Advection-Dispersion Matrix

On•-dimensiQnalelement,s:

nxn •1%,(•)
b<l lxl lxl as a•Jlxn

nxl

iLN?] lxl lxl

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

124 Step3: Develop


Sys•mof Equations

(4.52)
lxl

Two-dimensional elements:

Iix Ii
[j-liT
!¾e)A
_._(e)•;•,.,j [j-l]•?o•Z
....
...••)E'"
2•2 2•2 2•2 2xn

[I.(0(')+ •b "-dn '

•xl lxl lxn (4.53)

[•ldednd[

3:<5

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapte•4 125

oo.

nx3 3x3 . 3x3 3xa

[•.(0(•)+ Vb.•d•

nxl lxl lxd (4.54)

Element Sorption Matrix

One-dimensional elements: ..

[ A(e)]
: ß [,.(e)•(e)O(e)] ...
L•>j
nxn 1 nxl lxl (4.55)

Two-dimensionalelementS:
1 1

' ,,.,,,
...,,+ 0(½)]
r,,(•)u-(•) r•?.-- •?]lJl•d•
1 I
nxl lxl l><n (4.56)

Three-dimensionalelements:

(4.57)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

126 Step3: DevelopSystem


of Equations

When the numberof nodesfor an elementis greaterthantwo, or when the orderof the
polynomialfor theinterpolation
functionsis greaterthanone,or for two-dimensional
or
three-dimensional elements, it is convenient to use numerical methods to evaluate the
integralsin equations
4.39 to 4.5?. Specificallythemethodof Gaussquadraturecanbe
used. In thismethod,we obtaina numericalapproximation to theintegralof a function
over an intervalby computing the weightedsumof valuesof the functionfor specific
pointsontheinterval.In one-dimension, theequation for Gaussquadratureis

1
f(e)
d•= •W•(•)f(•),
i=l
o _•w•(r•) < • (4.58)

whereWi(ei)is theweightassigned to thevalueof thefunctionf at theGauss


point
-1 g gi -<1, andNz is thenumberof Gausspointson theinterval.In two-dimensions,
the
equationfor Gaussquadrature is

I I i=l j=l
o _<w•(•) • •
0 f Wj(vlj)• 1 (4.59)

where Wi(ei) andWi(Vl j) aretheweights


assigned
tothevalue
ofthefunction
f attheGauss
point(• -- ei, Vl= vii)andNeandN•iarethenumber ofGausspoints
ontheintervals-1 •
ei • 1 and.1 _<rli• 1. ,
In threedimensions,theequationfor Gaussquadrature
is

I I I i=l j=l k=l


0 • w•(e•) • 1

o < W•(•k) < • (4.60)

where
Wi(ei),
Wj(xlj),andWk(•k)aretheweights assignedtothevalue
offunction
f atthe
Gauss
point
(e= ei,rl = rli,• = •i ) andNe,N•iandN• arethenumberofGauss
pointson
theintervals
-1 _<ei -<1 and-1 < xli< 1,and-1 • •i < 1.
Thenumberandlocationof theGausspointsandthevaluesof theweightsareselected
to achievethegreatest accuracy.If thefunctionf is a polynomial,
Gaussquadrature can
provideanexactintegration. A totalof (n+1)/2Gausspointsarerequiredto obtainanexact
integrationfor a polynomialfunctionof ordern. If thequantity(n + 1)/2 is nota whole
numberit is roundedup to thenextlargestinteger.Forexample,if n = 2, (n + 1)/2= 3/2
= 1.5 whichis roundedupto 2 and2 Gausspointsarerequired.The numberandlocations
of theGausspointsandthevaluesof theweights, forpolynomial functionsof orders 0 to9
are in Table 4.1.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 127

Table 4.1 Locationsof Gauss points and values of weights for exact integration of
a polynomial function by Gauss quadrature (after Dhatt and
Touzot, 1984).

Orderof Numberof Locations(s)


of Weight(s)
polynomial Gauss
poims GaussPoims

Oor 1 1 0 2

2or :3

4or 5 o 8/9

6or7

128
8 or9
0 22'-•

•.,•5-4q5/14 4•-•
161 13
1
+ i8o4•/•.4

--•,•/5-4
•/14
'' 161 13
•5•q•/14 16118•s/ld'
4s•- 13
161 13
450 180•5/14'

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

128 Step3: DevelopSystemof Equations

Forexample,.
consider
theintegral

•(•+3)
1 de
The analyticalsolutionis
1

I
(e+3)de--•+3e-1 -- +3 - -3 --6

The highest-order
polynomialin thefunctionto beintegrated
is 1 (n -- 1) andthenumberof
Gausspointsrequiredis also1 (Table4.1). Usingequation
4.58,thenumericalsolution is

(e+3)de = %(eO f(•) = %(e=v4)


I i=l
= W(e---O)f(œ=O)= 2-(0+3) = 6

whichis thesameastheanalyticalsolution.
Foranother example,consider
theintegral

The analyticalsolutionis
1

1(•+•)d•= T+T
1 E3E2--(3+i)-(-}+i) ==-
-1
3

The highest-order
polynomialin thefunctionto beintegratedis 2 (n = 2) andthenumberof
Gausspointsrequiredis also2 (Table4.1). Usingequation4.58, thenumericalsolutionis

(œ2-1-•)
dœ--- Wi(F4)
f(•-i)
1 i=l

2
-3

whichis thesameastheanalyticalsolution.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 129

Example

Evaluatetheintegral

Thehighest
orderpolynomial
termisquartic0'}4) andfromTable4.1 wefindthatthree
Gausspointsarerexluired
in eachdirection
for a totalof ninepoints.Theyare(•,vl):

(o, o) (3,/]•, o) (-•-J'•Y,o)


•o,•,/•Y) (•4•', •,Y37•) •-•4•',

Thevalueof theintegralcanbecomputed
usingequation
4.5;9
3 3

i=l j=l

= 0 + 0.230- 0.230 + 0 + 0.210- 0.0•7 + 0 + 0.210


= 0.266

Example

Evaluatetheintegral

Thehighest
order
polynomial
termiscubic(•3)andfromTable4.1wefindthattwoGauss
pointsarerequired
in eachdirection
fora totalof eightpoints.Theyare(•,Vl,•):

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

130 Step3: DevelopSystem


of Equations

Thevalueof theintegralcanbecomputed
usingequation
4.60

(Note: Valuesof weightsequal1 at all Gausspoints)

1 1 2 1 • 1 1 1

1 1•3 1 2 1 1
1 1 2 1 3 1 • 1 1

1 1)•+ 12 1 1
1)3 2 1 1
1 2 1 3 1 • 1 1 2

0.1012 + 0.0272 - 0.0272 - 0.1012 + 0.0272 - 0.1012 + 0.1012 - 0.0272

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 131

The application
of Gaussquadrature
to thecomputation
of theelementmatricesleadsto
the followingequations.

Element Conductance Matrix (Saturated Flow)

One-dimensional elements:

[K(e)]
=EW•(•),
!IX !! i=l aN(J)(q)
lxl lxl a=
ax!
(4.61)

Two-dimensionalelement•:

aN(•)(•,q•)
a•)(•,q•)
'
ae aq
:

[J(Ei,T]i)-l]
[I•)i•)
] 0

nx
n i=1
j=l
2x2 2x2

ag

P(r'q (4.62)

Three-dimensionalelement•:

n•i• i=l •-1 k=l

nx3

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

132 Step3: Develop


System
of Equations

IJ(œi,•j,•k)
]

(4.63)

Element Conductance Matrix (Unsaturated Flow)

Theseequations
can
beobtained
bysubstituting
K?)(V),
K•e)(V),
andK?)(•)forK?,
K•),and
K?inequations
4.61,
4.62,
and
4.63.

Element Capacitance Matrix (Saturated Flow, Consistent Formulation)

One-dimensional
elements:

[C
(e)]
= ZWi(ei) ' IS?]
[N?)(ei)...
N?(ei)]
IJ(ei)
l (4.64)

Two-dimensional clements:

N•:
N,, N?)(ei,,rlj)]
_
[C(½)]
=Z Z Wi(œi)
Wj(qj)(½)i !/[S?]
Ix I
[N?'(ei,qj)"'
lxn
N•'(ei,q•)]
I•
nxn i=Ij=1 Nn(œi,qj)J
nxl (4.65)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 133

Thre•imen•on• elemems:

Nc N• Ng
'= j=,,=,
[L•)([i,•j,•,)
N?)(l•i,T•j,•g)]
J lx'

axl } (4.66)

Element Capacitance Matrix (Saturated Flow, Lumped Formulation)

No numerical
integration
isrequired;
useequation
4.9.

Element Capacitance Matrix (Unsaturated Flow, Consistent Formulation)

These
equations
can
beobtained
bysubstituting
C(e)(¾)
forS?) inequations
4.64,4.65,
and 4.66ß

Element Capacitance Matrix (Unsaturated Flow, Lumped Formulation)

No numerical
integration
is required;
useequation
4.11•

Element Advection-Dispersion Matrix


One-dimensional elements:

[D
(e)]
: i•lWi(Ei)ff(e0-l?[o)e(')lff(v4)
!!XII ' ----
i
ß

& .... 1x1 1x1 lxl

nxl

(4.67)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

134 Step
3: Develop
System
ofEquations

Two-dimensional
elements;

[•(•i,Tlj)-l]T
[D(•
0(•)
D(•
2x 2
0(• 2x 2

2xn

'1'••]Wi(•)Wj('qj)ß [•,(
0(e)'l'
i•b a'd 2.1
,,(e)•,, (•)v•

'='J=' LN?(ei,qj)
j •x•
nx!

[N?)(ei,nj)
.-.
N?)(ei,nj)]
[j(ei,qj)
[} (4.68)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapte•4 135

Three-dimensional elements:

[D(½)]
=

[J(ei,'qj,•k)-l]
'r

nx3

[J(Ei,TJj,•k)
-1]

3x3

3x3
V•
) [J(Ei,TIj,•k)
-1]
0 V(z
e 3x3

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

136 Step3: Develop


System
of Equations

Element Sorption Matrix

One-dimensional
elements:

[A
(•)]
=EWi(•i) ' r"(e)v'(e) I I
!l)(11i=l N?Cei)J 1x1 Ix,
(4.70)

Two-dimensional elements:

(4.71)

Three-•men•ionfl •lement$:

Ne
[A(e)]
=i•lNn
E ZN;Wi'•i)
""' '= J='"='
Wj(TIj
) [N?)(•i,TIj,•k)]
Wk([k'
' r"(e'•(e'
LN?c•,,Ui,•k)Jlxl
LPb iXd

nxl

[N?)(•i,•j,•k'
'"N•'(Ei,T]j,•,']
IJ(Ei,T]j,•k
Ix-,
l} (4.72)

Theorderof polynomial
for theelementmatrices
for theelementtypesin Figuzes
4.9 to
4.15 are in Table 4.2

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 137

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

138 Step3: DevelopSystem


of Equations

Example

De•e the numberof Gausspointsto use in equation 4.69 for the element
advection-dispersion
matrix [D(e)]
forthecubic
parallelepiped
element
(Figure
4.15).
From
equation
4.69,[D(e)]consists
ofthree
terms
containing
thedispersion
coefficients,
theapparentgroundwater
velocities,
andthesolutedecayanddistribution coefficients.
The
firsttermcontains
productsof thederivatives
of theinterpolation
functionsandterms such

as-•.•- arepolynomials
oforder
six(e.g.
terms
such
as ß or ) and
can
be
integrated
using
4-point
Gauss
quadrature,
Ns-- N•i-- N --4 (Table4ß1). Thesecond
termcontains
products
of theinterpolation
functionsandtheirderivatives.Terms suchas

i•z arepolYnOmials
oforder
sixandcanalso
beintegrated
using
4-point
Gauss
quadrature.
The thirdtermin equation
4.69contains
products
of theinterpolation
functions
andtermssuchasNiNi arepolynomials
of ordersixandcanbeintegrated
using4-point
Gauss
quadrature,
Nz= Nvl= N• = S (Table4.1). Thelocations
ofthe64Gauss
points
are
(0,0,0),
,0, 3-• ,0, ? ... ?, ? ,

Example

Compute
[K(½)]
forthe
linear,
quadrilateral
element
shown
below
(K•
e)•-1,K(y
e)--2).

node (7,5) (-1,1). TI _1,1)


numbers(3,4) ß

(3,2)
7,1) (-1,-1•' (1,-1)
x

Global Coordinaœ½s I•al Coordinates

Usingequation
4.62andthederivatives
in Figure4.10we canwrite

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 139

2x2 2x2 2x2

4x2

•(•'-0q(•'•) ¬0'•)
2x4

The highest-order
polynomialin thisequationis quadratic(n: 2). For example,

i(1_q).i(1+q)=•6(1
+q2)

Referring
toTable4.1,twoGausspointsarerequired in eachdirection (i.e.Ne= Nn = 2).
Thelocations
oftheseGausspoints
are(e,Vl):(-l/•r•,-1/•r•),(-1/•/•,1/4•),(l/•r•,lt•) and
(1/,•,-lP•). Atthef'srst
Gauss
point(•1= -1/,•, vl1= -1/,•) the$acobian
ramfix
(equation
4.36) is

:[_•[1+•]
41_[1+•]
41_[1_•]_•[1
3!
2 32

:[-0.3943
0.3943
0.1057
-0.•057]
i
L-0.3943 -0.1057 O.1057 0.3943J

[2.0000
Lo.oooo 1.2113J

(2.000)(1.2113)
- (0.000)(-0.2887)
= 2.4228
and

[•-,1
= [0.50000.1192]
LO.OOOO0.8255J

Thecontribution
of thefirstGausspointto theelementconductance
matrixis

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

140 Step3: Develop


System
of Equations

'-0.3943 -0.3943'
0.3943 -0.1057
[K(O(el,rll)]
--(1)(1)0.1057 o.ooo
0.1057
0.1192
-0.1057
o.oooo]
0.82551 [$ ro.ooo
L0.0000 0.8255..I
0.3943

-0.3943
0.3943
0.1057
x -0.3943-0.1057
--0.1057]
0.1057
0.39431
(2'4226)
0.65780.0285
-0.1763-0.5099]
0.02850.1194
-0.0076--0.1403
/
-0.1763
-0.00760.04730.1367/
-0.5099 -0.1403 0.1367 0.5135.1

Atthesecond
Gauss
point
( el = -1/•', r12= 1/x/•'), thelacobian
matrix
is

32

_-
•-0.•0•7
0.•0•7
0.•-0.•]
i
c-o.•n•-0.•0•7 0.•0•7 o.•n•

=[2.0000
0.0000 0.2886']
1.2114.]

]JI= 2.4228 and [0.5000


-0.1192]
[J'-•]
=LO.OOOO 0.82553
Thecontribution
of thesecond
Gausspointto theelementconductance
matrixis

[-0.1057-0.3943'
[K(e)(•l'•12}]
=(1)(1)
/ 0.3943 0.1057
L-0.3943 0.3943
1
-0. 192 0.82553

x [ 0.0000
0.5000-0.1192][-0.1057
0.8255.J 0.1057
L-0.3943 0.3943-0.394
-0.1057
0.1057
0.39431
x (2.4224)

0.51350.1367-0.1403-0.5099]
0.13670.0473-0.0076-0.1763
/
-0.1403
.-0.00760.11940.0285•
-0.5099 -0.1763 0.0285 0.6578J

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 141

Atthethird
Gauss
point
( • = 1/•/•,qt = -lh•' ) wehave

[2.0000
0.2886'
I 3.5772
[.rl= Lo.oooo
•.?88•J
ro.5oooo.o8o•]
[F•]= LO.OOOOo.559t]
andthecontribution
of thethirdGausspointto theelementconductance
matrixis

0.1763
-0.0284
-0.1555
0.0076]
-0.02840.4455
-0.2976-0.1194
I
-0.1555-0.2976
0.0076-0.1194
0.3733 0.0798!
0.0798 0.0320.1

Atthefotmh
Gauss
point(g2= 1/q•',•12= 1/•/•')wehave

2.0000
0.2886']
[J]= 0.0000
1.78863 3.5772

0.5000
-0.080T}
L0.00O0
o.559•

andthecontribution
of thefourthGausspointto theelementconductance
matrixis

0.0318 0.0793 -0.1188 0.0076'


0.0793 0.3713 -0.2960 -0.1546
-0.1188
--0.2960
0.4430
-0.0283
0.0076 -0.1546 -0.0283 0.1753

Theelementconductance
matrixis thesumof thecontributions
at thefourGausspoints

[K(')1 = [K(e)(E;i,TIi)]
+ [K(e)(E1,TI2)]
+ [K(e)(%,q0]
+ [(K(e)(EA,TI2)]
[ 1.379520,21649
-0.59149
-1.00452]
= ! 0.216490.98551
-0.61051-0.59149[
[.-0.59149
-0.610510.985510.21649!
L-1.00452 -0.59149 0.21649 1.37952J

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

142 Step3: DevelopSystemof Equatiora

4.4 ASSEMBLING THE GLOBAL SYSTEM OF EQUATIONS

After the elementmatriceshavebeencomputed,theymustbe combinedto obtaint.he


globalmatricesneededto solvefor unknownheadsor soluteconcentrations
at thenodes.
Thisprocess
is calledassembling
theglobalsystem
of equations.The assembly
process
can be written

[M]=
Z [M(½)] (4.73)
global ß= 1

where
[M]isanyglobal
matrix,
eistheelement
number,
[M(½)]
isanelement
matrix,
andm
•1obal
iSthe numberof elementsin themesh. For exampletheglobalconductance matrixfor a
meshcanbe obtainedby combiningtheelementconductance matricesfor eachelementin
the mesh

{K]= E [K(e)] (4.74a)


glob• ½= 1

Similarlyfor theothertypesof globalmatrices

{1:}
= ßE= 1 {F(½)}
global
(4.74b)

[K(v)]
= (4.74c)
global e= 1

[C]=Z [C(")] (4.74d)


gld•al ½=1

[c(¾)]
= (4.74e)
global ß= 1

[D]=Z [D(e)] (4.74f)


global ½= 1

[A]=Z [A(')] (4.74g)


global ß= 1

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 143

Thesummationsin equation 4.74canbeperformed bydirectmatrixaddition


onlyif the
element
matrices
arefirstexpandedtothesamesizeastheglobalmatrices.
Thisisdoneby
adding
rowsandcolumns of zewstotheelement
matrices.
Forexample,
theelement conductance
matrixforelement
1 in theexampleproblem in
section 3.2 was

1 2

[K
o)]
=
(4.75)

wherethe numbersabovethe columnsand to the right of the rows of the element


conductancematrix are the node numbersfor the nodeswithin element 1. Element 1 had
twonodes
(n= 2) andthesize
of[ KID]is 2x2.Thefinite
element
mesh
had5nodes
and
therefore
the sizeof the globalconductance
matrix[ K] is /5x/5. We can expandthe
global
conductancematrix for element1 to this sizeby addingzerosto the rowsand columns
containing
node3, 4, and5.

i 2 3 4 5
' I 1
-000 1
mesh node numbers
1
ooo (4.76)
0 0 0 0 0 3
expanded
0 0 0 0 0 4

0 0 0 0 0 5

LetI• )refer
tothe
entry
inthe
ithrow
and
jthcolumn
ofthe
expanded
element
conductance
•r(1)
Inane •rO)_
•,I 1-' 1/2isnonzero
because
element
1contains
node
number
1 S'unilarly
for•,-22.
L,.(I)
•'(•) K(21x
)---1/2arenonzero
because
clement
1contains
bothnodes
1and
2. •3 -'-•,•
We canalsowritetheexpanded
formoœtheclementconductance
matrixœor
theother
elementsin the mesh(elements2, 3, and4)

1 2 3 4 5
0 0 0 0 0 1

[K(2)]= -1 1 0 3 (4.77)

• 000 0 0 • 4
0 0 0 5

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

144 Step3: DevelopSystemof Equations

1 2 3 4 5
0 0 0 0
0 0 0 0
[K0)] = 0 0 1/3-1/3 (4.78)
• 0 0-1/3 1/3
0 0 0 0 0.]5

123 4 5

000 0 0
000 0 0
[KH)] = 000 0 0 (4.79)
0 0 0 1/3 -1/3
o o o -1/3 1/3

The globalconductance
matrixfor themeshcanthenbe assembled
by directmatrixaddition
of theexpandedmatrices
[K] = [K(1)]+ [K(2)]+ [K(3)]+ [K(4)]

I 2 3 4 5

1/2 -1/2 0 0 0

-1/23/2-1 o • (4.80)

= ! -14/3
-1/3 o-1/3
o
2/3-1/3
o -1/3 1/3

Forthisproblem[K] is symmetric
andhasa semi-bandwidth
of two (SBW= 2).
global

Consider
thesamemeshwitha differentchoiceof nodenumbers
(Figure4.16)

(1) (2) (3) (4)


1 3 2 5 4

Figure 4.16 Finite element mesh with a different choice of node numbers.

The expandedformof theelementconductance


matricesare
I 2 3 4 5
1/2 0 -1/2 0 o 1

0 0 o 0ø
02
[K
•0)]
= -10/2
0 1/20 3 0 0 0 4
(4.81)

0 0 0 0 5

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 145

1 2 3 4 5
0 0 0 0 0 1

[K(2)]= -1' I 0 3 (4.82)

• • 000 0 0 0 4 5

I 2 3 4 5
0 0 0 0 0 1

[e•j= 0 0 0 •
(4.83)

0-1/30 0
00' 0 1/3'/ 4
5

1 2 3 4 5

0 0 0 0 0 1

[K(4)]--
• !ooo 0 0
0 0 1/3 -1
LO o o-•/3
4
•/3.1 •
0 3 (4.84)

andtheglobalconductance
matrixforthemeshis

[K] = [K(1)]+ [K(2)]+ [K(3)]+ [K(4)]


global • • e.xpn,,d• e.xpa,,ded

1/2 o -1/2 o o

= 0 -14/3-1
-1/2 3/2 0
0 -1•3

0 0 0 1/3
0 -1/3J
-1/3 0 -1/3 2/3

[K]isstillsymmetric
(andwillbesymmetric
foranychoice
ofnode
numbers)
butthesemi-
global
bandwidth hasincreased to 3. UsingtheformulafromChapter 2, SBW-- R + 1 whereR
is themaximum differencein nodenumbers for anyelementin themesh.Forthemeshin
Figure4.16R -- 3 •computed in element
3) andSBW-- 3 + 1 = 4.
The effectof choiceof nodenumbers on theentriesof theglobalconductancematrix
andits semi-bandwidth for thismeshareshownin Figure4.17.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

146 Step3: DevelopSystemof Equations

Assemblingthe globalmatricesby directmatrix additionrequiresthateachclement


matrix fi_rstbe expandedto size p x p, wherep is the numberof nodesin the mesh.
Althoughthisprocedure helpsusvisualizetheassembly process
it is inconvenient
in that
we mustmanipulate a largenumberof zeroentriesin eachexpanded matrix.In computer
programs,direct matrix additionis also wastefulof computermemorybecauseeach
expanded clementmatrixis thesamesizeastheglobalmatrices.
A morecomputationally efficientprocedure
is to assemble
the globalmatricesby
component
addition.In thisproceduretheelement
matricesarenotexpandedtothesizeof
the globalmatricesby addingrows and columnsof zeros. Instead,the elementnode
numbers areusedto assignentriesin theelementmatricesto theirproperpositionin the
globalmatrices.Theprocedurecanbeusedfor one-,two-,or three-dimensionalproblems
andformeshes containing
severaldifferentelement types.In theexamples
thatfollow,the
elementnumber foreachtermin theõ1obal matrixisshown inparentheses
asa superscript.

choice of node numbers resultingglobal semi-


conductance matrix bandwidth

(1)
1

[,n o -,n 6......


,oq
(1) , /o -, o4>,{.
1
(2)
ß
2 (3).,
5(4)
4.. •.1/2-1
0 3/2
['"',@,, 0O/SBW=4
0 1/3-1/3 L 0"'",,1/3 0 -1/3 2/3J

(•) /o o o
1
_
3(2)
_
4(3)
.=
5(4)
.. L-l/2
0-1] 4/3-1/3
2 ]'",.Q,,,
0 -1O[SBW=4 L 0 "W,•./3 0 -1/3 2/3J

(1) 1/3 -1/3 0


(2) (3) (4)
-1/3 2/3 -1/3 SBW = 5
1 5 4 3 2
.....
[ 0 0 -1/3 4/3
[>q/•
I 0 0 -1

(1)
5

Figure 4.17 Effect of choice of node numbers on entries and semi-bandwidth of


global conductance matrix.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapte•4 147

Example

Compute
[K(e)]and[C(e)](consistent
formulation)
fortheelements
inthemesh
shown
below. Assemble[K] and [C]
global global

(1) (2) (3) (4)

1 3 2 4 5

LO)= 4 L(2)=6 L0) = 5 L(4)= 4


K(x•')
=2 K?)-- 1 K?)--2 K?)=4

Usingequations
4.15a and4.16a
1 3 3 2 2 4

[K(l)]
=-1/2 1/'2
3 [K(•-)]
:L-1/61/6]
2 [K(3)]
= -2/52/5]
4
4 5

1 3 3 2 2 4

4/3
2/3'
2/3
4/3. [C(2)]
=[2121
3 1 2

4 5

1 2 3 4 5

...........
0 '1/6(:2)+
2/5
0)' -1/6(2) ' -2/5(3) ' 0
_-............... .• ................ ) ............. ) .......

-1/20)' -1/6(2) ' 1/2(1)+ 1/6


(2)' 0 ' 0
.......... .-,............... _................. : .....................

..........
0 ' -2/5
.-. ...............
(3) :
: ................
0 :2/5(3)+
.• .............
1(4)!'-1
.......
(4)
0 ' 0 i 0 : -1('•) ' 1(4).

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

148 Step3: DevelopSystemof Equations

1/2 0 -1/2 0

-1/2 0 17/30
-1/6 -1/6
2/3 -2/5
0

o -2/5o 7/5
0 0 0 -1

I 2 3 4 5
o

0 '2(•)+•o
(3)' 1t•) ' 50) ' 0
....•'":....'ii•i'"•"•'"•......• .....i'"/•"
global
....,....

0 : 5© : 0 '100)+4
©' 2©
.....
•'":.....'•.....
:....•;'":
.....
•'(•i
....
4/302/300

0 121 500
0 1 2 0

0 5 0 14•
o o o 2

Example
Compute
[K(*)]and[ C(*)](lumped
formulation)
fortheelements
inthemesh
shown
below. Assemble[ K ] and [ C ].
global global

2 4 6
(0,1) (1,1) (2.5,1)

T•i k••,j iT

1 3 5

(0,0) (1,0) (2.5,0)

K?)=K?)=K(x4)
=K•4)
=4

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 149

Usingequations
4.20and4.22bwith

element 09•le numbers


J

we have

(-•)• (-1)(• ) (-1)(o) (-•)• (-1)(o) (-1)(1


2 )2 2 )2
[K0•]=•
11)(-1) (1 (o)(o
o)(-1) (o)(1) (1)(01
+•(0)(-1) (0 (0)(1
(•)(-0 (1)(o) (1)•
i 3 2

= 1 3
0 2

(-1)2(-1)(0)(-1)(11
[•2•]=•' (o)(_•)(o (o)(• +• [(0)2(0)(-1)(0)
) (-• (-•)(1)/
(1)(-1) (1)(0) (1)2 L(1)(O) (1)(-1) (1) 2
2 3 4
1 o
= o 1 3
-1 -1 4

[Ic (•_•)2
c_•)•
•)c_•)c
ol c-•.•)2
c-•.•)c
o)c-•'•)•'
4(•)(-•) (1)2(•)(o +•4(o)(-1.•) (o)2 (0)(1.5)/
ø)]=•'
( 0 )(-1) ( 0 )( 1) ( 0 )2 (1.5)(-1.5)( 1.5)(0 ) ( 1.5)(1.5).J
3 5 4

4.3 -1.3-3.0 3

-- -1.3 1.3 0.0 •


-3.0 0.0 3.0 4

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

150 Step3: DevelopSystem


of Equations

(1.5)
2 (1.5)( 0) (1.5)(-1.5)'
4F(1)2(1)(_1) (1)(0 4 (o)(1.5)
[K(4)]
=•'[(-1)(1)(-1)2 (-1)(0
L(o)(1) (o)(-•) (0) 2
+• (o)• (o)(-•.5)
(- •.5)(1.5)(- 1.5)(o) (- •.5)2

6 4 5
-3.0
=
[
-1.3
-3.0
1.3
o.o
0.0
3.0

1 2 3 4 5 6

[K] =
global

2 -1 -1 0 0 0
-1 0 0

_ - -• 02 6.30 -4 -1.3 0
6.3 0 -1.3

-1-40
0
-1.3
0
0
-1.3
4.3
-3
-3
4.3

1 3 2 2 3 4

[Cø)] = 0 0.5 3
0 0 O.52 0 0.54

3 5 4 6 4 5

[C0)] = 0 0.75
0 0 0.75
[C(4)]=
io: :1
L o
0.75
0 0.75

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 151

[C]=
global

0.5 0 0 0 0 0

1•00 0 0
= 0 1.752.00
0 0 0

0
o 0 o0 1•5
o o.75J

Example
Compute
[ C(e)](consistent
formulation)
fortheelements
inthemesh
shown
below.
Assemble[ C ].
global

2 4 6

(0.,1)
ns_ (1,1)
-,-- , (3,1)
am,

1 3 5
(o,o) (],o) (3,0)

s?'=a, s?=6

Usingequations
4.22aand4.27awith
n•;•lenum!•r•
element

1 3 2
2 3 4
3 5 6

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

152 St• 3: Develop


System
of Fxluatiom

134

[C(1)]--_ ß 12 = • 12 3
12 1 1 11 4
234

[c(a)]= i2 2 = • 2 3
1 1 4

3564
4212 4212 3

' ' 24 = • 124 6


12 212 4

1 2 3 4 5 6

1/40)' 0 :
.........'..,.,,o,,.............o...........
1/80) : 1/80)
'......o.......o..........
•ß 0 ' 0 1
0 '1/'2(2)' 1/4(2) • 1/4(2) :. 0 : 0 2
,0
. ooo, ..0ß .oo
. . , •.oo . ß

global 1• (1)'1/4(2)'1/8
(1)+1/4
(2)+8/3
(3)' I/4(1)+1/2
(2)+16/3
(3)'4/3(3)' 8/'3
(3) 4
'"i;...... ............
........
'i)ia..........
• .......
i.........
;/3i ..........
,. .......................... .• .......................... ., ......... • .........
',
0 : 0 i 4/30) : 8/'3
0) '8/3(3)'16f3½31
6

I0'205 0 0'1250'125 0 g 0.5

= /0.1250.256.6073.0422.6671.333
0.250 0.250 0

[0.1••
0.2•
•.042
6.0a•
1.•2.667
/ 0 2.6671.3335.3332.667
0
/
1.333 2.667 2.667 5.333.1

4.5 MODIFICATION OF GLOBAL SYSTEM OF EQUATIONS TO


INCORPORATE BOUNDARY CONDITIONS

4.5.1 Dirichlet Boundary Conditions

In mostproblemsthe valueof the field variable(hydraulichead,pressurehead,or


soluteconcentration)
is specifiedat oneor morenodes,sometimes calledDirichlctnodes.
Thesespecifiedvaluesconstitute the Dirichlctboundaryconditionsneededto solvethe
governing
differentialequation
of groundwater
flow or soluteuansport.WhenDirichlct
boundary
conditionsarespecified,
theglobalsystemof equations
mustbemodifiedbefore

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 153

a solutioncanbe obtained.The modification


procedure
reducesthe sizeof the.global
system
ofequations
toa size(p-d)x (p-d)where
p isthenumber
ofnodes
in themesh
and
d is thenumberof nodeswithspecified
valuesof thefieldvariable.Forexampleconsider
thesystem
ofequations
fromtheexample
problem
in Section
3.2.
1/2 -1/2 0 0 0 hi 0

-1/23/2-1 0 00h•h2-- 0
0 -1 4/3 -1/3 (4.85)
0 0-1/3 2/3-1/3 h4
0 0 0 -1/3 1/3 h•

In thisexample
thevalues
of hydraulic
headwerespecified
atnodes
1 and5, hI -- 12 and
h5--0. Thismeans
thatthefirstandfifthrows
ofequation
4.85arenotneeded
andcanbe
crossed out:

Wethenmodify
theremaining
equations
toeliminate
columns
1and5. Forrow2 wehave

_-0
I ,

and for row 4 we have

-]•h3+•h4-•h5
=0
buth5 = 0, sorow4 becomes

-•h3+•h4=
0

-1 0 h2 6
4/3 -1/'3 h3 -- 0
-1/3 2/3-1 h• 0

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

154 Step3: DevelopSystemof Equations

andthemodifiedsystemof equations
becomes

-1

3/2
0
4/3
-1/3
ha
h4
=

whichcanbesolvedto giveh2 -- 9.33,h3 -- 8.0,andh4 = 4.0.

Example
ModifythefoUowing
system
of equations
if ¾1 TM
10 and¾4= 5. Solvefor•2, ¾3,
and¾z

L o
17/30-1/(5
/-10/2
-1/6 0
0-!5•2
2/3 ¾3
=
o
-21:5
o
o
1 -
-1
¾4
7/5J •:•

CrossLug
outrows1 and4 andcolumns1 and4

1= I r g•
17/30 -1/6 o

-1/6 2/3
,:
-2/5 0

For row 2 we have

(0)(10) + (17/30)•2 - (1/6)•3 + 0(5) - (2/$)•5 = 0


or

(17/30)¾2- (1/6)•3 - (2/5)•5 = 0


For row 3'

--(1/2)(10) - (1/6)•2 4-(2/3)• + (0)(5) - (O)w5 = 0


or

-(1/6)•2 + (2/3)•3 + (O)•s -- 5


For row 5'

(0)(10) - (2/$)¾2+ (0)¾3 - (1)(5) + (7/$)¾5 = 0


or

-(2/5)W• + (0)¾3 + (7/5)¾• = 5

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 155

andthemodifiedsystemof equations
becomes

-1/6 2/3 ¾3 =
-2/5 0 ?/SJ ¾•

fromwhichweobtain¾2= 6.52,¾3= 9.13,and¾5-- 5.44.

4.5.2 Neumann Boundary Conditions

Ratesof groundwaterflow or soluteflux can be specifiedat one or more nodes,


sometimes
calledNeumann
nodes.Thesespecified
valuesconstitute
Neumann
boundary
conditionsandcanbe used,for example,to represent specifiedratesof groundwateror
soluterecharge
at thesoilsurface,
or theinjectionor withdrawlof groundwateror solutes
at wells.WhenNeumann boundary conditions
arespecified,
someentries in theglobal
[F] matrixarenonzero.Theequation for computing
thecontribution
of elementß to the
globalIF) matrixatnodei {Fi(c))forthesteady-state
saturated
flowequation wasgivenin
Section 3.3 as

(4.86)

where
q(e)
isthespecified
groundwater
flow
rate
within
element
e (positive
if groundwater
isflowing
intotheelemen0.
Thisequati.on
canalsobeused
tocompute
[Fi(e)}for
unsaturated
andtransient
groundwater
flow.Thecorresponding
equation
for[Fi(e)}inthe
solutetransport
equationis

where
q•e)
isthespecified
solute
fluxwithin
element
e.
Thereare two commonsituations
encountered
in practice,The first is the point source
orpointsink representing,
for example,a well asseenin a plan(map)view of an aquifer.
If thepointsource
or sinkis locatedat a node,equations
4.86and4.87 become

{1•?
)} = q ,.
(4.88)
and

{1•?
)} = q• (4.89)
for thenodewherethepointsourceor pointsinkis locatedandzeroat all othernodesin the
element.
Forexample
if apointsinkof-10m3/d
islocated
atnode
j intheelement
inFigure
4.18wehave
{•e)}= -10and{•i?
)} = {F?}= 0. The
specified
flux
matrix
forthe

element
is
{F(e)}
=fi0t
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

156 Step3: Develop


System
of Equations

SpecifiedFlow Rate

Figure 4.18 Point sink located at a node.

We mustbe carefulnot to countthe contributionfrom a point sourceor sinkmorethan


once.Forexample
if apointsource
of20m3/dislocated
atnode3 in themesh
inFigure
4.19it makesnodifference
whether
weconsider
thepointsource
tobelocated
atnodej in
element1, nodek in element2, nodej in element3, or nodei in element`4. But we can
onlycount
thecontribution
of 20m3/dtonode`4once.

node

Specifie•FlowRate clement • j k
= 20 m•'/d (inflow) 1

3 :2 `44. 1
,' `4 ,4:2 3

Figure 4.19 Point source located at a node.

If we assignthepointsourceto nodek in element2 the specifiedflow matricesfor the


elements are

{t=ø)}= 4 {t=•2)}
= 0 • {po)}= 4 {t=•'*)}
= 2
5 20 4 I 3

andtheglobal{F} matrixbecomes

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 157

'0(1)+ 0(3) o

o
o0) + 0(3)
o
0(2)+ 0(3)
global
0(1)+ 20(2)+ 0(3)+ 0© 2{

o
0(l)+ 0(2)

wherethesuperscripts
indicate
eachelement's
conlribution
to {F}. Anotherapproachis to
dividethepointsourceatnode4 amongthefourelementsjoiningthatnode.In thiscase
the clement matrices are

{F(1)]= 2 4 {F(2)]= 5 }= 2 4 {F(4)}= 0 2


5 2 4 1 0 3

andtheglobal{F} matrixbecomes

'0(1)+ 0(3)

{F} = 0(3)
+0(4)
0(2)+ 0©
global

20/4
.0(1)+(1)
+20/4
0(2) (2)
+20/40)
+20/4
(4
If thesource
or sinkis notlocatedat a node,thespecified
flow or flux is dividedamongthe
nodesof theelementthatcontainsthepointsourceor sink. Theruleis

ß = q(e) ß (4.90)

l•:)J N•)(xo,yo,zo)J

forspecified
ratesof groundwater
flow,and

(4.91)

F(•)J N?(xo,Yo,zo)J
for specified
ratesof soluteflux wheren is thenumber of nodesin elemente andthe
coordinatesof thepointsource or sinkare(x0,Y0,Z0).
Theapplication of equations
4.90
and4.91 is illustrated
by thefollowingexamples.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

158 Step3: Develop


System
ofEquations

Example

Calculate
{F(c)]fortheclement
shown
below
(q= -25m3/d).
(4, 6)
11(pointsink)

• (8,3)
(2, 2)

122
2A(O-_ 183 = 22
146

• = (8)(6)- (4)(3) = 36
bi = 3-6 = -3
ci = 4-8 ---4

ai = (4)(2)-(2)(6) = -4
h=6-2=g
• = 2-4 = -2
(2)(3) - (8)(2) = -10
2-3 =-1
Ck=8-2=6
and
1
N?)(6,4)
--• (36-3(6)-4(4))
--2/22
1
•e)(6,4)
= • (-4+4(6)
- 2(4))--•2/22
N(•*)(6,4)
= • (-10-1(6)
+6(4))
= 8/22

(Notethattheinterpolation
functions
sumtooneatthepointwhichisa usefulcheckonthe
calculations)

{F
(c)]
=-2512/22•
8/22J 2/22
] -2.273
= 13.636•
9.091j ]
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 159

Example
Calculate
(F(e))forthetwoelements
shown
below
(• = 10kg/d)

(0,2) (4,.=2) (8, 2)

i
(1)• (4,
1)(2) i

(0, O) (4, O) (8, O)

injectionwell (pointsource)

The point sourcecan be assigned


to eitherelement(or it canbe dividedbetweenthetwo
elements)
Wewillarbitrarily
assign
ittoelement
2. Forelement
2,N?(4,1)
= 1•12)(4,1)
=
1/2and
Nfj2)(4,1)
--N?(4,1)--0
and wehave

{F0)} -_ {F(•)} = 10 =
1/2J

In the caseof a distn'butedsourceor sink the rate of groundwateror soluteflow is


specifiedfor a portionof the length,surfacearea,or volumeof an element. In a one-
dimensional problemwe may wish to specifya flowratealongthelengthof theelement
(Figure
4.20a).
Inthis
case
{•e)}isgiven
by

(4.92)

for groundwater
flow problems
or

{•e)}
=fL•')q½
dx ?) (4.93)
forsolute
nansport
problems,
where
L(e)isthelength
oftheelement.
Thespecified
rates
q
andqccanbe•nctionsof x.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

160 Step3: DevelopSystemof Equations

Example

Compute
{F(e)}fortheclement
shown

q •

j (x•½)
= 10)

Theinterpolation
functions
for thelinearbarclementarcin Figure4.9. Fornodei

xj(
½)
L(c)
= q L(e)
- 2L(½
) (½) xi

and

12.5J

Forthelinearbarclement,thedistributed
source or sinkis dividedequallybetweenthetwo
nodesof theelement(aslongasq orqcareconstant alongthelengthof theelement).For
quadraticor cubicbarelements,thedivisionis different(Figure4.21). The formulascan
beconf'mned byintegrating
theinterpolation
functions alongthelengthof theelement.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 161

quadratic
barelement
1

4•q

cubic bar element

! 1

{t;(.)} q
4

Figure 4.21 Division of distributed source or sink to nodes in two-types of one-


dimensional elements.

In two-or three-dimensional
elements
we maywishto specifytherateof groundwater
flow
or soluteflux alongoneor moreelementboundaries
or surfaces.

Inthis
case
(l•i•)}isgiven
by

{•?)}
=•s•.
)N!e)q
ds (4.94)
for groundwater
flow problems
or

(4.95)

where
S(e)istheportion
oftheboundary
orsurface
ofelement
e forwhich
q isspecified.
Similarformulascanbedevelopedfor sourcesor sinksthataredistributed
throughout
an
elementvolumebutthesearerarelyusedin groundwaterflow or solutewansport
modeling.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

162 Step3: DevelopSystem


of Equations

(b)

(c) (d)

Figure 4.20 Typical applications of distributed source/sinks for one-, two-, and
three-dimensional elements.

Example
Compute
(F(e))fortheelements
shown
below

q= 10m3/d/m

(o,1) (•,•) (3,1)


•-- S(1) •, • S(a)
k j 1
nodal coordinates
(3) arein meters
i

(0,0) (1,0) (3,0)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 163

For clement 1,

F?) = 0

= 'f
F?) ds= ••2•(e
N?)(x,y)
qO) 1)(aj+bjx q(1)
+cjy)ds
butAO)=0.5,
aj=0,bj=1,cj=0,and
qO)
= 10
1

and
Ffl)=
•o0.•(x)(10)
ds= 5m3/d= Fit•)
0

For element 2,

(why ?)

For element 3,

F?)=.•3)= 0

F(•3)
=••Ni•3)(s,t)
q(3)
ds
- 4ai=)b(=
) 10ds
but2a(e)= 1, 2b(e)= 2, andt = 1 along
theboundary
andwehave

and
F(•3)
=•z[«]10
ds = 10m3/d-_
1•1')

{F(3)}
=li 1

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

164 Step3: DevelopSystemof Equations

In the previousexample the elementinterpolationfunctionswere linear and the


distributedsourcewas dividedequallybetweenthe two nodesof the elementon the
boundary
S(e).Forquadratic
orcubic
quadrilatex•
elements
thedivision
would
bedifferent
(Figure4.22)

qS(e)

cubicquadrilateral 1

2,
3
10 9 4

• 11 6 qS(e) 6

• 12
= 7

9
1 2 3 4
10

11

12

Figure 4.22 Division of distributed source or sink to nodes in two-types of two-


dimensional, elements.

Example
Compute
{F(•)}fortheelements
shown
below

qc= 2kg/yr/m

t • 3 5 -8 10 13-
•• 2. (1)
1 4 7
6 (2)
9 12
11

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 165

For element I

F?) = (5)(2)
6 = 1.7
kg/yr
F(•
) (5)(2)(4)
= 6.7kg/yr
F?= (•)(2)
6 + (•0)(2)
6 = 5.0
kgtyr
F?) --- (•o)(2)(4)
6 •3.3
kg/yr
F(s•
) -- (10)(2)
6 + (10)(2)
6 = 6.7
kg/yr
F(2) (10)(2)(4)
lo = 6 ' TM
13.3
kg/yr
F[•= (10)(2)
6 = 3.3kg/yr
and

2
3
4

5
6

{F} = 7

lO
11

12

13

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

166 Step3: DevelopSystemof Equations

NOTES AND ADDITIONAL READING

1. Forproblems withaxisymmetry, theclementconductance matrixis givenby equation


3.169. Thisequation isvalidfor thelineartriangleandrectangleelements(Figure4.6
and 4.7) and for the quadrilateralelements(Figures4.10 to 4.12). However,the
interpolation
functions andtheirderivativesmustbewrittenusinganaxisymmetric (r,z)
coordinatesystem.Forexample,consider theaxisymmetric,lineartriangleelement
Theinterpolationfunctionsarein Figure4.23(Segerlind, 1984).

N?)(r'z)
--2-•(ai+bir
+ciz)
N•)(r,z)
= 2A(½
1)(aj+ bjr+ cjz)

Figure 4.23 Interpolation functions for the axisymmetric, linear triangle element.

The derivatives
of theinterpolation
functionsare

• 2A(•) • 2A½• 8r 2A½•)

aN? • ci a• e) cj aN•) ck
•- 2A(e) •z 2A(•) •z 2A(e)
where A(e)= Areaofelement

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 167

Theclementmatrices
areeasilycomputed
because
of therelation

f[ 2•r
drdz=2m
'•e)
A
where
r•e)isther coordinate
of thecentroid
ofA

The results are

2 cicjcick
ci

3x3 4A(e) cjcic• C•Ck (4.96)

b.bibkbjb•J

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

168 Step3: DevelopSystem


of Equations

Problems

1. Verify
that
theapproximate
solution
for• iscontinuous
along
theboundary
joining
the
pairsof elementsshownbelow
•) c)
1 4 6
(1) (2) (0,4) (6,4) (9,4)

1
• j 2i J3 kl '

Jli
2 3 5
(0,0) (6,0) (9,0)
b)
(8,4) (12,4)
3

(o,o) (8,o)

2. Verify thattheinterpolation functionsfor theelementsshownbelowsumto oneat an


arbitrarypoint(x) or (x, y)

a) c)
(2,6) (9,6)
i x J
x=3 x=7

(x•,y)

(2,2) (9,2)
b)
(9,7)

(3,4

(10,2)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 169

3. Calculate
[K(•)],[C(•)],[D(•)],and[A(•)](consistent
formulation)
fortheelements
in
problem
2 if Kx --Ky-- 2,Dxx--Dyy-- 1,Dxy-- Dyx--2, Dyy-- 1,vx -- 10,vy-- 1,8s
-- 1, 0 -- n -- 0.4, Pb-- I. 1, Kd -- 5, and•, -- 0.

4. Deriveequation4.18aby substituting the interpolation


functionsandinterpolation
functionderivatives
for thelinearbarelementintoequation4.12 (remember that,for
one-dimensional elementsthe integrations are performedOverthe lengthof the
element).

5 Deriveequation4.20 or 4.21 by substituting


theinterpolation
functionderivativesfor
thelineartriangleelementintoequation
4.6 or 4.7 (rememberthat,for two-dimensional
elements,
theintegrations
for[K(")]and[K(e)(¾)]
are
performed
over
thearea
ofthe
element).

6. Derivethefollowing
equations
forthelineartriangle
element
a) Equation4.22a c) Equation4.25a
b) Equation4.24b

0Ni 0Ni
7. PlotNi, .•., and•-, i =1to12forthe
cubic
quadrilateral
element
inFigure
4.12
alongthelinee = 0 fromxl= -1 toxl= 1 andalongthelinexi-- 0 from• -- -1 toe = 1.

8. Giventheinterpolation
functions
forthelinearrectangle
element
(Figtu'e
4.8)verifythe
entries in the first row and secondcolumn of the element matrices in

a) Equation4.26 c) EquatiOn4.29
b) EquatiOn4.27 b) Equation4.30

9. Repeatproblem5 for thethirdrowandsecond


columnof theelementmatrices.

10. Verify thattheinterpolation


functions
for thefollowingelementtypessumto oneat an
arbitrary
point(e0),(e0,x10),
or(e0,x10,
COO).
a) Linearbar (Figure4.9a).
b) Quadraticbar (Figure4.9b).
c) Linearquadrilateral(Figure4.10).
d) Linearparallelepiped (Figure4.13).

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

170 Step3: DevelopSystem


of Equations

11.Compute
[J],[j--l],andI$[ atthecenter
(e--•1=O)oftheelements
shown
below

a) b)

3(5,8) 5 node
xy
1 2.0 2.0
2 4.0 3.0
4 7 4 3 6.03.3

(1 72.0
5.0
4 6.0 5.3
5 6.0 ?.0
8 3 6 4.06.5
Yf'(1,3)2(•,3) 1 2
• YL 82.03.
8 ?
node x y z
1 000
2 700
3 730
4 030
5 003

Z•y 3
6 703
7 733
8 033
x 1 2

12.Perform
thefollowing
integrations
analytically
andnumerically
using
Gauss
quadrature

a) 1
• + 3e2+9ede d) 1
I•4+
1
+'ri2de.
dq

b) I
81•
4+e2de e) a-la-la-1 •"q•cl•d'rl
d•

c) 1 I F.
2+2•"q
+ de
dq f) .,-i-'-l-'-I
E37]
+•rr}•2
+ 3•2cl•d'qd•

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 171

13.
Compute
the
conuibution
ofthe
first
Gauss
point
(•3,•3)tothe
element
condunce
matrix
[K(e)]
forthe
linear
quadrilateral
elements
shown
below
if Kx
= 1andKy=
2for
all elements

a) b)
(0,1) (1,1) (0,2) (2,2)
4 3 4 3

(o,o) (1,o)

(o,o) (2,o)

½) d)
3 (6,4) 4 (2,6) 3 (9,6)

1 2 1 2
(0,0) (6,0) (2,2) (5,2)

14. Repeatproblem13 exceptcomputethe contribution


of the first Gausspointto the
element
capacitance
matrix
[•e)](consistent
formulation).
LetSs=5forallelements.

15. Repeatproblem13for theelementin problem1lb.

16, Repeatproblem14for theelementin problem1lb.

17. Repeatproblem13for theelementin problem1lc.

18. Repeatproblem14 for theelementin problem11c.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

172 Step3: DevelopSystem


of Equations

19. Given the followingelementconductance


matricesassemble[K] for themeshshown
below global

[Kit)]
=• -12-
!] [Kø)]=•-1 2-
o-1 !]
4 -I -2 -1

[K(2)]
--• -1 4
-2 -1

node
element numbers
i j k
1 1 2 4
4
'6 2 235
3 465
(2)

ß i ' ß

20. Repeatpwblcm19if thenodesarenumbered


asshownbelow

(2)

2 4

21. Write thesystemof equations


[K] {h} = {F}
global global

for problem19with
175]
175•
{F} =
global

Giventhath6 = 0, modifythesystem
of equations
andsolveforh1,h2, h3,h4, andh5.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
4 173

22. Repeatproblem21 if hi = h2= h3= 0.

23. Solvethefollowingone-dimensional, steady-state


groundwater
flow problemif hI =
10m andh5 = 0 m. Ploth(x),0 g x g 19m
(x•,0) (1) .. (2) , (3) _ (4) (x• 19)
1 2 3 4 5
L0) = 4 L(2)= 6 L0)= 5 L(4)= 4 m
K?=2 K?)=1 K13)=2 K?)=4 m/d
24.Repeat
problem
23ifK•I)=K(x
2)=K?)= K?)=2m/d.
25. Giventhefollowingelementconductance
matrices
assemble
[K] for the meshshow
g•ob•
below. Modi• thesystem of equations
andsolvefor h at eachnodeif h1 = h2 = 10
andh3 = h6.=hi = 0, {F} = {0}.
4 -1 -2 -1

[K(1)]
= -1 2 - [K½2)]
= • -1 4
o-1 -• -2-1
' 1.415 -1.74 0.72 -0.36 0.64 --0.92 0.53 --0.31'
-1.74 3.82 -1.74 0 --0.92 1.51 --0.92 0
0.74 -1.74 1.44 -0.31 0.53 --0.92 0.64 --0.36
--0.36 0 -0.31 1.96 --0.31 0 --0.36 --0.62
[K0)] = 0.64 --0.92 0.53 --0.31 1.44 -1.74 0.72 --0.36
-0.92 1.51 -0.92 0 -1.74 3.82 -1.74 0
0.53 --0.92 0.64 --0.36 0.72 -1.74 1.44 --0.31
--0.31 0 --0.36 -0.62 '-0.36 0 -0.31 1.96.

(1,2) (3/2,2)
3 6 8(2,2)
node
element numbers

i j kl
1 143-

(0,1) I (1,1) 9(2,1) 2 254 1


(3) node
element numbers

2 (2)5 2
(0,0) (1,0) (3/2,0)
-.10
(2,0)
3
1234567
571098634
8

K•)=K•e)=
1for
allelements

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

1'/4 Step3: DevelopSystem


of Equations

26. Giventhefollowingelementconductance
matrices
assemble
FIe]for the meshshow
global
below.Modifythesystem
ofequations
andsolve
forh ateachnodeff h5 = 0 and[F}T
= [ 10,10,10,10,0,0,0,0,-10,-10,-10,-10}.

' 0.64 0.17 0.00 0.15 0.22 --0.17 -=0.22 --0.36'


0.17 0.64 0.15 0.00 -0.17 -0.22 -0.36 -0.21
0.00 0.15 0.51 0.11 .0.10 .0.13 -0.32 -0.22
0.15 0.00 0.11 0.51 -0.13-0.10-0.22-0.32
[K(1)]
= -0.22
-0.17
-0.10
-0.130.510.15
-0.050.01
-0.17 -0.22 -0.13 -0.10 0.15 0.51 0.01 -0.05
-0.21 -0.36-0.32-0.22 -0.05 0.01 0.84 0.32
--0.36 -0.21 -0.22 -0.32 0.01 -0.05 0.32 0.84.

' 0.84 0.32 -0.05 0.05 --0.32 --0.22 -0.21 -0.36'


0.32 0.84 0.05 -0.05 .0.22 .0.32 -0.36 -0.21
-0.05 0.05 0.51 0.15 -0.10 -0.13 -0.22 -0.17
0.05 -0.05 0.15 0.51 -0.13 -0.10 -0.17 -0.22
[K½:0]
= -0.32 -0.22 -0.10 -0.13 0.51 0.11 0.00 0.15
-0.22 -0.32 -0.13 -0.10 0.11 0.51 0.15 0.00
-0.21 -0.36 -0.22 --0.17 0.00 0.15 0.64 0.17
--0.36 .0.21 .0.17 -0.22 0.15 0.00 0.17 0.64

node
element numbers
i=l 2 3 4 5 6 7 8

I 2378 1 465 9 (0,3,1)


2 8 7 1112 5 6 10 9 element 2

(0,3,0) ,
1
(0,0, ,,'
IIlIIIliii
I
(2,1,1):::". (2,3,0)
z (0,0,0) (2,0,1) '7
(2,2,0)

3
(2,0,0) element 1

for all elements

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter4 17.5

27. Assume thatthesolution


toproblem 23 representsinitialconditions.At timet -- 0 hI is
increased to 15m andheldconstant thereafter.Solvefor h2 -.-h5 at timest = 1, 2,
..(1)
and3 d. Usea timestepof ld. •s ----1,-•(2)
,-s = 1,S? ) ----6,and
R(4)= 3 m-l.

28.Compute
IF(e)}fortheelements
shown
below
(nodal
coordinates
inmeters)
a) b)
(8,6) (0,1) (1,1)
PumpingWell (Outflow) i
--•0m3/•
)

(3,2) ) (1,0)
(o,o)
PumpingWell (Inflow)
=25m3/d

c) d)

(4,7) (13,7) (8,6)


••q10m3/d.m
(Inflow)
(•,5) $

PumpingWell (Inflow)
(3,2) (1:)
--•m3/d

e)
PumpingWell(Ouuqow)

(4,7) (13,7) =8m3/d


_(0,1) tl 1•
•/df (1,.,

q--4m3/d.m )
i

(•,,2) (13'•2)
(0,0) (1,o)

•o
15 kg/d.m(Inflow)
tttttt
q--4m3/d.m

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 5

STEP 4: SOLVE SYSTEM OF EQUATIONS

As we saw in Chapter3 the applicationof Galerkin'smethodto the equationsof


groundwater
flow andsolutetransport
resultsin systemsof equations
thatcanbe writtenin
mat• form:

1. Steady-State,
Saturated
FlowEquation
[KI {h} = (5.1)

2. Steady-State,
Unsaturated
FlowEquation
[K(¾)1{¾} = {F} (5.2)

3. Transient,
Saturated
FlowEquation

([C] + mat[K] ){h}t+at= ([C] - (1-0)) At [K] ){h}t


+ at ( (1-•o){Fh + o•{Fh+,,,) (5.3)

4. Transient,Unsaturated
FlowEquation

( [C(v)] + eat [K(V)]


+ At ( (1-m){F}t + m{F}t+a
t) (5.4)

5. SoluteTransportEquation

([A] + OAt [D] ){C}t+at = ([A] - (1-re)At[D] ){C}t


+ At ( (1-m){F}t + m{F}t+at) (5.5)

This chapterdescribesmethodsthatcanbeusedto solvethesesystems of equationsto


obtainvaluesof hydraulichead,pressure
head,or soluteconcentration at eachnodein the
mesh(andfor eachtime-stepin the caseof transientflow or solutetransportproblems).
Equations
5.1, 5.3, and5.5 aresystems
of linear equations
of theform
[M]{X} = {B} (5.6)

where
[M]ismatrix
ofknown
coefficients
mij,{X} isa vector
oftheunknowns
xi, and
{B} is a vectorof knownvaluesbi. Equation 5.6 is a system
of linearequations
because
noneof thecoefficientsin [M] area functionof theunknowns {X}. Equations
5.2 and5.4

176

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
5 177

aresystems
of nonlinearequations
of theform
[M(X)][X) = lB) (5.7)
where
[M(X)]isamatrix
ofknown
coefficients
withenuies
mij(x),IX} isa vector
ofthe
unknowns
xi,a•d[B] isavector
ofknown
values
hi. Equation
5.7isnonlinear
because
someor all of thecoefficients
in [M(X)] arefunctions
of theunknowns
IX}. We will first
describe
a methodthatcanbeusedto solveequation
5.6.

$.1 PROCEDURE. FOR SOLVING SYSTEM OF LINEAR EQUATIONS

Equation
5.6canbewritten
in anexpanded
formasfollows

m.?l
m?
2 3I•--bill (5.8
Thereare severaldifferentnumericalmethodsthatcanbe usedto solveequation5.8. In
selecting
a method
for usein solving
theequation•
of groundwater
flow andsolute
transport
thefollowing
criteria
should
beconsidered:
1. [M] is diagonally
dominant(i.e.,for anyrowtheentryon themaindiagonal is
largerthantheotherentries
in therow),banded,andsparse (i.e.,contains
many
zero entries).
2. [M] mayormaynotbesymmetrical
(seeAppendix IV).
3. Foreachmatrix[M] wemaywishto solveequation5.8 for severaldifferentright-
handsidevectors[B ].
One choiceof methodthatmeetsthesecriteriaandwhichhasbeenwidely usedfor this
purpose
istheCholeski
method
(Cook,1981).Wewillfirstdescribe
theCholeski
method
for thecasewhen[M] is storedin full matrixstorage
modebecause
thenotation
is simpler.
We will then describea modificationof the Choleski method for the case when [M] is
storedin vectorstorage
mode.Vectorstorage
reduces
thesizesof thearraysthatmustbe
storedandmanipulated whentheCholesld
methodisimplemented in a computer
program
(seeChapter13).

5.1.1 Choleski Method for NonsymmetricMatrix in Full Matrix Storage


The Choleskimethodis a directmethodfor solvinga systemof linear algebraic
equations
whichmakes useof thefactthatanysquare
realfix[M] canbeexpressed
asthe
product
of a lowertriangular
matrix[L] andanuppertriangularmatrix[U]
[M] = [L][U] (5.9a)
or

(5.9b)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

178 Step4: SolveSystem


of Equations

Wesaythatman'ix[M] isdecomposed orfactoredintotheproductof twotriangular


matrices
andthisstepof theCholeski
method issometimesreferred
toasthetriangular
decomposition
of [M]. Theentries
of [L] and[U'Jaregivenby
j-.l

lij= miJ
- Z li•ukJ
' i_>
k--I
j (5.10a)

lij ---O, i<j (5.lOb)


i-!

mij-Z likUkj
k=l

Uij-- lii , i <j


uij = 1, i=j (5.10d)

Uij----O, i>j (5.10e)

Example
Perform
triangular
decomposition
onthefollowing
matrix

rollm12
m•3
m14] 2 1 -1 1'
[M]= m21
m22
m23:m241
= -1 4 1 -1
m4!m42m43m44
j ! -1-2 4
1

111 = mll = 2
1•2 = l•s = 1•4 = 0
Ull---- 1
u•2 = m•2/l• = 1/2 = 0.$
U!3 = m13/lll =-1,/2 = -0.5
u•4 = m14/l•l = 1/2 = 0.5

12• = rn2• =-1


122= m22-121u•2= 4-(-1)(0.5) = 4.5
123 -- 124 -- 0
U21----O, U22= 1
u23= (m23-121ut3)/122
= ( 1-(-1)(-0.5))/4.5 = 0.11
U24= (m24-121u14)f122
= (-1-(-1)(0.5))/4.5 = -0.11

lz• = rn• = -2
1•2 = m•2-l:•lul2 =-1-(-2)(0.5) = 0.0
1:•3= ma3- 13lUna
- 1•2u2•= 4- (-2)(-0.5) - (0)(0.11) = 3.0

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
5 179

134--0
us! = u32 --O, uss-- !
u34= (m34-131ul•-132u24)/133
-- (1-(-2)(0.5)-(0)(-0.11)/3.0 = 0.67
141 = m• ---1
h2 = m•2-1•lu12 -- -2-(-1)(0.5) ---1.5
1•3 -- m•3- h•u13- l•2uz•= 1 - (-1)(-0.5) - (-1.5)(0.11)-- 0.6?
1•4 = man- 14•u•4-142u24-145u34
= 2 - (-1)(0.5) - (-1.5)(-0.11) - (0.67)(0.67) = 1.89
U41----U42----
U43----O, Ua4----

1.0 0.5-0.50.5
2.0 0.0 0.0 0.0
-1.0 4.5 0.0 0.0 0.0 1.0 0.11 -0.11
[L]=-2.0 0.0 •.0 0.0 JUl= 0.0 0.0 1.0 0.6?
-1.0 -1.5 0.67.1.89 0.0 0.0 0.0 1.0

andit is easyto verifythat[M]-- [L][U].


Once[M] hasbeendecomposed intoloweranduppertriangular
matrices
thesolution
of
thesystem
of equations
for anychoiceof [B ] is verysimple.Because
[M] = [L][U] we
can write

[M]{X} = {B} = [L][U]{X} = {B} (5.11)

If we definea vector[Z} as

[U]{X} = {Z} (5.12)


we can write

ILlf Z} = rS} (5.13a)

111z
1 --- b1
121Zl+ 122Z2 = b2 (5.13b)

1.•zi + ln2z2+ "' + l,mz,, =

whichcanbe solvedfor thevaluesin [Z] using

i = 1 to n (5.14)
zi = lii '
Afterwe havecomputed thevaluesin {Z} we canthensolvefor thevaluesin [X } using
equation
5.12(thisstepis sometimescalled"backwardsubstitution")

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

180 Step4: SolveSystemof Equations

XI+uI2x2+u13x3+ --. +UlnX.n = Z1


X2+u23x3+ --- +U2nX.n = Z2
X3+ -.. +U3nXn = Z3
. .

x•=z.

The solutionis givenby


i-I

Xn+l_
i = Zn+l_
i--ZUn+l_i,n+l_k
Xn+l-k,i = 1 to n
k=l
(5.16)

Example

Solvethefollowingsystemof equations

2 1 -1 1 xl 1

!!41--211
x2
=i
-1
-2
4
1
x3
x4

Triangulardecompositionof [M] was performedin the previousexampleand using


equation5.13 we have

-1.0 4.5 0 0

-2.0.0.0
-1.0 3.00 z3]
-1.5 0.67 1.89 z4

z I = bl/ltt = 1/2 = 0.50


z2 = (b2 - 121Zl)/ 122= (0-(-1.0)(0.5)) / 4.5 = 0.11
z3 = (b3 - 131z
1- 132z2)
/ 133= (0 - (-2.0)(0.5) - (0)(0.11) / 3 = 0.33
z4 = (b4- 141Zl- 142z2
- 143z3)
/ 144
= (0-(-1.0)(0.5) - (-1.5)(0.11) - (0.67)(0.33)) / 1.89 = 0.24

In thenextstepwe have

xt 0.50]
1.0
0.5
0
-0.5
0.5
1.0 0.11
X2 --_0.11•
0 0 1.0 0.67 x3 0.33[
-0.11

0 0 0 1.0 x,• 0.24J

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter5 181

and

X4 --==Z4 = 0.24
X3 ----Z3 --U34X
4 = 0.33- (0.67)(0.24) = 0.17
X2 ---- Z2 --U24X 4 -- U23X3
-- 0.11-(--0.11)(0.24)-•0.11)(0.17) -- 0.12
X 1 ---- Z I--uI4x 4--uI3x $--uI2x2
= 0.50 - (0.5)(0.24) - (-0.5)(0.17) - (0.50)(0.12) -- 0.41

0.41]
0.12[
{x}= 0.24J

5.1.2 Choleski Method for SymmetricMatrix in Full Matrix Storage


If [M] is a symmetric
matrix,[MJ canbe decomposed
into theproductof an upper
triangularmau• andits•mspose

[M] = [U]?[U] (5.17)


wheretheentriesof [U] aregivenby

ui=
i-•]1/2
k=l
, i =j (5.18a)

i-1

mij-E uta
u•j
k=l
Uij= ' , i<j (5.18b)
uii

uij = O, i>j (5.18c)

Example

Performtriangular
decomposition
onthefollowingman•

mllm12
m13
m1412 --12 1
[M]
=m21
m22
m31 m23
m32 m24[
m33 / =-1
m34 6-1
2 -1 6 -2

m41 m42 m43 m441 1 1 -1

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

182 Step4: SolveSystemof Equations

ull = (roll)
1/2= (2)1/2= 1.414
u12= m12/Ull =-1/1.41.4 = -0.707
Ula = mla/Ul• = 2/1.414 = 1.414
ul4 = ml4/ull = 1/1.414 = 0.707

U21= 0
u• = (m22-u•2)
•/2 = (6- (-0.707)2)
1/2= 2.345
us = (ms - u12ula)/u• = (-1- (-0.707)(1.414))/2.345= 0.000
u24 = (m24-u12u14
) /u22 = ( 1- (-0.707)(0.707))/'2.345= 0.640

U31•- U32= 0
Uaa
= (maa
- U•a
- ula}
•/• = (6- (1.414)
2- (0)2)
1/2= 2.000
Ua4= (man- u•au•n- UsUen)/ uaa
= (-1 (1.4145)(0.707)- (0.000)(0.640))/2.000 = -1.000

U41= U42= U4a-- 0


U44= (m4•-U•- U224-U324)1/2
= (2-(0.707)
2--(0.640)2-(-1.000)2)
•/2= 0.301

1.414
-0.7071.4140.707]
[U] = 0 2.3450.000 0.640[
0 0 2.000-1.000!
o o o o.3ol]

1.414 0 0 0
--0.707 2.345 0 0
[U]?
= 1.414
0.000
2.0000
0.707 0.640 -1.000 0.301

andit iseasytoverifythat[lVl]= ILlIT[U].


Oncethe symmetric
matrix[M] hasbeendecomposed thesolutionof the systemof
equations
foranychoice
of {B} is verysimple.Because
[M] = [U]T[U]wecanwrite

[M]{X}= {B} = [u]T[uI{X}= {B} (5.19)


Thenby defininga vector{Z} as

[U]{X} = {Z} (5.20)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
:5 183

we can write

[u]T{z}-- (5.21)

If the entriesin [U] arc

[U] --
Ull
UI2
U22"......
Uln
1
U2n
[ (5.22)

0 0 UnnJ

theentries
in [U]T are

(5.23)

andequation5.21 canbewritten

UllZ1 = b1
Ui2Z1+ U22Z2 ----b2 (5.24)
ß ß ß ß

UlnZI+u2nz 3+ .-. +UnnZn = b3

whichcanbe solvedfor thevaluesin {Z } using

zi =
( bi -
k=l

uii
)
ukiZk
, i = 1 to n (5.25)

Afterwe havecomputed
thevaluesin {Z} we canthensolvefor thevaluesin {X} using
equation5.20

UllX l+u12x 2+u13x 3+ --- +UlnXn --- Z1


u22x2 + u23x3+ --. + u2nxn = z2
U33X3+ --- +U3nXn ----Z3 (5.26)
ß .

UnnXn =Zn

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

184 Stop4: SolveSystemof •xluations

The solutionis givenby

Za+l=i
-- =Un+l-i,n+l-k
F'n+l-k (5,2?)
Xn+l_ i ----
Un+1-i.n+1-i

Example
Solvethefollowingsystemof equations

2 -1 2 1 xl 1

-16-1
1 -ix2
2 -1
--
1 --1
6 x•
X4

Triangulardecompositionof [M] was performedin the previousexample and using


equation5.24 we have

1.414 0 0 0

--0.707
2.345
1.414 0 • 0.000 2.000
0.707 0.640 -1.000 0.301

Z1 = bl/u• = 1/1.414 = 0.707


za = (!h - u•2z•)/ uz• = (0 - (--0.707)(0.707))/2.3456
= 0.213
z3 = (b3 - u13zl- u23z2) / u33
= (0- (1.414)(0.707) - (0.000)(0.213))/2.000 = -0.5000
z,• = (b,•- u14Zl- U2nZ
2 - u34z3)u44
= (0- (0.707)(0.707)- (0.640)(0.213)- (-1.000)(-0.500))/0.301 = -3.775

In thenextstepwe have

1.414
-0.707
1.4140.707][x, 0.707]
0.213
L
0 2,345
0
0
0.000
0.640/t
x2=-0,500
0
0
/ 2.000 -1.000
0 0.301J!.x4
x3
-3,775J

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter5 185

and

Z4/U44 =-3.775/0.301 =-12.54


(z3 -u34x4)[u33 = (-0.500- (-1.000)(-12.54))/2.000 = -6.52
(zz - u•x4 - u23x•)/ u2z
(0,213 - (0.640)(-12.54) - (0.000)(-6.52))/2.345 = 3.51
(Z1-- Hi4X4 -- Hi3X3-- Hi2X2)! Ull
(0.707 - (0.707)(-12.54) - (1.414)(-6.52) - (-0.707)(3.51))/1.414
15.05

15.051
3.sx /
_6.521
-12.54J

$.1.3 CholeskiMethod for NonsymmetricMatrix in Vector Storage

We haveseenthatthe applicationof the finite elementmethodto the equations of


groundwater flow and solutetransportresultsin systemsof equationsthat axebanded.
Laxgesavings in computerstoragecanbeachieved byassemblingandsolvingthesystem
of equationsin vectorstorage. In vectorstorageonly the entrieswithin the bandare
stored;theentriesoutsidethe band(whicharcall zero)arcdiscarded.Considerthebanded
matrixin Figure5.1. Thereare6 equations andthe semi-bandwidth is 2. In full matrix
storage,36 entriesarestoredincluding20 entries"outside"
thebandthatareknownto be
zew. If thematrixin Figure5.1 is nonsymmetric (e.g.,whensolvingthesoluteuransport
equationusingequation5.5 and5.6) theentrieswithinthe bandcanbe storedin a vector
with lengthIJSIZE where

LISI• = (NDOF)
2- (NDOF
- SBW)(1
+ NDOF- SBW) (5.28)

whereNDOF(forNumberof D_=egrees
of Freedom)
is thenumber
of equations
andSBWis
thesemi-bandwidth.
For theexamplein Figure5.1, NDOF = 6, SBW = 2 and

IJ$IZE= (6)2- (6-2)(1+ 6- 2)


= 36-20 = 16

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

186 Step4: Solve


System
of Equations

(a) Full Matrix Storage

'mll ml2'.,0 0 0 0 ' NDOF = 6


SBW = 2
.•m_21
rn22m•«'.,,.0.
0 0
'0',,,•maa
m•.,.o o ...
o 0',•.• m. m•,.,.o
o o 0"..•.• r• m'•

ooo•"• ••an
36entries
20 entries "outside" of band
d

(b) VectorStorage (c) VectorStorage


Non-Symmetric Matrix SymmetricMau'ix

ml
ml
m2
m2

{M} = {M} = m3

m4
m•
m•
m6

Figure 5.1 Full matrix and vector storage schemes for non-symmetric and symmetric
matrices.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
5 187

Example
Compute
thelength
ofarrayrequir•tostore
thebanded,
nonsymmeu'ic
matrixshown
below in vectorstorage

123OO

[M]= 340

0432
032

For thismatrixNDOF = 5, SBW = 3 andfromequation5.28

IJSIZE= (5)2-(5-3)(1+ 5- 3)
= 25-6=19

A typical
entry
mijin[M](fullmatrix
storage)
canbeassigned
toanentry
muin {M}
(vectorstorage)usingthealgorithm in Figure5.2. Notethatthesubscript
LI refersto a
singleindex,theposition
of anentryin thevector{M}.

IJ = j
IF i>l THEN
IF SBW<NDOF THEN
IF i>SBW THEN
IJ - IJ + SBW - i
ENDIF
IJ -- IJ + (i-1) (2SBW-1)
L = MIN (SBW, i) -1
IJ = IJ- (L/2)[ (SBW-1) + (SBW-L)]
L = i - NDOF + SSW- 2
IF L>0 THEN
IJ = IJ - L(L+i)/2
ENDIF
ELSE
IJ - IJ + (i-1)NDOF
ENDIF
ENDIF

Figure 5.2 Vectormatrixstoragefor banded,nonsymmetric


matrix. MIN(SBW,i)
means take the minimum value of SBW and i.

The Choleskimethodcanbeusedwithnonsymmetric
matrices
in vectorstorage.The
onlydifferenceisthattheindexIJ (invectorstorage) mustbecomputedusingthealgorithm
in Figure5.2foreachpairof indices (i,j)or(j,k)in equations
5.10,5.14,and5.16.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

188 Step4: SolveSystemof Equations

Example
Usethealgorithmin Figure5.2 to assigntheentriesof thenonsymmetric
matrixshown
belowin full matrixstorageto vectorstorage

3210
NDOF = 4
SBW = 3
33
24 usu• = (4)=- (4- 3)(•+ 4- 3) = •4

i=1 j -1 I J= j -1
j -2 IJ-Z
j- 3 IJ-•

i-2 j-1 IJ = 1
2>1
3<4
2<3
IJ - 1 + (2-1) ((2) (3)-1) - 6
L -MIN(3,2) - i - 2 - 1 = 1
IJ - 6 - 1/2[(3-1) + (3-1)]
= 6- 2- 4
L -2-4+3-2--1<0

' IJ=4

i - 4 j = 4 I J- j =4
i= 4 > 1
3<4
i= 4 > 3
IJ- 4+3- 4=3
IJ - 3 + (4-1) (2(3) - 1) - 18
L = MIN(3,4) - 1 - 3 - 1 - 2
IJ = 18 - 2/2[(3-1) + (3-2)]
- 18 - 3 = 15
L = 4 -4+3-2=1>0
IJ = 15 - 1(1+1)/2 - 14

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
5 189

and
IJ i j
1 1 1
2 1 2
3 1 3
4 2 1
5 2 2
6 2 3
{M} = 7 2 4
8 3 1
9 3 2
10 3 3
11 3 4
12 4 2
13 4 3
14 4 4

5.1.4 Choleski Method for Symmetric Matrix in Vector Storage


If the matrix[M] is bandedandsymmetric(e.g., whensolvingthe steady-state
or
transient
groundwater flowequations)
theentries
withinthebandcanbestored in a vector
withlengthI/SIZE wher•

I/SIZE=
SBW(NDOF-SBW+
1)+
(SBW-1)[Sl•
W] (5.29)
whereNDOF is thenumberof equations
andSBW is thesemi-bandwidth (The quantity
(SBW- 1)x(SBW)is alwaysanevennumber).Fortheexamplein Figure5.1,NDOF = 6,
SBW = 2 and

I/SIZE=
2(6-2+
1)+(2-1)
(-•)
=11

A typical
entry
mijin[M](fullmatrix
storage)
canbeassigned
toanentry
mijin{M}using
thealgorithmin Figure5.3

I J- j - i + 1
IF i>1 THEN
IF SBW<NDOF THEN
IJ - IJ + (i-1)SBW
L - i - NDOF + SBW - 2
IF L>0 THEN
IJ • IJ - L(L+i)/2
ENDIF
ELSE
IJ- IJ + (i-l)(NDOF+(NDOF-i+2))/2
ENDIF
ENDIF

Figure 5.3 Vector matrix storage for banded, symmetric matrix.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

190 Step4: SolveSystem


of Equations

Example
Use the algorithmin Figure5.3 to assignthe entriesof the symmetricmatrixshown
belowin full matrixstorageto vectorstorage
3200 NDOF -- 4

24
02 IJS•- = 2(4- 2+ 1)+ (2- 1) =7
i- 1 j = i XJ• 1- 1+ 1-1
j--• •J•2- i + I-2
-.,--...., ............ .---..,.. ...................................................................... ..,

i-2 j-2 IJ=2-2 + 1=1


2>1
SBW < NDOF
IJ m I + (2-1)(2) = 3
L =2-4+2 -2=-2<0

' IJ•3

j i 3 IJ=3-2 + 1-2
2>1
SBW < NDOF
IJ = 2 + (2-1)(2) = 4
L =2-4+2-2=-2<0

.'. IJm4

i= 4 j-• 4 I J=4 - 4 + 1- 1
4>1
SBW < NDOF
IJ • i + (4 - 1)(2) = 7
L = 4 - 4 + 2 - 2 = 0

ß IJ = 1

m•d 3 u i j

• 1 1 1
2 1 2
{M} = 3 2 2
4 2 3
5 3 3
6 3 4
7 4 4

TheCholeskimethodcanbeused withsymmelric
matrices
invector
storage.Theonly
difference
isthattheindexIJ (invector
storage)
mustbecomputed
usingthealgorithm
in
Figure5.2 for eachpairof indices
(i•j)or (j,k) in equations
5.18,5.25,and5.27.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter$ 191

$.2 APPLICATION OF CHOLESKI METHOD

$.2.1 Steady-State, Saturated Flow Equation

The matrixformulationfor the steady-state,


saturated
flow equation(equation5.1) can
be solvedby the Choleskimethodfor symmeuicmatricesdescribedin sections$.1.2 and
$.1.4. We simplyset[M] = [K], theglobalconductance matrix;{X} = {h}, theunknown
valuesof hydraulicheadat eachnode,and{B} = {F], thespecified ratesof groundwater
flow at nodesrepresenting sourcesand sinks(i.e., at Neumannnodes). The global
conductance matrixis symmetricbecause theelementmatricesit containsaresymmetric.
Equation$.1 is a systemof linearequations becausenoneof the entriesof the global
conductance matrix arefunctionsof hydraulichead. Recall thattheelementconductance
mauix
[K(•)]iscomputed
using
theinterpolation
function
derivatives
foreach
node
inthe
element and the components of saturatedhydraulicconductivityfor the element. The
interpolation
functionderivativesdependonlyon thenumberof nodesin theelementand
theclement'ssize andshape.The components of saturated
hydraulicconductivityare
constant
withinanelement(butcanvaryfromoneelementto thenext)anddonotdepend
on thevalueof hydraulicheadat theelcment's
nodes.
Becausethe globalconductance matrixis symmetricand banded,equation5.1 is
conveniently assembled andsolvedin vectorstorageusingthe procedure describedin
sections5.1.2 and 5.1.4. Decompositionof [K] and {F} is performedonceand {h} is
obtaineddirectlyby backwardsubstitution.

$.2.2 Transient, Saturated Flow Equation

The matrixformulationfor thetransient,


saturated
flow equation(equation5.3) canbe
solvedby the Choleskimethodfor symmetricmatricesdescribedin sections5.1.2 and
5.1.4. Weset

[M] = [C] + tofit [K] (5.30a)


{X} = {h}t+at (5.30b)

{B} = ([C] - (1 - tO)At[K]){ht} + At ((1 - to){F}t + (5.30c)

where[C] is theglobalcapacitance matrix,[K] is theglobalconductance matrix,tois the


relaxationfactor,At is the time step,and {F} are the specifiedratesof groundwater flow
representing
sourcesandsinksatNeumann nodes.{F) isknownatalltimesteps.(h) t is
knownfromtheinitialconditions
or fromthesolutionobtainedfortheprevious
timestep.
{h}t+At
aretheunknown valuesof hydraulic
headat timet + At.
•d] is symmeuicbecause [C] and[K] aresymmetric.The choiceof toandAt will have
no effecton the symmetryof [M]. Equation5.3 is a systemof linearequations because
noneof theentriesof [C] or [K] arefunctionsof hydxaulic
head.
Because[M] is symrnelricand bandedequation5.3 is convenientlyassembled and
solvedin vector storageusingthe proceduresdescribedin sections5.1.2 and 5.1.4.
Assembly anddecomposition of [lVl]isperformedonlyonce(unless
toor At changes from
onetimestepto thenext). However,assembly anddecomposition
of {B} andbackward
substitution
to obtain(h)t+Atmustbeperformed foreachtimestep.Thusit is desirable
to
minimizethenumberof timesteps
usedtosolvea particular
problem, suggestingthatlarge
timestepsshouldbeused.However,severalnumerical difficultiescanariseduringthe
solutionprocesswhenAt is large. The sizeof time steprequiredto obtainusefulresults
depends
on thesizeandshapeof theelements
in themesh,thevaluesof specificstorage

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Step4: SolveSystemof Equations

andhydraulicconductivity for eachelement,whethera lumpedor consistentformulation


wasusedto computethe elementcapacitance maltices,the boundaryconditionscontained
in [ B ), andthevalueof ther•laxationparametero•.
The first type of difficulty thatcanoccurwhen solvingequation$.2 occurswhen
calculatedvaluesof headviolate"reality"
(Segerlind,
1984).Forexample whencomputed
valuesof headd•e neara pointsource or increase
neara pointsink. Thissituationcan
be avoidedby choosingo• andAt so that the coefficientsin [M] (equation5.30a) are
positivefor positions
on themaindiagonalandnegativefor off diagonalpositions (see
below)(Segerlind,1984,Maadooliat,1983).
Thesecond
typeof difficulty
thatcanoccurWhensolving
equation
5.2 is called
instability. Instability occurswhen the differencebetweenthe true solutionand the
numerical
solution
growsextremely
la/'gein a fewtimesteps
(Figure5.4). Fortunately
it is
possibleto avoidinstabilityby settingr.0> 1/2. When thisconditionis met,thenumerical
solution
forequation
5.3 will beunconditionally
stable(Lapidus
andPinder,1982,p.166).

numerical solution
true solution

Fillure $.4 Numerical instability in computed value of hydraulic head.

Thethirdtypeof difficultythatcanoccurwhensolvingequation
5.3 for largevaluesof
At is callednumericaloscillation. Numericaloscillationoccurswhenthecomputed values
of hydraulicheadfluctuateaboutthe truesolution.From one time stepto the nextthe
numericalsolutionis alternatively
aboveandbelowthetruesolution(Figm• 5.5).
Criteria to avoid numericaloscillationscan be derivedbasedon theproperties
of the
matrix
product
[M-I][P]wher•
[Pl: [c] - (t - m) [K] (5.31)

Toavoid
numerical
oscillations
itissufficient
torequire
thatallofthecigenvalues
of [M-1]
[P] bepositive(Myers,1971). An eigenvalue
is definedasanynumberE thatsatisfies
the
matr• equation

{[M-'I[Pl
- ] =o (5.32)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapt• 5 193

u-ue solution

numerical solution

Figure 5.5 Numerical oscillation in computed value of hydraulic head.

whereI I is thedeterminant and[I] is theidcndtymau'ix( seeAppendixIV). Equation


:5.32is alsosadstied(Segerlind,1984)if

[[PI-E[M][
--0 (5.33)
In equation5.33 E will bepositiveif both[P] and[lV[]arepositivedeftmite.Now [C] and
[K] will alwaysbepositivedefinite.Fortransient,saturatedflow
[M] = [C] + co•t [K] (5.34)

wherem andAt are positiveconstants.[M] will alwaysbe positivedefinitebecausea


matrixobtainedby addinga positivedefinitematrixto a positivedefinitematrixmultiplied
by anypositiveconstant is alsopositivedefinite(Myers,1971).
However,['P]is notguaranteed to be positivedef'mitebecausea matrixobtainedby
subtractinga portionof onepositivedefinitematrixfromanother is notnecessarily
positive
definite(Myers,1971). Theproblemof avoidingnumericaloscillations thusbecomes one
of selecting
valuesof coandAt thatinsurethat[P] is positivedefipite.In otherwords,we
selectvaluesof coandAt suchthat(foranynumber

--o
[P] will bepositivedefiniteif novalueof [• _<0. Now theminimumvalueof anyglobal
matrixis greaterthantheminimumeigenvalue for all itscomponent
(orelement)matrices
(Fried,1979).Thuswecandevelop criteriato selectvaluesof coandt by usinga formof
equation5.35writtenfor anarbitraryelemente

I[P('ø1
- I](•)[I]
] =0 (5.36)
where

[P(')]= [c(•)]- (] - re)at[K(')] (5.37)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

194 Step4: SolveSystem


ofEquations

and[C(e)]istheelement
capacitance
matrix,
[K(e)]istheelement
conductance
matrix,
and
[•(c)
isaneigenvalue
forelement
e.Nowifthe
minimum
eigenvalue
forany
element
equals
zero([5
(e)=0),theminimum
eigenvalue
forthe
global
matrix
willbegreater
than0 ([•>_
0)
andnumerical'oscillations
willnotoccur.
Setting
[5(e)=0,equation
$.36becomes

I,(q-o ml =o

I[c(q-(1- co)At
[K(')]
J: 0 (,5.38)
Let c•= (1 - co)At.Then equation5.38 becomes

J[c(q-
a J= o (5.39)

andthecriteriafor stabilitybecomes

At < 1-co' co>1 (5.40)

where0•is thesmallestnumber(foranyelement) thatsatisfies


equation
5.39(thesmallest
numberof • will occurin thesmallest
elementin themesh).Forthecaseco= 1, it canbe
shownthat no numericaloscillati9n•will 9•!•r (Segerlind,1984). In practicethe
following
procedure
canbeusedtoavoidnumerical
oscillations
whensolving
thetransient,
saturated
flow equation:

1. Compute
[C(½)]
and[K(½)]
forthesmallest
element
inthemesh.
2. Solveequation
5.39to obtaintheminimumvalueof ctfor thatelement.

3. Useequation5.40 to selecta suitablevaluefor At andco.

Example

The elementcapacitance
andconductance
matricesfor the smallestelementin a mesh
aregivenbelow.Findcombinations
of coandAtthatdonotviolaterealityandthatprevent
instabilityandnumericaloscillations

it(e)]
: 0.03
0
0
0.03
[K(½)]
: -0.5
0.5 0.5
Fora meshconsisting of thistypeof elementthediagonal coefficients
in [M] will be
positive
andtheoff-diagonal
coefficients
in [M] will benegative
forall valuesof coandAt.
Fromequation5.39

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
:5 19:5

0.03 0 0.5
0 0.03 - • -0.5 0.5
or

(0.03
- •0.05)(•0.05) =0
(•0.05) (0.03- •0.05)
(0.03 -•0.05)(0.03 - •0.05)- (•0.05)(•0.05) -- 0
or

0.0025•2- 0.003•+ 0.0009- 0.0025•2 -- 0


or

0.0009
0.003= 0.3
Instability
willnotoccur
if co> 1/2andnumerical
oscillations
willnotoccur
if
0.3
At <
1-co

Thevaluesof At andcothatmeetthiscriteriaareplottedbelow.Any combination


of At and
coin theshaded
regionwill prevent
instabilityandnumericaloscillations.

15

At

0
0.5 0.6 0.7 0.8 0.9 1.0

Forlinearelements
with4 nodesor less,equation
5.39canbeusedto derivealgebraic
expressions
for fit thatpreventnumerical
oscillations.
Formorecomplicated
elements,
equation
5.39must
besolved
numerically..
Consider
furst
thelinearbarelement
(Figure
4.5). The elementconductance
matrixis gxvenby equation4.15a

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

196 Stgp4: SolveSystemof Equations

where
K(x
e)isthesaturated
hydraulic
conductivity
andL(0 istheelement
length.
If weuse
theconsistent
formulation
theelementcapacitance
matrixis givenby equation4.16a

S?)L(•)

where
S?) isthespecific
storage.
For a meshconsisting of thistypeof element,thediagonalcoefficients
in [M] will be'
positiveforall valuesof mandAt. Theoff-diagonal coefficients
will benegativeif

6 - mAt•-•
<0
or

At <
6K?m
Fromequation5.39

'6 [2•]_
1
=o

or

'• = . + i.(,)'j=o
6 "+•'•x
L•) ø3 - L•)j
Evaluatingthedctcrmin•t wc have

'3 L(,)
J 6 L(•)
J
whichcanbe solvedto give

12K(x
•)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
5 197

so that the criteriafor avoidingnumerical


oscillations
for the linearbarelement
witha
consistent
formulation
for[C(e)]is
i ,

, (5.41)
< -
If weusethelumped
formulation
theelement
capacitance
matrixisgivenbyequation
4.16b

[C½:)]:
2 [0•]
Fora meshconsisting
of thistypeof element
thediagonal
coefficients
in [M] will be
positive
andtheoff-diagonal
coefficients
in [M] willbenegative
forallvalues
ofo)andAt.
Substituting
[C(e)]and
[K(e)]
into
equation
5.39wehave

=0

or

=0

Evaluatingthedeterminant
we have

whichcanbe solvedto give

4K?
)
so that the criteriafor avoidingnumericaloscillations
for the linearbarelementwitha
lumped
formulation
for[C(c)]
is

At<4K•)(l_m
) (5.42)
• m

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

198 Step4: SolveSystem


of Equations

Equationssimilarto 5.41 and 5.42 can be derivedfor otherelementtypes(Segerlind,


1984)
1. Linear triangle element. lumoed formulation
Theelement
•natrices
aregivenbyequations
4.20and4.22b.Asanexample
consider
thetriangleelementshownbelow.Nodei is at (0,0),theelementis a righttriangle,andthe
sidelengthis b
y •

(0,b) A=T

(o,o) (b,0) x

Ifweassume
that
K(x
e)=K(y
e)=K(e)wecan
use
equation
5.39
tofind
2S?)A
(½)
a = 9K(.
) (5.43)
and

2S?)A
(e)
At < (5.44)
9K(e)(l_(o) ß

2. Linearrectangle
element,lumpedformulation
Theelement matrices
aregivenbyequations 4.26 and4.27b.As anexample
consider
asquare
element
(2a
(e)
5.39 to find
=2b(e)).
Ifweassume
that
I•e)=K(y
•)=K(e)wecan
use
equation
$?)a(e)b
(e)
(x= K(,0 (5.45)
S?)a(')b
(e)
At<K(C)(l_(o) (5.46)
5.2.3 Solute Transport Equation

Thematrixformulation
forthesolute
transport
equation
(equation
5.5)canbesolved
by
the Choleskimethodfor nonsymmetric
matricesdescribedin sections5.1.3 and 5.1.5.
Thisis doneby setting

[M]= [A]+coat
[D] (5.48a)
{X} = {C}t+at (5.48b)
{B} = ({A] - (1-re)AtI'D]){C}t + At ((1-(o){F}t+ (o{F}t+a,) (5.48c)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter5 199

where[A] is theglobalsorption matrix,[D] is theglobaladvection-dispersion


matrix,m is
the relaxation factor, At is the time step, and IF] are the specifiedsolute fluxes
representingsourcesandsinksat Neumann nodes.IF} is knownat all timesteps.[ C}t is
knownfromtheinitialconditions or from thesolutionobtainedfor theprevioustimestep.
[CJt+at aretheunknown valuesof soluteconcentrationattimet+At.
[1• is nonsymmetric because [D] is nonsymmetric.The choiceor m andAt will have
no effecton the symmetryof [MI. Equation5.5 is a systemof linearequations because
noneof the entriesof [A] or [D] are functionsof soluteconcentration.
Because[M] is bandedequation5.5 is convenientlyassembled andsolvedin vector
storage(Section5.1.•). Assemblyanddecomposition of [M] areusuallyperfon•ned
only
once. However,for solutetransport
in transient
groundwaterflow conditions,
e.g.Section
3.7.3, [M] would be assembledand decomposedat each time step (becausethe
components
ofapparent
groundwater
velocity,
v?),v5
e),and
v?)used
tocompute
[D(e)]
are
changingfi'omonetimestepto thenextin transientflow). [M] mustalsobe assembled and
decomposed if coor At changeduringthe solutionprocess(e.g., it is commonto usea
smalltimestepfor thefirstfew timesteps,whensoluteconcentrations arechanging rapidly
andthenusea largerAt whensoluteconcentrations arechanging moreslowly).
The samecriteriausedto avoidproblems of violatingreality,instability,andnumerical
oscillations
whensolvingthetransient,saunmtedflow equation
(Section5.2.3)canbcused
whensolvingthesolutetransport equation.Thusto avoidproblems of instabilitywe setco
• 1/2. The criteriafor preventingnumericaloscillations
can be written(followingthe
discussionin section5.2.3)

At < 1- co (5.49)
whereo•is thesmallestnumber(for anyelement)thatsatisfies

[A
(")1
- a[U(*)]]
:0 (5.50)

where
[A(e)]and[D(e)]aretheelement
sorption
matrix
andadvection-dispersion
matrix,
respectively.
For simpleelementtypes,equation5.$0canbeusedto derivealgebraic
exprcssionsfor
combinations of At andcothat preventnumericaloscillations.For more complicated
elements,equation5.50 mustbe evaluatednumerically. As for the caseof transient,
saturated flow the smallest value of c• will occur in the smallest elemcnt in the mesh.

Example
Detentinc the criteriafor preventingnumericaloscillations
whensolvingthe solute
transport
equationusinglinearbarelements (Figure4.5).
Wewilluse
thelumped
formulation
for[A(e)]and[D(e)](equations
4.19b
and
4.18b)
and set •. -- 0

e..(,),.,.(,)
[d(")]= •'b '"d+(..•
' [10•]
+ -I I]
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

200 Step4: SolveSystemof Equations

where
p•) is bulkdensity,
K•e)is thedisu'ibution
coefficient,
0(e)isvolumetric
water
content,
L(e)istheelement
length,
D(x
e)isadispersion
coefficient,
and v•) istheapparent
groundwater
velocity.To simplifythealgebraset

R(e)----•b
•(e)T,,-(e)
•d

Substituting
intoexluation
5.50 we have

=o

R(e)L
2 (e)
,- c•(D•)0
(e)
Evaluatingthedec.•finant

]:)?)o
(•) v?)•l
JJ[

or
I (e)
- or, L(e) (e)J] +tjj --o
(Cz - aC1)(C] - czC3)- ct (C2)cz(C3) = 0

R(e)L(O
where Cz = 2
,, etc.

Cx
2- c•C
].(C3+ C9 = 0
or

el
C2 + Ca

R(e)L
(e)
2

D•o('•v?)D?O
•i ¾?
L(½)
-T + L(•)' +T
R(e)(L(½))
2
(5.51a)
4Die)0
(½)
and

At < (5.51b)
1-CO

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
5 201

5.3 PROCEDURE FOR SOLVING SYSTEM OF NONLINEAR


EQUATIONS

Equation
5.7canbewritten
inexpanded
formas

,xa)
-'-
mln(Xl,.'"
mll(Xl,
... ixn)]I
!} {b•i
}
mnl(X1,ß.. , x.) .- m=(x,,.
(5.52)

where
each
mijisafunction
ofone
ormore
values
ofxi. Although
notshown
explicitly
in
equation
5.52thecoefficients
in {B} arealsosometimes
functions
ofoneormorexi i.e.,
bi(Xl..... Xn).Thenonlinear
solution
process
begins
byspecifying
aninitialguess
for
{x}, {xo}

(x ø} = x,ø
1ß (5.53)

If {Xø}wasanexact
solution,
it would
satisfy
equation
5.52exactly.
In other
words

[M(Xø)I{X
ø}= {B}
or

{B}- [M(Xø)I{X
ø}= {Rø}= {0} (5.53)

where
{Rø}aretheresiduals
ateach
node
(nottobeconfused
withtheresiduals
obtained
in
Chapter
3 using
Galerkin's
method).
Equation
5.53canalso
bewritten
inexpanded
form

bl mll(Xl,."
, . ' . . (5.54)

Lm,
i(x•
ø, ,x•) m=(x•,, x•)Jl,
x•J [r•øJ
where
rioaretheentries
of{Rø}.If theinitial
guess
for{X}isincorrect,
thesolution
will
notbeexactandtheresiduals
willnotallequal
zero,[Rø} ;e[0}. In practice,
weusually
onlyrequire
theresiduals
tobe"close"
tozero

wheremaxdenotes
themaximnm
valueof theresidual
atanynodeand• isa predetem•ed
tolerance.
If theinitialprediction
{Xø}does
notsatisfy
equation
5.55wesearchforanimproved
prediction
[Xk}.Theprocess continues
inaniterative
fashion
untilasufficiently
accurate
solution
isfound.Several
methods
canbeusedtoobtaintheimproved
prediction
[Xk).
Wewillconsider
onlytwomethods:
Picard
iteration
andtheNewton-Raphson
method.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

202 Step4: SolveSystem


of Equations

5.3.1 Picard Iteration

In Picarditeration
(alsocalledthesubstitution
method) weconstruct
a sequence
of
solutions
{Xø},{X1},{X2},etc.andeachsolution {Xk} iscalculated
fromtheprevious
solution{Xk-1}

{xk}= {B} (5.56)

where[M(Xk-1)]represents
thematrixof coefficients
constructed
fromtheprevious
solution(Kluteet al., 1965).Equation
5.56canbewrittenin expanded
formas

(5.57)

(If thecoefficients
in {B} arcfunctions
of {X} theywouldalsobe computed using
{Xk'l}). Theprocedurebe•n• by specifying
aninitialguess{X0}. Thenwe solvethe
systemof linear equations

[M(Xø)]
{X'}= {B} (5.58)
toobtainthenewsolution
{X1} (forexample
usingCholcski's
method).
Wethencompute
the residuals

{R0}= {B}- [M(X0)]


{X1} (5.59)

anddetermine
if therioarcsufficiently
close
tozero.If theyarc,wccanusethesolution
{X1}. L•'theyarenotwc conslruct
a newmatfixof coefficients
using{X• } andsolvefor
thenextsolution{X2}

[M(X')]fX
2}= lB} (5.60)
where[l•[(Xl)]represents
thematrixof coefficients
conslructed
fromsolution
{X l }. This
processis repeateduntil themaximumvalueof a residualis smallerthana specified
tolerance •

Jma,,{h
J<e
Equation5.61 is calleda testfor convergenceor convergence criterion becauseit is a
measure of howclosetheapproximate solution{Xk} is to theunknown maesolution{X}.
Thistestcanalsobeperformed onresiduals
computed fromtwoconsecutive solutions

{Rk} = {Xk}-{x k-l} (5.62)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter5 203

whichcanbe writtenin expandedform as

(5.63)

Thealgorithm
for Picarditerationis summarized
in Figure5.6.

1.Specify
initial
approxfmate
solution
{Xø}
2. For k = 1, 2, 3.... (eachvalueof k is an iteration)do the following

A. Construct
thematrix
ofcoefficients
[M(Xk-t)]
B. Solvethe systemof linearequations

[M(X (Xk=
for{X•}
C.Construct
the
vector
ofresiduals
{Rk}using

or
{Rk}= {B}-[M(Xk-I)]{X
k)
{Rk} = {xkt-{X k-l}
D. Test for convergence

Ima(rl <
If convergence
criterion
issatisfied,
usesolution
{Xk},otherwise
setk = k + 1 andrepeatstepsA, B, C andD

Figure $.6 Algorithm for Picard iteration.

Example
UsePicarditerationto solvethefollowingsystemof nonlinear
equations
(lete -- 0.05)

5xl
2 + 4XlX
2- 4x:• =5
-4XlX
2+ 4x2
2 + 3x2x3 - 3x3
2 =4
-3x2x3+ 3x3
2 =3

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

204 Step4: SolveSystemof Equations

Thesystemof equations
canbewrittenin matrixformas

(5x
1+4x
2)-4x
2 0]Ixlfit
-4x 2
0
(4x2+3x 3) -3x 3 x2
-3x3 3x3J[ x3
Following
thealgorithm
in Figure5.6,wespecifyaninitialsolution
IX 0} (usuallys½lecte•
arbitrary)

Thiscanbeusedtoconstruct
thematrixof coefficients
[MOO)]

[M(xO)] 5(1)+4(1)
-4(1)3•]
-- -4(1) (4(1)+3(1))-1)
o -3(•) 3(1)j

= -4 7
0-3

We canthenconstruct
thesystemof linearequations

MCXø))X
!}--{B}

-40•I] •
0 -3 x•J
whichcanbe solvedto give

[XI)= x•[=J4.151
The residual vector for the first iteration is

{R1}---{X0}- {X1}--
f!t--f4.15[.=f-3.15[
5.15J -4.15.1

andImaxtr•}l= 4.15> 0.05


For the next iteration(k = 2) the matrix of coefficientsis

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
5 205

=[ -4(;.15)-4(4.15)
0]
{'(5(2.4)
+ 4(4.15)
['M(X•)]
(4(4.15) + 3(5.15)) -3(5.15)
-3(5.•5) 3(5.•5).1

=
28.60
-16.60
00]
-16.60 32.05
-15.45
-15.45
15.45]

There,suitingsystem
of linearequations

28.60 -16.60

-16.60 32.05 -15.45


0
5
0 -15.45 15.45

canbe solvedfor {X 2}

[X2]
= x22•
= 142'
and

{R2}= {Xi}-{X2}= 4.15{,-1.42{•


= 2.73{•
5.15J 1.62J 3.53J

with[max{r•}
[ = 3.53> 0.05.Theresults
fortheremaining
iterations
arcsummarized
below

0 1 1 1
1 2.40 4.15 5.15 4.15
2 1.40 1.42 1.62 3.53
3 1.54 2.77 3.39 1.77
4 1.56 2.19 2.49 0.90
5 1.54 2.34 2.74 0.25
6 1.56 2.31 2.67 0.07
7 1.54 2.30 2.67 0.02 < 0.05

and the solution is

1.54]
{X} = 2.30]
2.67J

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

206 $tc'p4: SolveSystemof Equations

For somenonlinearproblems (i.e., whenthecoefficientsin [M(X)] am sensitiveto


smallchanges in IX]) it is betterto usea modification of Picarditerationbasedon an
incrementalsolutionprocedure (sometimes calledthe modifiedNewton-Raphson
method ). Asbefore,we specify aninitialapproximate solutionIXø] andconstructthe
matrixof coefficients
[M(Xø)]. However,theresidual vector[Rø] iscomputed beforethe
systemof linearequations is solvedi.e.,

(5.64)

We thentestfor convergence

If a newsolution
is needed
we construct
a system
of linearequations
using{R0} asthe
righthandside

(5.66)

where{AX1} is a vectorof increments


usedtoconstruct
thenextsolution[X1]

{X } = {Xø}+ co*{Ax (5.67)

andco*is a relaxation
factor(usually
determined
by trialanderror).We thencompute
a
newresidualvector{Rl } andrepeattheentireprocessuntiltheconvergence criterionis
satisfied.The algorithmis summarized in Figure5.7. Thisprocedure canincreasetherate
of convergence compared to thealgorithm in Figure5.6 (i.e.,a fewernumberof iterations
arerequiredtoreachthespecified tolerance) for someproblems butmayalsoincrease the
totalnumber of calculationsbecause of thematrixmultiplications required
toobtain[Rk}.

Example
Use Picarditerationwith an incrementalsolutionprocedureto solvethe systemof
nonlinear
equations
in theprevious
example
(let• = 0.05formax[&xi] anduseco*= 0.5)
Followingthealgorithmin Figure5.7, we specifyaninitialsolution

The matrix of coefficients is the same as before

[M(Xø)]= 7
-3

The residual vector is

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter5 207

1.Specify
initial
approximate
solution
{Xø}
2. For k = 1, 2, 3.... (eachvalueof k is an iteration)do thefollowing
A. Consmict
thematrix
ofcoefficients
[M(Xk-l)]
B.Compute
the
entries
ofthe
residual
vector[Rk-1}
{Rk-l} = {B}- [M(xk-I)]{X
k-l}
C. Test for convergence

[max•r•-•l< •?
Ifconvergence
criterion
issatisfied
usesolution
ofi•erwise
performstepsD, E, andF
D. Solvethesystem
of linearequations

[M(xk-1)I{Ax
k} -_[Rk-I}
for{aXk}
E. Construct
thenextsolution
{Xk}
{xk} = {x•-•} + o)'{•xk}
F. Setk = k+ 1 andgoto stepA.

Figure $.7 Algorithm for Picard iteration with an incrementalsolutionprocedure.

{go}= {•}_[M•xO)]fX
o}

-• _ ? =

andImax{riø}l
=4
We canthencons•uct•hesys•mof linearequations

[M(xo)]{•X•}= {go}

-4
o 7-3
3,xIJ
AxI•=
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

208 Step4: SolveSystemof Equations

andsolve
forfAX•}

{ax =
1.40
4.15J

The nextsolutionis givenby

iX'}= {Xø}+m*{AX
t} = +0.53.15[
-- 2.58•
4.15J 3.08J
The resultsfor theremainingiterationsare summarized
below

0 1 1 1 4 1.40 3.15 4.15 4.15


1 1.70 2.58 3.08 1.62 -0.29 -0.49 -0.67 0.67
2 1.56 2.34 2.75 0.38 -0.02 -0.05 -0.10 0.10
3 1.55 2.32 2.70 0.13 -0.0026 -0.019 -0.029 0.029 < 0.5
4 1.549 2.311 2.686

and the solution is

1.549
{X}= 2.311•
2.686J

In this example, the incrementalsolution procedurereducedthe number of iterations


requiredfor Piearditerationfrom7 to 4.

5.3.2 Newton-Raphson Method

For someproblems,Picarditerationmayconverge
slowly.In thiscasewe maywish
to use the Newton-Raphsonmethod(Coneus,1967). This methodis similar to the
algorithm
in Figure5.7in thatwespecify aninitialsolution
{X0} andcompute
a seriesof
newsolutions |Xt }, {Xa), {X3) .... whereat eachiteration
k we compute
thesolution
{Xk} usingequation 5.68
{Xk} ----{Xk-l}+ (0'{• k} (5.68)
As before, we continueto computenewsolutions
untiltheresidualsaxecloseto zero i.e.,
{Rk}- {0}. IntheNewton-Raphson
method
wesolve
for{fixk} bywriting
aTaylor
series
approximation
for {R•'} andsetting
it equaltozero

{Rk}
= +a{x}ix} = ixk-•}{fixk}
•)2{R}
({AXk})
2 + '" = {0} (5.69)
2!•){X}
2 {x} = {x•'-•}

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
5 209

Neglecting
thehigher-order
terms
containing
([Axk])
2,(fAXk])
3,etc...wehave

{Rk}
= {Rk-•}
+ fx} = :x•_•Dx
•)=fo} (5.70)

or

afR}[
{xk_i}{AX
k}m
{g
afX} ix}=k-l} (5.71)

But

{Rk-1}
----
[B)_IM(xk-1)][xk-1
) (5.72)

andif we assumethattheentriesin {B} arenotfunctionsof [X} (for convenience


only,
thisisnota requirement
of theNewton-Raphson
method)
wecanwrite(using
thepr•uct
rule)

9fR} 3[M(X)]
{x) =(x•-•} =[M 4-•{X)"(x}=ix•'•}{Xk4}
(xk-1)] (5.73)

Substituting
equation
5.73intoequation
5.71givesa system
oflinearequations
thatcanbe
solved
for [AXk]

[M(xk-I)]
+ •){X}-
{X}={x•-,}
{x }{AXk}
-- (5.74a)

whichcanbewrittenin expanded
formas

'ml
l(Xlj-l,.,
x•-')---mlu(Xl•
...... -1, x•-' am,,
(x•._
a•T'' , ....x•_l) am,..
•'•_,
'" •-•-, .....
: : +Xl
k-I : ... :
mnl(Xkl
-I.....
x• ,•-bJ ••mul
-l' m•(4-L (x,k-!
,. ....X•
-1)---•5-•,,
•mnn.....

k-I i•1Ill
1.k-Ik-I•ml
ß n(xkl-I
x•-IAxkl]
rlk-1
•-•-•tx,.....x. ).-- •x•
'"' .

ß : ß
(5.74b)

•311
1.k-1
.....Xnk-I) **' •}mnn.
,-•-•-•
tXl k-I
1 ...Xkn-IA
•Xn,.
{,X rnk-lJ
The algorithm
is summarized
in Figure5.8. The majordifficultyin implementing
the
Newton-Raphson
method
iscomputing
theentries
in•[M.00)However,
therateof
convergence
is usually
fasterthanPicard
iteration
andthiscansometimes
giveanoverall
improvement
in computational
efficiency.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

210 Step4: SolveSystemof Equations

i i i i i i i i i i ii

1.Specify
initial
approximate
solution
{Xø}
2. For k = 1, 2, 3.... (eachvalueof k is aniteration)do thefollowing

3[M(X)] tXk_
1
A.Construct
the
mawices
[M(xk-I)]
and3{X}{X}={xk-I•
B.Compute
theentries
oftheresidual
vector
{Rk-•}
{ak-I} = {B}- [M(Xk-l)]txk-l}
C. Testfor convergence

Ifconvergence
criterion
issatisfied
usesolution
{Xk-1
}
otherwiseperformstepsD, E, andF
D. Solvethesystem
of Encarequations

[[MiX-)I
+i)[M(X)]
aixlta-- Xlc-,]
lxk'• } {Axk}
= }
for{AXk}
E.Construct
the
next
approximate
solution
{Xk}
{x ----{x {ax
F. PerformstepsA throughE untilconvergence
criterionis satisfied
, ,, , , _

Figure 5.8 Algorithm for Newton-RaphsonMethod.

Example
Use the Newton-Raphson
methodto solvethe systemof equationsin the previous
example
(lete --0.05formax[Axi]anduset0*= 1.0)Following
thealgorithm
inFigure
5.8 we specify
aninitialsolution
[Xø}

Fork = 1, thematrixof coefficients


[M(X•-•)] andtheresidualvector{Rk-I} arethe same
asin thepreviousexample

[M(X•-•)]= [M(Xø)]= 7
-3

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
;5 211

The derivatives
of [M•] aregivenby

•x•(Sxx
+•x•)8_•z
(_4x2)
8 '
lo)
a•i --'

= 0
0

Similarly

a[•)]
-- -4 4
0 0
and 8x3 3
-3

•3[M(X)] •_•[M(X)]
{X}
--{Xk-l]
'{xk-1
} --'--
xl 3X1
-
4-x• •)x2 {:x)= t•-')

+ 3x•

= (1) 0 +(1 -4 4 + (1 3
0 0 0 -3

= -4 7
0-3

andreferringto equation5.74 we have

9-4 0 9-4 0 Axll 0


-4 7-33
o -3 +--4 7-33
o -3
which
canbesolved
for{AX•}

0.700]
AxlJ 2.075J

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

212 Step4: SolveSystem


of Equations

and

{X'}= +(1.0),
1.575•
= 2.575•
2.075J 3.075J
For k = 2 we have

[•(x•)] =-•
[18.0(••8-10.30
0] 0 19.•2-9.23
-9.23 9.23.l

{R
1}= - -1•30
19.52
-9.23 -9.23
9.23J2.575•
=J-0.372!
3.075J L-1.615J
and

[-10.30
0 -9.23 o1
19.52 -9.23 + (1.700) 0 0
9.233 0 0 0
+ (2.575 4
0

+(3.075) 0 3 = -20.60 39.05 -18.46


0 -3 0 -18.46 18.463

-18.4618.46J[
Ax]J -0.327J
whichcanbe solvedto give

{ax•}: -0.•
-0.•4•]
-0.327J

and

{1.7001{-0.1431{1.557]
3.075J -0.327J 2.748J

After
onemore
iteration
(k=3)we
find
{1.54]
{X3}= 2.32•
with
Imax
{ri
3}I TM
0.03.
2.71J

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter5 213

5.4 APPLICATION OF PICARD ITERATION

5.4.1 Steady-State, Unsaturated Flow Equation

The matrixformulation
for thesteady-state,
unsaturatedflow equation(equation5.2)
can be solved usingPicard iteration. We simply set [M(X)] = [K(W)], the global
conductance matrix,{X} = {W}, theunknownvaluesof pressure headat eachnode,and
{B} = {F}, the specified ratesof groundwaterflow at nodesrepresenting sources and
sinks(i.e., at Neumannnodes).The globalconductance matrixis symmetric because the
elementmalticesit contains aresymmetric. Equation5.2 is a systemof nonlinearequations
because theentriesof theelementconductance matricescontainthehydraulic conductivity
for theelementand,in unsaturated flow, hydraulicconductivity is a functionof pressure
head. An exampleof thedependence of hydraulicconductivityon pressure headfor three
soilsis in Figure5.9. Hydraulicconductivityis maximumwhen the porousmediais
saturatedi.e., W = 0 and decreases rapidly with increasingnegativevaluesof W.
Unfortunately,the unsaturated hydraulicconductivityfunctionis difficult to measure
experimentally.
K(W)alsodisplays
hysteresis
(i.e.,thevalueofK(Wø)fora fixedvalueof
pressure
headW0isusually
different
forconditions
of wettinganddrying).
To solvethe steady-state,
unsaturatedflow equationusingPicarditerationwe canuse
the algorithmin Figure5.6 or 5.7. To beginwe specifyan initial approximate
solution
{Wø}.We usethesevaluesto compute
initialvaluesof hydraulic
conductivity
for each
elementin the meshand computethe elementconductancematrices. The global
conductance
matrixis assembled
andmodifiedfor specified
valuesof W andthesystemof
linearequations
issolved
forthenewvalues
of pressure
headateachnode{W1}

[K(vø)]{V
•} = {F}

Theresiduals
arccomputed
from

{R = {F}
or

If theconvergence
criterion
issatisfied
weusethesolution
{W1}. Otherwise
we use{W•}
to computenew valuesof hydraulicconductivity
for eachelement,computenewelement
conductancematrices,assemble [KOg•)]andsoon. Because of theneedto determine
valuesof hydraulicconductivity
for eachelementfor eachiterationit is convenient
to
expressmeasuredvaluesof K(W)vsW in a simpleanalyticalform. Severalempirical
equationshavebeenproposedfor thispurposee.g.,
a
K(•) = (5.76)

K(•) = K•exp(-aV) (5.77)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

214 Step4: SolveSystemof Equations

loo
Clay

10-2

Pressure
Head,¾ (cm)

Figure 5.9 Dependenceof' hydraulic conductivityon pressurehead for three soils.

wherea, b, andm areempiricalcoefficients andKs is thesaturated


valueof hydraulic
conductivity(i.e.,at• -- 0) (GardnerandMayhugh,1958). Otherequations for K(•F)vs
¾ arediscussed in Mualem(1976),RaatsandGardner (1971),andBear(1972).Althouõh
theseequations areconvenient forcalculations
theyoftenprovidea poorfit toexperimental
data. In manycasesa simple"tablelookup"interpolation scheme(i.e., usingcubic
splines)
canbeusedtocompute K(•F)foranyvalueof •F. • is computed at thenodes of
the meshso we mustdecidewhichvalueof • and KOF)to usetocompute theelement
conductance
matrices.
If analytical
methods
areused
tocompute
[K(e)(tF)]
(e.g.,forthelinear
bar, triangle,or rectangleelements)we can simplyuse the averagevalueof•Fforthe
nodes
ofeach
element
(see
Chapter
6). If Gauss
quadrature
is used
tocompute
[K(½)(W)]
(e.g.,for theisoparametric
elements)we canalsousetheaveragevalueof •For we can
computethe valueof •F and K(•F) at eachGausspointduringthenumerical
integration

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
5 215

(i.e.,wecanwriteK(e)(•(ei,
rli,•i)) etc.inequation
4.63.Thevaul½
of• attheGauss
pointcanbecomputed
using
the½lemcnt's
interpolation
functions
andthevalues
of • for
eachnodein theelement(seeChapter6). Thevariousstepsin solvingthesteady-state,
unsaturated
flowequation
areillustrated
in thefollowing
example.

Example
Use Picarditerationto solve thesteady-state,
unsaturated
flow equationfor themesh
shown
below.
Assume
that
I•e)0g)(cm/s)
vslg(cm)
isgiven
by

K(,
•)(v) = o.o•exp(O.O•
v)
for all elementsand usee = 0.05

(1) (2) (3)


•g---100
© : -' _-•g=-80
1 2 3 4

L(e)= 5 crnforallelements

Theelement
conductance
matrices
ar• givenbyequation
4.15a

-0.2
[K(½)(•)]
= L(½)
forallelements.
Theglobalconductance
matrixcanbeassembled
usingtheprocedures
in
chapter
4 andtheglobal
system
ofequations
canbewritten
(afterdividing
bythecommon
factor 0.2)

-K (V) (ICI1)(V)
+I(?(•)) -K?)(•). . v• =
-K?)(V)
0 -K?)(•) K?)(•)J

Modifying
these
equations
fortheboundary
conditions
•gl= ' 100and•g4= -80givesthe
system
of nonlinear
equations
tobesolved
for•g2and•g3

(2) (3)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

216 Step4: SolveSystemof Equations

Following
thealgorithm
in Figure5.6wespecify
aninitialsolution
{¾0}

Theaverage
valueof ¾,• andK(Cl/)foreachelement
cannowbecomputed

(¾•+ ¾2)/2= (-100-90)/2= -95.0


+¾s)/2 = (-9o-
(¾3+¾•/2= (-85- 80)/2 = -82.5
K(x•)(¾)
= 0.01exp(0.01(-95))
= 0.00387
crrds
K?(¾)= 0.01exp(0.01(-87.5))
= 0.00417
cm/s
K?)(•)= 0.01exp(0.01(-82.5))
= 0.00438
crrds

The system
of linearequations
for thefirstiteration(k = 1) is

-0.3871
={-0.351J
-0.00417 (0.00417
+0.00438).][¾]j
and

{¾1}
= ¾]J-86.37J
The residualvector{R• } is

{-92.94•
=f2.94•
-86.36J
1.36J
andImax = 2.94.
Theresults
fortheremaining
iterations
aresummarized
below

0 -90 -85 0.00387 0.00417 0.00438 -


1 -92.94 -86.36 0.00381 0.00408 0.00435 2.95
2 -92.88 -86.23 0.00381 0.00408 0.00436 0.13
3 -92.88 -86.22 0.01 < 0.05

and the solution is

-92.88[
-86.22
]
-80.00 J

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter5 217

$.4.2 Transient, Unsaturated Flow Equation

The matrixformulationfor thetransient,


unsaturated
flow equation(equation5.4) can
be solvedusingPicarditeration.We simplyset

[M(X)] = [C(NO]+ mat [K(¾)] (5.78a)

{X} = {•}t+at (5.78b)

{B}: ([C(¾)]- (l-m) At [K(•)] ){¾}t + At ((1-<o){F}t + m{F}t+at) (5.78e)

in equation5.7 where [C(•)] is the global capacitancematrix, [K(•)] is the global


conductance matrix, tois therelaxationfactor,At is thetimestep,and {F} arethespecified
rates of groundwaterflow representingsourcesand sinksat Neumannnodes. {F} is
knownat all timesteps.{V}t is knownfromtheinitialconditions or fromthesolutionfor
the previoustime step. /•l/}t+Atcontainsthe unknownvaluesof pressureheadat time
t+At. [M(X)] is symmetricbecause [C(•)] and[K(•)] aresymmeu•c.
Equation5.7 is a systemof nonlinearequationsbecausethe entriesof the element
conductance andcapacitance matricescontainthe hydraulicconductivityand specific
moisturecapacityfor theelement,andfor unsaturated flow thesearefunctions
of pressure
head. An exampleof the dependence of hydraulicconductivityon pressureheadis in
Figure5.9. C(¾)is usuallycalculated
by differentiating
experimental
curvesof 0 vs•,
where0 is volumetric
watercontent(Figure5.10)
•0
C(V):• (5.79)
BothK(•) andC(•) maydisplayhysteresis.
To solvethe transient,unsaturated flow equationusingPicarditerationwe usethe
algorithmin Figure5.6 or 5.7 at eachtimestep. To beginwe specifyan initial guessfor
[xg0}t+At.We usethesevaluesto compute
initialvaluesof hydraulic
conductivity
and
.specificmoisturecapacityfor eachelementin the meshand computethe element
conductanceandcapacitance matrices.The globalmatricesareassembled andmodifiedfor
specifiedvaluesof Xl/andthesystemof linearequations is solvedfor the newvaluesof
pressureheadateachnode[•1 }t+At

(it(vø)]+ coat
[IC(vø)ltv'},+a,:
([c(vø)]
-(•-m)at[IC(vø)l)fv},
+ at ((1-m){r} t + to{r}t+at) (5.80)

whereallvalues
of {tiP]referto timet+At. (Thevalues
of [ •]t ontheright-hand
sideof
equation5.80 areknownfrom the solutionfor theprevioussolutionanddo not change
duringtheiterations
required
tofind{¾•}t+at)-Theresiduals
arecomputed
from

{R•} = ([C(vø)]
- (•-m)at [K(Vø)]){¾},
+
-([c(vø)]+ coat (5.8•)
or

{R•}: {V•}_ {vo} (S.82)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

218 Step4: SolveSystem


of Equations

0.7

0.6

0.5

0.4

0.2

0.1

c(o:
0.0

_10-• _10o _10•

Pressure
Head,W(cm)
Figure 5.10 Dependenceof volumetric water content on pressurehead for three soils
and definition fo specific moisture capacity.

If theconvergence
criterion
issatisfied
weusethesolution
[ •l }t+Atforthistimestep,set
[¾]t= [¾}t+At,
andproceed tothenexttimestep.Otherwise wecompute newvaluesof
hydraulicconductivity
andspecific
moisture
Capacity,assembleandmodify
[K(•I)] and
[C(•I)] andsolve
thesystem
ofequations
for[l[/2]t+A
t, andsoon. Weusually
usethe
solution
fromtheprevious
timestepastheinitialguess
tobegintheiterations
forthenext
timestep
(¾o},+•,:{•g}, (5.83)
Theprocedure for solvingthetransient,
unsaturatedflowequation usingPicarditerationis
in Figme$.11. Similaralgorithmscanbe writtenfor Picarditerationwith an incremental
solutionprocedureandfor theNewton-Raphson method.
Becauseof theneedtodeterminevaluesof hydraulicconductivityandspecific moisture
capacityforeachelement foreachiteration
it is convenient
toexpress measured valuesof

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
5 219

K(¾)vs¾ andC(¾)vs¾ in simple analytical


forms.Several empiricalequations
have
beenproposed for thispurpose,
althoughit is oftenpreferable
to use"tablelookup"
interpolation
schemes tocomputeK010andC010foranyvalueof •. Aswiththecaseof
steady-state,
unsaturatedflowwecanusetheaverage valueof ¾ withinanelement to
computetheentries
in[K(•)(•)]and[C(e)(•)]
orwecancompute thevalueof•!/,K010,
and
C(¾)ateachGauss
pointduring
thenumerical
integration.

For eachtimestepdo thefollowing

1. Specifyan initial guess


solution
forpressure
headat thecurrenttime
.0
step[• •t+z•t.Usually
weusethevalues
ofpressur•
headcomputed
fromtheprevious
timestep

2. For k = 1, 2, 3.... (eachvalueof k is aniteration) do the following


A. Compute
the
values
ofK(e)(Vk-1)and
C(e)(Vk-i)for
each
element.
Consu'uctthe elementconductance
and capacitancematrices
[K(•)(Vk-•)]
and[C(')(•k-•)]
B. Solvethesystemof linearequations

= ([COltk-1)]-
(I-co)at
[K(xItk-1)l){•}t
+ At ((1-co){F}t+
for
C.Construct
the
vector
ofresiduals
{Rk}using
{Rk} = ([C(l•tk-l)]
- (1-co)At
[K(ll/k-1)l){v}
t
+ At ((1-co){F}t+ o){F}t+at)
- +
or

{R =
n. Testfor convergence

If convergence
criterion
issatisfied
usesolution{Vk}t+at.
Set
{•}t={Vk}t+a,and
proceed
tothe
next
time
step.
Otherwise,
set
k = k + 1 andrepeatstepsA, B, C, D

Figure 5.11 Procedure for solving the transient, unsaturated flow equation using
Picard iteration.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

220 Step4: SolveSystemof Equations

5.4.3 Modification of Solution Procedure for Relatively Dry Porous Media

When the porousmediais relativelydry, hydraulicconductivitycan changerapidly


with only a small changein pressurehead. For example,in Figure5.9 the hydraulic
conductivityof the sandyloamsoildecreases from 0.8 to 0.0017cm/dayasthe pressure
headdecreases from -1 to -10 cm. This behaviorcancausedifficultieswhensolvingthe
steady-stateor transient,unsaturatedflow equationsusingPicarditerationor theNewton-
Raphsonmethod. An alternativeapproachcan be developedby rewritingequations1.2
and 1.4 in termsof thevolumetricwatercontent0. For steady-state, unsaturatedflow we
have

aK(e)
8z = 0 (5.84)

where
Dx(0),Dy(0,),andDz(0)arethecomponents
oftheaquifers
diffusivity

D(O) • = K(O)
= K(e)

and K(0) and C(0) are the unsaturatedhydraulicconductivityand specificmoisture


capacity writtenasfunctions
of 0. Empirical
expressions
canbedeveloped for K(0) and
C(0) or simiple"table-look
up"orinterpolation
schemes
(e.g.usingthedatain Figures5.9
and5.10)canbeused.ForexampleGardnerandMayhugh(1958)proposed
theequation
D(0) = a exp(b0) (5.85)

wherea andb areempiricalcoefficients.In equations5.84 thez coordinate


axisis oriented
verticallyupward.For transieng
unsaturated flow we have
aK(e) a0
+•'(Dy(0)•'
+•(D,.(0)•)
+ az = a: (5.86)

If theporousmediais relativelydry it is oftenassumed thattheeffectof gravityon


waterflow is small. In thiscase,thelasttermon theright-handsideof equation5.84 can
bediscarded.Followingtheprocedures describedin Chapter3 and4, matrixexpressions
similarto equations5.2 and5.4 canbe developedfor usein solvingequations5.84 and
5.86.

[C(O)]{•}}
+ [D(O)]{O}
= {F} (5.87)

Equation5.84 canbe written

([c] + coat[D(O)]){O},+•,= ([C] - (1-o•) At [D(O)]){O),


+ At ((l-m) {F}t + m{F}t+A
0 (5.88)

where [C] is a globalcapacitance


matrix that canbeobtainedby assembling
theelement
capacitance
matrices
[C(e)]forallelements
in themesh
(written
here
withaconsistent
elementformulation)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter$ 221

• N•'J
N?)] (5.89)

and [D(O)] is a globaldiffusivity


matrix that can beobtained
by assembling
theelement
diffusivity
matrices
[D(e)(O)]
forallelern•nts
inthemesh
'•N?) •N?) •N?)'
3x i}y 3z
[D00(e)]
=

o D•>(e)
nx3 3x3

oo.

•x

o•N?
) dx dy dz

•N?) oo.
•N•)
. 8z 8z .
3xa (5.90)

Theprocedures in Chapter4 canbeusedto computetheelementmatrices,assemble the


globalsystemof equations, andmodifythe systemof equations for knownvaluesof'0 at
Dirichletnodes.Equation5.88 is a systemof nonlinear
equations thatcanbe solvedusing
eitherPicarditerationor theNewton-Raphson method.Becausethediffusivityvariesless
with changingwatercontentthanhydraulicconductivity varieswith changingpressure
headthe numericalsolutionsshouldconvergemorerapidlywhen solvingequation5.86
thanwhensolvingequation5.2. However,equation5.86 can be extremelydifficult to
solvewhentheporousmediais nonhomogeneous becauselargechanges in watercontent
canoccurabruptlyat boundaries betweenlayerswithdifferenthydraulicproperties
(e.g.at
thecontactbetweensandandclaylayers).In thiscasesolutions basedonequation5.2 are
preferred.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

222 Step4: SolveSystemof Equations

NOTES AND ADDITIONAL READING

1. A varietyof numericalmethods canbe usedto solvethesystemof linearequations


representedby equations5.1, 5.3, and5.5. Someexamples areGausselimination
(Cook,1981),Gauss-Seidel iteration(WangandAnderson,1979),andthewavefront
method(Irons,1970). The meritsof thesemethodsarecompared in Meyer(1973) and
Jensenand Parks(1970). There is no single "best"equationsolverbecausethe
performance of analgorithmvariesfromoneclassof problemtothenext.Unlessthe
numberof unknownsexceedsseveralhundred,choiceof methodhaslittle impacton
speedor accuracyof computation.

2. An alternativeform of matrixstoragethatis widely usedis called"skyline"matrix


storage(Eversfine,
1979). Skylinestorageis usefulfor reducing
storagerequirements
whenthenumberof zeroentrieswithinthebandis large.

3. A thoroughdiscussion
of instability
andnumericaloscillation
for transient
groundwater
flow andsolutetransport
is in LapidusandPinder(1982),PinderandGray(1977)and
Remsonet al. (1971, p.71 - 77).

4. A computerprogramthatusesPicarditerationto solvethe transientunsaturated


groundwaterflow equationusinglineartriangleelementsis described
in Davisand
Neumann (1983). Comparisonsof several computerprogramsfor transient,
unsaturated
groundwaterflow arein MatangaandFrind(1981),Bachmat et al. (1978),
and Oster(1982).

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter5 223

Problems

1. Performtriangulardecomposition
on thefollowingmatrices

(a) -1 2- Co) 4
o-1 1

4 -1 -2 -1 4 -2 -2 -1

(c)
-14-1
-1 2i
-2-1 4
-2 -1
(d) -2
-1 -14-22i
-1
-2
4
-1

2. Solvethesystemof equations
[M] {X} = {Bi}, i = 1, 2, usingCholesld's
method

(a) [M]=-• 2- , {B•}= , {Sa}=


0-1

(b) [M] = 2 4 , {B•} = , {•a} = lo


2 1 lO

4 -1 -2 -1 1 1

(c) [M] =
-2 -1 4 ' '
-1 -2 -1

4 -2 -2 -1 1 0

-14-2-2,{B!}
='
(d) [M] =
-2-1 4-41
-1 -2 -1

3. Compute
thelengthof vector[M} requiredto storeeachmatrixin problem1 in vector
storage.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

224 Step4: SolveSystemof Equations

4. Use the algorithmsin Figures5.2 and 5.3 to assignthe entriesof the following
matricesto vectorstorage
1200 1020

(a) 21 (b) o 1
01 o2

40220

(o 042442
4240
4404
0420

5. Findcombinations of ¾ andAt thatpreventinstabilityandnumericaloscillations


when
solvingthetransient,
saturated
flowequation usingtheelementsshownbelow (usethe
cons/stent
formulation
forelement
capacitance
matrices).
S?
)=0.1m-l, K?)=
Kiy
e)=
0.1 m/day.
(a) (b)

[ x•

(c) (d)
(6,7)
(10,3)

(•o,•)
,4) (0,0)
(3,3)

6. Repeat
problem
5if K?=1m/day
andK•e)=0.05
m/day.

7. Repeat
problem
5 usinga lumped
formulation
fortheelement
capacitance
man'ices.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
5 225

8. Repeat
problem
6 usinga lumped
formulation
fortheelement
capacitance
matrices.

9. Findcombinationsof t0andAt thatpreventinstability


andnumerical
oscillations
when
solvingthe solutetransportequationusingthe elementsin problem5. Consider
saturated
groundwater flow andusethelumped formuhtionforelementsorptionand
advection-dispersion
matrices.
@?)
= 1600
kg/m
3 K•)=•,=0,n= 0.35,
r•ie)
'"xx ='"yy
r)ie)-
--

1m2/day,
Dix•
=r)(e)0.5m2/day,
v?=1m/day,
v•)=0.2m/day.

10.Solvethefollowing
systems
ofnonlinear
equations
using
Picard
iteration
(Figure
$.6)
(2x• + 3x2)
(a) -3x 2 (3x2 + 4x3) -4x 3 x2 --
0 -4x• 4xs3•,xs
(x• + 2xz)
-2x 2 (xl+2x 2+x 3) (-2x 2-x3) x2 =
0 (-2xz- x•) (2xz+ x•) J• x•

11. Repeatproblem10 usingPicarditerationwith an incremental


solutionprocedure
(Figure 5.7).

12. Repeatproblem10 usingtheNewton-Raphson


Method.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 6

STEP 5: CALCULATE REQUIRED ELEMENT


RESULTANTS

By solvingthe global systemof equationswe obtainvaluesof the field variable


(hydraulichead,pressurehead,or soluteconcentration) at eachnodein the finiteelement
mesh(and at eachtime stepif we are solvinga transientgroundwaterflow or solute
transport
problem).We alsomaywishto calculatecertainadditionalquantities for each
elementthatwe will collectively
referto as elementresultants.The threetypesof element
resultants
usuallyconsidez'edaxe

1) The valueof thefieldvariableat anyspecified


point (notnecessarily
a noaa•point)
within an element,

2) The averagevalue of thefieldvariablewithinanelement,and

3) The valuesof derivan'ves


of thefieldvariableat anyspecifiedpointwithinan element

In mostcasesthecomputed valuesof thefieldvariableat thenodalpointsaretheonly


information required.However,it is possible
to calculatethevalueof thefieldvariableat
any point in the mesh. For example,the valueof hydraulicheadmay be requizedat a
pumpingwell.thatis notlocatedat a node.

6.1 LINEAR ELEMENTS

If the interpolationfunctionsfor an elementare definedusinga globalcoordinate


systemthe procedureis very simple. We first specifythe coordinatesof the point of
interestanddetem•e whichelementin themeshcontainsthepoint(If thepointfallson the
boundarybetweentwo elementseitherelementcanbe considered to "contain"thepoint
becausethe approximatesolutionis continuousfrom one elementto the next). Let
(x0,Y0,Zo) refer to the globalcoordinates
of the specifiedpointandlet e0 refer to the
elementthat containsthe point. The value of heador concentration at the point can be
obtained directlyfromtheapproximate solutions(seesection3.1)

fi(%)(xo,Y0,Z0)
= ZN?ø)(xo,Y0,Zo)hi
i=l
(6.1a)
n

•%)(xo,
Yo,Zo)
= N?ø)(xo,Yo,Zo)V
i=l
(6.1b)
n

•(%)(xo,
Yo,Zo)
= ZN?O)(xo,Yo,zo)Ci
i=l
(6.1e)

226

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter6 227

where
N?0)aretheinterpolation
functions
fortheelement
containing
thepoint,
nisthe
numberof nodesin elemente0, andhi, •i- andCi are the computedvaluesof hydraulic
head,pressurehead,andsoluteconcentrationat eachnodein elemente0.

Example

Given themeshshownbelowcomputethevalueof pressurehead• at pointsA andB.

(5,5) (•5,5)
3 5
node

1 -5

j_ 1).
jI_
15,3)
(2)(•3,31:
2 -5
3 -8
4 -10
5 -12
1 2 4
(0,0) (5,0) (15,0)

We can computethe value of • at point A usingthe interpolationfunctionsfor either


element.
For element1 (seeFigure4.6):

N?(5,3)
= 2A1(e)(ai+bi(5
)+ci(3))
N•)(5,3)
= 2A(•
1)(aj+bj(5)
+cj(3))
N?(s,3)
= +bdS)
+cd3))
2A0)=5(5)= 25
aj = xkY
i -- xiYk = (5)(0)-0(5) = 0
bj = yk-Yi= 5-0= 5
Cj ----Xi-x k = 0-5 = -5
N?)(5,3)= 0 (why
?)
N?(5,3)
=2-•(0+5(5)-
5(3))
=0.4
N(k•)(5,3)
= 1- 0.40= 0.6 (why?)
¾0)(5,3)= 0(-5)+ 0.4(-5)+ 0.6(-8)= ":4.8

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

228 Step5: CalculateRequkedElementResultants

For element2 (seeFigure4.7):

N?--(2b(e)-s)(2a(e)-t!
4a(e)b
(•)

s(2a(e)-t)
2)-_ 4a(e)b
(e)

(k
2)= 4a(e)b(0
St

N?='(2b(e)-s)t
2b(e)= 15-5 = lO 2a(e)= 5-0 = 5
At pointA, x = 5, y = 3, s = 0, andt = 3

N?(0,3)
-- fl.0(lo)(5)
- 0)(5 -3)_-0.4
NJ2)(0,3)
= 1-0.4= 0.6 (why
?)
•?(o,3) = •)(o,3) = o
•(2)(0,3)
= 0.4(-5)+ 0(-10)+ 0(-12)+ 0.6(-8)= -4.8
We computethevalueof W at pointB usingthe interpolationfunctionsfor element2. At
pointB, x = 13, y = 3, s = 8, andt = 3

N?(8,3)
= (•0- 8)(5
- 3)
''(•0)(5) ' = 0.08

N?(8,3)
= 8(10-3)
'(•o)(5)
= 0.32

N?(8,3)
= 4(5/2)(5)
8(3) = 0/,8
N?(8,3)
= (10- 8)(3) --0.12
' (10)(5)
•(2)(8,3)= 0.08(-5)
+ 0.32(-10)
+ 0.48(-12)
+ 0.12(-8)= -10.3
If theinterpolationfunctionsfor anelementaredefinedusinga localcoordinate
system
thesameprocedure is usedbuttheapproximate solutionis givenby

[(•(•,qo,•o)
--ZN?ø)(•o,qo,•o)hi
i=l
(6.2a)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
6 229
n

(6.2b)
i--1

= i=l
(6.2c)

wher•(•,q0,•o)arethelocalcoordinates
of thespecified
point.
Example
Compute thevalueof soluteconcentration
at pointA for theisoparamcwic,
linear
quadrilateral
elementshown belowin thelocal(E,q)coordinate system.Thelocal
coordinates
of pointA are(2/3,1/3)
4 3
(1,1)

Ci

q
L A
-.•
i
1
2
(mg/L)
100
75
3 80
4 95

1
(-1,-1) (1,-1)

Theinterpolation
functions
for thistypeof element
arcin Figure4.10. Usingequation
6.2c we have

(Notethatthesameresults
couldbeobtained
by usingtheinterpolation
functions
for the
linearrectangle
clementin Figure4.7).
If thecoordinates
of thespecified
pointaregivenin a globalcoordinate
system
andthe
interpolation
functions
for theelementcontaining
thepointaredefinedusinga local
coordinate
system,a coordinate
transformation
isrequired
toobtainthecoordinates
of the
specified
pointin thelocalcoordinate
system
eo= ft(xo) (6.3a)
•o = f2(Yo) (6.3b)
• = f•(zo) (6.3c)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

230 Step5: Calculate


RequiredElementResultants

where
fl, f2,andf3arethecoordinate
transformation
equations.
Oncethevalues
of•0,
and•0 are
obtained
equation
6.2can
beused
toobtain
thevalue
of •, •, or• atthe
specified
point.Unfortunately,
obtaining general
coordinatetransformationequations
for
manytwo-,andthree-dimensional isoparametric
elements is difficultbecause
the
interpolation
functions
are nonlinear.Thisapproach is seldomusedin practice.If
isoparametric
elementsareused(andif theshape
oftheelementswillbehighlydistorted)
it
is recommended
thattheanalyst

I) insures
thatnodalpointsareplacedatanyspecial
pointsof interest,
and
2) usesa largeenough
number of nodalpointssothatcontourlines,streamlines,etc.
canbedrawnusingonlythecomputedvaluesof thefieldvariableat thenodes.
Thesecond
typeof element
resultant
wewillconsider
istheaverage
valueof thefield
variablewithin an element. This informationis needed,for example,when solving
unsaturated
groundwater
flowproblems.Forunsaturated
porousmedia,thecomponents
of hydraulic
conductivity
andspecific
moisture
capacity
arefunctions
of thepressure
head,

K = K(•') (6.4a)
C = C(•) (6.4b)

Weusually
assume
thatthevalueof hydraulic
conductivity
andspecific
moisture
capacity
are constantwithinan elementbut can vary from oneelementto the next. A typical
procedureis tocomputeanaverage valueof pressureheadforeachelementandthenuse
thisaveragevaluetoobtaina valueof K(•) or C(•). Theaveragevalueof pressure
head
within
element
e,•e) isgiven
by

1I•(e)/ix
dy
dz
_ I N?(x,y,z)v
i (ixdydz (6.5)
v(e) \i =1

where
V(e)isthevolume
ofelement
e. Similar
equations
canbewritten
forone-andtwo-
dimensional elements.
Evaluating theintegralin equation
6.5 forisoparametric
elements will usuallyrequire
numericalintegrationand the procedures of Chapter4 can be usedfor thispurpose.
However,aslongastheelementshapeis nothighlydistorted andif pressureheadis not
changing
rapidlywithintheelement anacceptable approximation
toequation 6.5is given
by
1
•(•)• • XVii--1
(6.6)
wheren is the numberof nodesin elemente. Equation6.6 assignsequalweightto the
valueof •l/at eachnode.Fortwotypesof elements, thelinearbarandlineartriangle,the
resultsobtained by equations
6.5 and6.6 will beidentical.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
6 2;31

Example
Compute
theaverage
value
of •, • fortheelement
shown
below
using
equations
6.5
and 6.6

¾i=-1 (e) ¾J
=-1.8
! j
x•=• x•=•
The one-dimensional
formof equation
6.5 is

•e)_-L1(e)•,i=
1N?(x)V•

=L=•x!)
(N{e)(x),i
+N•C)(x)w'j)
ß

dx
==+.,;i,{rx,.,-
.,.
_
_ •I f{(3-x +(X-1)(_l.8)}dx
z )(-1)
1 -•.+ - 0.9x
+0.9dx
-- • (-0.4x- 0.6)dx

, [_o½.,I''
= • --------o.dx = • (-t.8- •.8+0.2+o.d)= :t.4
1

Usingequation6.6 we have
1
,•) = • (-1+(-,...8))
= -'1.4
Example
Compute
theaverage
valueof •, • fortheelement
shown
belowusing
equations
6.5
and 6.6
•/•,= -5.5 •/ j = -6
(3,8) (8/.s)

YL,,•,,¾i
x
---5 d• (3,2)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

232 Step5: Calculate


Required
Element
Resultants

The two-dimensional
formof equation6.5 is

•t{c)
=•-•IA(•)
N?)(x,y)llti
dx
dy
_ 1(I.•,•
'N?)(x,y)•
idx
dy+
la,,•,
N•jO(x,y)•j
dx
dy+
la,,•,
l•)(x,y)•k
dx
dy)
Performingthe integrationsoneat a time usingthe integration
formulasfor the linear
triangleelementdescribed
in Chapter4 we have

and
1
•) = •. (-25- 30-27.5)
= -5..__•5

Usingequation6.6 we have

(-5- 6- 5.5)= --5.5


Thethirdtypeof element resultant
thatwewill needtocompute is thederivativeof the
fieldvariableat a specified
pointwithinanelement.In groundwater fiow problems the
derivativesof hydraulicheador pressureheadareneeded to compute thecomponents of
apparent groundwater velocityusingDarey'sLaw. The velocitycomponents canthenbe
usedto drawstreamlines, showing thedirectionandmagnitude of apparent groundwater
velocitythroughout themesh.In a solutetransportproblem,thecomponents of apparent
groundwater velocityareneededto computetheelementadvection-dispersion matrices.
Derivativesof soluteconcentration
canalsobeusedtocompute thecomponents of solute
flux althoughthisisrarelydonein practice.
Thecomponents
of apparent
groundwater
velocityarecomputed
usingDarey'sLaw
which can be written

vx= -Kx•'• (6.7a)


•h
Vy= -Ky• (6.7b)
v, -- -K2• (6.7c)

for saturated flow and

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
6 233

for.unsaturated
flow. In equation6.8 it assumed
thatthe z axisis directedvertically
downward.Remember thathydraulic
head-- pressure
head4-elevationhead

h= • +z (6.9)
wherethe elevationheadz* is definedwith respectto an arbitrarilyplaceddatum
(AppendixI). In unsaturated
flowin a horizontal
direction
(inourcasein theplaneof the
x andy coordinateaxes)equation
6.8aisobtained
fromequation6.7a
•}h •h
v• = -K• = -K•(V)•

=-K,(•)•(•+
Z'•O
=-K•
(•)-•x•
Similarly
forVy.Since
thezaxis
isdirected
vertically
downward
.•. = 1and ,

v,=-r,,(¾)•(•
+

Once
wehave
computed
thevalues
ofhydraulic
head orpressure
head
foreach
node
inthe
meshwecancompute thederivatives
of headat anyspecified
pointin themesh.Let
(x0,Y0,Z0)
refertothecoordinates
(inaglobal
coordinate
system)
ofthespecified
pointand
lete0refertotheelement
thatcontains
thepoint.Thevalues
ofthederivatives
ofheadat
thespecified
point
canbeobtained
byevaluating
thederivatives
oftheapproximate
solution
(equation
6.1)atthepoint.Forhydraulic
headtheapproximate
solution
Is
!1

fi(%)(xo'Yo'Zo)
= Z N(?(xo'Yo'Zo)hi
i=l

(6.9)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

234 Step5: Calculate


Required
Element
Resultants

The derivatives
aregivenby

•[t
(•(X0'Y0'-u)=
'c3x_•..,[•N?
ø)
cqx •N(neo
)(xo'yo'zo)J
'][
(x0'Y0'Z0)
....
c3x I (6.10
•)•(• [øqN?ø)
'3y(x0'Yø'Zø)
&N•O
) ]{
= 3y (xø'Yø'Zø)
.....3y"(xø'yø'zø) (6.10b)

'• (xo,Yo,•o•
= •z (xo,Yo,Zo)'"
i)z (xo,Yo,Zo) (6.10c)

Similarexpressions
canbe writtenfor thederivatives
of pressure
head

•'(• [•(•)
(xo,yo,%)
--•r4(n•)
3x (xø'Yø'Zø)
= ' 3x
]{ ' •)x'(xø'Yø'Zø) (6.11a)

•y (xo,Yo,Zo)
= "•y (xo,Yo,Zo)
'" •)y(xo,Yo,Zo) (6.1lb)

•)3z (xø'Yø'Zø)
'•z
[
= •(•(xo,yo,zo)
"' (xo,yo,zo) (6.•
•c)
Thecomponents
of apparent
groundwater
velocityatthespecified
pointaregivenby

v(?(xo,Yo,Zo)
=-K•ø)•)x(xo,Yo,Zo) (6.12a)

•(xo,
Yo,Zo)
=-K(?
a•7
(xo,Yo,Zo) (6.12b)
v('-•(xø'Yø'Zø)
=-Kiz•o•(xø'Yø"•) (6.12c)
for saturated flow and

v•(xo,yo,zo)
(%)
= -Kx (•) c3X'
(xo,Yo,Zo) (6.13a)

v?(xo,Yo,Zo)
=-K(?(•)
•)y(xo,Yo,Zo) (6.13b)
v(-%)(xo,Yo,Zo)
=- z •'•)•.- . 1)
3z•'xø'Yø'Zø)+ (6.13a)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
6 235

forunsaturated
flow,
where,
forexample,
v•ø)(Xo,
Y0,z0)isthecomponent
ofapparent
groundwater
velocity
in thex coordinate
direction
atthepoint(x0,Y0,Z
0) withinelement
e0.
Thesaturated
andunsaturated
hydraulic
conductivities
havealsobeensuperscripted
withe0
because
theycanvaryfromoneelement
tothenext.Theuseofequations
6.10to6.13is
illustrated
by thefollowingexamples.

Example
Compute vxatxo= 2.5½mfortheelement
shown
below.LetKx -- 0.02era/d,hi -- 1
cm,andhj-- 1.6cm

i (%) .xo .}

Theone-dimensional
formof equation
6.10ais(fora two-node
element
n = 2)

ax"(xo)
=Lax(Xo)ax(xo)J
t h•

Forthistypeof element
( seeFigure4.5)

8• %) 1 1
ax(Xo)=-L(
• TM-•
i)l•j
eø) 1 1
ax(xo)=L(•= •
8x (2.5)= -•. i]{I =o.,
and

v?)(Xo)
= v(? = -(0.02)(0.3)
= -O,006cm/d

Thenegative
valuemeans
thatflowisinthenegative
x dizection
(totheleftin thefigure).

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

236 Step5: Calculate


Required
Element
Resultants

Example
Compute vxandvyatxo= 5 andy0= 7 fortheelement
showbelow.LetKx = 0.03
cm/dandI• = 0.015cm/d.
¾k---5.5 ¾j = -6
•,•) •8,_8)

(5,7)•

•' (3,2)
¾i =-5

The two-dimensional
formsof equations
6.10aand6.10bare

8x 8x (xo,Yo)

xo,,o,j{
Forthistypeof element.(see
Figure4.6 andtheexamplefollowingequation
4.25)

bk 6
2A(%) 30
Ck 5

•)y = 2A(•=-3'• '•)y' = 2A(eO) •)y 2A(•

3h(•(5,7,=
•)x
[•0][0
6--6]
•.5= -• = -0.01o

and
8y(5,7)= [-5o 5]-•.5=-T6'
=-o.083
v•ø)(5,7)
= v?) =-(0.03)(-0.100)= 0.0030
em/d
v•eø)(5,7)
= v(?
) = -(0.015)(-0.083)
= 0.0013
cm/d
Thepositive
values
meanthatflowisinthepositive
x andy directions
(upandtotheright
in thefigure).

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter6 237

6.2 ISOPARAMETRIC ELEMENTS

Note thatfor the two typesof elementsin the previousexamplesthe components of


apparentgroundwater velocitywithintheelementswereconstant (didnotvaryfrompoint-
to-pointwithin the element). This is so becausethe derivativesof the interpolation
functions
for thesetypesof elements arenotfunctionsof eitherx or y.
Forisoparametric elements, thevaluesof thederivativesof headat a specifiedpointin
thelocalcoordinate
system
(E0,TI0,•0) canbeobtained
byevaluating
thederivatives
of the
approximatesolutionat the point. The derivatives(with respectto the local coordinate
ciixecfions)are

o• (e-o,qo,•o)--
o•e'(•,TI0,•0)'"o• (e0,q0,•0 (6.14a)

ø••(•,q0,•0)
[ø•N•'" c3•!•(E0,TI0,
= •rl'(eø'T!ø'•0) (6.14b)

c3•(•
)(•,TI0,•0)
=[•)N?O) •)N(neo)
8{'(eo,qo,•)"'
for hydraulicheadand
][
3{(•ø'qø'{ø)J
t (6.14c)

at•(eo•1o{o)
= 3• (•0'TI0'{0)"'
3• (Co,q0,{0 (6.15a)

(•
• '(eø'qø'{ø)=
[81•1e•
•N?O
) )]{
!1
'3q (eo,qo,{o)'"
3q'(•,qo,{o: (6.15b)

a• (eo,qo,{o)
= a{ (eo,%,{o)--.
a{ (co,no,go (6.•5c)
for pressure
head.To obtainthevaluesof thederivatives
for thepointin theglobal
coordinatesystem,a coordinate
transformation
can be used(seeChapter4). The
coordinate
transformation
equations
are

a• (eo,qo,•o)

ay(eo,qo,{o)
TM
W•(eo'qo'•o)]
• (eo,•o,•o)
3xl 3x3 nxl
(6.16)
for three-dimensional elements,

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

238 Step
S: Calculate
Required
Element
Resultants

ax
½eo,qo•}.
= [aN?O•. aN(?
Ifh'l
•}y
(e0..,]
[J-]
2xl
(eo'qø)] 2x2 2xn
'
nxl

for two-dimensional
elements,
and

._•(eOjf
_--
[j-I(F.o)]
•)•(F.o)
.....•)•(F.o) (6.•8)

lxl lxl lxn nxl

for one-dimensionalelements.

For unsaturatedHow we have

¾1

= ff'•(eo,
'qo,
•o)]
8y(eo.qo.•o)
'-•-(eo.qo.•o)
3x3
(6.19)
for three-dimensional
elements,

•h•(•O ,
'Sx
(eo,qo][ (6.20)

a•
2xl

for two-dimensional
elements,
and

ax(eø)œ
=['r-'(eo)]{
aN?")
a•(•)'"aN?)
a• ll'V
(6.21)

lxl lxl /
lxn nxl

for one-dimensionalelements.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter6 239

The entriesof the JacobJan


matrix[l] aregivenin equations
4.32, 4.35, and4.3? for one-,
two-,andtlh-ce-dimensional
elements,
respectively.
Theentries
in [•.1]canbecomputed
usingtheequations
in AppendixIV.
Thecomponents of apparent
groundwater
velocityat thespecified
pointaregivenby

(6.22a)

(6.22b)

(6.22c)

for saturated flow and

v•i•o,•o,r,o):-K•økV)
ax(eo,qo,r,o) (6.23a)

(6.23b)

v•(•o,•o,•o)
=-K?økV)(
az(•oao,•o)+
•) (6.23c)

forunsaturated
flowwhere,
forexample,
v(?
) (e0,
q0,•0)isthecomponent
ofapparent
groundwater
velocity
in thex coordinate
direction
atthepoint(eo,qo,•)withinelement
e0.
For two-dimensional elements we have

(6.24a)

(6.24b)

(6.25a)

(6.25b)

for unsaturated flow. For one-dimensional elements we have

,ax (•o) (6.26a)

for sauwated flow and

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

240 Step5: Calculate


Required
Element
Resultanu

(6.26b)

for unsaturated flow.


Theuseof equations
6.14to 6.26isillustrated
bythefollowingexamples.

Example
Compute
vxand
vyat --•, •i = and
at(•---0,•i --0)fortheelement
show
below.
LetKx--0.03cm/dandICy--0.015cm/d.
7 6 5
node x y h(cm)
1 2 2 10.0
2 7 2 9.0
3 12 2 8.0
•4 4 12 5 8.4
5 12 8 8.7
6 10 8 9.0
7 7 8 9.6
8 1 4 10.2

Theinterpolation
function
derivatives
for thistypeof clementaxein Figure4.11. At the
point (• = 1/2, •1= 1/3) thederivativesax•

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter6 241

(-1) 2(-1)
2 +(-1)(-1) =4-•
aN2,
aq -- (?)1- ----
8

-• = • 1+(1) 2(-1)
2 +(-1)(1) = 1'•*
•N4
oq --- («I1+(1)
/«)]=-•1
•)N•
'•- __I (1)/1•)][
•[•+ 2(1)2/«/+
(1)(1)/«)]
=7_
16
•-=T •- =•

"•q=• 1+(-1) 2(1)2(•-)+(1)(-1)


48
•1 =- •' 14-(-1) =-•

The$acobian
matrixat thepointis givenby equation
4.36

:_!! _4_.
[J(11)]
•'• = • 3
391 99
1 ?

= [4.556
0.444]
L 1.396 3.167J

and

,,1 [--0.101
(:.5)]
__ 0.330.1

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

242 Step
5: Calculate
Required
Elem•tResultams

Usingequation6.17 we have
0.•3
L0
t.0
1.4
1.7
L0
•.6
D.2

: [-0.101 0.33011,0.065J: 0.091J


and

At thepoint(e = 0, q = 0) thederivatives
are

8N1 •)N2 o•N3 •)N4


'Be : 0 ,• : o ae :
•N 7 8Na 1
' --- 0
'ae" : -•
ON• 1 a•
• = 0 •T- = -E & = 0
8Ns 1 •}N7 8N8
-•-= 0 ae : -•-= 0 8e = 0
TheJacobian
matrixat thepointis
2 2

[J(0,0)]
= 0o-1/2
o 0o 1/2
o 1/2
0 0 o 00-10/21
12
12

: Fs.so
o.so
1
L •.5o 3.ooj
and

g 0.190-0.032]
[j-l(o,o)]
=L-0.0950.349.1

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
6 243

Usingequation6.17

ax
,(o,o)[
[0.190-0.0321F0
o
01/2 o o

a•('0 / = -0.0950.349]L0-1/2 o o Ol/2 o 8.7

-•y (o,o)] 9.0


9.6
10.2

_[ o.,o-o.o3211-o.,ool,
- -0.095 0.349][O.000J
0.086J=
and

v?o)(0,0)
-- -(0.03)(-0.171)
= 5.13
x 10
4 cm/d
v?(0,0)
---(0.015)(0.086)
-- 1.29
x10
-3cm/d
Example
Compute
vx,Vy,and
vzat(• = -1,•1-n1,• = 1)andat(• = 0,•l = 0,• = 0)forthe
element
shown
b•low.I.•t Kx= 0.01cm/d,
ICy= 0.02era/d,
andKa= 0.03cm/d.
8
node x y z h
I 3 205
5 210204
310503
4 3504
5 3266
610234
7 10 5 3 3
8 3564

Theinterpolationfunction derivatives
forthistypeof elemem
arein Figure4.13. At the
poim(• = -1,vl= 1,• -- 1)thederivatives
are
•N• 1
• -- -•. [1+(-1)(1)][1+(-1)(1)] -- 0
•)N2 1
• = E[•+(-•)(• )][•+(-•)(• )] = o
c')N3 1
•)e = •' [•+( • )(• )][1+(-•)(• )] = o
•---•œ1+(1)(1)][1+(-1)(1)] = 0
3N5 1
•- = -• [1+(-1)(1)][1+( 1)( 1)] = o
3N• 1
• = • [1+(-1)(1)][1+( 1)(1)] = o

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

244 Step
5: Calculate
Required
Element
Resultants

•tN7 1 1
'OE-- •'[1+(1)(1)][1+(1)(1)] = •,
3Ns 1 1
'a•=-• [1+(i )(1)][1
+(1)(1)]=-•
-•- = -• [1+(-1)(-1)][1
+(-1)(1)] = 0
•tN2 1
ß
• = -• [1+( 1)(-1)][1+(-1)(1)]
= 0
3N• 1
-•--- •[1.+(1)(-1)][1+(-1)(1)]
-- 0
aN4 1
o• = • [1+(-1)(-1)][1
+(-1)(.1)]
-- 0
aNs 1 1
-•- -- -*•[1+(-1)(-1)][1
+( 1)(1)] = --•
3N6 1
ß
•.---•[1+(1)(-1)][1+(1)(1)] = 0
aN7 1
• -- •[1+(1)(-1)][1+(1)(1)1
= 0
aN8 1 1
D• = • [1+(-1)(-1)][1
+( 1)(1)] = •
1
• -- -• [1+(-1)(-1)][1
+(-1)(1)] = 0
a•N2 1
• = -• [1+( 1)(-1)][1
+(-1)(I )] = 0
3N• 1
• =-•[1+(1)(-1)111+(1)(1)1
= 0
•)N4 1 1
-• - -• [1+(-1)(-1)111
+( 1)(I )1-- -•
dNs 1
• [1+ (-1)(-1)][1
+ (-1)(1)] -- 0
1
•. [1+( 1)(-1)][1+(-1)(1)] -- 0
c•N7 1
•[1+(1)(-1)][1+(1)(1)] -- 0
1 1
•[1+(-1)(-1)J[1+(1)(1)]
= •

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
6 245

TheJacobJan
matrixa•thepointis givenby equation
4.38
2O

5
000 0 0 0 1/2

-1/2]
5
[J(-1,1,1)1 ß= 0 0 0 0 -1/2 0 0 1/2
26
0 0 0-1/2 0 0 0 1/2

5
5

•3.500.00-1.50•
-- 13.00
0.00

[0.29 0.000.14]
0.670.00I
0.00 0.33J

Usingequation6.16 we have

,(-1,1,1)
FO.29
= [0.00 0.670.00
0.00000 001/2
0.14][0
/ 000 0
-1/2]
LO.OO 0.00 0.33J 0 0 0 -1/2
-1/2
0
0
0
0
0
1/2
1/2

(-1,1,1)

=
0.000.14]{-0.50]
0.29
0.00
o.6v
0.00o.oo {-0.15]
I o.ool
0.00 0.333
---1.00 =
O.00J

and

v(x•(-1,1,1)
= -(0.01)(-0.15)
= 1.250
x 10
-3cm/d
v(y%)(-1,1,1)
= -(0.02)(-0.67)
= 1.34
x 10
-2cm/d
v•O)(-1,1,1)
= -(0.03)(
0.00) = 0.00cm/d

At thepoint(e = 0, q = 0, • = 0) thederivatives
are

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

246 Step5: Calculate


Required
Element
Resultants

1
=-•
1
=-•*

1
=-•
1
= g

The lacobianmatrixat thepointis

3020
20

-1/8
1/8
1/8
-1/8
-1/8
1/8
1/8
-1/8]
50
(o,o,o)]: -1/8-1/8 1/8 1/8-1/8-1/8 1/8 1/8! 326
-1/8 -1/8 -1/8 -1/8 1/8 1/8 1/8 1/83
1023

and
3.50
0.00
-0.75]
0.00 1.50
o.oo o.oo
o.oo
2.25

0.29
0.00
0.10]
[•-'(0,0,0)1= 0.000.670.00!
0.00 0.00 0.44J

Usingequation6.16
'5

a•-•-(x•
(o,o,o}
-1/8
1/8
1/8
-1/8
-1/8
1/8
1/8
]
-1/8

(o,o,o) =10.00 0.670.00 I -1/8 -1/8 1/8 1/8 -1/8 -1/8 1/8 1/8
L O.00 o.oo 0.44J -1/8 -1/8-1/8 -1/8 1/8 1/8 1/8 1/8

a-•o,o,o}

0.29
0.00
0.10•
{-0.6251
-0.169]
0.000.670.00[-0.625•= --0.419•
0.00 0.00 0.441 0.125J 0.055J

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chnpter6 247

and

v?O(O,O,O)
= -(0.01)(-0.169)
= 1.69x 10-3cm/d
viy•(O,O,O)
=-(0.02)(-0.419)
= 8.38
x 10
-3cm/d
v(?(O,O,O)
= -(0.03)(
0.055
) = -1.65x 10-3cm/d
The previousexampleshaveshownthat,for sometypesof elements,the computed
components of apparentgroundwater velocityvaryfrompoint-to-point
withintheelement.
Thisis truefor thelinearrectangle element(because thederivativesof theinterpolation
functionsarefunctions of s andt, seeFigure4.?) andfor all theisoparametricelements
excepttheone-dimensional, linearbarelement (because
thederivatives
of theinterpolation
functionsarefunctionsof •, •1,and•, seeFigure4.9bto 4.15).
The previousexamples
havealsoshownwhy it is commonpractice,whenusing
isoparametric
elements,
tocompute
thecomponents
ofapparent
groundwater
velocities
at
the center of the element. When the derivauves are evaluated at the center of the element
((E -- 0), (• = 0, •1 -- 0), or (• -- 0, •1 -- 0, • -- 0) for one-two-, andthree-dimensional
elements respectively) thecalculations aregreatly simplified.
Expressions
givingthevalues
of thederivatives atthecenter of eachtypeof isoparametric elementarein Figures
4.9to
4.15.
Oncethecomponents of apparent
groundwater
velocityhavebeencomputed, the
magnitude
anddirection
of apparent
groundwater
velocity
canbecomputedandplottedfor
each element in the mesh.

Example
Computeandplot themagnitudeanddirectionof apparentgroundwater
flow for the
mesh shown below.
element v v
x y
I 2 -2
2 3 -1
3 3 0
4 3 1
/(2) ,/(4) 5
6
2
2
2
3
7 3 -1
$ 3 0
9 3 0
10 2 1
11 2 1
12 2 2

For element 1

v= +Vy
2= + = 2.83

•xx=tan-1 =-45.0'
where• isthemagnitude
of apparent
groundwater
velocityand0 is ananglebetween• and
x-axis. Plottingtheseat thecenterof theelementwe have

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

248; Step5: CalculateRequiredElementResultants

v=2.3

Theresultsfor theremainingelements
are

element

1 2.83 -45.0
2 3.16 -18.4
3 3.oo o.o
4 3.16 18.4
5 2.83 45.0
6 3.61 56.3
7 3.16 -18.4
$ 3 .oo o.o
9 3 .oo o.o
lO 2.24 26.6
11 2,24 26.6
12 2,83 45.0

whichar• ploRedbelow

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter6 249

Problems

Note: In thefollowingproblems,theunitsof nodalpointcoordinates


andhydraulichead
are centimeters.

1. Compute
vxfortheelements
shown
below
(K?--2cm/s,
K? -- 1.5cm/s).
node x h
1 (1) 2 (2) 3 1 -3 200
2 1 100
• ji j
3 2 50

2,
Computevxahd
Vyforthe
elements
shownbelow
(K?--K(x
2)--lcm/s,
K•I)-
- 1cm/s,
I••)--3cm/s).
3 4

"i k - nodex y h
1 2 2 10
2 10 2 9
3 6 6 9
4 24 6 8
1 2

,
Compute
h,vxandvyatpoint
A,B,and
Cforthe
element
shown
below
(K?--0.5
cm/s,
I• l)--2cm/s).
node or
2 4 point x y h

"•i
I k""j
A 1008
B 2
3 0
6 4
0 7
6
ß 4 6 4 5
(1) A 6 2 -
- ß B 3 2 -
, c c a o -

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

250 Step5: Calculate


Required
Element
Resultants

4. Compute
h,vxand
Vyatpoint
A forthe
elements
shown
below
(K?= 1cm/s,
K••)=
0.05
cm/s,
K?=0.•cm/s,r•2)=0.01cm/s).
2 4 node or
" - ' j point
1
x
1
y1 h
9

(1) A 2
3 7 51 10
1 8
4 7 5 7
i 5 12 1 6
i' A ? 3 -

5. Compute h, vxandvyatpointA, B andC fortheelement


shown
below(Kx = 0.05
cm/sr• = o.o•cm/s).
2 4 node x y h
' 1 0 0 10
2 2 6 9
3 8 0 9
8
A Be 4 8 6

i
I
=
C
' -
3
point
A
B
C
eq -1
0
0
0
0
-1

6. Computeh,vx andVyatnode5 fortheelements


shown
below(IQ = 0.05cm/s,and
Ky= 0.01cm/sforallelements).
node x y h
6 8 11 I 0 0 1
2 0 2 2
3 0 4 6
4 4 0 6
5 4 2 7
(3) )1o 6 4 4 8
7 6 0 7
8 6 4 9

(2) ,
9 8 0 8
10 8 2 9
11 8 4 10
4

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
6 251

7. Compute
h,vxandvyatpoint
A andBfortheelement
shown
below
(Kx= lcm/s,
Ky
-- 2 c'm/s).
node x y h
1
2 1.5 5.2 4
3 0 3.5 1
4 0 2.0 0.5
A 5 0 0 0
6 2 0 0.5
7 4 0 1
8
B

point
A 0 0
5 6 7 15 -1/2

8. Comp•te
h,vxand
vyatpoint
A(e=0,rl=0)forthe
clement
shown
below
(Kx=0.5
cm/s, = 1cm/s).
node x y h
1 2 2 2
2 4 2 2
3 6 2 2
4 8 2 2
5 10 2 2
6 8.5 3 3
7 6 5 4
8 3 3 2

9. Compute
h,vx,Vyandvzatpoint
A (e=0,•l =0,• = 0)andB(e = 1,•1= 0, • = 1)
fortheelement
shown
below
(Kx= Ky= Kz= 1cm/s).

node x y z h
1 4 0 0 2
2 4 2 0 2
3 0 2 0 6
4 0 0 0 6
5 4 0 2 2
6 4 2 2 2
7 0 4 2 6
8 0 0 2 6

z Y4

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

252 Step$: Calculate


Required
Element
Resultants

10. Repeatproblem9 if thevaluesof hydraulic


headare
node h node h
1 10 5 9
2 9 6 8
3 8 7 7
4 9 $ 8

11.Compute vx andVyfor eachelementshownbelowandsketchthemagnitudeand


direction
ofgroundwater
flowineachelement
(Kx=Ky= 1cm/sforallelements).
Hint: theinterpolation
functionderivatives
needonlybecomputed
for oneelement.

node x y h
3 6 9 12 1 0 0 8.6
2 0 3 9.2
3 0 6 10
4 4 0 8.2
5 4 3 8.5
11 6 4 6 9
7 8 0 7.8
8 8 3 7.5
9 8 6 7.8
10 12 0 6.8
11 12 3 7.8
1 4 7 lO
12 12 6 7.3

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 7

FINITE ELEMENT COMPUTER PROGRAMS

7.1 INTRODUCTION

In previouschapters,the stepsinvolvedin solvinga groundwater flow or solute


transportproblemby the finite elementmethodwere illustratedwith simplehand
calculationsfor mesheswith a very few nodesandelements.In practicewe will needto
solveproblems withmanyhundreds or eventhousandsof nodesandthisrequirestheuse
of a computer program.Implementing thevariousstepsof thefiniteelementmethodin a
computerprogramis notdifficult;a simpleprogrammayconsistof lessthana hundred
lines of code. However,as we increasethe versatilityof a particularcomputerprogram,
for example,by givingthe usera choiceof severalelementtypes,we will inevitably
increaseit's size. It is not uncommonfor programsto consistof severalhundred
thousands of lines of code. The programspresentedin this chapterwere developed
primarilyfor educational purposes butnevertheless containmanyadvanced features
that
makethemsuitablefor usein solvingmanyproblems encounteredin practice.Becausethe
programs arewrittenin a "modular" form(i.e.,thecomputations areperformedin a setof
sub-programs) thereaderwill findit easyto modifytheprograms or to useportions
of the
codeto developoth.•rprograms.The programsare writtenin FORTRAN-77 andwere
initially intendedfor use on microcomputers.However, they have successfullybeen
compiledon a variety of mini and mainframecomputersas well. Many arraysand
variablesaredefinedin theINCLUDE file "COMALL" (Figure7.1). By editingthisfile
the usercan adjustprogramdata requirements to matchthe memorycapacityof the
particularcomputerused.
An attempthasbeenmadeto chooseFORTRANvariablenamesthataresuggestive of
the variablesand symbx)ls usedin the text. Referencesare also given in the codeto
equation or figurenumbers in thetextasneeded to explaina computation orprocedure.
Five computerprogramsarepresented: GW1, GW2, GW3, GW4, andST1. Program
GW1 solvesthesteady-state, saturated groundwater flow equation.ProgramGW2 solves
the steady-state, unsaturated flow equation(neglectinggravitationaleffects). Program
GW3 solvesthe transient,saturated flow equation.ProgramGW4 solvesthe transient,
unsaturated flowequation (neglecting gravitational
effects).Program ST1solvesthesolute
transport equationfor steady-state,
saturated groundwater flow. All programs arecapable
of solving one-, two-, and three-dimensional problemsas well as problemswith
axisyrnmetry. Theprograms will accommodate upto thirteendifferentelementtypes.The
element
matrices
[K(e)],[c(e)],[A(e)],and[D(e)]arecomputed
in a setof subroutines.
Becauseof spacelimitationssubroutines
arenotprovidedfor all elementmatricesand
elementtypes. However,examplesof eachare includedand the readershouldhaveno
difficultyin codinga particular
subroutine
usingtheexamples
asa guide.

255
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

256 FiniteElement
Computer
Programs

C FILE "COMALL"

THIS FILE DIMENSIONS ARRAYS FOR THOSE VARIABLES SHARED


BY THE SUBROUTINES IN THE TEXT. WHEN THE SUBROUTINES ARE
COMPILED, THE STATEMENT
$INCLUDE: t COMALL t
THAT APPEARS IN EACH SUBROUTINE WILL DIRECT THE COMPILER TO
PROCEED AS THOUGH THE SPECIFIED FILE (COMALL) WERE INSERTED
AT THE POINT OF THE $INCLUDE (SOME COMPILERS MAY USE A
A SLIGHTLY DIFFERENT FORM OF THE INCLUDE STATEMENT). BY
CHANGING THE PARAMETER STATEMENTS IN THIS FILE THE USER CAN
EASILY MODIFY THE SUBROUTINES FOR USE ON ANY COMPUTER SYSTEM.

DEFINITION OF PARAMETERS:

INF = UNIT SPECIFICATION FOR INPUT DATA FILE


OUTF = UNIT SPECIFICATION FOR OUTPUT FILE
MAX1 =MAXIMUMNUMBER OF NODES
MAX2 = MAXIMUM NUMBER OF ELEMENTS
MAX3 • MAXIMUM NUMBER OF NODES PER ELEMENT
MAX4 • MAXIMUM NUMBER OF MATERIAL SETS
MAX5 = MAXIMUM NUMBER OF MATERIAL PROPERTIES PER MATERIAL SET
MAX6 • MAXIMUM VALUE OF SEMI-BANDWIDTH
MAX7 • MAXIMUM NUMBER OF DIFFERENT TIME STEP INCREMENTS
MAX8 = MAXIMUM SIZE OF MODIFIED GLOBAL CONDUCTANCE MATRIX IN
VECTOR STORAGE

**********************************************************************

REAL M, B1
INTEGER OUTF, DIM, ELEMTYP, SBW, E, DTSTEP
LOGICAL SYMM
CHARACTER*20 LABEL1, LABEL2
PARAMETER (INF=5, OUTF=6)
PARAMETER (MAX1•200 ,MAX2=200 ,MAX3=32, MAX4=200 ,
MAX5•32, MAX6=200, MAX7•20, MAXS=40000 )
COMMON/COM1/ DIM, NUMNOD,NUMELM, NUMMAT, NUMPROP,
NDN,NNN,NDOF, SBW,ICH (MAX1) ,LCH (MAX1),
X (MAX1), FLUX (MAX1), B (MAX1), X1 (MAX1),
X2 (MAX1), X3 (MAX1), SYMM,LABEL1, LABEL2
COMMON/ COM2/ IN (MAX2,MAX3), ELEMTYP(MAX2), V1 (MAX2),
V2 (MAX2), V3 (MAX2)
COMMON/COM3/ MATSET(MAX2) ,PROP (MAX4,MAX5)
COMMON/TFUNC/ FC (MAX1) ,DTSTEP (MAX7) ,DELTAT (MAX7),
TIME (MAX7), GT (MAX7), OMEGA,OMOMEGA,
MXSTEP, T, IDT, IGT, IGTDT
COMMON /GLOBAL/ M (MAX8)
COMMON /GLOB/ BI(MAXS)

Figure 7.1 Source code listing for COMALL.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
7 257

7.2 STEADY.STATE, SATURATED GROUNDWATER FLOW,


PROGRAM GW1

The stepsusedto solvethe steady-state,


saturated groundwater How equationby the
f'miteelementmethodweredescfibeA in Part1. Thecomputer programGW1 implements
thesestepsin a setof eightFORTRAN subroutines: NODES, ELEMENT, MATERL,
BOUND, ASMBK, DECOMP, SOLVE, VELOCITY, and DUMP. The operations
performedby eachsubroutine are describedbriefly in the sourcecodelistingfor GW1
(Figure7.2); detailedinformationabouttheseoperationsis containedin subsequent
chapters(e.g.,theoperations
performedby subroutine NODES aredescribed in Chapter
8). Thirteendifferentelementtypesareprovided(seeChapter12). Materialproperties
(i.e, thecomponents of saturatedhydraulicconductivity)canbe differentfor eachelement
in the mesh(seeChapter10). Both Dirichlet(specifiedhydraulichead)andNeumann
(specifiedflow) boundaryconditions canbe prescribed.Hydraulicheadis computedat
eachnodeandthecomponents of apparent
groundwater velocityarecomputed at thecenter
of eachelementin the mesh. ProgramGW1 readsthe problemdescription(i.e., node
numbers andcoordinates,elementnumbers, etc.)froma singleinputfile. Thisinformation
is writtento an outputfile followedby computed valuesof hydraulicheadandapparent
groundwater velocity(Figure7.3). The components of apparent groundwater velocityfor
eachelementarealsowrittento an additionaloutputfile for usewith thesolutetransport
programST1 (seeSection7.6). Arraysandvariables canalsobewrittento additional user-
definedoutputfilesusingsubroutine DUMP (seeChapter15).

PROGRAM GW1
**********************************************************************
C THIS PROGRAM SOLVES STEADY-STATE, SATURATED
C GROUNDWATER FLOW PROBLEMS.
**********************************************************************
$ INCLUDE: ' COMALL '
DIMENSION XX (MAX1)
INTEGER HDF, VLF
LOGICAL LOOP
CHARACTER*20 INFILE,OUTFILE
CHARACTER*80 TITLE

SYMM - .TRUE.
LOOP -- .FALSE.
LABEL1 - ' HYDRAULIC HEAD '
LABEL2 - ' GROUNDWATER FLOW'
WRITE(*,10) ' ENTER THE NAME OF THE INPUT DATA FILE: '
lO FORMAT (A\)
READ (*,20) INFILE
2o FORMAT (A)
WRITE(*,10) ' ENTER THE NAME OF THE OUTPUT FILE: '
READ (*, 20) OUTFILE
OPEN ( INF, FILE-INF ILE)
OPEN (OUTF, FILE-OUTFILE, STATUS-- 'NEW' )
READ (INF, 20) TITLE
WRITE (OUTF, 20) TITLE

1. INPUT NODE NUMBERS AND COORDINATES

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

FiniteElemen•
Computer
Programs

READ ( INF, *) DIM


CALL NODES

2. INPUT ELEMENT NUMBERS, TYPES, AND NODE NUMBERS

CALL ELEMENT

3. INPUT MATERIAL PROPERTIES FOR EACH ELEMENT

CALL MATERL

4. INPUT BOUNDARY CONDITIONS

CALL BOUND

ASSEMBLE AND MODIFY THE GLOBAL SYSTEM OF EQUATIONS

CALL ASMBK

6. SOLVE THE SYSTEM OF EQUATIONS

CALL DECOMP(NDOF, SBW,SYMM,M)


CALL SOLVE (NDOF, SBW, SYMM,M, B, XX)

7. WRITE OUT COMFUTED HYDRAULIC HEAD VALUES

WRITE (OUTF, 30) LABEL1, LABEL1


30 FORMAT(//70('*')//16X,'COMPUTED VALUES OF ',A/
16X, 39('-')//19X,'NODE NO.•,10X, A/)
J=0
DO 50 I = 1, NUMNOD
IF (ICH(I) .EQ. 0) THEN
J= J + 1
X{I) - XX{J)
ENDIF
IF (ICH(I) .EQ. 0) THEN
WRITE(OUTF, 40) I,X(I),' '
ELSE
WRITE(OUTF, 40) I,X(I),'*'
ENDIF
40 FORMAT ( 19X, I5, 12X, F15.4, A)
50 CONTINUE
WRITE (OUTF, 60)
60 FORMAT (/40X, '* = SPECIFIED VALUE' )
c
c 8. COMPUTE GROUNDWATER VELOCITIES FOR EACH ELEMENT
c
CALL VELOCITY

9. WRITE OUT CONTENTS OF ARRAYS (IF REQUESTED)

CALL DUMP (LOOP, HDF, VLF)


END

Figure 7.2 Source code listing for program GW1.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
7 259

INPUT FILE OUPUT FILE # 1

Problem Tifie ProblemTitle


Inputfor NODES OutputfromNODES
InputforELEMENT øu•ut•om•eMe•
InputforMATERL OutputfromMATERL
Inputfor BOUND Output
fromBOUND
Inputfor DUMP Output
from
AsMBK
(Optional) OutputfromSOLVE
output
from
vELocrrY

OUTPUT FILE #2

v.ocrr¾I
(for usewith ST1)

OUTPUT FILE #3, #4, #5 ....

[ OuuomD
(foruseinPlotting
software)

Figure7.3 Input and outputfile structurefor programGW1.

Theuseofprogram GW1isbestillustratedwithanexample. Themesh in Figure


7.4
is beingusedto solvea two-dimensional(planview)groundwaterflowproblem in a
confined aquifer.Theaquifer
consistsof twotypesof material:
siltysandandsandy
gravel.Aquiferrechargeisoccurring
along theconstant
headboundaryandgroundwater
is beingpumped fromtheaquifer
ata singlewell. All otherboundaries
areconsidered
impermeable.TheinputandoutputfilesareinFigures
7.5and7.6.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

260 FiniteElement
Computer
Programs

sandygravel siltysand

Low permeability
basalt
(No flow boundary)
Nodal coordinates are in kilometers
Forsandy gravel
Kx = Ky= 1m/day
ForsiltysandKx= Ky= 0.1m/day
ForwellQ = 5 m3/day
(discharge)

Figure 7.4 Exampleproblemfor program GW1.

EXAMPLEPROBLEMFORPROGRAMGW1 (SEEFIGURE7.4)
2 (ProblemDimension) Problem
Title
1 1 3o00 5000 (Node Coordinates)
4 1 18000 5000
5 1 5000 10000
8 1 20000 10000
9 1 2000 17000 Inputfor NODES
12 1 21000 15000
-1 -1 -1 -1
I 6 1 5 6 10 9 (ElementNode Numbers)
3 6 1 7 8 12 11
4 ..6 1 1 2 6 5 Inputfor ELEMENT
6 6 1 3 4 8 7
-1 -1 -1 -1 -1 -1 -1

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
7 261

1 1 (ElementMaterial Set Numbers)


2 2
3 2
4 1
5 2
Inputfor MATERL
6 2
ol -1
2
1 1 1 (ElementMaterialProperties)
2 .1 .1 (SaturatedHydraulicConductivities)
1 125 (SpecifiedHeadBoundaryConditions)
5 125
9 125
Inputfor BOUND
-1 -1
7 -5 (Specified
FlowBoundary
Conditions)
-1 -1
-1
Input
forDUMP

Figure 7.$ Example input file for program GW1.

EXAMPLE PROBLEM FOR PROGRAM GW1 (SEE FIGURE 7.4)

NODE NODAL COORDINATES


NUMBER X Y

1 3000.0000 5000.0000
2 8000.0000 5000.0000
3 13000.0000 5000.0000
4 18000.0000 5000.0000
5 5000.0000 10000.0000
6 10000.0000 10000.0000
7 15000.0000 10000.0000
8 20000.0000 10000.0000
9 2000.0000 17000.0000
10 8333.3333 16333.3300
11 14666.6700 15666.6700
12 21000.0000 15000.0000

ELEMENT ELEMENT
NO. TYPE NODE NUMBERS

6 5 6 10 9
6 6 7 11 10
6 7 8 12 11
6 1 2 6 5
6 2 3 7 6
6 3 4 8 7

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

262 FiniteElemen•
Computer
P•ograms

ELEMEN'r
NO. MATERIAL SET NUMBER

ELEMENT
SET NO. MATERIAL PROPERTIES

1.000000E+00 1.000000E+00
1.000000E -01 1.000000E -01

ELEMENT SPECIFIED
NO. HYDRAULIC HEAD

1 125.0000
5 125.0000
9 125.0000

NUMBER OF NODES W1TH SPECIFIED HYDRAULIC HEAD = 3

NODE SPECIFIED
NO. GROUNDWATER FLOW

7 -5.0000

NUMBER OF NODES wrrH SPECIFIED GROUNDWATER FLOW = 1

NUMBER OF DEGREES OF FREEDOM IN MODIFIED K MATRIX = 9.

SEMI-BANDWIDTH OF MODIFIED K MATRIX = 5

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter7 263

COMPU'I•D VALUES OF HYDRAULIC HEAD


....................... ., ......... .•....._...,...• ..... . ....... .•...., .......

NODE NO. HYDRAULIC HEAD

1 125.0000'
2 123.5652
3 108.8910
4 94.8066
5 125.0000'
6 122.0316
7 88.5567
8 97.6736
9 125.0000'
10 123.5305
11 106.4210
12 94.3300

* -- SPECIFIED VALUE

COMPUTED VALUES OF APPARENT GROUNDWATER VELOCITY

1 3.930606E-04 2.514829E-05
2 4.411657E-04 -8.783318E-05
3 1.816742E-05 -1.372678E-04
4 4.403232E-04 -2.276382E-05
5 4.814902E-04 2.608370E-05
6 4.967537E-05 1.548034E-04

Figure 7.6 Example output file from program GWl.

7.3 STEADY-STATE, UNSATURATED GROUNDWATER FLOW,


PROGRAM GW2

The computerprogramGW2 solvesthe steady-state, unsaturated groundwaterflow


equation(equation1.2) (Figure7.7). Theeffectof gravityis notincluded(although
it can
easilybe addedif necessary).The programis almostidenticalto GW1 exceptthat
subroutineINITIAL (seeChapter16) is usedto readin initialvaluesof pressureheadfor
eachnodein the mesh(Figure7.8) andPicarditerationis usedto solvethe systemof
nonlinearequations.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

264 FiniteElement
Computer
Programs

PROGRAM GW2
***********************************************************************
C THIS PROGRAM SOLVES STEADY-STATE, UNSATURATED GROUNDWATER FLOW
C FLOW PROBLEMS. SUBROUTINE ASMBK, KBAR2, KBAR3, ETC. MUST BE
C MODIFIED FOR USE IN UNSATURATED FLOW PROBLEMS
***********************************************************************
$ INCLUDE: ' COMALL '
DIMENSION XX (MAX1)
INTEGER HDF, VLF
LOGICAL LOOP, CONVRGE
CHARACTER*20 INFILE, OUTFILE
CHARACTER* 80 TITLE
DATA MAXIT/20/ , TOLRNCE/O . 01/

SYMM - .TRUE.
LOOP - .FALSE.
LABEL1 - ' PRESSURE HEAD'
LABEL2 - ' GROUNDWATER FLOW'
WRITE(*,10) • ENTER THE NAME OF THE INPUT DATA FILE:
10 FORMAT (A\)
READ (*, 20) INFILE
2O FORMAT (A)
WRITE(*,10) ' ENTER THE NAME OF THE OUTPUT FILE: '
READ (*,20) OUTFILE
OPEN (INF, FILE-INFILE)
OPEN (OUTF, FILE=OUTFILE, STATUS• 'NEW' )
READ (INF, 20) TITLE
WRITE (OUTF, 20) TITLE

1. INPUT NODE NUMBERS AND COORDINATES

READ (INF, *) DIM


CALL NODES

2. INPUT ELEMENT NUMBERS, •YPES, AND NODE NUMBERS

CALL ELEMENT

3. INPUT MATERIAL PROPERTIES FOR EACH ELEMENT

CALL MATERL

4. INPUT BOUNDARY CONDITIONS

CALL BOUND

5. INPUT INITIAL CONDITIONS

CALL INITIAL

6. BEGIN PICARD ITERATION

DO 40 ITER- 1, MAXIT

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter7 265

7. ASSEMBLE AND MODIFY THE GLOBAL SYSTEM OF EQUATIONS

CALL ASMBK

8. SOLVE THE SYSTEM OF EQUATIONS

CALL DECOMP(NDOF, SBW, SYMM, M)


CALL SOLVE(NDOF, SBW, SYMM, M,B, XX)
CONVRGE m .TRUE.
II • NDOF
DO 30 I m NUMNOD, 1, -1
IF (ICH(I) .EQ. 0) THEN

9. CHECK FOR CONVERGENCE

IF (ABS((X(I) - XX(II)) / X(I)) .GE. TOLRNCE)


i CONVRGE - .FALSE.
X{I) ', XX(II)
II - II - 1
ENDIF
30 CONTINUE
IF (CONVRGE) GOTO 50
40 CONTINUE
WRITE(OUTF, 20) ' *** MAXIMUM NUMBER OF ITERATIONS EXCEEDED ***'

10. WRITE OUT COMPUTED PRESSURE HEAD VALUES

50 WRITE (OUTF, 60) LABEL1, LABEL1


60 FORMAT(//70('*')//16X,'COMPUTED VALUES OF ',A/
16X, 39('-')//19X,'NODE NO.',10X, A/)
DO 80 I - 1, NUMNOD
IF (ICH(I) .EQ. 0) THEN
WRITE(OUTF, 70) I,X(I),' '
ELSE
WRITE(OUTF, 70) I,X(I),'*'
ENDIF
70 FORMAT (19X, I5, 12X, F15.4, A)
SO CONTINUE
WRITE (OUTF, 90)
90 FORMAT(/40X, '* = SPECIFIED VALUE' )

11. COMPUTE GROUNDWATER VELOCITIES FOR EACH ELEMENT

CALL VELOCITY

12. WRITE OUT CONTENTS OF ARRAYS (IF REQUESTED)

CALL DUMP (LOOP, HDF, VLF )


END

Figure 7.7 Source code listing for program GW2.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

266 FiniteElement
Computer
Programs

OL]TP• FILE #1
INPUT FILE Problem Title

Problem Title •3utput


frOrn
NODES
Inputfor NODES
,
Output
from
,
•.LEMENT
, • ,

Input
forELEMENT
• ,
OutputfromMATERL
Inputfor MATERL
GW 2
' Output
from
B'•)UND
'
Inputfor BOUND ' 6utput'from
INITIAL
Input for IN1TIAL Output
from
ASMBK
Input for DUMP Output SOLVi'
(Optional)
'Output
fromVELOCITY , ,,

OUTPUT FILE #2, #3 ....

"f' 6'u'tputfromDVM
1
Figure 7.8 Input and output file structure for program GW2.

The usermust modify the calculationof the elementconductance


matrix [K(e)]
performedin subroutines
KBAR2, KTRI3, etc. calledby ASMBK (seeChapter12).
Currently
thesesubroutines
usea singlefixed-value
of hydraulic
conductivity
readby
subroutine
MATERL (Chapter10) i.e.,

KXE= PROP
(•ATSET(E),1)
KYE = PROP (MATSET (E), 2)
KZE = PROP (MATSET (E), 3)
ß

These
stafements
willhave
tobemodified
tocompute
thefunction
Kx(Xl/),
Ky(Xl/),
and
Kz(W)aftereachiteration.The valueof pressure
headfor eachnodein themeshis
recomputed
attheendof eachiteration
andstoredin thearrayX. Theusercouldputthe
Kx(W),
K¾0g),andKz(•) functionsina subroutine
PSIK

CALLPSIK(E,•XE, KYE,KZE)

whereE is theelementnumber
andKXE, KYE, andKZE arethecorn up_Lt•_
valuesof
unsaturated
hydraulic
conductivity
for thatelement.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
? 26?

7.4 TRANSIENT, SATURATED GROUNDWATER FLOW, PROGRAM


GW3

Thecomputer program GW3 solvesthetransient, saturated


groundwater flow equation
usinga setof elevensubroutines:NODES, ELEMENT, MATERL, BOUND, INITIAL,
ASMBKC, RHS, DECOMP, SOLVE, VELOCITY, andDUMP (Figure?.9). Detailed
informationabouttheoperation of thesesubroutines is contained
in subsequent chapters.
ProgramGW3 readstheprogramdescription froma singleinputfile (Figure?.10). This
information
is writtento anoutputfile followedby computed valuesof hydraulicheadand
apparentgroundwater velocityat eachtimestep.Arraysandvariablescanalsobe written
to additional
user-def'medfilesusingsubroutineDUMP (seeChapter15). Exampleinput
andoutputfilesarein Figures?.12and?.13for themeshin Figure7.11. In theexample,
a singlewell is pumpingin a confinedaquifer(homogeneous andisotropic).The results
arecompared with theJacobapproximationto theTheisssolutionfor onepointin Figure
?.15. The codingof inputdatafor themeshin Figure?.14is left asanexercise.

PROGR3• GW3
**********************************************************************
C THIS PROGRAM SOLVES TRANSIENT, SATURATED
C GROUNDWATER FLOW PROBLEMS.
**********************************************************************
$ INCLUDE: ' COMALL '
DIMENSION XX(MAXl) ,V(MAX2, 3)
INTEGER HDF, VLF
LOGICAL LOOP
CHARACTER*20 INFILE, OUTFILE
CHARACTER* 80 TITLE
EQUIVALENCE (V1,V(1,1)), (V2,V(1,2)), (V3,V(1,3))

SYMM • .TRUE.
LOOP = .TRUE.
LABEL1 = • HYDRAULIC HEAD •
LABEL2 = • GROUNDWATER FLOW '
WRITE(*,10} • ENTER THE NAME OF THE INPUT DATA FILE:
10 FORMAT (A\)
READ (*, 20) INFILE
2O FORMAT (A)
WRITE(*,10) • ENTER THE NAME OF THE OUTPUT FILE: •
READ (*,20) OUTFILE
OPEN ( INF, FILE=INFILE)
OPEN (OUTF, FILE=OUTFILE, STATUS= •NEW • )
READ (INF, 20) TITLE
WRITE (OUTF, 20) TITLE

1. INPUT NODE NUMBERS AND COORDINATES

READ(INF,*) DIM
CALL NODES

2. INPUT ELEMENT NUMBERS, TYPES, AND NODE NUMBERS

CALL ELEMENT
C
C 3. INPUT MATERIAL PROPERTIES FOR EACH ELEMENT
C
CALL MATERL
C

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

268 FiniteElement
Computer
Programs

C 4. INPUT BOUNDARY CONDITIONS


C
CALL BOUND
C
C 5. INPUT INITIAL CONDITIONS
C
CALL INITIAL
C
C 6. WRITE OUT CONTENTS OF ARRAYS (IF REQUESTED)
C
CALL DUMP (LOOP, HDF, VLF)
C
C 7. INITIALIZE COUNTERS
C
IF (DIM .LE. 3) THEN
IDIM = DIM
ELSE
IDIM = 2
ENDIF
IDT • 0
IGT • 1
IGTDT -- 1

C
C 8. FOR EACH TIME STEP. . .
C
DO 90 ISTEP • 1, MXSTEP
C IF SIZE OF TIME STEP CHANGES REASSEMBLE GLOBAL MATRICES
IF (ISTEP .EQ. 1 .OR. ISTEP .GT. DTSTEP(IDT)) THEN
IDT • IDT + 1
C
C 9. ASSEMBLE AND MODIFY THE GLOBAL SYSTEM OF EQUATIONS
C
CALL ASMBKC
C
C 10. DECOMPOSE THE MODIFIED GLOBAL SYSTEM OF EQUATIONS
C
CALL DECOMP (NDOF, SBW, SYMM, M)
END IF
C
C 11. CALCULATE THE RIGHT HAND SIDE VECTOR FOR THIS TIME STEP
C
CALL RHS
C
C 12. SOLVE THE SYSTEM OF EQUATIONS AND OUTPUT NODAL VALUES
C
CALL SOLVE (NDOF, SBW, SYMM, M, B, XX)
WRITE (OUTF, 30) LABEL1, LABELi
30 FORMAT(//70('*')//16X,'COMPUTED VALUES OF ',A/
1 16X, 39('-')//19X,'NODE NO.',10X, A/)
J= 0
DO 50 I = 1, NUMNOD
IF (ICH(I) .EQ. O) THEN
J-- J + 1
X(I) = XX(J)
ENDIF
IF (ICH(I) .EQ. 0) THEN
WRITE(OUTF, 40) I,X(I),' '
ELSE
WRITE(OUTF, 40) I,X(I), '*'
ENDIF

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
7 269

40 FORMAT (19X, I5, 12X, F15.4, A)


IF (HDF .NE. 0) WRITE(HDF,*) I,X(I)
50 CONTINUE
WRITE (OUTF, 60)
6O FORMAT(/40X,'* - SPECIFIED')
WRITE (OUTF, 70) T
70 FORMAT(/19X,'*** RESULTS FOR TIME -',F7.2,' ***')
c
c 13. COMPUTE VELOCITIES
C
CALL VELOCITY
WRITE (OUTF, 70) T
IF (VLF .NE. 0) THEN
DO 80 I - 1, NUMELM
WRITE (VLF,*) I, (V(I,J) ,J-l, IDIM)
80 CONTINUE
ENDIF
90 CONTINUE
END

Figure 7.9 Sourcecodelistingfor programGW3.

OUTPUT FILE #1

INPUT FILE Problem Title


II I 1111

Problem Title OutputfromNODES


,

Inputfor NODES OutputfromELEMENT


Input
forELEMENT OutputfromMATERL
InputforMATERL
GW 3
Output
fromBOUND
Inputfor BOUND OutputfromiNITIAL

Inputfor INITIAL OutputfromASMBKC


InputforDUMP .. for fin'sttime step..
(Optional)
OutputfromSOLVE
OutputfromVELOCITY
.

.. for last time step.. ..

OutputfromSOLVE
OutputfromVELOCITY

OUTPUT FILE #2, #3 ....

Output
from
DUMP]
Figure7.10 Input and outputfile structurefor programGW3.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

2?0 FiniteElement
Computer
Programs

i ml i i i ii i ii i i

i• i ii

:,,•

..

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter7 271

EXAMPLE PROBLEM FOR PROGRAM GW3 (SEE FIG• 7.11)

2 (Problem Dimension)
1 1 0 0 (Node Numbers and
9 1 0 800 Coordinates)
10 1 0 1000
12 1 0 1400
13 1 0 1700
14 1 0 2000
15 1 100 0
23 1 lOO 800
24 1 100 1000
26 1 100 1400
27 1 100 1700
28 1 lOO 2000
29 1 200 0
37 1 200 800
38 1 200 1000
40 I 200 1400
,41 1 200 1700
42 1 200 2000
43 1 300 0
51 1 300 800
ß52 1 300 1000
54 1 300 1400
55 1 300 1700
56 1 300 2000
57 1 400 0
65 1 400 800

i83 i 200 '0


191 1 2000 800
192 1 2000 1000
194 1 2000 1400
195 1 2000 1700
196 1 2000 2000
-1 -1 -1 -1 (Element
1 5 1 1 15 16 2 Number,
13 5 1 13 27 28 14 Types,and
14 5 1 15 29 30 16 Node
26 5 1 27 41 42 28 Numbers)
27 5 1 29 43 44 30
39 5 1 41 55 56 42
40 5 1 43 57 58 44
52 5 1 55 69 70 56

Fi9ure continued

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

272 FiniteElement
Computer
Programs

$3 5 1 57 71 72 58
65 51 69 83 84 70
66 5 1 71 85 86 72
78 51 83 97 98 84
79 5 1 85 99 100 86
91 51 97 111 112 98
92 5 1 99 113 114 100
104 51 111 125 126 112
105 5 1 113 127 128 114
117 51 125 139 140 126
118 5 1 127 141 142 128
130 51 139 153 154 140
131 5 1 141 155 156 142
143 51 153 167 168 154
144 5 1 155 169 170 156
156 51 167 181 182 168
157 5 1 169 183 184 170
169 51 181 195 196 182
-1 -1 -1 -1 -1 -1 -1
1 1 (ElementMaterial Set
169 1 Numbers)
-1 -1
3
1 300 300 0.002
(Material
SetProperties'
Kx Ky Ss)
-1 -1 (No SpecifiedHeads)
1 -500 (SpecifiedFlow Rate)
-1 -1
1. (RelaxationFactor) -
10 .Ol (Time Steps)
20 .02
30 .04
40 .06
$0 .09
6O .14
7O .20
80 .30 _ Inputfor
INITIAL
9O .45
177 1
-1 -1
0 1 (Time Function)
100.1 1
-1 -1
1 o (Initial Conditions)
169 o
-1 -1
-1 (subroutine
Dumpnotused)

Figure 7.12 Example input file for program GW3.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
7 273

EXAMPLE PROBLEM FOR PROGRAM GW3 (SEE FIG• 7.11)

NODE NODAL COORDINA•S


NUMBER X Y

1 .0000 .0000
2 .0000 100.0000
3 .0000 200.0000
4 .0000 300.0000
5 .0000 400.0000
6 .0000 500.0000
7 .0000 600.0000
8 .0000 700.0000
9 .0000 800.0000
10 .0000 1000.0000
11 .0000 1200.0000
12 .0000 1400.0000
13 .0000 1700.0000
14 .0000 2000.0000

1•3 200010000 i0000


•n 2000.0000 •oo.oooo
• 2000.0000 200.0000
186 2000.0000 300.0000
187 2000.0000 400.0000
• 2000.0000 •00.0000
189 2000.0000 600.0000
190 2000.0000 700.0000
•9• 2000.0000 800.0000
192 2000.0000 1000.0000
193 2000.0000 1200.0000
! 94 2000.0000 1400.0000
195 2000.0000 1700.0000
196 2000.0000 2000.0000

ELEMENT ELEMENT
NO. TYPE NODE NUMBERS

5 1 15 16 2
5 2 16 17 3
5 3 17 18 4
5 4 18 19 5
5 5 19 20 6

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

274 FiniteElement
Computer
Programs

ELEMENT ELEMENT
NO. TYPE NODE NUMBERS

6 5 6 20 21 7
7 5 7 21 22 8
8 5 8 22 23 9
9 5 9 23 24 10
10 5 10 24 25 11

•o 1:721•6 1}7 1:73


161 5 173 187 188 174
162 5 •74 •88 •89
163 5 •75 •89 •9o
164 5 176 190 191 177
165 5 177 191 192 178
166 5 •78 •92 •93 •79
167 5 •79 x93 •94
168 5 •80 •94 •9• •8•
169 5 •8x •9• •96 •82

ELEMENT
NO. MATERIAL SET NUMBER

1
2
3
4
5
6
7
8
9
lO

1•i2
163
164
165
166
167
168
169

ELEMENT
SET NO. MATERIAL PROPERTIES

1 3.000000E+02 3.000000E+02 2.000000E-03

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
7 275

NUMBER OF NODES WITH SPECIFIED HYDRAULIC HEAD = o

NODE SPECIFIED
NO. GROUNDWATER FLOW

-500.000

NUMBER OF NODES WITH SPECIP•D GROUNDWATER FLOW = 1

OMEGA = 1.oooo

START END DELTA T

1 10 .0100
11 20 .0200
21 30 .0400
31 40 .0600
41 50 .0900
51 60 .1400
61 70 .2000
71 80 .3000
81 90 .4500
91 177 1.0000

TOTAL TIME = 100.1000

• T G(T)

.oooo 1.oooo
lOO. lOOO 1.oooo

COMPUTED VALUES OF HYDRAULIC HEAD

NODE NO. HYDRAULIC HEAD

1 .0000
2 .0000
3 .0000
4 .0000
5 .0000
6 .0000
7 .0000

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

276 FiniteElementComputer
Programs

COMPUTED VALUES OF HYDRAULIC HEAD

NODE NO. HYDRAULICHEAD

8 .0000
9 .0000
lO .oooo

.ooo
191 .0000
192 .0000
193 .0000
194 .0000
195 .0000
196 .0000

* = SPECIFIED VALUE

NUMBER OF DEGREES OF FREEDOM IN MODIFIED,


GLOBAL COMBINED CONDUCTANCE AND CAPACITANCE MATRIX = 196

SEMI-BANDWID• OF MODIFIED,
GLOBAL COMBINED CONDUCTANCE AND CAPACITANCE MATRIX = 16

*** RESULTS FOR TIME = .01 ***

*** RESULTS FOR TIME = .02 ***

*** RESULTS FOR TIME = .03 ***


ß

*** RESULTS FOR TIME = .04 ***

COMPtH'ED VALUES OF HYDRAULIC HEAD

NODE NO. HYDRAULIC HEAD

1 - 1o. 6991
2 -8.2799
3 -7.6519

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter7 277

COMPUTED VALUES OF HYDRAULIC HEAD

NODE NO. HYDRAULIC HEAD

4 ø7.2344
5 -6.9411
6 -6.7157
7 -6.5350
8 -6.3858
9 -6,2606
10 -6,0636
11 -5,9199
12 -5,8166
13 -5.7229
14 -5.6928
15 -8,2799
16 -8.1215
17 -7.5490
18 -7.1863
19 -6.9122
20 -6.6969
ß ß

ß ß

1•0 -5.5•04
181 -5.5323
182 -5.5224
183 -5.6928
184 -5.6916
185 -5.6881
186 -5.6823
187 -5.6744
188 -5.6647
189 -5.6535
190 -5.6410
191 -5.6276
192 -5.5996
193 -5.5722
194 -5.5481
195 -5.5224
196 -5.5133

* = SPECIFIED VALUE

ETC.

Figure 7.13 Example output file for program GW3.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

2?8 FiniteElement
Computer
Prqgrams

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
7 279

-.,-- ß

I ! '1'

(tu) lq•(Xl•v'cI•

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

280 Finite
Element
Computer
Programs

7.5 TRANSIENT, UNSATURATEDGROUNDWATERFLOW,


PROGRAM GW4

Thecomputerprogram GW4 solves thetransient,


unsaturated
groundwater
flow
equation
(equation
1.4)(Figure
7.16).Theprogramissimilar
toGW3exceptthatPicard
iteration
isused
tosolve
thesystem
ofnonlinear
equations
ateach
timestep.
Theinput
and
outputfile structure
arein Figure7.17.

PROGRAM GW4
**********************************************************************
C THIS PROG•M SOLVES TRANSIENT, UNSATURATED
C GROUNDWATER FLOW PROBLEMS. SUBROUTINES ASMBKC,
C KBAR2, CBAR2, ETC. WILL HAVE TO BE MODIFIED FOR
C UNSATURATED CONDITIONS.
**********************************************************************
$INCLUDE: ' COMALL t
DIMENSION XX(MAX1) ,V(MAX2,3)
INTEGER HDF, VLF
LOGICAL LOOP, CONV•GE
CHARACTER*20 INFILE, OUTFILE
CHARACTER*SO TITLE
EQUIVALENCE (V1, V ( 1,1 ) ), (V2, V ( 1, 2 ) ), (V3, V ( 1, 3 ) )
DATA MAXIT/20/, TOLRNCE/0.01/

SYMM ' .TRUE.


LOOP" .TRUE.
LABEL1 - ' PRESSURE HEAD'
LABEL2 ' ' GROUNDWATER FLOW'
WRITE(*,10) ' ENTER THE NAME OF THE INPUT DATA FILE:
10 FORMAT (A\)
READ (*, 20) INFILE
20 FORMAT(A)
WRITE(*,10) • ENTER THE NAME OF THE OUTPUT FILE:
READ (*, 20) OUTFILE
OPEN ( INF, FILE'INFILE)
OPEN (OUTF, FILE"OUTFILE, STATUS• • NEW• )
READ (INF, 20) TITLE
.W•ITE (OUTF, 20) TITLE

1. INPUT NODE NUMBERS AND COORDINATES

READ(INF,*) DIM
CALL NODES
C
C 2. INPUT ELEMENT NUMBERS, TYPES, AND NODE NUMBERS
C
CALL ELEMENT
C

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter7 281

C 3. INPUT MATERIAL PROPERTIES FOR EACH ELEMENT


C
CALL MATERL
C
C 4. INPUT BOUNDARY CONDITIONS
C
CALL BOUND
C
C 5. INPUT INITIAL CONDITIONS
C
CALL INITIAL
C
C 6. WRITE OUT CONTENTS OF ARRAYS (IF REQUESTED)
C
CALL DUMP (LOOP, HDF, VLF )
C
C 7. INITIALIZE COUNTERS
C
IF (DIM .LE. 3) THEN
IDIM B DIM
ELSE
IDIM" 2
ENDIF
IDT = 0
IGT = 1
IGTDT - 1

C
C 8. FOR EACH TIME STEP. . .
C
DO 120 ISTEP • 1, MXSTEP
DO 40 ITER- 1, MAXIT
IF SIZE OF TIME STEP CHANGES REASSEMBLE GLOBAL MATRICES
IF ((ITER .GT. 1) .OR. (ISTEP .EQ. 1) .OR.
I (ISTEP .GT. DTSTEP(IDT))) THEN
IF (ITER .EQ. 1) IDT • IDT + i
C
C 9. ASSEMBLE
ANDMODIFYTHE GLOBALSYSTEMOF EQUATIONS
C
CALL ASMBKC
C
C 10. DECOMPOSE THE MODIFIED GLOBAL SYSTEM OF EQUATIONS
C
CALL DECOMP (NDOF, SBW, SYMM, M)
ENDIF
C
C 11. CALCULATE THE RIGHT HAND SIDE VECTOR FOR THIS TIME STEP
C
CALL RHS
C
C 12. BEGIN PICARD ITERATION
C

Figure continued

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

282 FiniteElememComputerPrograms

CALL SOLVE (NDOF, SBW, SYMM, M, B, XX)


CONVRGE - . TRUE .
II - NDOF
DO 30 I - NUMNOD, 1, -1
IF (ICH(I) .EQ. 0) THEN
IF (ABS((X(I) - XX(II)) ! X(I)) .GT. TOLRNCE)
CONVRGE • .FALSE.
x(•) - x(•)
II -- II - 1
ENDIF
30 CONTINUE

IF (CONVRGE) GOTO 50
4O CONTINUE
WRITE (*,20) ' *** EXCEEDS MAXIMUM NUMBER OF ITERATIONS ***'
50 WRITE (OUTF, 60) LABEL1, LABEL1
60 FORMAT(//70('*')//16X,'COMPUTED V/•LUES OF ',A/
16X, 39('-')//19X,'NODE NO.',10X, A/)
DO 80 I - 1, NUMNOD
IF (ICH(I) .EQ. 0) THEN
WRITE(OUTF, 70) I,X(I),' '
ELSE
WRITE(OUTF, 70) I,X(I),'*'
ENDIF
7O FORMAT ( 19X, I5, 12X, F15.4 , A)
IF (HDF .NE. 0) WRITE(HDF,*) I,X(I)
8O CONTINUE
WRITE (OUTF, 90)
90 FORMAT(/40X, '* • SPECIFIED ' )
WRITE (OUTF, 100) T
100 FORMAT(/19X,'*** RESULTS FOR TIME =',F7.2,' ***')

13. COMPUTE VELOCITIES

CALL VELOCITY
WRITE (OUTF, 100) T
IF (VLF .NE. 0) THEN
DO 110 I - 1, NUMELM
WRITE(VLF,*) I, (V(I,J),J-I,IDIM)
110 CONTINUE
ENDIF
120 CONTINUE
END

Figure 7.16 Source code listing for program GW4.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter7 283

OUTPUT FILE #1
INPUT FILE
Problem Tifie

Problem Title OutputfromNODES


Inputfor NODES OutputfromELEMENT
input
forELEMENT OutputfromMATERL
GW 4
Inputfor MATERL OutputfromBOUND
Inputfor BOUND OutputfromINITIAL

Inputfor IN1TIAL Outv'ut ASMZCC


InputforI•UMP .. for first time step..
(Optional)

t OutputfromVELOCITY
I
ß

.. for last time step..


outP
'ut
fromSOLVE
' "Outvui
•romVELOCiTY

OUTPUT FILE $$2,$$3....

OutputfromDUMP

Figure 7.17 Input and output file structure for program GW4.

7.6 SOLUTE TRANSPORT, PROGRAM ST1

The stepsused to solve the solutetransportequationfor steady-state,saturated


groundwater flow weredescribed in Part1. Thecomputer programST1 implements these
stepsin a setof ten FORTRAN subroutines (NODES, ELEMENT, MATERL, BOUND,
INITIAL, ASMAD, DECOMP, RHS, SOLVE, and DUMP) (Figure 7.18). The
operationsperformed byeachsubroutine aredescribed
brieflyin thesouwecodelistingfor
ST1; additionaldetailsarein subsequent chapters.The inputandoutputfile structure
is
similartoprogram GW3 (Figure7.19). Thecomponents of apparent groundwatervelocity
for eachelementarereadfroma file createdby programGW I (usingsubroutine DUMP,
seeChapter15). Exampleinputandoutputfriesforthemeshin Figure7.20arein Figures
7.21 and7.22. A comparison betweensoluteconcentrations computedwith ST1 andwith
ananalyticalsolutionfromBear(1979)is in Figure7.23. Exampleinputandoutputfiles
for the meshin Figure7.24 are in Figures7.25 and 7.26. The codingof the meshin
Figure7.27 is left asanexercise.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

2•4 FiniteElementComputer
Programs

PROGRAM ST1
**********************************************************************
C THIS PROGRAM SOLVES SOLUTE TRANSPORT PROBLEMS FOR
C STEADY-STATE, SATURATED GROUNDWATER FLOW.
**********************************************************************
$ INCLUDE: ' COMALL '
DIMENSION XX(MAX1) ,V(MAX2, 3)
INTEGER HDF, VLF
LOGICAL LOOP
CHARACTER*20 INFILE,OUTFILE,VELFILE
CHARACTER* 80 TITLE
EQUIVALENCE (V1,V(1,1)), (V2,V(1,2)), (V3,V(1,3))

SYMM • .FALSE.
LOOP ' .TRUE.
LABEL1 ' 'SOLUTE CONCENTRATION'
LABEL2 - ' SOLUTE FLUX'
WRITE(*,10) ' ENTER THE NAME OF THE INPUT DATA FILE: '
10 FORMAT (A\)
READ (*, 20) INFILE
2O FORMAT (A)
WRITE(*,10) ' ENTER THE NAME OF THE VELOCITY FILE: '
READ (*, 20) VELFILE
WRITE(*,10) ' ENTER THE NAME OF THE OUTPUT FILE: '
READ (*,20) OUTFILE
OPEN ( INF, FILE•INFILE)
VLF' 2
OPEN (VLF, FILE•VELFILE)
OPEN (OUTF, FILE•OUTFILE, STATUS" ' NEW ' )
READ (INF, 20) TITLE
WRITE (OUTF, 20) TITLE

1. INPUT NODE NUMBERS AND COORDINATES

READ(INF,*) DIM
CALL NODES

2. INPUT ELEMENT NUMBERS, TYPES, AND NODE NUMBERS

CALL ELEMENT

3. INPUT MATERIAL PROPERTIES FOR EACH ELEMENT

CALL MATERL

4. INPUT BOUNDARY CONDITIONS

CALL BOUND

5. INPUT INITIAL CONDITIONS

CALL INITIAL

6. WRITE OUT CONTENTS OF ARRAYS (IF REQUESTED)

CALL DUMP(LOOP,HDF, IDMY)

7. INITIALIZE COUNTERS

IF (DIM .LE. 3) THEN


IDIM - DIM

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter? 285

ELSE
IDIM - 2
ENDIF
DO 30 I - 1, NUMELM
READ(VLF,*) J, (V(J,K) ,K-I, IDIM)
3O CONTINUE
IDT- 0
IGT - 1
IGTDT - 1

8. FOR EACH TIME STEP. . .

DO 90 ISTEP - 1, MXSTEP
IF SIZE OF TIME STEP CHANGES REASSEMBLE GLOBAL MATRICES
IF (ISTEP .EQ. I .OR. ISTEP .GT. DTSTEP(IDT)) THEN
IDT - IDT + 1

9. ASSEMBLE AND MODIFY THE GLOBAL SYSTEM OF EQUATIONS

CALL ASMBAD
C
C 10. DECOMPOSE THE MODIFIED GLOBAL SYSTEM OF EQUATIONS
C
CALL DECOMP (NDOF, SBW, SYMM, M)
ENDIF
C
C 11. CALCULATE THE RIGHT HAND SIDE VECTOR FOR THIS TIME STEP
C

CALL RHS
C
C 12. SOLVE THE SYSTEM OF EQUATIONS AND OUTPUT NODAL VALUES
C
CALL SOLVE (NDOF, SBW, SYMM, M, B, XX)
WRITE (OUTF, 40) LABEL1, LABEL1
40 FORMAT(//70('*')//16X,'COMPUTED VALUES OF ',A/
1 16X, 39('-')//19X,'NODE NO.',10X, A/)
J- 0
DO 60 I - 1, NUMNOD
IF (ICH(I) .EQ. 0) THEN
J- J + 1
X(I) - XX(J)
ENDIF
IF (ICH(I) .EQ. 0) THEN
WRITE(OUTF, 50) I,X(I),' '
ELSE
WRITE(OUTF, 50) I,X(I),'*'
ENDIF
50 FORMAT (19X, I5,12X, F15 ..4, A)
IF (HDF .GT. 0) WRITE(HDF,*) I,X(I)
60 CONTINUE
WRITE (OUTF, 70)
70 FORMAT(/40X,'* - SPECIFIED')
WRITE (OUTF, 80) T
80 FORMAT(/19X,'*** RESULTS FOR TIME -',F7.2,' ***')
90 CONTINUE
END

Figure 7.18 Source code listing for program ST1.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

286 FiniteElement
Computer
Programs

OUTPUT FILE #1
INPUT FILE ß

Problem Title
i . ii

Problem Tide Output


f•m•ODES
Inputfor NODES Output
from
ELEMEI•
Input
forELEI•NT
!
Output
from
M••
Inputfor MATERL OutputfromBOUND

InputforBOUND ' O•tput


from
IN1TIAL'
'
Inputfor INITIAL Output
from
ASMBAD
Input
forDUMP .. for f'•rsttime step..
(Optional)
OutputfromSOLVE

INPUT FR, E #2

(•u•' frorn
__VELOC•
.

gramGW1) .. for lasttimestep..


Output
from
SOLVE
OUTPUT FILE #2, #3 ....

Output
frøm
D.
UMP
I•liI
!

Figure 7.19 Input and output file structurefor programST1.

Direction of Groundwater Flow

C(O,t) = 100, t • 0 vff)=O.0035


C(x,O)=O, x_> 0

1 2 3 4 5 6 7 8 19 20 21

Figure 7.20 Example problem for program ST1 using linear bar elements.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
7 287

EXAMPLE PROBLEM FOR PROGRAM ST1 (SEE FIGUR• 7.20)


1 (ProblemDimension)
1 1 o (Nodal PointData)
21 1 lOO
-1 -1 -1
1 1 1 1 2 (ElementNumbers,Types,
2o 1 1 20 21 and Node Numbers)
-1 -1 -1 -1 -1
1 1 (ElementMaterialSetData)
2o 1
-1 -1
7 (MaterialProperties)
1 lOO .35
1 lOO (SpecifiedConcentration)
-1 -1
-1 -1 (No SpecifiedSoluteFluxes)
1 (RelaxationFactor)
11 50 (Take11Time Stepsof 50 DaysEach)
-1 -1
o 1 (Time Function)
1 1
11 1
-1 -1
-1 -1
-1

Figure7.21 Exampleinput file for programST1.

EXAMPLE PROBLEM FOR PROGP•M ST1 (SEE FIG• 7.20)


NODE NODAL COORDINA•S
NUMBER X

1 .0000
2 5.0000
3 10.0000
4 15.0000
5 20.0000
6 25.0000
7 30.0000
8 35.0000
9 40.0000
10 45.0000
11 50.0000
12 55.0000
13 60.0000
14 65.0000
15 70.000O
16 75.0000
17 80.0000
18 85.0000
19 90.0000
20 95.0000
21 100.0000

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

288 FiniteElement
Computer
Programs

ELEMENT
NO. NODE NUMBERS

1 1 1 2
2 1 2 3
3 1 3 4
4 1 4 5
1 5 6
6 1 6 7

l'S
19 1 19 20
20 1 20 21

ELEMENT
NO. MATERIAL SET NUMBER

I 1
2 1
3 1
ß ß

19 1
20 1

MATERIAL
SET NO. MATERIAL PROPERTIES

1.000000E+02 0.000000E+00 1.000000E+00 0.000000E+00


3.500000E-01 1.000000E+00 1.000000E+00

NODE SPECIFIED
NO. SOLUTE CONCENTRATION

1 100.0000

NUMBER OF NODES WqTH SPECIFIED SOLUTE CONCENTRATION = 1

NUMBER OF NODES WITH SPECIFIED SOLUTE FLUX -- 0

OMEGA = 1.oooo

START END DELTA T

1 11 50.0000

TOTAL TIME = 550.0000

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter? 289

• T

.oooo 1.oooo
1.oooo 1.oooo
550.0000 1.0000

INHIAL VALUES OF SOLUTE CONCENTRATION

NODE NO. SOLUTE CONCENTRATION

1 100.0000'
2 .0000
3 .0000

1'8 .0•00
19 .0000
20 .0000
21 .0000

* = SPECIFIED

NUMBER OF DEGREES OF FREEDOM IN MODIFIED,


GLOBAL COMBINED SORPTION AND ADVECHON-DISPERSION MATRIX = 20

SEMI-BANDWIDTH OF MODWIED,
GLOBAL COMBINED SORFrION AND ADVECHON-DISPERSION MATRIX =2

COMPUTED VALUES OF SOLUTE CONCENTRATION

NODE NO. SOLUTE CONCENTRATION


1 100.0000'
2 54.2676
3 27.0555
4 13.4887
5 6.7249
6 3.3527
7 1.6715
8 .8333
9 .4155
10 .2071
11 .1033
12 .0515
13 .0257
14 .0128
15 .0064
16 .0032
17 .0016
18 .0008
19 .0004
20 .0002
21 .0002

* = SPECIFIED

*** RESULTS FOR TIME = 50.00 ***

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

290 FiniteElementComputerPrograms

COMPUTED VALUES OF SOLUTE CONCEPTION


........... ......., ....... .. .... ., ......... .,.,....,.....,., ...... ., ..... ,. .......

NODE NO. $OLtrrE CONCENTRATION

1 100.0000'
2 69.8320
3 44.9692
4 27.4820
5 16.2252
6 9.3475
7 5.2876
8 2.9489
9 1.6261
10 .8885
11 .4817
12 .2595
13 .1390
14 .0741
15 .0393
16 .0208
17 .0110
18 .0059
19 .0032
20 .0020
21 .0016

* = SPECIFIED

*** RESULTS FOR TIME = 100.00 ***

COMPUTED VALUES OF SOLU/• CONCENTRATION

NODE NO. SOLUTE CONCENTRATION

1 100.0000'
2 83.1162
3 66.6319
4 51.5875
5 38.6600
6 28.1214
7 19.9123
8 13.7633
9 9.3098
10 6.1769
11 4.0280
12 2.5863
13 1.6376
14 1.0241
15 .6335
16 .3884

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
7 291

COMPUTED VALUES OF SOLUTE CONCENTRA•ON

NODE NO. SOLUTE CONCENTRATION

17 .2369
18 .1453
19 .0921
20 .0645
21 .0559

SPECIFIED

*** RESULTS FOR TIME = 250.00 ***


**********************************************************************
COMPUTED VALUES OF SOLUTE CONCENTRATION

NODE NO. SOLUTE CONCENTRATION

1 100.0000'
2 84.9458
3 ?0.0360
4 56.0643
5 43.6218
6 33.0407
7 24.4070
8 17.6170
9 12.4487
10 8.6274
11 5.8739
12 3.9350
13 2.5975
14 1.6919
15 1.0891
16 .6945
17 .4407
18 .2814
19 .1857
20 .1349
21 .1189

* = SPECIFIED

*** RESULTS FOR TIME = 500.00 ***


**********************************************************************

COMPUTED VALUES OF SOLUTE CONCENTRATION

NODE NO. SOLUTE CONCENTRATION

1 100.0000'
2 89.7406
3 79.2830
4 68.9309

Fi9ure conbinued

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

292 FiniteElement
Computer
Programs

COMPUTED VALUES OF SOLUTE CONCENTRATION

NODE NO. SOLUTE CONCENTRATION


5 58.9663
6 49.6288
7 41.1007
8 33.5004
9 26.8832
10 21.2485
11 16.5506
12 12.7118
13 9.6349
14 7.2147
15 5.3466
16 3.9339
17 2.8918
18 2.1504
19 1.6557
20 1.3713
21 1.2781
* = SPECIFIED
Figure 7.22 Example output file from program ST1.

120

AnalyticalSolution
FEM Solution
8O
t=50d

6O

t 250d
4O

t = 500d
2O

o
o 20 40 60 80 100 120

Distance(m)
Figure 7.23 Comparisonof analyticaland FEM solutionsfor program ST1.

EXAMPLE PROBLEM FOR PROGRAM ST1 (SEE FIG• 7.24)


2 (PROBLEMDIMENSION)
1 1 0 0 (NODALPOI•CrDATA)
2 1 0 40
3 1 0 60
7 1 0 100
9 1 0 140
10 1 0 180

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
? 293

11 lO

111 1 220 o
112 1 220 40
113 1 220 60
117 1 220 lOO
119 1 220 14o
12o 1 220 18o
-1 -1 -1 -1
1 4 lO 1 11 2 (ELEME• DATA)
11 4 lO lol 111 102
12 4 lO 2 11 12
22 4 lO lO2 111 112
23 4 lO 2 12 3
33 4 lO lO2 112 103

'1o 9 '19 •0
187 4 lO lO9 119 120
188 4 !o lO 9 20
198 4 lO 11o 109 120
-1 -1 -1 -1 -1 -1 -1
1 1
198 1
-1 -1
7 (MATERIAL PROPERTIES)
1 2 .25 1
1 0 (SPECIFIEDCONCENTRATIONS)
2 0
3 0
4 0
$ 3OO
6 0
7 0
8 0

1•6
117 o
118 o
119 o
12o o
-1 -1
5 300 (SPECIFIED SOLUTE FLUX)
-1 -1
1. (RELAXATION FACTOR)
2o lO (TAKE20 TIME STEPSOF 10EACH)
-1 -1
o 1 (TI1VIEFACTOR)
200 1
-1 -1
1 o (IN1TIAL CONCEPTIONS)
12o o
-1 -1
-1

Figure7.24 Exampleinput file I'or programST1.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

294 FiniteElementComputer
Programs

EXAMPLE PROBLEM FOR PROGRAM ST1 (SEE FIGURE 7.24)


NODE NODAL COORDINATES
NUMBER X Y

1 .0000 .0000
2 .0000 40.0000
3 .0000 60.0000
4 .0000 70.0000
5 .oooo 80.0000
6 .0000 90.0000
7 .oooo lOO.OOOO
8 ß0000 120.0000
9 .oooo 14o.oooo
lO .0000 180.0000

16010000 180•0000
111 220.0000 .0000
112 220.0000 40.0000
113 220.0000 60.0000
114 220.0000 70.0000
115 220.0000 80.0000
116 220.0000 90.0000
117 220.0000 100.0000
118 220.0000 120.0000
119 220.0000 140.0000
12o 220.0000 180.0000

ELEMENT ELEMENT
NO. TYPE NODE NUMBERS

1 4 1 11 2
2 4 11 21 12
3 4 21 31 22
4 4 31 41 32
5 4 41 51 42
6 4 51 61 52
7 4 61 71 62
8 4 71 81 72
9 4 81 91 82
10 4 91 101 92

1•7 • 2• iS i9
158 4 38 48 49
159 4 48 58 59
160 4 58 68 69
161 4 68 78 79
162 4 78 88 89
163 4 88 98 99
164 4 98 108 109
165 4 108 118 119
166 4 9 8 19
167 4 19 18 29

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
7 295

ELEMENT ELEME•
NO. TYPE NODE NUMBERS

168 4 29 28 39
169 4 39 38 49
170 4 49 48 59
171 4 59 58 69
172 4 69 6•1 79
173 4 79 78
89
174 4 89 88
99
175 4 99 98
109
176 4 109 108
119
177 4 9 19
20
178 4 19 29
30
179 4 29 39
40
180 4 39 49
50
181 4 49 59
60
182 4 59 69
70
183 4 69 79
80
184 4 79 89
90
185 4 89 99
100
186 4 99 109
110
187 4 109 119 120
188 4 !0 9 20
189 4 20 19 30
190 4 30 29 40
191 4 40 39 50
192 4 50 49 60
193 4 60 59 70
194 4 70 69 80
195 4 80 79 90
196 4 90 89 100
197 4 100 99 110
198 4 110 109 120

ELEMENT
NO. MATERIAL SET NUMBER

1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1

1•}4 i
195 1
196 1
197
198 1

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

296 FiniteElcmcntComputerPrograms

MATERIAL
SET NO. MATERIAL PROPERTIES

2.000000E+00 1.000000E+00 0.000000E+00 2.000000E+00


0.000000E+00 2.$00000E-01 1.000000E+00

NODE SPECIFIED
NO. SOLUTE CONCENTRATION

1 .oooo
2 .oooo
3 .0000
4 .0000
$ 300.0000
6 .0000
7 .0000
8 .0000
9 .0000
10 .0000
20 .0000
3O .0000
40 .0000
50 .0000
60 .0000
70 .0000
80 .0000
90 .0000
100 .0000
110 .0000
111 .0000
112 .0000
113 .0000
114 .0000
115 .0000
116 .0000
117 .0000
118 .0000
119 .0000
120 .0000

NUMBER OF NODES WITH SPECIFIED SOLUTE CONCENTRATION = 30

NODE SPECIFIED
NO. SOLUTE FLUX

5 300.0000

NUMBER OF NODES WITH SPECIFIED SOLUTE FLUX = 1

OMEGA = 1.oooo

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter7 297

START END DELTA T

1 20 lO.OOOO

TOTAL TIME = 200.0000

TIlVlET G(T)

.oooo 1.oooo
200.0000 1.oooo

INITIAL VALUES OF SOLUTE CONCENTRATION

NODE NO. SOLLrrE CONCENTRATION

1 .0000'
2 .0000'
3 .0000'
4 .0000'
5 300.0000'
6 .0000'

.oboo*
118 .0000'
119 .0000'
120 .0000'

* = SPECIFIED

NUMBER OF DEGREES OF FREEDOM IN MODIFIED,


GLOBAL COMBINED SoRFrION AND ADVECTION-DISPERSION MATRIX = 90

SEMI-BANDWIDTH OF MODWIED,
GLOBAL COMBINED SORP'rION AND ADVECTION-DISPERSION MATRIX = 11

*** RESULTS FOR TIME = 10.00 ***

*** RESULTS FOR TIME = 20.00 ***

*** RESULTS FOR TIME = 30.00 ***

*** RESULTS FOR TIME = 40.00 ***

*** RESULTS FOR TIME = 50.00 ***

*** RESULTS FOR TIME = 60.00 ***

*** RESULTS FOR TIME = 70.00 ***

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

298 FiniteElementComputerPrograms

*** RESULTS FOR TIME = 80.00 ***

*** RESULTS FOR TIME = 90.00 ***

*** RESULTS FOR TIME = 100.00 ***

*** RESULTS FOR TIME = 110.00 ***

*** RESULTS FOR TIME = 120.00 ***

*** RESULTS FOR TIME = 130.00 ***

COMPU•D VALUES OF SOLUTE CONCENTRATION

NODE NO. SOLUTE CONCENTRATION

1 .0000'
2 .0000'
3 .0000'
4 .0000'
5 300.0000*
6 .0000'
7 .0000'
8 .0000'
9 .0000'
10 .0000'
1! -.4024
12 .5881
13 -3.3477
14 42.5015
15 228.2954
16 42.4914
17 -3.2888
18 .9138
19 -.1811
20 .0000'
21 -.1427
22 .0470
23 -.6714
24 62.3467
25 182.7819
26 62.3475
27 -.5372
28 .2034
29 -.0590
30 .0000'
31 .2244
32 -.6711
33 3.7866
34 68.3779
35 149.0262
36 68.3933

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter7 299

COMPU•D VALUES OF SOLUTE CONCENTRATION

NODE NO. SOLUTE CONCENTRATION

37 3.9406
38 -.7868
39 .0968
40 .0000'
41 .4454
42 -1.1199
43 7.3474
44 64.3831
45 117.9321
46 64.4055
47 7.4753
48 -1.4140
49 .1748
50 .0000'
51 .5042
52 -1.2155
53 .8.6262
54 53.3718
55 89.8220
56 53.3947
57 8.7133
58 -1.5534
59 .1859
60 .0000'
61 .•".•.7
62 -1.0155
63 7.5597
64 36.9853
65 56.5931
66 37.0008
67 7.6051
68 -1.3035
69 .1395
70 .0000'
71 .3103
72 -.5886
73 3.0124
74 13.5022
75 19.7430
76 13.5078
77 3.0336
78 -.7412
79 .0969
80 .0000'
81 .1952
82 -.2791
83 .4304
84 3.0719
85 5.0566
86 3.0735
87 .4379
Fi9ure continued

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

300 FiniteElementComputer
Programs

COMPUTED VALUES OF SOLUTE CONCEYlON

NODE NO. SOLUTE CONCENTRATION

88 -.3506
89 .0688
90 .0000'
91 .0?46
92 -.0640
93 -.0802
94 .2728
95 .6212
96 .2730
97 -.0784
98 -.0779
99 .0251
100 .0000'
101 .0102
102 .0051
103 -.0254
104 -.0480
105 -.0048
106 -.0481
107 -.0255
108 .0O88
109 .0042
110 .0000'
111 .0000'
112 .0000'
113 .0000'
114 .0000'
115 .0000'
116 .0000'
117 .0000'
118 .0000'
119 .0000'
120 .0000'

* = SPECIFIED

Figure 7.25 Example output file from program ST1.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter7 301

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

302 FiniteElementComputerPrograms

oo

•l ,. ...... ii i ii i

• ß i i i i iii ii

i i (• i i

• i i

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 8

SUBROUTINE NODES

8.1 PURPOSE

SubroutineNODES inputsthenodenumbers andcoordinatesfor eachnodein thefinite


elementmesh.The subroutine canbe usedfor one-,two-,or three-dimensional
problems
or for problemswith axisymmetry.

8.2 INPUT

Node numbersand coordinates are read "free-format"from the user-suppliedfile


assigned to unit "INF". The operationof the subroutine is controlledby the variable
"DIM" (seeSection8.5 for a descriptionof programusage). Both INF and DIM are
passedto thesubroutine throughlabeledcommonblockscontained in thefile "COMALL"
(seeChapter7 for a listingof COMALL).

8.3 OUTPUT

Node numbersand coordinatesare written to the user-definedfile assignedto unit


"OUTF". OUTF is passedto the subroutinethrough a labeled common block in
COMALL. Columnheadingsare addedto thelist of nodenumbersandcoordinates written
to OUTF. The numberof nodesin the mesh,variable "NUMNOD", and the coordinates
for eachnodein the mesh,arrays"X l", "X2", and "X3", are storedin labeledcommon
blocks(containedin thefile COMALL) for useby othersubroutines.

8.4 DEFINITIONS OF VARIABLES

DIM = Typeof coordinate systemusedin thisproblem(Figure8.1).


= 1,problemis one-dimensional.
= 2, problemis two-dimensional.
= 3, problemis three-dimensional.
= 4, problemis two-dimensional
(axisymmetric).
INC = Nodenumberincrement
usedto generate"missing"
nodenumbers.
NUMNOD = Number of nodes in the mesh.

= x coordinatefor node I if DIM -- 1, 2, or 3.


= r coordinate for node I if DIY,,I = 4.

X2(I) = not used if DIM = 1.


= y coordinate
for nodeI if DIM = 2 or 3.
= z coordinate for node I if DIM = 4.

X3(I) = not usedif DIM = 1, 2, or 4.


= z coordinate for node I if DIM = 3.

303
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

304 SubroutineNodes

DIM -- 1

DIM = 2

DIM = 3

Y•

DIM = 4

axis of
symmetry

Figure 8.1 Correct values of DIM to use with different types of finite element
meshes.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
8 305

USAGE

Exampleinputdataandoutputfor subroutineNODESarein Figures8.2 to 8.5. Each


lineof inputcontains
thenodenumber,nodenumberincrement, andthecoordinates of a
node. The meshin Figure8.2 is two-dimensional
(DIM = 2). Node numberI hasa node
numberincrementof 1 (INC = 1), an x coordinateof 0 (X1(1) = 0) and a y coordinateof 0
(X2(1) = 0). Node number4 has a node numberincrementof 1 (INC = 1), an x
coordinate of 2 (X1(4) = 2) anda y coordinate
of 9 (X2(4) = 9). The subroutinehasthe
capabilityto "generate" thenodenumbersandcoordinates for nodes"missing"from the

(2,9) (7,9) (12,9)


8 12

DIM = 2 11

I_9•node
number
(o,o) (6,0) (12,0)
.••.aode
coordinates

InputData'
1 I o. o.
4 1 2. 9.
5 I 6. o.
8 I 7. 9.
9 I 12. o.
12 I 12. 9.
-1 -1 -1 -1

Output'
NODE NODAL COORDINATES
NUMBER X Y

1 .0000 .0000
2 .6667 3.0000
3 1.3333 6.0000
4 2.0000 9.0000
5 6.00o0 .0000
6 6.3333 3.0000
7 6.6667 6.0000
8 7.0000 9.0000
9 12.0000 .0000
10 12.0000 3.0000
11 12.0000 6.0000
12 12.0000 9.0000

Figure 8.2 Example input data and output for subroutine NODES. ß

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

306 Subroutine Nodes

10 (0,6,8)

DIM = 3
11

(o,o,8)

! 12 (12,6,2)
4!(0,6.
.•....................ß 6 (12,6,0)
--' ..-' (12,0,2)
--
1 2 3

(0,0,0) (12,0,0)

InputData:
1 I o. o. o.
3 1 12. o. o.
4 1 o. 6. o.
6 1 12. 6. o.
7 1 o. o. 8.
9 1 12. o. 2.
10 1 o. 6. 8.
12 1 12. 6. 2.
-1 -1. -1 -1 -1

Output:
NODE NODAL COORDINA•S
NUMBER X Y Z

1 .0000 .0000 .0000


2 6.0000 o0000 .0000
3 12.0000 .0000 .0000
4 .0000 6.0000 .0000
5 6.0000 6.0000 .0000
6 12.0000 6.0000 .0000
7 .0000 .0000 8.0000
8 6.0000 .0000 5.0000
9 12.0000 .0000 2.0000
10 .0000 6.0000 8.0000
11 6.0000 6.0000 5.0000
12 12.0000 6.0000 2.0000

Figure 8.3 Example input data and output for subroutine NODES.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter8 30?

inputfile, andthisfeaturecanbe us.edto greatlysimplifydatainputfor portionsof the


meshwherenodesareregularlyspaced.In Figure8.2, nodes2 and3 areequallyspaced
betweennodes1 and 4. Therefore it is necessaryonly to enter the node numbers,node
numberincrements,
andcoordinates for nodes1 and4. The subroutine computesthenode
numbersand coordinatesfor the two "missing"nodes(nodes2 and 3) usingthe node
number coordinates for nodes 1 and 4 and the node number increment for node 4. Linear
interpolation(in thiscasebetweennodes1 and4) is usedto computethecoordinates of the
'*missing*'
nodes.The computedcoordinates of the missingnodesare alsostoredin the
arraysX1 andX2 (Xl(2) -- 0.6667, X2(2) -- 3.0000,Xl(3) -- 1.3333,X2(3) -- 6.0000).
Thisprocess is repeatedfor nodes5 and8 (nodes6 and7 are"missing**) andfor nodes9
and12 (nodes10 and11are'*missing**). Inputis terminated by placinga -1 in all fields.
The meshin Figure8.3 is three-dimensional(DIM ---3), sothreecoordinates (x, y, and
z) arereadfor eachnode. Forexample,node9 hasa nodenumberincrementof 1, an x
coordinateof 12 (Xl(9) -- 12), a y coordinateof 0 (X2(9) -- 0, and a z coordinateof 2
(X3(9) = 2). Node numbersandcoordinates for the **missing**nodes2, 5, 8, and 11 are
computedby the subroutine.

DIM = 4

(3,6) (18,6)
2 4 6 8 10

1 3 5 9

(18,3)

InputData: 1 2 3. 3.
9 2 18. 3.
2 2 3. 6.
10 2 18. 6.
-1 -1 -1 -1

Output: NODE NODAL COORDINATES


NUMBER R Z

1 3.0000 3.0000
2 3.0000 6.0000
3 6.7500 3.0000
4 6.7500 6.0000
5 10.5000 3.0000
6 10.5000 6.0000
7 14.2500 3.0000
8 14.2500 6.0000
9 18.0000 3.0000
10 18.0000 6.0000

Figure 8.4 Example input data and output for subroutineNODES.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

308 SubroutineNodes

The nodesdo not haveto be enteredsequentiallyandthe nodenumberincrementscan


be assigned anypositiveintegervalue. Two examplesare in Figures8.4 and 8.$. The
meshin Figure8.4 is for anaxisymmetricproblem(DIM = 4), sotwo coordinates (r andz)
are read for eachnode. For example,node2 has a nodenumberincrementof 2, an r
coordinateof 3 (Xl(2) = 3) and a z coordinateof 6 (X2(2) = 6). Node numbersand
coordinates for the "missing"
nodes3, 4, 5, 6, ?, and8 arecomputed by thesubroutine.
The meshin Figure8.5 is two-dimensional(DIM = 2) anda nodenumberincrement of 3 is
usedto generatethe "missing"nodes4, ?, 10, 5, 8, 11, 6, 9, and 12.
DIM = 2
(2,8) (14,8)
3 6 9 12 15

InputData' 1 3 2. 1.
13 3 14. 1.
2 3 2. 3.
14 3 14. 3.
3 3 2. 8.
15 3 14. 8.
-1 -1 -1 -1

Output' NODE NODAL COORDINATES


NUMBER X Y

1 2.0000 1.0000
2 2.0000 3.0000
3 2.0000 8.0000
4 5.0000 1.0000
5 5.0000 3.0000
6 5.0000 8.0000
7 8.0000 1.0000
8 8.0000 3.0000
9 8.0000 8.0000
10 11.0000 1.0000
11 11.0000 3.0000
12 11.0000 8.0000
13 14.0000 1.0000
14 14.0000 3.0000
15 14.0000 • 8.0000

Figure 8.5 Example input data and output for subroutine NODES.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter

8.6 SOURCE CODE LISTING

SUBROUTINE NODES
**********************************************************************

8.1 PURPOSE:
TO INPUT NODE NUMBERS AND COORDINATES

8.2 INPUT:
NODE NUMBERS AND COORDINATES ARE READ FROM THE USER-
SUPPLIED FILE ASSIGNED TO UNIT "INF"

8.3 OUTPUT:
NODE NUMBERS AND COORDINATES ARE WRITTEN TO THE USER-
DEFINED FILE ASSIGNED TO UNIT "OUTF"

8.4 DEFINITIONS OF VARIABLES:


DIM - COORDINATE SYSTEM TYPE
INC • NODE NUMBER INCREMENT
NUMNOD =NUMBER OF NODES READ
Xl(I) • X COORDINATE FOR NODE I IF DIM • 1, 2, OR 3
= R COORDINATE.FOR NODE I IF DIM • 4
X2(I) = IS NOT USED IF DIM m 1
• Y COORDINATE FOR NODE I IF DIM • 2 OR 3
= Z COORDINATE FOR NODE I IF DIM = 4
X3(I) - IS NOT USED IF DIM = 1, 2, OR 4
= Z COORDINATE FOR NODE I IF DIM = 3

8.5 USAGE:
NODE NUMBERS AND COORDINATES ARE READ, ONE NODE
PER LINE, BEGINNING WITH NODE 1. NODE NUMBERS
FOR "MISSING" NODES ARE GENERATED BY THE
SUBROUTINE BY ADDING THE NODE NUMBER INCREMENT
TO THE NODE NUMBER FOR THE PRECEEDING NODE.
COORDINATES FOR "MISSING" NODES ARE COMPUTED BY
THE SUBROUTINE USING LINEAR INTERPOLATION. TO
TERMINATE INPUT, PLACE A -1 IN ALL FIELDS OF
THE INPUT FILE.

SUBROUTINES CALLED:
NONE

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, CHAPTER 8.

**********************************************************************
$ INCLUDE: ' COMALL '
DIMENS ION XYZ (MAX1, 3)
EQUIVALENCE (XI,XYZ(1,1)), (X2,XYZ(1,2)), (X3,XYZ(1,3))
INTEGER CNODE, OLDNOD

NUMNOD = 0
IDIM = DIM
IF (DIM .EQ. 4) IDIM = 2
OLDNOD = MAX1
C READ FROM INPUT FILE: NODE NUMBER, NODE NUMBER INCREMENT,
C AND NODAL COORDINATES
10 READ (INF, *) CNODE, INC, (XYZ (CNODE, I), I-1, IDIM)
IF (CNODE .EQ. -1) GOTO 40
IF (CNODE .GT. NUMNOD) N!JMNOD m CNODE

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

3! 0 Subroutine
Nodes

GENERATE NODE NUMBERS AND COORDINATES FOR "MISSING" NODES


NGENP1 - (CNODE - OLDNOD) / INC
IF (NGENP1 .GT. 0) THEN
DO 30 I - 1, IDIM
XYZINC - (XYZ (CNODE, I) - XYZ (OLDNOD, I) ) / FLOAT (NGENP1)
DO 20 J - OLDNOD + INC, CNODE - INC, INC
XYZ (J, I) - XYZ (J-INC, I) + XYZINC
20 CONTINUE
30 CONTINUE
ENDIF
OLDNOD - CNODE
GOTO 10
c WRITE NODE NUMBERS AND NODAL COORDINATES TO OUTPUT FILE
4o IF (NUMNOD .GT. 0) THEN
IF (DIM .EQ. 1) THEN
WRITE (OUTF, 50 )
50 FORMAT (3X, 'NODE ' , 10X, 'NODAL COORDINATES ' /
2X, 'NUMBER' , 18X, wX' /
2X, 6 ('-'), 8X, 20 ('-') )
ELSEIF (DIM .EQ. 2) THEN
WRITE (OUTF, 60 )
6o FORMAT (3X, 'NODE', 21X, 'NODAL COORDINATES ' /
2X, 'NUHBER' , 18X, 'X', 20X,
2X, 6('-') ,8X, 20('-') ,1X, 20('-') )
ELSEIF (DIM .EQ. 3) THEN
WRITE (OUTF, 70 )
7o FORMAT (3X, 'NODE •, 31X, WNODAL COORDINATES ' /
2X, • NUMBER', 18X, ' X ', 20X, ' Y ', 20X, ' Z ' /
2X, 6 ('-') , 8X,20 ('-') , lX, 20 ('-') , 1X, 20 ('-') )
ELSEIF (DIM .EQ. 4) THEN
WRITE (OUTF, 80)
8o FORMAT (3X, 'NODE ', 21X, 'NODAL COORDINATES • /
2X, •NUMBER', 18X, 'R', 20X, ' Z' /
2X, 6 ( '-' ) , 8X, 20 ('-') , 1X, 20 ('-') )
ENDIF
DO 100 I •' 1, NUMNOD
WRITE (OUTF, 90) I, (XYZ (I, J) ,J=l, IDIM)
90 FORMAT (I6, 10X, 3 (F15.4, 6X) )
100 CONTINUE
ELSE
WRITE (OUTF, 110 )
110 FORMAT (' NO NODAL POINT DATA READ. ')
ENDIF
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 9

SUBROUTINE ELEMENT

9.1 PURPOSE

Subroutine
ELEMENT inputsthe elementnumber,elementtype, andelementnode
numbersfor each element in the f'mite element mesh. The subroutinecan be used for one-,
two-,or three-dimensional
problems
or for problems
withaxisymmetry.

9.2 INPUT

Elementnumbers,elementtypes,andelementnodenumbersareread"free-format"'
from the user-supplied
file assignedto unit "INF". INF is passedto the subroutine
througha labeledcommonblockcontained in thefile "COMALL"(seeChapter7 for a
listingof COMALL).

9.3 OUTPUT

Elementnumbers,elementtypes,andelementnodenumbersare writtento the user-


definedfile assigned
to unit "OUTF". Columnheadingsare addedto thelist of element
numbers,elementtypes,andelementnumberswrittento OUTF. The numberof elements
in the mesh(variable"NUMELM"), elementtypes(array"ELEMTYP"), andelementnode
numbers(array"IN"), arestoredin labeledcommonblocksin COMALL for useby other
subroutines.

9.4 DEFINITIONS OF VARIABLES

ELEMTYP(I) = Elementtypefor elementI (Table9.1).


= Node number J for element I.

INC = Element node number increment.

NODETBL(I) = Numberof nodesin elementtypeI (Table9.1).


NUMELM = Number of elements in the mesh.

9.5 USAGE

Exampleinputandoutputfor subroutine ELEMENT are in Figures9.1 to 9.3. Each


line of inputcontainsan elementnumber,and the elementtype, elementnodenumber
increment,andnodenumbersfor theelement.The meshin Figure9.1 is one-dimensional
(DIM = 1) and containsfive linear bar elements. Element 1 has an elementtype of 1
(ELEMTYP(1) = 1), an elementnodenumberincrementof 1 (INC = 1), andnodenumbers
1 and2 (IN(1,1) = 1 and IN(1,2) = 2). Element5 hasanelementtypeof 1

311
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

312 SubrouœineElement

o.: = õ.... ..o=: . =

i ß i.,.i

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter9 313

node numbers

1
/ 2 3 4 5 6

(1) (2) (3) (4) (5)

element numbers

InputData'
1 1 1 1 2
5 1 1 5 6
-1 -1 -1 -1 -1

Output.
ELEMENT
NO. TYPE NODE NUMBERS

1 1 1 2
2 1 2 3
3 1 3 4
4 1 4 5
5 1 5 6

Figure 9.1 Example input data and output for subroutine ELEMENT.

(ELEMTYP(5) = 1), an elementnodenumberincrementof 1 (INC = 1), and nodenumbers


5 and6 (IN(5,1) = 5 andIN(5,2) = 6). The subroutine hasthecapabilityto "generate"
elementnumbers,elementtypes,andelementnodenumbersfor elements"missing"from
theinputfile, andthisfeaturecanbe usedto greatlysimplifydatainput. In Figure9.1, for
example,the elementnodenumbersfor element2 are generatedwithin ELEMENT by
addingthenodenumberincrement for node5 to thenodenumbers for element1 ß

IN(2,1) = IN(1,1)+ INC = 1 + 1 = 2


IN(2,2) = IN(1,2) + INC = 2 + 1 = 3

Similarlytheelementnodenumbersfor elements3 and4 are generatedwithin ELEMENT


by addingthenodenumberincrementfor node5 to thenodenumbersfor element2 and3.
For element 3'

IN(3,1) = IN(2,1) +INC = 2+ 1 = 3


IN(3,2) = IN(2,2) + INC = 3 + 1 = 4

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

314 Subroutine
Element

For element 4:

IN(4,1) = IN(3,1) +INC = 3 + 1 = 4


IN(4,2) = IN(4,2) + INC -- 4 + 1 = $

Inputis terminated
by placinga -1 in all fields.
The mesh in Figure 9.2 is two-dimensional(DIM = 2) and containsten linear
quadrilateral
elements.Element1 hasanelementtypeof 6 (ELEMTYP(1)= 6), anelement
nodenumberincrement of 3 (INC = 3), andelementnodenumbers1, 4, 5, and2 (IN(1,1)
= 1, IN(I,2) = 4, IN(1,3) = 5, IN(1,4) = 2). Element5 hasan elementtypeof 6
(ELEMTYP(5) = 6), an elementnodenumberincrementof 3 (INC = 3), andelementnode
numbers13, 16, 17, and 14 (IN(5,1) = 13, IN(5,7) = 16, IN(5,3) = 17, andIN(5,4) =
14). The nodenumberincrementfor element5 is usedto "generate"the elementnode
numbersfor the "missing"
elements2, 3, and4.

18

node numbers

17
clement
numbers

1 4 7 10 13 16

InputData:
1 6 3 1 4 5 2
5 6 3 13 16 17 14
6 6 3 2 5 6 3
10 6 3 14 17 18 15
-1 -1 -1 -1 -1 -1 -1

Output:
ELEMENT
NO. TYPE NODE NUMBERS

1 6 1 4 5 2
2 6 4 7 8 5
3 6 7 10 11 8
4 6 10 13 14 11
6 13 16 17 14
6 6 2 5 6 3
7 6 5 8 9 6
8 6 8 11 12 9
9 6 11 14 15 12
10 6 14 17 18 15

Figure 9.2 Example input data and output for subroutineELEMENT.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
9 315

For element IN(2,1) -- IN(1,1) + INC -- 1+ 3 = 4


[N(2,2) -- IN(1,2) + INC -- 4+3 -- 7
IN(2,3) -- IN(1,3)+ INC -- 5+3 -- 8
IN(2,4) -- IN(1,4) + INC -- 2+ 3 -- 5
For dement 3: IN(3,1) -- IN(2,1) + INC -- 4+ 3 -- 7
IN(3,2) -- IN(2,2) + INC = 7+3 = 10
IN(3,3) = IN(2,3) + INC -- 8+ 3 -- 11
IN(3,4) -- IN(2,4) + INC = 5+3 -- 8

node
numbers element numbers

(5)

,
2• 8,, (7)• 13

(6)

7 10 12

InputData:
1 4 1 2 6 3
2 4 1 2 5 6
3 4 1 1 5 2
4 4 1 4 5 1
5 5 1 5 8 9 6
6 5 1 4 7 8 5
7 7 1 7 10 12 13 14 11 9 8
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

Output:
ELEMENT ELEMTd•
NO. TYPE NODE NUMBERS

1 4 2 6 3
2 4 2 5 6
3 4 1 5 2
4 4 4 5 1
5 5 5 8 9 6
6 5 4 7 8 5
7 7 7 10 12 13 14 11 9 8

Figure9.3 Exampleinputdata and outputfor subroutine


ELEMENT.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

316 Subroutine Element

for clement 4' IN(4,1) = IN(3,1)+INC = 7 +3 = 10


IN(4,2) = IN(3,2) + INC = 10 + 3 -- 13
IN(4,3) = IN(3,3) + INC = 11 + 3 = 14
IN(4,4) = IN(3,4)+INC = 8 +3 = 11

The sameprocedureis usedto "generate"the "missing"elementsbetweenelements6 and


10.
SubroutineELEMENT allowstheuserto useanycombination of compatible
element
typesin a mesh. Refeaingto Table9.1 a one-dimensional
meshcanbe designedusing
any combination of one-dimensionalelements (Types 1, 2, or 3). Similarly, any
combinationof elementtypes3, 4, 5, 6, 7, or 8 can be usedin a two-dimensional
mesh,
anycombinationof elementtypes9, 10, or 11 canbe usedin a three-dimensional mesh,
andanycombination of elementtypes12 or 13 canbeusedin an axisymmetric mesh. An
exampleof a two-dimensional meshcontaining a threeelementtypesis in Figure9.3.
Elements1, 2, 3, and4 arelineartriangleelements(Type 4), elements5 and6 are linear
rectangleelements(Type5), andelement7 is a quadratic
quadrilateral
element(Type7).
Note thattheelementnodenumbersmustbe enteredin a specificorder. The proper
orderis shownin thedefinition
sketch fortheinterpolation
functions
foreachelement type.
For example, by referringto Figure 4.10 we see that the node numbersfor linear
quadrilateral
elementsmustbeenteredin a "counterclockwise"fashion.

9.6 SOURCE CODE LISTING

SUBROUTINE ELEMENT
**********************************************************************

9.1 PURPOSE:
TO INPUT ELEMENT NUMBERS, TYPES, NODE NUMBERS

9.2 INPUT:
ELEMENT NUMBERS, TYPES, AND NODE NUMBERS ARE READ
FROM THE USER-SUPPLIED FILE ASSIGNED TO UNIT "INF"

9.3 OUTPUT:
ELEMENT N-GMBERS, TYPES, AND NODE NUMBERS ARE WRITTEN
TO THE USER-DEFINED FILE ASSIGNED TO UNIT "OUTF"

9.4 DEFINITIONS OF VARIABLES:


ELEMTYP(I) • ELEMENT TYPE FOR ELEMENT I
IN(I,J) • NODE NUMBER J FOR ELEMENT I
INC • NODE NUMBER INCREMENT
NODETBL(I) - NUMBER OF NODES IN ELEMENT TYPE I
NUMELM • NUMBER OF ELEMENTS IN MESH

9.5 USAGE:
ELEMENT DATA (ELEMENT N/IMBER, TYPE, AND NODE NUMBERS)
ARE READ SEQUENTIALLY, SET OF ELEMENT DATA PER LINE.
ELEMENT NUMBERS, TYPES, AND NODE NUMBERS FOR "MISSING"
ELEMENTS ARE GENERATED BY THE SUBROUTINE. TO TERMINATE
INPUT, PLACE A -1 IN ALL FIELDS OF THE INPUT FILE.

SUBROUTINES CALLED:
NONE

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, CHAPTER 9.

**********************************************************************

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter9 317

$ INCLUDE: • COMALL t
INTEGER OLDELM, ELM, TYPE
DIMENSION NODETBL (13)
DATA NODETBL/2,3,4,3, 4, 4,8,12,8,20,32,3,4/

MAXNODm0
OLDELMtMAX2
NUMELMt0
c READ FROM INPUT FILE: ELEMENT NUMBER, ELEMENT TYPE,
c AND ELEMENT NODE NUMBERS
lO READ (INF, *) ELM, TYPE, INC, (IN(ELM, I), Iml,NODETBL (ABS (TYPE)) )
IF (ELM .EQ.-1) GOTO 40
ELEMTYP (ELM) -- TYPE
IF (ELM .GT. NUMELM) NUMELM • ELM
IF (NODETBL (TYPE) .GT. MAXNOD) MAXNOD • NODETBL (TYPE)
GENERATE THE MISSI-NG ELEMENTS
IF (ELM .GT. OLDELM+l) THEN
DO 30 I -OLDELM + 1, ELM-1
IM1 • I - 1
DO 20 J • 1, NODETBL(TYPE)
IN(I,J) - IN(IM1,J) + INC
20 CONTINUE
ELEMTYP (I) t TYPE
30 CONTINUE
ENDIF
OLDELM - ELM
GOTO 10
c WRITE ELEMENT NUMBE.RS AND ELEMENT NODE NUMBERS TO OUTPUT FILE
40 IF (NUMELM .GT. 0) THEN
IF (MAXNOD .EQ. 2) THEN
WRITE(OUTF, 50) (t •,I-1,2)
ELSEIF (MAXNOD .EQ. 3) THEN
WRITE (OUTF, 50) (' ', I•1,2)
ELSEIF (MAXNOD .EQ. 4) THEN
WRITE (OUTF, 50) (• t, I-1,2)
ELSEIF (MAXNOD .GT. 4) THEN
WRITE (OUTF, 50) (• '•, I-l, 2)
ENDIF
50 FORMAT (/,2 (2X, •ELEMENT • , 4X)/4X, •NO. t, 10X, •TYPE • , 6X, A,
•NODE NUMBERS•/2 (2X, • ....... t, 4X) , lX, A, • ............
DO 70 I • 1, NUMELM
WRITE(OUTF, 60) I,ELEMTYP (I),
(IN (I, J), Jr1, NODETBL (ELEMTYP (I)) )
60 FORMAT(I7, I13, 6X, 816: 4 (/26X, 816) }
70 CONTINUE
ELSE
WRITE (OUTF, 80)
80 FORMAT ( • NO ELEMENT DATA READ. • )
ENDIF
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 10
,

SUBROUTINE MATERL

10.1 PURPOSE

SubroutineMATERL inputstheelementmaterialsetnumbers for eachelementin the


finiteelementmeshanda setof materialproperties
for eachmaterialset. Theterm"material
property"refersto anyphysicalor chemicalpropertyfor anelement.Forexample,in
solvingthesteady-state,
saturated
groundwaterflow equationwe usethecomponents of
saturated
hydraulicconductivity
to computea conductancematrixfor eachelement. It is
convenientto assignall elements
withthesamesaturated hydraulicconductivity
to a single
materialset, the materialpropertiesfor that set would be the componentsof saturated
hydraulicconductivity
fortheelements
in theset.Otherexamples of material
propertiesare
specificstorage,
porosity,bulkdensity,dispersivities,
distribution
coefficients,
or a table
of valuesof unsaturated
hydraulic
conductivity
asa functionof pressure
head.

1 0.2 INPUT

Element material set numbersare read "free-format"from the user-suppliedfile


assigned
to unit"INF". INF is passedto thesubwutine througha labeledcommonblock
containedin the file "COMALL" (seeChapter7.for a listingof COMALL). Then the
numberof materialpropertiesin a materialsetand a list of materialpropertiesfor each
material set are read from INF.

10.3 OUTPUT

Element'materialsetnumbersandthe list of materialpropertiesfor elementsin each


materialsetarewrittento theuser-defined
file assigned
to unit"OUTF". Colurnnheadings
areaddedto thelist of materialsetnumbersandmaterialproperties
writtento OUTF. The
numberof elementmaterialsets(variable"NU•T"), the materialsetnumbersfor each
element(array"MATSET"), thenumberof materialpropertiesin a materialset(variable
"NUMPROP"), andthematerialpropertiesfor eachmaterialset,array"PROP",are stored
in labeledcommonblocksin COMALL for useby othersubroutines.

10.4 DEFINITIONS OF VARIABLES

MATSET(I) = Material set number for element I.

NUMMAT = Number of material sets in the mesh.

NUMPROP = Numberof materialproperties


in a materialset.

PROP(I,J) = MaterialpropertyJ for materialsetI.

318
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
10 319

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

320 SubroutineMateft

1o.$ USAGE

Materialsetnumbersarereadin sequentially
fromelementoneto elementNUMELM,
one elementand materialset numberper line. The subroutinehas the capabilityto
"generate"
thematerialsetnumbersfor elements"missing"
fromtheinputf'fie. In themesh
in Figure10.1,thematerialsetnumbersfor all elementsarethesame. In thiscasewe need
only list the material set numbersfor elements I and 10 (MATSET(i) = 1 and

element numbers

(•) (2) (3) (4) (5)

(6) (7) (8) (9) (10)

• • ,• ,• ,

All elements
haveidenticalmaterialproperties
Kx = Ky= 10, Ss= 0.0002

InputDam-
1 1
lO 1
-1 -1
3
1 lO. 10. 0.0002
Outputß
E• •MENT
NO. MATERIAL SET NUMBER

1 1
2 1
3 1
4 1
:5 1
6 1
7 1
1
9 1
10 1

MATERIAL
SET NO. MATERIAL PROPERTIES

1 .100000E+2 .100000E+2 .200000E-3

Figure I0.1 Example input data and output for subroutine MATERL.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
10 321

MATSET(10) = 1). The subroutine "generates" the materialsetnumbersfor the eight


"missing"elements(elements 2, 3, 4, 5, 6, 7, 8, and9), MATSET(2) = MATSET(3) = ...
MATSET(9) = 1. Inputof materialsetnumberis terminated by placinga -1 in bothfields.
The numberof materialproperties in a materialsetis readnext. Notethatall material
setsmusthave the samenumberof materialproperties.For the meshin Figure 10.1
NUMMAT = 3 (thetwo components of hydraulicconductivity andspecificstorage).The
materialproperties
foreachmaterialsetarereadnext. Thecorrectorderto usefor entering
materialpropertiesis in Table 10.1. Any consistentsystemof unitscan be used(If in
doubtseethesottreecodelistingfor thesubroutines thatcomputetheelementmatrices,e.g.
KBARZ, KQUA4, DQUA4, etc.). For the mesh in Figure 10.1, PROP(I,1) = 10,

element numbers

sandstone

granite--•
Forsandstone:
Kx=Ky= 1x 10-4
Forgranite: Kx--Ky--1x 10-6
InputData: 1 1
4 1
5 2
8 2
-1 -1
2
1 1 .E-4 1 .E-4
2 1.E-6 1.E-6

Output: ELEMENT
NO. MATERIAL SET NUMBER

1 1
2 1
3 1
4 1
5 2
6 2
7 2
8 2

MATERIAL
SET NO. MATERIAL PROPERTIES

1 .100000E--03 .100000E--03
2 .100000E-05 .100000E-05

Figure 10.2 Example input data and output for subroutine MATERL.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

322 SubroutineMaterl

PROP(I,2)
= 10,andPROP(I,3)
= 0.0002.Inputof material
properties
isterminated
automatically by the subroutine.
Therearetwo materialsetsin the meshin Figure 10.2. Elements1, 2, 3, and4 arein
material set 1 and elements5, 6, ?, and 8 are in material set2. Each material set has two
properties,
in thiscasethetwocomponentssaturated
hydraulic conductivity.
Materialproperties
canalsobeusedtorepresent
a table,for examplea tableof valuesof
unsaturated
hydraulicconductivityasa functionof pressure head. If an unsaturatedflow
problemwasbeingsolved,thevalueof unsaturated hydraulicconductivity at anyvalueof
pressmeheadcouldbeobtained fromsucha listbyinterpolation (alternative
approaches to
describing
unsaturatedhydraulic
conductivity
weredescribed in Chapter5). An example of
theuseof materialproperty
dataforthispurpose is in Figure10.3.
element numbers

(4)

All elements
haveidentical
material
properties

o 1.oo0
lO .6oo
20 .200
50 .015
100 .010
200 .002
30O .003
InputData: 1 1
4 1
-1 -1
14
1 o 1.000 10. 0.600 20. 0.200
50. 0.015 100. 0.010 200. O.002
300. 0.003

Output: ELEME1Wr
NO. MATERIAL SET NUMBER

1 1
2 1
3 1
4 1

MATERIAL
SET NO. MATERIAL PROPERTIES

1 .000000E+00 .100000E+01 .100000E+02 .600000E+00


.200000E+02 .200000E+00 .500000E+02 .150000E- 0!
.100000E+03 .100000E- 01 .200000E+03 .200000E- 02
.300000E+03 .300000E- 02

Figure 10.3 Example input data and output for subroutine MATERL.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter! 0 323

10.6 SOURCE CODE LISTING

SUBROUTINE MATERL
**********************************************************************
c
c lO.1 PURPOSE:
C TO INPUT ELEMENT MATERIAL SET NUMBERS AND MATERIAL
C PROPERTIES FOR EACH MATERIAL SET
C
C 10.2 INPUT:
C ELEMENT MATERIAL SET NUMBERS AND MATERIAL PROPERTIES
C FOR EACH MATERIAL SET ARE READ FROM THE USER-SUPPLIED
C FILE ASSIGNED TO UNIT "INF"
C
C 10.3 OUTPUT:
C ELEMENT MATERIAL SET NUMBERS AND MATERIAL PROPERTIES
C FOR EACH MATERIAL SET ARE WRITTEN TO THE USER-DEFINED
C FILE ASSIGNED TO UNIT "OUTF"
C
C 10.4 DEFINITIONS OF VARIABLES:
C MATSET(I) - MATERIAL SET NUMBER FOR ELEMENT I
C NUMMAT - NUMBER OF MATERIAL SETS
C NUMPROP - NUMBER OF MATERIAL PROPERTIES IN EACH
C MATERIAL SET
C PROP(I,J) - MATERIAL PROPERTY J FOR MATERIAL SET I
C
C 10.5 USAGE:
ELEMENT MATERIAL SET NUMBERS ARE READ IN SEQUENTIALLY,
ONE ELEMENT NUMBER AND MATERIAL SET NLP'•ER PER LINE.
MATERIAL SET NUMBERS FOR "MISSING" ELEMENTS ARE
GENERATED BY THE SUBROUTINE BY ASSIGNING THE MATERIAL
SET NUMBER OF THE PRECEEDING ELEMENT TO EACH "MISSING"
ELEMENT. TO TERMINATE INPUT OF ELEMENT MATERIAL SET
NUMBERS, PLACE A -1 IN ALL FIELDS OF THE INPUT FILE.
THE PROGRAM THEN READS THE NUMBER OF MATERIAL SET
PROPERTIES IN EACH MATERIAL SET (THE NUMBER OF MATERIAL
PROPERTIES IN EACH MATERIAL SET IS THE SAME). THEN
THE MATERIAL PROPERTIES FOR EACH MATERIAL SET ARE READ IN
SEQUENTIALLY, ONE MATERIAL SET NUMBER AND ONE SET OF
MATERIAL PROPERTIES PER LINE. INPUT IS TERMINATED
AUTOMATICALLY WHEN THE LAST MATERIAL SET PROPERTIES ARE

SUBROUTINES CALLED:
NONE

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, CHAPTER 10.

**********************************************************************
$INCLUDE:•COMALL •
INTEGER OLDELM, ELM, SETNUM
C
OLDELM - MAX4
NUMMAT = 0
C READ FROM INPUT FILE: ELEMENT NUMBER, AND MATERIAL SET NUMBER
10 READ(INF,*) ELM,MATSET(ELM)
IF (ELM .EQ. -1) GOTO 30
DETERMINE THE NUMBER OF MATERIAL SETS
IF (MATSET(ELM) .GT. NUMMAT) NUMMAT = MATSET(ELM)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

324 ß SubroutineMateft

GENERATE THE MATERIAL SET NUMBER FOR EACH "MISSING" ELEMENT


IF (ELM .GT. OLDELM + 1) THEN
DO 20 I - OLDELM + 1, ELM - 1
MATSET (I) = MATSET (I-l)
2O CONTINUE
END IF
OLDELM = ELM
GOTO 10
c WRITE THE MATERIAL SET NUMBER FOR EACH ELEMENT TO OUTPUT FILE
30 IF (N7JMELM .GT. 0) THEN
WRITE (OUTF, 40)
40 FORMAT(//2X, •ELEMENT •/4X, •NO. ', 9X, 'MATERIAL SET NUMBER' /
1 2X, ' ....... ', 7X, ' .................... ')
DO 60 I = 1, NUMELM
WRITE (OUTF, 50) I,MATSET (I)
50 FORMAT (I6, I20)
60 CONTINUE
C READ FROM INPUT FILE: THE NUMBER OF PROPERTIES IN EACH
MATERIAL SET
READ ( INF, * ) NUMPROP
IF (NUMPROP .EQ. 1) THEN
WRITE(OUTF, 70) (' ',I-1,2)
ELSEIF (NU'•ROP .EQ. 2) THEN
WRITE (OUTF, 70) (' ', I=l, 2)
ELSEIF (NUMPROP .EQ. 3) THEN
WRITE(OUTF, 70) (• ', I=l, 2)
ELSEIF (NUMPROP .GE. 4) THEN
WRITE(OUTF, 70) (• ',I=1,2)
ENDIF
70 FORMAT(//2X, 'MATERIAL'/3X, ' SET NO. ', 3X, A,
'MATERIAL PROPERTIES '/2X, ' ........ ', 3X, A,
! .................... !)
WRITE MATERIAL PROPERTIES INFORMATION TO OUTPUT FILE
DO 90 I = 1, NUMMAT
READ (INF, *) SETNUM, (PROP (SETNUM, J) , J--1,NUMPROP)
WRITE (OUTF, 80) SETNUM, (PROP (SETNUM, J) , J=I,NUMPROP)
80 FORMAT (I7, 7X, 8 (1P4E15.6/14X))
90 CONTINUE
ELSE
WRITE (OUTF, 100)
100 FORMAT (' NO ELEMENT MATERIAL PROPERTY DATA READ. ')
ENDIF
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 11

SUBROUTINE BOUND

11,1 PURPOSE

SubroutineBOUND inputsspecifiedvaluesof the field variable(hydraulichead,


pressure head,or soluteconcentration)andspecifiedvaluesof eithergroundwater
flow or
soluteflux, for selectednodesin mesh. Thesevaluesareusedto representDirichlet and
Neumannboundary conditions
for thegroundwaterflow andsolutewansportequations.

11.2 INPUT

Specified valuesof thefieldvariableareread"free-format"fromtheuser-supplied


file
assignedto unit "INF". INF is passedto the subroutinethrougha labeledcommonblock
containedin thef'fie"COMALL"(SeeChapter7 for a listingof COMALL). Thenspecified
valuesof eithergroundwater or soluteflux arereadfrom INF.

11.3 OUTPUT

Specifiedvalues of the field variable (hydraulichead, pressurehead, or solute


concentration)
andeithergroundwater flow or soluteflux arewrittento theuser-def'med
file
assigned
to unit"OUTF". Columnheadings areaddedto thelistof specified valueswritten
to OUTF. The character variables "LABELl" and "LABEL2" are used to label the column
headingson OUTF as "HYDR_AULIC HEAD", "PRESSURE HEAD", or "SOLUTE
CONCENTRATION" and "GROUNDWATER FLOW" or "SOLUTE FLUX".

11.4 DEFINITIONS OF VARIABLES

FLUX(I) • Specifiedvalueof groundwater


flow or soluteflux at nodeI.
x(i) = Specified
valueof thefieldvariable(hydraulic
head,pressure
head
or soluteconcentration)
at nodeI.

ICH(I) = 1 if thevalueof thefieldvariableis specified


for nodeI.
= 0, otherwise.

LCH(I) E ICH(k).
k•-I
Thearrays
ICHand
LCH
are
used
insubroutines
ASMBK, ASMBKC, andASMBAD to modifyglobalsystemof
equations
for specified
valuesof thefieldvariable.
LABEL1 = Charactervariableusedto label columnheadingsfor specified
valuesof the field variableon the file assignedto unit OUTF.

325
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

326 Subroutine Bound

LABEL1 --"HYDRAULIC HEAD", "PRESSURE HEAD", or


"SOLUTE CONCENTRATION".

LABEL2 = Charactervariableusedto label columnheadingsfor specified


valuesof groundwater
Howor solutefluxonthefile assigned
tounit
OUTF. LABEL2 = "GROUNDWATER FLOW" or "SOLUTE
FLUX".

NDN = Numberof nodeswithspecified


valuesof thefieldvariable(named
for "Numberof DirichletNodes").
NDOF = Number of nodes where the value of the field variable are unknown
(namedfor "Numberof Degreesof Freedom).
= NUMNOD- NDN.

NNN -- Numberof nodeswith specifiedvaluesof groundwaterflow or


soluteflux (namedfor "Numberof NeumannNodes).

11.5 USAGE

Specifiedvaluesof thefieldvariablearereadfirst,onenodenumberandthespecified
valueof thefieldvariableatthatnodeperline. Thenodenumbers andspecifiedvaluescan
belistedin anyorderontheinputfile. Th$v•10eof thefieldvariablemustbespecified for
at leastonenodein themesh. Inputis terminated by placinga -1 in bothfields. Specified
valuesof groundwater flowor solutefluxarereadnext,onenodenumberandthespecified
valueof groundwater flow or soluteflux at thatnodeperline. The nodenumbers and
specifiedvaluescanbelistedin anyorderontheinputfile. Inputis'terminated byplacing a
-1 in both fields.
The meshin Figure11.1is for anunsaturated
groundwater
flow problem.In thiscase,
the calling programwould assignthe characterstrings"PRESSUREHEAD" and
"GROUNDWATER FLOW", to the character variables "LABELl" and "LABEL2",
respectively.Fourvaluesof pressureheadarespecified (atnodes1, 2, 5, and6) andthere
are no specifiedvaluesof groundwater flow. Specifiedvaluesof pressureheadare
assignedto thearray"X", theremaining
entriesof X arearbitrarilyassigneda valueof zero
(thevaluesof pressureheadat thesenodeswill be computedby subroutine SOLVE, see
Chapter13). Theentriesof thearrays"ICH"and"LCH"areassigned and,sincethereare
no specifiedvaluesof groundwaterflow, theentriesof the arrayareassigned a valueof
zero.AfterBOUND is executed thesearrayswouldcontainthefollowing:

I x(I) ICH(I) LCH(I) FLUX(I)


1 -10. 1 1 o.
2 -10. 1 2 o.
3 o. 0 2 o.
4 o. 0 2 o.
5 -5. 1 3 o.
6 -5. 1 4 o.

The meshin Figure11.2is for a saturated


groundwater
flow problem.In thiscasethe
calling program would assignthe characterstrings "HYDRAULIC HEAD" and
"GROUNDWATER FLOW" to the character variables "LABEL1" and "LABEL2",
respectively.Fivevaluesof hydraulicheadarespecified(at nodes3, 5, 8, 10,and13) and
a pumpingwell is locatedat node7. After BOUND is executedtheentriesof arraysX,
ICH, LCH, andFLUX wouldcontainthefollowing:

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter11 327

X(I) ICH(I) LCH(I) FLUX(I)


1 0. 0 0 0.
2 0. 0 0 0.
3 10. 1 1 0.
4 0. 0 1 0.
5 10. 1 2 0.
6 0. 0 2 0.
7 0. 0 2 -10.
8 10. 1 3 0.
9 0. 0 3 0.
10 10. 1 4 0.
11 0. 0 4 0.
12 0. 0 4 0.
13 10. 1 5 0.

2 4 6
!g=-10 •=-5

lit =-10 •=-5


1 3 5

InputData'
1 -10.
2 -10.
5 -5.
6 -5.
-1 -1
-1 -1

Output'
NODE SPECIFIED
NO. PRESSURE HEAD

I -10.00
2 -10.00
5 -5.00
6 -5.O0

NUMBER OF NODES WITH SPECIFIED PRESSURE HEAD = 4

NUMBER OF NODES WITH SPECIFIED GROUNDWATER FLOW = 0

Figure 11.1 Example input data and output for subroutine BOUND.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

328 Subroutine Bound

h--10

3 5 8 10 13

12

-lOm/a

1 4 6 9

InputData'
3 10.
5 10.
8 10.
10 10.
13 10.
-1 -!
7 -10.
-1 -1

Output'
NODE SPECIFIED
NO. HYDRAULIC HEAD

3 10.00
5 10.00
8 10.00
10 10.00
13 10.00

NUMBER OF NODES WITH SPECIFIED HYDRAULIC HEAD = 5

NODE SPECIFIED
NO. GROUNDWATER FLOW

7 - 10.00

NUMBER OF NODES WITH SPECIFIED GROUNDWATER FLOW = 1

Figure 11.2 Example input data and output for subroutine BOUND.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter11 329

11.6 SOURCE CODE LISTING

SUBROUTINE BOUND
**********************************************************************
c
c 11.1 PURPOSE:
C TO INPUT SPECIFIED VALUES OF THE FIELD VARIABLE
C (HYDRAULIC HEAD, PRESSURE HEAD, OR SOLUTE CONCENTRATION)
C AND SPECIFIED VALUES OF GROUNDWATER FLOW OR SOLUTE FLUX,
C FOR SELECTED NODES.
C
C 11.2 INPUT:
C SPECIFIED VALUES OF THE FIELD VARIABLE AND SPECIFIED
C VALUES OF GROUNDWATER FLOW OR SOLUTE FLUX ARE READ
C FROM THE USER-SUPPLIED FILE ASSIGNED TO UNIT "INF".
C
C 11.3 OUTPUT:
C SPECIFIED VALUES OF THE FIELD VARIABLE AND SPECIFIED
C VALUES OF GROUNDWATER FLOW OR SOLUTE FLUX ARE WRITTEN
C TO THE USER-DEFINED FILE ASSIGNED TO UNIT "OUTF".
C
C 11.4 DEFINITIONS OF VARIABLES:
C FLUX(I) - SPECIFIED VALUE OF GROUNDWATER FLOW OR
C SOLUTE FLUX AT NODE I
C ICH(I) • i IF THE VALUE OF THE FIELD VARIABLE IS
C SPECIFIED FOR NODE I,
C - 0 OTHERWISE
C LCH(I) • ICH(I) + ICH(I-1) + ICH(I-2) + ...
C THE ARRAYS ICH AND LCH ARE USED TO MODIFY
C GLOBAL SYSTEM OF EQUATIONS IN SUBROUTINES
C ASMBK, ASMBKC, AND ASMBAD
C LABEL1 - CHARACTER VARIABLE USED TO LABEL COLUMN
C HEADINGS FOR SPECIFIED VALUES OF THE FIELD
C VARIABLE ON FILE ASSIGNED TO UNIT OUTF.
C LABEL1 = "HYDRAULIC HEAD", "PRESSURE HEAD"
C OR "SOLUTE CONCENTRATION"
C LABEL2 = CHARACTER VARIABLE USED TO LABEL COLUMN HEADINGS
C FOR SPECIFIED VALUES OF GROUNDWATER FLOW OR
C SOLUTE FLUX ON FILE ASSIGNED TO UNIT OUTF.
C LABEL2 • "GROUNDWATER FLOW" OR "SOLUTE FLUX"
C NDN - NUMBER OF NODES WITH SPECIFIED VALUES OF THE
C FIELD VARIABLE (NAMED FOR NUMBER OF DIRICHLET
C NODES )
C NDOF - NUMBER OF NODES WHERE THE VALUE OF THE FIELD
C VARIABLE IS UNKNOWN (NAMED FOR NUMBER OF DEGREES
C OF FREEDOM)
C NNN = NUMBER OF NODES WITH SPECIFIED VALUES OF
C GROUNDWATER FLOW OR SOLUTE FLUX (NAMED FOR NUMBER
C OF NEUMANN NODES)
C X(I) • SPECIFIED VALUE OF THE FIELD VARIABLE
C (HYDRAULIC HEAD, PRESSURE HEAD, OR
C SOLUTE CONCENTRATION) AT 'NODE I
C
C 11.5 USAGE:
C SPECIFIED VALUES OF THE FIELD VARIABLE ARE READ FIRST, ONE
C NODE NUMBER AND THE SPECIFIED VALUE OF THE FIELD VARIABLE
C AT THAT NODE PER LINE. THE NODE NUMBERS CAN BE LISTED IN
C ANY ORDER ON THE INPUT FILE. THE VALUE OF THE FIELD
C VARIABLE MUST BE SPECIFIED FOR AT LEAST ONE NODE IN THE
C MESH. INPUT IS TERMINATED BY PLACING A -1 IN BOTH FIELDS.
C SPECIFIED VALUES OF GROUNDWATER FLOW OR SOLUTE FLUX ARE

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

330 Subroutine
Bound

READ NEXT, ONE NODE NUMBER AND THE SPECIFIED VALUE OF


GROUNDWATER FLOW OR SOLUTE FLUX AT THAT NODE PER LINE.
THE NODE NUMBERS AND SPECIFIED VALUES CAN BE LISTED IN ANY
ORDER ON THE INPUT FILE. INPUT IS TERMINATED BY PLACING
A -1 IN BOTH FIELDS.

SUBROUTINES CALLED:
NONE

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, CHAPTER 11.

**********************************************************************
$INCLUDE: 'COMALL'
C
C INITIALIZATION
DO 10 I m 1, NUMNOD
ICH (I) "0
FLUX(I) m 0.
10 CONTINUE

C READ FROM INPUT FILE: NODE NUMBER AND SPECIFIED VALUE OF


C FIELD VARIABLE
2O READ (INF, *) I,X(I)
IF (I .NE. -1) THEN
IF(NDN .EQ. 0) WRITE(OUTF, 30) LABEL1
3O FORMAT(//3X, 'NODE', 15X, 'SPECIFIED'/4X, 'NO. ', 10X, A/
2X, ' ...... ', 9X, ' ..................... ')
NDN - NDN + 1
ICH (I) ' 1
WRITE INFORMATION JUST READ TO OUTPUT FILE
WRITE (OUTF, 40) I,X(I)
40 FORMAT(I6, 10X, F15.4)
GOTO 20
ENDIF
WRITE (OUTF, 50 ) LABEL1, NDN
50 FORMAT(//' NUMBEROF NODES WITH SPECIFIED ',A, • '•',I7)
NNN'0
C READ FROM INPUT FILE: NODE NUMBER AND SPECIFIED VALUE OF
C GROUNDWATER FLOW OR SOLUTE FLUX
60 READ (INF, *) I, FLUX (I)
IF (I .NE. -1) THEN
IF (NNN .EQ. 0) WRITE(OUTF, 30) LABEL2
NNN • NNN + 1
WRITE THE INFORMATION JUST READ TO OUTPUT FILE
WRITE (OUTF, 40) I, FLUX (I)
GOTO 60
ENDIF
WRITE (OUTF, 50 ) LABEL2, NNN
LCH(1) " ICH(1)
DO 70 I • 2, NUMNOD
LCH(I) = LCH(I-1) + ICH(I)
70 CONTINUE
NDOF - NUMNOD - NDN
RETURN
END

Copyright American Geophysical Union


Chapter 12

SUBROUTINE ASMBK

12.1 PURPOSE

Subroutine ASMBK assembles the global conductance matrix [K] and the global
specified flow matrix (F) (equation 5.1). The global matrices are modified during the
assembly process to account for specified values of the field variable (hydraulic head or
pressure head) and groundwater flow. ASMBK also computes the semi-bandwidth and the
number of degrees of freedom for the modified system of equations.

12.2 INPUT

None

12.3 OUTPUT

The semi-bandwidth and number of degrees of freedom for the modified system of
equations are written to the user-defined rue assigned to unit "OUTF".

12.4 DEFINITIONS OF VARIABLES

B(I) Modified specified flow matrix.

E = Element number.

ELEMTYP(I) = Element type for element I (see Table 9.1 for a list of element
types).

FLUX(I) =
Specified value of groundwater flow at node 1.

ICH(I) =
1 if the value of the field variable is specified for node I,
=
0 otherwise.

IJSIZE = Length of array M.

KE(I,J) = Conductance matrix for element e in full matrix storage.

LCH(I) = I ICH(k). The arrays ICH and LCH are used to modify the
k=l
global system of equations for specified values of the field
variable.

M(IJ) Modified global conductance matrix in vector storage.

331
332 Subroutine ASMBK

NDOF = Number of nodes where the value of the field variable is


unknown.

NODETBL(I) = Number of nodes in element type I.

NUMELM = Number of elements in mesh.

SBW = Semi-bandwidth of modified global conductance matrix.

XCI) = Value of the field variable (hydraulic head or pressure head) at


node I.

12.5 USAGE

Subroutine ASMBK assembles the global conductance matrix [K] and the global
specified groundwater flow matrix (F). [K] and (F) are modified to account for specified
values of the field variable (hydraulic head or pressure head) during the assembly process,
using the procedures in Chapter 4. The global conductance matrix is assembled and
modified in vector storage in the array M. The modified, global specified flow matrix is
stored in the array B. Arrays M and B can be passed to subroutines DECOMP and SOLVE
(see Chapter 13) to obtain the remaining unknown values of head.
The number of degrees of freedom (number of unknown values of the field variable),
NDOF is computed in subroutine BOUND as

NDOF = NUMNOD - NDN (12.2)

where NUMNOD is the number of nodes in the mesh (Chapter 8) and NDN is the number
of nodes with specified values of the field variable (Number of ,Qirichlet Nodes) (Chapter
11). The semi-bandwidth, SBW for the modified system of equations is computed in
ASMBK using

SBW = R+ 1 (1 2 . 3)

where R is the maximum difference in node numbers for any two nodes within any element
in the mesh. However, if the value of the field variable is specified for a node, that node is
IlQ1 used in the calculation of R (because the row in [K] for that node will be eliminated
when [K] is modified for the specified value of head).
The element conductance matrices are computed in a set of subroutines, one subroutine
for each element type (fable 12.1). Each subroutine name in this set begins with the letter
"K" (for the element conductance matrix [K(e)]) followed by three or four letters that
identify the element type and the number of nodes in elements of that type. For example,
subroutine KBAR2 computes the element conductance matrix for one-dimensional, linear
bar elements and subroutine KPAR20 computes the element conductance matrix for three­
dimensional, quadratic parallelepiped elements. Subroutines KTRI3A and KREC4A
compute the element conductance matrix for two-dimensional (axisymmetric) linear triangle
and linear rectangle elements, respectively.
The source code listing for each element conductance matrix subroutine gives the
figure containing the interpolation functions and the equation used to compute [K(e)] for that
element type. Subroutines KBAR2, KTRI3. KREC4, and KTRI3A use analytical methods
to compute [K(e) ] (Section 4.3.1), The rest of the subroutines use numerical methods
!
ij
i::i

Table 12.1 SubroutiRes used to cfHRpute e1eJlleRt conductance matrices in ASMBK.

Element Type Description Subroutine Name DIM

1 Unearbar KBAR2 1
2 Quadratic bar KBAR3 1
3 Cubic bar KBAR4 1
4 Unear triangle KTRI3 2
5 Linear rectangle KREC4 2
6 Linear quadrilateral KQUA4 2
7 Quadratic quadrilateral KQUA8 2
8 Cubic quadrilateral KQUA12 2
9 Linear parallelepiped KPAR8 3
10 Quadratic parallelepiped KPAR20 3
11 Cubic parallelepiped KPAR32 3
12 Linear ttiangle (axisymmettic) KTRI3A* 4
13 Linear rectangle (axisymmetric) KREC4A* 4

*Source code listing not provided for these subroutines.

...

334 Subroutine ASMBK

(Section 4.3.2). An attempt has been made to choose FORmAN variable names that are
suggestive of the symbols used in the equations in Chapter 4. A list of the most imponant
FORnAN variable names and their symbols &Ie in Table 12.2.
The operation of ASMBK is most easily explained by considering specific exa mples .

The mesh in Figure 12.1 contains four nodes (NUMNOD = 4) and three elements
(NUMELM = 3).

(1)
hi=10m • •
1 2

K�l) = K�) = K�) = 0. 02 mid


L(1)=5, L(2)=6, L (3)=4m
Fiaure 12.1 Example mesh for ASMBK.

The value of hydraulic head is specified at nodes one and four (lCH(l) = ICH(4) = I,
NON = 2) and we are to compute the head at nodes two and three.NOOF = 4 - 2 = 2 and
SBW = 1+1 = 2. All elements are the same type, ELEMTYP(l) = ELEMTYP(2) =
ELEMTYP(3) = 1, corresponding to a linear bar element type (Table 12.1). This element
type has two nodes (NODETBL(l) = 2) and the element conductance matrix for this
element type &Ie computed using subroutine KBAR2. The results &Ie:

for element 1
E = 1
KE
=
[ 0.0040 -0.0040 ]
-0.0040 0.0040

for element 2
E=2
KE
=
[ 0.0033 -0.0033 ]
-0.0033 0.0033

for element 3
[ 0.0050 -0.00501

O]{ 1O} {O}


KE

[
E=3 =
-0.0050 0.0050J

The global system of equations for this problem is

0.0040 -0.0040 0 hi=


-0.0040 0.0073 -0.0033 0 h2 0
=
o -0.0033 0.0083 -0.0050 h3 0
o 0 -0.0050 0.0050 h4 = 0 0

which can be modified to give

[ 0.0073 -0.0033 ]{ } { }
h2
=
0.04
(12.4)
-0.0033 0.0083 h3 0
Chilpter 12 335

{ }
Equation 12.4 is stored in three arrays in ASMBK: M, X, and B

0.0073
M= -0.0033
0.0083

These arrays can be passed to subroutines DECOMP and SOLVE (see Chapters 13) to
obtain hZ and h3.
For ano ther example consider the mesh in Figure 12.2.

noclenwnber

3 6 8
I/: node coordinates

11
(0,10) (5,10) ( 10, 10) . ( 15,10)

element
(1) nwnber

h= 10 2 (0,5) ....-_Q--. 5 (5,5) �4 ) 10 ( 15,5) h = 0

1 4 7 9
(0,0) (5,0) ( 10,0) (15,0)

K�l) = K�) K�) K�4)= 1. 0 mid


= =

K�l) = K�2) K?) K�4)= 1.0 mid


= =

x Q=-100m3/d

Element Node Numbers


Number 1 2 3 4 5 6 7 8

1 2 5 6 3
2 1 5 2
3 1 4 5
4 4 7 9 10 11 8 6 5

Figure 12.2 Example mesh ror ASMBK.


t.»
t.»
0\
Table 12.2 Definitions ror selected variables in element conductance matrix subroutines.

FORmAN Variable Definition Symbol(s) in Text


or Array Name

AE4 4 x (Area of element) 4A(e)

DETJAC Determinant of Jacobian matrix at I J(£j) I or I J(£j.1'Ij) I or I J(£j.1'Ij.tk) I


Gauss point

aNj aNj aNj


DNDXI(I) Partial derivative of interpolation Te(£j) or Te(£j.1'Ij) or Te(£j.1'Ij.tk)
function for node I with respect to
£ at Gausspoint
aNi aNj
DNETA(I) Panial derivative of interpolation
ail(£j.1'Ij) or ail(£j.1'Ij.t k)
function for node I wi th respect to
1'1 at Gausspoint

aN·l
DNDZETA(I) Panial derivative of interpolation
at (£j.1'Ij.tk)
function for node I with respect to
VJ
t at Gausspoint g-
o

aNi aNi aNi �.
DNDX(I) Panial derivative of interpolation ax-(£j) or
ax-(£j.1'Ij) or ax-(£j.1'Ij.tk) Ii
VJ
»-
function for node I with respect to
x at Gau sspoin t ��
aNj aNj
DNDY(I) Partial derivative of interpolation (Ej.1'Ij) or (E )
ay ay j.1'Ij.tk (')
:r
function for node I with respect to �
y at Gausspoint Ii
...
l,)
aNj
DNDZ(I) Partial derivative of interpolation Tz(£it1'lj.tk)
function for node I with respect to
z at Gausspoint

JAC(I.J) Jacobian matrix at Gauss point [J(£j» or [J(£j.1'Ij)] or [J(Ej.1'Ij.tJ]

l 1 or
JACINV(I.J) Inverse of Jacobian manix at Gauss [J(£jf ] or [J(Ej.1'Ijf ] [J(Ej.1'Ij.ttl-1]
point

KE(I.J) Conductance matrix for element e [K(e)]

KXE Hydraulic conductivity in x direction Kx(e)


for element e

KYE Hydraulic conductivity in y direction Ky(e)


for element e

Hydraulic conductivity in z direction


KZE
I4e)
for element e

IE Length of element e L (e)

W(I) Weight for Gauss point I

XI(I). ETA(I). Location of Gauss po ints in £, 1'1. and t coordinate E. 1'1. t


ZETA(I) directions
...,
SIGNl(I).SIGN2(I). Algebraic signs of terms in interpolation £j; 1'Ij. tk �
SIGN3(I) functions and derivatives for node I.
338 Subroutine ASMBK

The mesh contains eleven nodes (NUMNOD ::: 11) and four elements (NUMNOD ::: 4).
The value of hydraulic head is specified at nodes 1,2,3,9, 10, and 11 (NON::: 6) and we
are to compute the head at nodes 4, 5,6, 7, and 8. NDOF::: 11 - 6 = 5 and SBW = 4 + 1
= S. where the maximum difference in node numbers occurs in element 4 (nodes 1,2.3,9,
10,and 11 are not used to calculate SBW). Element 1 is a linear rectangle (ELEMTYP(I)
::: 5, with NODETBL(5) ::: 4), elements 2 and 3 are linear triangles (ELEMTYP(2) :::
ELEMTYP(3) ::: 4, with NODETB(4) ::: 3), and element 4 is a quadratic quadrilltteral
(ELEMTYP(4) = 7. with NODETBL(7) = 8). The element conductance matrix for element
1 is computed by subroutine KREC4:

l)
[K( ] =
[ 2 S 6
0.666 -0.166 -0.333 -0.166 2
-0.166 0.666 -0.166 -0.333 S
3
]
-0.333 -0.166 0.666 -0.166 6
-0.166 -0.333 -0.166 0.666 3

the element conductance matrices for elements 2 and 3 are computed by subroutine KTRI3:

)
[K(2 ] =
[ 1
0.500
0.000
S
0.000 -0 . 500
0.500 -0.500
2
] 1
S
-0.500 -0.500 1.000 2

[K(3)] =
[ 1
0.500 -0.500
-0.500
4
0.000
1.000 -0.500
S
] 4
1

0.000 -0.500 0.500 s

and the element conductance matrix for element 4 is computed by subroutine KQUA8:

4 7 9 10 11 8 6 S
1.555 -0.822
· 0.500 -0.511 0..511 -0.511 0.500 -0.822 4
-0.822 2.311 -0.822 0.000 -0.511 0.355 -0.511 0.000 7
0.500 -0.822 1.155 -0.822 0.500 -0.511 0.511 -0.511 9
-0.511 0.000 -0.822 2.311 -0.822 0.000 -0.511 0.355 10
0.511 -0.511 0.500 -0.822 1.152 -0.822 0.500 -0.511 11
-0.511 0.355 -0.511 0.000 -0.822 2.311 -0.822 0.000 8
0.500 -0.511 0.511 -0.511 0.500 -0.822 1.155 -0.822 6
-0.822 0.000 -0.511 0.355 -0.511 0.000 -0.822 2.311 S

The global system of equations for the problem is


Chapter 12 339

1 1.000 -0.500 0.000 -O.SOO 0.000 0.000 0.000 0.000 0.000 0.000 0.000 h1=10 0
2 -0.500 1.666 -0.166 0.000 -0.666 -0.333 0.000 0.000 0.000 0.000 0.000 h2=10 0
3 0.000 -0.166 0.666 0.000 -0.333 -0.166 0.000 0.000 0.000 0.000 0.000 h3=10 0
1--------------------,
4 -0.500 0.000 0.000: 2.555 -1.322 O.SOO -0.822 -0.511: O.SOO -0.511 0.511 h4 0
s 0.000 -0.666 -0.333 :-1.322 3.977 -0.988 0.000 0.000:-0.511 0.355 -0.511 hs -100
6 0.000 -0.333 -0.166: 0.s00 -0.988 1.821 -0.511 -0.822: 0.s11 -O.s11 0.500 h6 0
I I
7 0.000 0.000 0.000 :-0.822 0.000 -0.511 2.311 0.355 :-0.822 0.000 -0.511 h7 0
s 0.000 0.000 0.000 :-0.511 0.000 -0.822 0.355 2.311 :-0.511 0.000 -0.822 hs 0
9 0.000 0.000 0.000' o.sexf :tf5ii -0:5ii :0.11"22 --CUll" 1.155 -0.822 0.500 h9=0 0
10 0.000 0.000 0.000 -0.511 0.355 -O.Sl1 0.000 0.000 -0.822 2.311 -0.822 h l0= 0 0
11 0.000 0.000 0.000 0.511 -0.511 O.SOO -0.511 -0.822 0.500 -0.822 1.155 hll=O 0

Figure 12.3 Global system 01 eqaatiODs lor the mesh iD Figure 12.3.

After modifying the global system for the six specified values of hydraulic head we
have

2.SSS -1.322 0.500 -0.822 -o.Sl1 h4 -S


-1.322 3.977 -0.988 0.000 0.000 hS -90
0.500 -0.988 1.821 -o.Sl1 -0.822 h6 = 0 (12.5)
-0.822 0.000 -0.511 2.311 0.35S h7 0
-o.SI1 0.000 -0.822 0.35S 2.311 hs 0

Equation 12.S is stored in arrays M, X. and B

2.55S
-1.322
0.500
-0.822
-0.511
h4

!':°l
3.977
-0.988 hs
M= 0.000 X= h6 B= 0
0.000 h7 o
1.821 o
hs
-0.511
-0.822
2.311
0.355
2.311

These arrays can be passed to subroutines DECOMP and SOLVB to obtain h4. h5. h6. h7
and h8 '
340 Subroutine ASMBK

12.6 SOURCE CODE LISTING

SUBROUT INE ASMBK


C* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
C
C 12 . 1 PURPOSE:
C SUBROUTINE ASMBK ASSEMBLES THE GLOBAL CONDUCTANCE MATRIX
C AND THE GLOBAL SPEC I F I ED FLOW MATRIX . THE GLOBAL MATRICES
C ARE MOD IF IED DURING THE ASSEMBLY PROCESS TO ACCOUNT FOR
C SPEC I F I ED VALUES OF THE F IELD VAR IABLE AND GROUNDWATER
C FLOW DURING THE ASSEMBLY PROCESS . THE GLOBAL CONDUCTANCE
C MATRIX IS ASSEMBLED AND MOD I FIED IN VECTOR STORAGE . ASMBK
C ALSO COMPUTES THE SEMI-BANDWIDTH AND THE NUMBER OF DEGREES
C OF FREEDOM FOR THE MOD IF IED GLOBAL CONDUCTANCE MATRIX .
C
C 12. 2 INPUT :
C NONE
C
C 1 2. 3 OUTPUT :
C THE SEM I-BANDWIDTH AND NUMBER OF DEGREES OF FREEDOM FOR
C THE MOD IFIED GLOBAL CONDUCTANCE MATRI X ARE WR I TTEN TO THE
C U SER-DEFINED F I LE AS S IGNED TO UNIT "OUTF"
C
C 12 . 4 DEF INIT IONS OF VARIABLES :
C B ( I ) - MOD IF IED SPECIF IED FLOW MATRIX
C E - ELEMENT NUMBER
C ELEMTYP ( I ) - ELEMENT TYPE FOR ELEMENT I ( SEE TABLE 9.1
C FOR A L I S T OF ELEMENT TYPES )
C FLUX ( I ) - SPEC I F I ED VALUE OF GROUNDWATER FLOW
C AT NODE I
C ICH ( I ) - 1 IF THE VALUE OF THE F IELD VARIABLE I S
C SPEC I F I ED FOR NODE I ,
C - 0 OTHERWISE
C IJSlZE = LENGTH OF ARRA Y M
C KE ( l , J ) - CONDUCTANCE MATRIX FOR ELEMENT E IN
C FULL MATRIX STORAGE
C LCH ( I ) - lCH ( I ) + ICH ( I - 1 ) + ICH ( I-2) +
C THE ARRA Y S ICH AND LCH ARE U S ED TO MOD IFY
C GLOBAL SYSTEM OF EQUATIONS FOR SPEC I F I ED
C VALUES OF THE F IELD VAR IABLES
C M ( I J) - MOD I F I ED GLOBAL CONDUCTANCE MATRIX
C IN VECTOR STORAGE
C NDOF - NUMBER OF NODES WHERE THE VALUE OF THE
C F I E LD VAR IABLE IS UNKNOWN
C NODETBL ( l ) - NUMBER OF NODES IN ELEMENT TYPE I
C NUMELM - NUMBER OF ELEMENTS IN MESH
C SBW - SEM I-BANDWIDTH OF MOD I F IED GLOBAL
C CONDUCTANCE MATRIX
C XC I ) - VALUE OF THE F IELD VAR IABLE ( HYDRAULIC
C HEAD OR PRES SURE HEAD ) AT NODE I
C
C 12. 5 USAGE :
C THE SEM I -BANDWIDTH OF THE GLOBAL CONDUCTANCE MATRIX
C I S COMPUTED F I RS T. THEN THE ENTRIES OF THE ELEMENT
C CONDUCTANCE MATRIX ARE COMPUTED IN A �ET OF SUBROUTINES ,
C ONE SUBROUT INE FOR EACH ELEMENT TYPE . THE GLOBAL
C CONDUCTANCE MATRI X FOR THE MESH IS AS SEMBLED BY ADD ING
C THE CORRESPOND I NG ENTRIES OF THE ELEMENT CONDUCTANCE
C MATRICES TO THE GLOBAL CONDUCTANCE MATRIX . DURING THE
C ASSEMBLY PROCES S THE GLOBAL CONDUCTANCE MATRI X IS MOD I F IED
Chapter 12 341

C FOR SPEC IF IED VALUES OF HEAD . SPEC I F IED VALUES OF


C GROUNDWATER FLOW ARE ADDED TO THE GLOBAL FLOW MATRIX .
C
C SUBROUT INES CALLED :
C KBAR2 , KBAR3 , KBAR4,KTRI 3 , KREC4 , KQUA4,KQUA8,KQUA1 2 , KPAR8 ,
C KPAR2 0 , KBAR3 2 , KTRI 3A, KREC4A
C LOC
C
C REFERENCE S :
C I S TOK , J . D . GROUNDWATER FLOW AND SOLUTE TRANSPORT
C MODELING BY THE F INITE ELEMENT METHOD , CHAPTER 1 2 .
C
C* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ INCLUDE : ' COHALL '
REAL KE (MAX3 , MAX3 )
INTEGER NODETBL ( 1 3 )
DATA NODETSL / 2 , 3 , 4 , 3 , 4 , 4 , 8 , 1 2 , 8 , 2 0 , 32 , 3 , 4 /
C
C COMPUTE THE SEM I -BANDWIDTH
C
SBW = 1
DO 30 E � 1 , NUHELH
DO 2 0 I a 1 , NODETBL (ELEMTYP ( E »
K I '" I N ( E , I )
I F ( ICH ( K I ) . E Q . 0 . AND . I . LT . NODETBL ( ELEMTYP ( E » ) THEN
II - KI - LCH ( K I )
DO 10 J = I + 1 , NODETBL ( ELEMTYP ( E»
KJ = IN(E , J)
I F ( ICH ( KJ ) . EQ . 0) THEN
JJ '" ABS(KJ - LCH(KJ ) - I I ) + 1
IF (JJ . GT . SBW ) SSW - JJ
END I F
10 CONT INUE
ENDIF
20 CONTINUE
30 CONTINUE
WR I TE ( OUTF, 4 0 ) NDOF , SBW
40 FORMAT( / /, NUMBER O F DEGREES O F FREEDOM I N MOD IF IED K MATRIX - ' ,
1 15 / / / ' SEMI -BANDW IDTH OF MOD IF IED K MATRIX -',IS)
IF (SBW . GT. MAX6) STOP'·· EXCEEDS MAXIMUM SEM I -BAND WIDTH •• '
C I N I T IAL I ZE ENTRIES OF GLOBAL CONDUCTANCE MATRI X TO ZERO
IJS I ZE - SBW • ( NDOF - SSW + 1 ) + (SBW - 1 ) • SBW / 2
DO 50 IJ - 1 , IJSIZE
M ( I J) - 0 . 0
50 CONTINUE
DO 60 I - 1, NUMNOD
IF ( ICH ( I ) . EQ . 0 ) B ( I -LCH ( I ) ) - FLU X ( I )
60 CONT INUE
C LOOP ON THE NUMBER OF ELEMENTS
DO 90 E - 1, NUHELH
C COMPUTE THE ELEMENT CONDUCTANCE MATRIX FOR TH IS ELEMENT TYPE
IF (ELEMTYP(E) .EQ. 1 ) THEN
C ELEMENT IS A ONE -DIMENS I ONAL , L INEAR BAR
CALL KBAR2 (E, KEI
ELSE IF (ELEHTYP(EI .EQ . 2 ) THEN
C ELEMENT IS A ONE -D IMENS IONAL , QUADRAT I C BAR
CALL KBAR3 (E, !tEl
ELSE IF (ELEMTYP(E ) . E Q . 3 ) THEN
C ELEMENT I S A ONE -D IMENS IONAL , CUBIC BAR
CALL KBAR4 ( E , KE )
ELSE I F (ELEMTYP(E ) . EQ . 4 ) THEN
342 Subroutine ASMBK

C ELEMENT I S A TWO-DIMEN S I ONAL, LINEAR TRIANGLE


CALL KTRI 3 ( E , KE )
ELSE IF ( E LEMTYP ( E ) . EQ. 5 ) THEN
C ELEMENT I S A TWO-D IMENS IONAL, LINEAR RECTANGLE
CALL KREC 4 ( E , KE )
ELSEIF ( ELEMTYP ( E ) . EO . 6 ) THEN
C ELEMENT IS A TWO-D IMENS IONAL , LINEAR QUADRI LATERAL
CALL KQUA4 ( E , KE )
ELSEIF ( ELEMTYP ( E ) . EO . 7 ) THEN
C ELEMENT I S A TWO-D IMENS IONAL, QUADRATIC QUADRI LATERAL
CALL KQUA8 ( E , KE )
ELSEIF ( E LEMTYP ( E ) . EQ . 8) THEN
C ELEMENT I S A TWO-D IMENS IONAL , CUBIC QUADRILATERAL
CALL KQUA12 ( E , KE )
ELSE IF ( ELEMTYP ( E ) . EQ . 9) THEN
C ELEMENT IS A THREE-D IMENS IONAL, LINEAR PARALLELEP IPED
CALL KPAR8 ( E , KE)
ELSEIF ( E LEMTYP ( E ) . EQ . 1 0 ) THEN
C ELEMENT IS A THREE-D IMENS IONAL , QUADRAT I C PARALLELEP I PED
CALL KPAR2 0 ( E , KE )
ELSEIF ( ELEMTYP ( E ) . EQ . II) THEN
C ELEMENT IS A THREE-DIMENSIONAL , CUBIC PARALLELEP I P ED
CALL KPAR32 ( E , KE )
ELSEIF ( ELEMTYP ( E ) . EO . 1 2 ) THEN
C ELEMENT IS A TWO-D IMENS IONAL , LINEAR TRIANGLE ( AX I SYMM ETRI C )
CALL KTRI3A ( E , KE )
ELSE I F (ELEMTYP ( E ) . EQ . 13) THEN
C ELEMENT IS A TWO-D IMENS I ONAL, L INEAR RECTANGLE
( AXISYMMETRIC)
CALL KREC 4A ( E , KE )
ENDIF

C
C ADD THE ELEMENT CONDUCTANCE MATRIX FOR TH I S ELEMENT
C TO THE GLOBAL CONDUCTANCE MATRI X
C KE ( I , J ) -----------> M ( IJ) <-> M ( K I , KJ )
C ( FULL MATRIX STORAGE ) (VECTOR MATRI X STORAGE ) ( FULL MATRIX
STORAGE )
C

DO 80 I - 1 , NODETB L ( ELEMTYP ( E ) )
KI • IN ( E , I )
I F ( ICH ( K I ) .EQ . 0 ) THEN
II • KI - LCH ( K I )
DO 7 0 J • 1 , NODETBL ( ELEMTYP ( E ) 1
KJ • IN ( E , J )
IF ( ICH ( KJ ) . NE . 0) THEN
B ( I I ) - B ( I I ) - KE ( I , J) * X ( KJ)
ELSE I F (J . GE . I ) THEN
JJ - KJ - LCH ( KJ )
CALL LOC ( I I , JJ, IJ, NDOF , SBW , SYMM )
M ( IJ ) • M ( IJ ) + KE ( I , J )
END IF

70 CONTINUE
END IF

80 CONTINUE

90 CONTINUE

RETURN
END
Chapter 12. 343

SUBROUTINE LOC ( I , J , IJ, NDOF , SBW, SYMM )


C * * * * * * * * * ** * ** * * * ** ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
C PURPOS E :
C SUBROUTINE LOC COMPUTES THE LOCAT ION IN VECTOR STORAGE
C OF A SPEC I F I ED ROW AND COLUMN OF A MATRIX ( SYMME T RIC OR
C NONSYMME TRI C ) IN FULL MATRIX STORAGE
C
C DEFINIT IONS OF VARIABLES :
C I - SPECIFIED ROW OF MATRIX IN FULL MATRIX STORAGE
C J '" SPECIF IED COLUMN OF MATRIX IN FULL MATRIX
C STORAGE
C IJ '" LOCATION IN VECTOR STORAGE CORRESPOND ING TO
C SPECIF IED ROW AND COLUMN IN FULL MATRIX S TORAGE
C NDOF NUMBER OF DEGREES OF FREEDOM OF MATRI�
C SBW '" SEM I -BANDWIDTH OF MATRIX
C
C REFERENCES :
C I STOK , J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
C MODELING BY THE F INITE ELEMENT METHOD , CHAPTER 5,
C SECTIONS 5.1.3 AND 5. 1.4
C * * * * * * * * * * * * * * * * * *** * ** ** * * * * * * * * ** * ** * * * * * * * * * * * * * ** * * * * * * * * * * * * * * * *
INTEGER SBW
LOGICAL SYMM
c
IF ( SYMM ) THEN
C M IS A SYMM ETRIC MATRIX
II - I
JJ - J
IF ( I . GT . J) THEN
K '" I
I '" J
J '" K
END I F
IJ'" J - I + 1
IF ( I . GT . 1) THEN
IF (SBW . LT . NDOF ) THEN
IJ a IJ + ( I - 1) * SBW
L - I - NDOF + SBW - 2
IF (L . GT . 0 ) IJ '" IJ - L * ( L + 1) I 2
ELSE
I J'" IJ + ( I - 1) * ( NDOF + (NDOF - I + 2» I 2
END IF
END IF
I - II
J - JJ
ELSE
C M IS A NONSYMME T RIC MATRIX
IJ - J
IF ( I . GT . 1) THEN
I F (SBW . LT . NDOF ) THEN
IF ( I . GT . SBW) IJ - IJ + SBW - I
IJ - IJ + (I - 1) * (2 * SBW - 1)
L '" M IN ( SBW, I ) - 1
IJ - IJ - L * «( SBW - 1 ) + ( SBW - L» I 2
L '" I - NDOF + SBW -2
IF ( L .GT . 0 ) IJ - IJ - L * ( L + 1) I 2
ELSE
I J'" IJ + ( I - 1) * NDOF
END IF
ENDIF
END IF
RETURN
END
344 Subroutine ASMBK

SUBROUT INE KBAR2 ( E , KE )


C* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
C
C PURPOSE :
C TO COMPUTE THE ELEMENT CONDUCTANCE MATR I X FOR A
C ONE-DIMENS IONAL , LINEAR BAR ELEMENT
C
C DEF INITIONS OF VARIABLES :
C E • ELEMENT NUMBER
C KE ( I , J ) ELEMENT CONDUCTANCE MATRIX
C KXE • HYDRAULIC CONDUCTIVITY IN X COORDINATE D IRECT ION
C LE - ELEMENT LENGTH
C
C REFERENCES :
C ISTOK , J . D . GROUNDWATER FLOW AND SOLUTE TRANSPORT
C MODELING BY THE F INITE ELEMENT METHOD , CHAPTER 4,
C F I GURE 4. 5 , EQUAT ION 4 . 1 5 .
C
C * * * * * * * * * * * * * * * * * * * * * * *� * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **� *
$ INCLUDE : ' COMALL '
REAL KE (MAX 3 , MAX3 ) , KXE , LE
C
KXE - PROP (MATSET ( E ) , l )
LE • ABS ( X l ( IN ( E , 2» - X l ( IN ( E , l » )
KE ( l , l ) • KXE I LE
KE ( l , 2 ) -KE ( l, l )
KE(2 , 1 ) -KE ( l , l )
KE ( 2 , 2 ) - KE ( l , l )
RETURN
END

SUBROUTINE KBAR3 ( E , KE )
C* * * * * * * * * * * * * * * * * * * * * * ** * * * * * * * * * * * * * * * * * * * * * * * ** * * * * * * * * * * * * * ** * * * * *
C
C PURPOSE:
C TO COMPUTE THE ELEMENT CONDUCTANCE MATR I X FOR ONE -
C D IMENS IONAL, QUADRAT IC BAR ELEMENT
C
C DEFINITIONS OF VAR IABLES :
C D ETJAC . DETERMINANT OF JACOBIAN MATR I X
C DNDX I ( I ) PARTIAL DERIVATIVE OF INTERPOLAT ION
C FUNCTION W I TH RESPECT TO XI AT NODE I
C DNDX (I ) PARTIAL DERIVATIVE OF INTERPOLAT ION
C FUNCTION WITH RESPECT TO X A T NODE I
C E ELUJENT NUMBER
C JAC JACOB IAN MATR I X
C JACINV • INVERSE OF JACOBIAN MATR I X
C KE ( I , J ) - ELEMENT CONDUCTANCE MATRIX
C KXE HYDRAULIC CONDUCT IVITY
C IN X COORDINATE D I RECT ION
C WeI) HE I GHT FOR GAUSS POINT I
C X I ( I ) - LOCAT ION OF GAUSS PO INT I
C IN XI COORD INATE D IRECTION
C
C REFERENCES:
C ISTOK , J . D . GROUNDWATER FLOW AND SOLUTE TRANSPORT
C MODEL ING BY T H E F INITE ELEMENT METHOD , CHAPTER 4 ,
C F IGURE 4 . 9 , EQUATION 4 . 61
C
C* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ****
Chapler 12 34S

$INCLUDE : 'COMALL'
REAL JAC , JACINV , KE (MAX3 , MAX3 ) , DNDXI ( 3 ) , DNDX ( 3 ) , W ( 2 ) ,
1 XI ( 2 ) ,KXE
C
XI ( l ) - 1 / S QRT (3 . )
XI ( 2 ) � -XI (1)
W ( l) - l .
W (2) - l .
KXE - PROP (MATSET ( E ) , l )
DO 30 I = 1, 3
DO 2 0 J - 1, 3
KE ( I , J ) = O .
20 CONTINUE
30 CONT INUE
DO 8 0 I = 1, 2
DNDXI ( l ) = - 0 . 5 + XI ( I )
DNDXI ( 2 ) = -2.0 * XI ( I )
DNDXI ( 3 ) = 0 . 5 + XI ( I )
JAC - 0
DO 40 J - 1 , 3
JAC" JAC + DNDXI ( J ) * X1 ( IN ( E , J»
40 CONTINUE
JACINV - 1 / JAC
DETJAC .. JAC
DO 5 0 J .. 1 , 3
DNDX ( J ) - JACINV * DNDXI ( J )
50 CONTINUE
DO 7 0 J .. 1, 3
DO 6 0 K - 1 , 3
KE ( J , K) - KE ( J , K ) + W ( I ) * KXE * DNDX ( J )
1 * DNDX ( K ) * DETJAC
60 CONT INUE
70 CONTINUE
80 CONTINUE
RETURN
END

SUBROUTINE KBAR 4 ( E , KE )
C * * * * * * * * * * * * * * * * * * * * *� * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
C
C PURPOSE :
C TO COMPUTE THE ELEMENT CONDUCTANCE MATRI X FOR ONE-
C D IMENS IONAL , CUS IC BAR ELEMENT
C
C DEF INITIONS OF VARIABLES :
C DETJAC - DETERMINANT OF JACOBIAN MATRI X
C DNDXI ( I ) .. PARTIAL DERIVATIVE O F INTERPOLAT ION
C FUNCT ION WITH RESPECT TO XI AT NODE I
C DNDX ( I ) .. PARTIAL DERIVATIVE O F INTERP OLAT ION
C FUNCTION WITH RESPECT TO X AT NODE I
C E .. ELEMENT NUMBER
C JAC .. JACOBIAN MATRIX
C JACINV .. INVERSE OF JACOBIAN MATRIX
C KE ( I , J ) - ELEMENT CONDUCTANCE MATRIX
C KXE - HYDRAULIC CONDUCTIVITY IN X
C COORDINATE DIRECTION
C WeI ) WEIGHT FOR GAUSS POINT I
C XI ( I ) - LOCATION O F GAU S S POINT I IN
C XI COORDINATE DIRECTION
346 Subroutine ASMBK

C
C REFERENCES :
C ISTOK , J . D . GROUNDWATER FLOW AND SOLUTE TRANSPORT
C MODELING BY THE FINITE ELEMENT METHOD , CHAP TER 4 ,
C FIGURE 4. 9B , EQUATION 4.6 1
C
C*****************************************************************
$INCLUDE: ' COMALL '
REAL JAC , JACINV , KE (MAX3 , MAX3 ) , DNDXI ( 4 ) , DNDX ( 4 ) , W ( 3 ) ,
1 XI ( 3 ) , KXE
C
X I ( l ) - O.
XI ( 2 ) = SQRT ( 3. / 5 .1
XI ( 3 ) = -XI ( 2)
WI l l - 8 . / 9 .
W ( 2 ) - 5 . / 9.
W ( 3) = W (2 )
KXE - PROP (MATSET ( E ) , l )
DO 3 0 I = 1 , 4
00 2 0 J - 1 , 4
KE ( I , J ) = O.
20 CONTINUE
30 CONTINUE
00 8 0 I - 1, 3
DNDXI ( 1 ) - - ( 9 . / 1 6 . ) * ( 3 . * ( XI ( I ) ** 2 ) -
1 2 . * XI (I ) - 1. / 9 . )
ONDXI ( 2 ) - ( 27 . / 1 6 . ) * ( 3 . * ( X I ( I ) * * 2 ) -
1 ( 2 . / 3 . ) * XI ( I ) - 1 . )
ONDXI ( 3 ) - - ( 2 7. / 1 6 . ) * (3 . * (XI (I) * * 2 ) +
1 ( 2 . / 3. ) * XI (I ) - 1 . )
ONDXI ( 4 ) ( 9 . / 1 6. ) * ( 3 . * ( XI ( I ) * * 2 ) +
1 2 . * XI ( I ) - 1. / 9 . )
JAC - 0
00 4 0 J - 1, 4
JAC - JAC + ONDXI (J ) * X 1 (IN ( E , J »
40 CONTINUE
JACINV - 1 / JAC
OETJAC - JAC
00 50 J - 1 , 4
ONDX ( J ) = JACINV * ONDXI ( J )
50 CONTINUE
00 7 0 J - 1 , 4
00 60 K = 1 , 4
KE (J , K ) - KE (J , K ) + W (I ) * KXE * DNDX (J)
1 * ONDX ( K ) * OETJAC
60 CONTINUE
70 CONTINUE
80 CONTINUE
RETURN
END

SUBROUTINE KTRI 3 ( E , KE )
c*********************************************************************
C
C PURPOSE :
C TO COMPUTE THE ELEMENT CONDUCTANCE MATRIX FOR TWO-
C DIMENSIONAL , LINEAR TRIANGLE ELEMENT
C
C DEFINITIONS OF VARIABLES :
C AE4 - FOUR TIMES ELEMENT AREA
C E - ELEMENT NUMBER
Chapter 12 347

C KE ( I , J) - ELEMENT CONDUCTANCE MATRIX


C KXE .. HYDRAUL I C CONDUCT IV ITY IN X
C COORDINATE D IRECTION
C KYE - HYDRAULIC CONDUCT IVITY IN Y
C COORD INATE DIRECT ION
C
C REFERENCES :
C I S TOK, J . D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
C MODELING BY THE F INITE ELEMENT METHOD , CHAPTER 4 ,
C F I GURE 4 . 6 , EQUATION 4 . 2 0
C
C * * * * * * * * * * * * * *� * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

$ INCLUDE : 'COHALL'
REAL KE (MAX3 , MAX3 ) , KXE , KYE , BE ( 3 ) , CE (3 )
C
KXE � PROP (MAT SET ( E ) , l )
KYE - PROP{MAT S ET{E ) , 2 )
BE{ l ) = X2{ IN{E , 2» - X2{ IN{E , 3»
BE ( 2 ) - X2 ( IN{E , 3 » - X2{IN ( E , l»
BE ( 3 ) - X2{ IN ( E , 1» - X2{ IN{E , 2»
CE{ l ) - X 1 ( IN ( E , 3» - X1{ IN{E , 2»
CE ( 2 ) - X 1{ IN{E , 1» - X 1{IN{ E , 3»
CE ( 3 ) - X 1 ( IN ( E , 2» - X 1{ IN(E,1»
AE4 - 2 * ( X1{ IN{E , 2» * X2{ IN{E , 3» + X1{IN ( E , 1» *
1 X2{IN ( E , 2» + X2 ( IN (E , 1» * X1 ( IN (E , 3» -
2 X2 ( IN ( E , 3 » * X 1 ( IN ( E, 1 » - X 1 ( IN ( E , 3 » *
3 X2{ IN ( E , 2 » - Xl ( IN ( E , 2 » * X2 ( IN (E , 1 » )
DO 2 0 I .. 1 , 3
DO 1 0 J .. 1 , 3
KE{ I,J ) - (KXE * BE ( I ) * BE{J) + KYE * CE ( I ) * CE ( J» I AE 4
10 CONT INUE
20 CONT INUE
RETURN
END

SUBROUT INE KREC 4 ( E , KE )


C * * * * * * ** * * ***** * ** ** * * ** * * * * * ** * * * ** * * * * * * * * * * * ** * * * * * * * * * * * * * * * * * * * *
C
C PURPOSE:
C TO COMPUTE THE ELEMENT CONDUCTANCE MATRIX FOR TWO-
C D IMENS IONAL , LINEAR RECTANGLE ELEMENT
C
C DEFINITIONS OF VARIABLES:
C E - ELEMENT NUMBER
C KE ( I , J) - ELEMENT CONDUCTANCE MATRIX
C KXE - HYDRAUL I C CONDUCT IV ITY IN X
C COORDINATE D I RECT ION
C KYE - HYDRAULIC CONDUCT IVITY IN Y
C COORDINATE D I RECT I ON
C
C REFERENCES:
C I STOK , J . D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
C MODELING BY THE F INITE ELEMENT METHOD , CHAPTER 4 ,
C F IGURE 4 . 7 , EQUAT ION 4 . 2 6
C
C * * * * * * * * * * * * * * * * * * * * * * * * * * ** * * * * * * * * ** * ** * * * * * * * * * * * * * * * * * * * * *** * * * * *
348 Subroutine ASMBK

$ INCLUDE : ' COHALL '


REAL KE (MAX3 , MAX3 ) , KXE , KYE
C
KXE - PROP (HATSET ( E) , l)
KYE - PROP (MATSET ( E) , 2)
AE s AB S ( X2 ( IN ( E , 1 » -X2 ( IN ( E , 3 » ) I 2 .
BE • AB S ( X l ( IN ( E , l » - Xl (IN ( E , 3 » ) I 2 .
CX - KXE * AE I ( 6. * BE )
CY - KYE * BE I ( 6 . * AS)
KE ( l , l ) - 2 . * CX + 2 . * CY
KS ( 1 , 2 ) c -2 . * CX + CY
KE ( 1 , 3 ) - -CX - CY
KE ( 1 , 4 ) CX - 2. * CY
KE ( 2 , 1) - KE (1 , 2 )
KE ( 2 , 2 ) - 2 . * CX + 2. * CY
KE ( 2, 3 ) - cx - 2 . * CY
KE ( 2 , 4 ) - -CX - CY
KE ( 3 , 1 ) - KE (1 , 3 )
KE ( 3 , 2 ) - KE ( 2 , 3 )
KE ( 3 , 3) - 2 . * C X + 2 . * CY
KE( 3 , 4 ) - -2 . * CX + CY
KE ( 4 , 1 ) - KE( 1 , 4 )
KE ( 4 , 2 ) - KE ( 2 , 4 )
KE ( 4 , 3 ) - KE ( 3 , 4 )
KE ( 4 , 4 ) - 2 . * C X + 2 . * CY
RETURN
END

SUBROUT INE KQUA 4 ( E , KE )


C* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
C
C PURPO SE:
C TO COMPUTE THE ELEMENT CONDUCTANCE MATRIX FOR TWO-
C DIMENS IONAL , L INEAR QUADR ILATERAL ELEMENT
C
C DEF INITIONS OF VARIABLES :
C DETJAC - DETERM I NANT OF JACOBIAN MATRIX
C DNDXI ( I) - PART IAL DERIVATIVE OF INTERPOLAT ION
C FUNCTION WITH RESPECT TO XI AT NODE I
C DNDX ( I) - PART I AL DERIVATIVE OF INTERPOLAT ION
C FUNCT ION WITH RESPECT TO X AT NODE I
C DNDETA ( I ) - PART IAL DERIVATIVE OF INTERPOLAT I ON
C FUNCT ION WITH RESPECT TO ETA AT NODE I
C DNDY ( I) - PART IAL DERIVAT IVE OF INTERPOLAT ION
C FUNCT ION WITH RESPECT TO Y AT NODE I
C E - ELEMENT NUMBER
C ETA (I) - LOCAT ION OF GAUSS POINT IN ETA COORD INATE
C D IRECT I ON
C JAC ( I , J ) - JACOB I AN MATR I X
C JACINV ( I , J ) - INVERSE O F JACOBIAN MATRIX
C KE ( I , J) - ELEMENT CONDUCTANCE MATRI X
C KXE - HYDRAUL IC CONDUCTIVITY IN X
C COORD INATE D IRECT ION
C KYE - HYDRAULIC CONDUCT IV ITY IN Y
C COORD INATE D I RECT ION
C W ( I ) - WE IGHT FOR GAUSS POINT I
C Xl ( IN ( E , I) - X COORD INATE FOR NODE I , ELEMENT E
C X2 ( IN ( E , I ) - Y COORD INATE FOR NODE I , ELEMENT E
C XI ( I ) - LOCAT I ON OF GAUSS P OINT IN X I COORD INATE
C . D IRECTION
C
Chapter 12 349

'
C REFERENCES:
C I STOK, J . D . GROUNDWATER FLOW AND SOLUTE TRAN SPORT
C MODELING BY THE F IN I TE ELEMENT METHOD , F IGURE 4 . 1 0 ,
C EQUAT ION 4 . 6 2
C
C**** ***** * ** * * ** * * * ** * * * * * ******* * * * * * * * * * * *** * * * ** * ** * ***** ** * **
$INCLUDE: ' COMALL '
REAL JAC ( 2 , 2 ) , JAC INV ( 2 , 2 ) , KE (MAX3 , MAX3 ) , DNDXI ( 4 ) , DNDX ( 4 ) ,
1 DNDETA ( 4 ) , DNDY ( 4 ) , W ( 2 ) , XI ( 2 ) , E TA ( 2) , S IGN1 ( 4 ) , SIGN2 ( 4 ) ,
2 KXE , KYE
DATA S I GN1 /- 1 . , 1 . , 1 . , - 1 . /
DATA S IGN2 / - 1 . , - 1. , 1 . , 1. /
C
XI ( l ) - 1 . / SQRT ( 3 . )
XI ( 2 ) = -XI ( 1)
ETA ( l ) .. X I ( l )
ETA ( 2 ) .. XI ( 2 )
W (l ) = l .
W ( 2 ) .. l.
KXE - PROP (MATSET ( E ) , l )
KYE .. PROP (MATSE T ( E ) , 2 )

DO 30 K = 1 , 4
DO 2 0 N - 1 , 4
KE ( K , N ) .. o.
20 CONTINUE
30 CONTINUE

DO 1 2 0 I - 1, 2
DO 1 1 0 J - 1, 2

DO SO K - 1 , 2
DO 40 N - 1 , 2
JAC ( K , N ) - O.
40 CONTINUE
SO CONTINUE

DO 6 0 N - 1 , 4
DNDXI ( N ) - 0 . 25 * S IGN1 ( N ) * ( 1 . + S IGN2 ( N ) * ETA ( J»
DNDETA ( N ) - 0 . 2 5 * S IGN2 ( N ) * ( 1 . + S IGN1 ( N ) * X I ( I»
60 CONTINUE
DO 7 0 N .. 1, 4
JAC ( l , l ) - JAC ( l , l ) + DNDXI ( N ) * X1 ( IN (E , N»
JAC ( l , � ) = JAC ( 1 , 2 ) + DNDXI ( N ) * X2 ( IN (E , N»
JAC ( 2 , 1 ) - JAC ( 2 , 1 ) + DNDETA ( N ) * X1 ( IN (E , N »
JAC ( 2 , 2 ) - JAC ( 2 , 2 ) + DNDETA ( N ) * X2 (IN (E , N»
70 CONTINUE
DETJAC - JAC (l , l ) * JAC ( 2 , 2 ) - JAC (1 , 2 ) * JAC ( 2 , 1 )
JACINV ( l , l ) - JAC ( 2 , 2) / DETJAC
JACINV ( 1 , 2 ) .. -JAC (1 , 2 ) / DETJAC
JACINV ( 2 , 1 ) .. -JAC ( 2 , 1 ) / DETJAC
jACINV ( 2 , 2 ) - JAC ( l , l ) / DETJAC
DO 80 N .. 1 , 4
DNDX ( N ) .. JACINq ( l , l) * DNDXI ( N ) + JACINV ( 1 , 2 ) * DNDETA ( N )
DNDY ( N ) - JACINV ( 2 , 1 ) * DNDXI ( N ) + JACINV ( 2 , 2 ) * DNDETA ( N )
80 CONTINUE
DO 1 0 0 K .. 1, 4
DO 90 N - 1 , 4
KE ( K , N ) - KE ( K , N ) + W ( I ) * W ( J ) * ( KXE * DNDX ( K ) *
1 DNDX ( N ) + KYE * DNDY ( K ) * DNDY ( N » ) * DETJAC
90 CONTINUE
350 Subroutine ASMBK

100 CONT INUE


110 CONT INUE
120 CONT INUE
RETURN
END

SUBROUTINE KQUAS(E,KE )
C****** ***************************************************************
C
C PURPOSE:
C TO COMPUTE THE ELEMENT CONDUCTANCE MATRIX FOR TWO-
C D IMENS IONAL , QUADRAT IC QUADRILATERAL ELEMENT
C
C DEF INIT IONS OF VARIABLES:
C DETJAC - DETERMINANT OF JACOBIAN MATRI X
C DNDXI ( I ) - pART IAL DERIVA TIVE O F INTERPOLAT ION
C FUNCTION WITH RESPECT TO XI AT NODE I
C DNDX ( I ) - PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCT ION WITH RE S PECT TO X AT NODE I
C DNDETA ( I ) - PART IAL DERIVATIVE OF INTERPOLATION
C FUNCTION W I TH RESPECT TO ETA AT NODE I
C DNDY ( I ) - PART IAL DERIVA TIVE OF INTERPOLATION
C FUNCT ION WITH RESPECT TO Y AT NODE I
C E - ELEMENT NUMBER
C ETA ( I ) - LOCAT ION OF GAU S S PO INT I I N ETA
C COORD INATE D IRECT ION
C JAC ( I, J ) - JACOBIAN MATRIX
C JACINV( I , J) INVERSE OF JACOBIAN MATRIX
C KE ( I , J) - ELEMENT CONDUCTANCE MATRIX
C KXE - HYDRAULIC CONDUCTIV I TY IN X
C COORDINATE D IRECTION
C KYE - HYDRAULIC CONDUCT IV ITY IN Y
C COORD INATE D IRECTION
C We I ) - WE I GHT FOR GAU S S P OINT I
C X I ( I ) - LOCATION OF GAUSS POINT I I N X I
C COORDINATE D I RECTION
C
C REFERENCE S :
C ISTOK , J . D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
C MODELING BY THE F INITE ELEMENT METHOD , F I GURE 4 . 1 1 ,
C EQUAT ION 4 . 62
C
C*****************************************************************
$ INCLUDE : ' COMALL '
REAL JAC ( 2 , 2 ) , JACINV ( 2 , 2 ) , KE (MAX 3 , MAX 3 ) , DNDXI (B ) ,
1 DNDX (S ) , DNDETA (B ) , DNDY (S ) , W ( 3 ) , XI (S ) , ETA ( 8 ) ,
2 S IGN1 (B ) , S IGN2 ( 8 ) , KXE , KYE
DATA S IGN1 /- 1 . , 0 . , 1 . , 1 . , 1 . , 0 . , - 1 . , - 1 . /
DATA S IGN2 / - 1 . , - 1 . , - 1. , 0 . , 1. , 1 . , 1 . , 0 . /
C
XI ( 1 ) - o.
X I ( 2 ) - SQRT (3 . / 5 . )
XI ( 3 ) - -XI ( 2 )
ETA ( l ) - X I ( l )
ETA ( 2 ) - XI ( 2 )
ETA ( 3 ) = XI ( 3 )
Chapter 12 351

W(1) - 8. / 9.
W ( 2 ) - 5. I 9 .
W( 3 ) - W (2 )
KXE .. P ROP (MATSET ( E ) , l )
KYE - PROP(MATSET(E),2)
DO 30 K - 1, 8
DO 2 0 N - 1 , 8
KE ( K , N) - O.
20 CONT INUE
30 CONTINUE
DO 1 2 0 I - 1, 3
DO 1 1 0 J .. 1 , 3
DO 50 K .. 1, 2
DO 4 0 N - 1 , 2
JAC ( K , N ) .. O.
40 CONT INUE
50 CONT INUE
DO 60 N .. 1 , 8
IF «N . EO . 1) . OR . (N . EO . 3) .OR .
1 (N .EO. 5) . OR . (N .EO . 7» THEN
DNDXI (N) .. 0 . 2 5 * ( 1 . + S IGN2 (N) * ETA ( J» *
1 (2. * S IGN1 (N) *2 * XI ( I) + S IGN2 ( N ) *
*
2 S IGNl ( N ) * ETA ( J»
DNDETA ( N ) .. 0 . 2 5 * ( 1 . + S IGN1 (N) * XI ( I» *
1 (2 . * S I GN2 ( N ) ** 2 * ETA ( J ) + S I GN2 ( N ) *
2 S IGNl ( N ) * X I ( I ) )
EL SEIF «N .EO . 2 ) . OR. (N .EO. 6» THEN
DNDXI ( N ) .. -XI ( I ) * ( 1 . + S IGN2 ( N ) * ETA ( J»
DNDETA ( N ) .. 0 . 5 * S IGN2 ( N ) * ( 1 . - XI ( I ) ** 2 )
ELSE IF «N . EO. 4 ) . OR . ( N . EO . 8» THEN
DNDXI (N) - 0 . 5 * S IGN1 (N) * ( 1 . - ETA ( J ) ** 2 )
DNDETA (N) - -ETA ( J ) * ( 1 . + S IGN1 ( N ) * XI ( I»
ENDIF
60 CONT INUE
DO 7 0 N - 1 , 8
JAC ( l, l ) - JAC( l, l ) + DNDXI ( N ) * X l ( IN ( E , N»
JAC ( 1 , 2 ) - JAC ( 1,2 ) + DNDXI ( N ) * X2 ( IN ( E , N»
JAC ( 2 , 1 ) .. JAC ( 2 , 1 ) + DNDETA ( N ) * Xl ( IN ( E,N»
JAC ( 2 , 2 ) .. JAC ( 2 , 2 ) + DNDETA ( N ) * X2 ( IN ( E , N»
70 CONT INUE
DETJAC" JAC ( l , l ) * JAC ( 2 , 2 ) - JAC ( 1 , 2 ) * JAC ( 2 , 1 )
JACINV ( l , l ) .. JAC ( 2 , 2 ) / DETJAC
JAC INV ( 1 , 2 ) .. -JAC ( 1 , 2 ) / DETJAC
JAC INV ( 2 , 1 ) .. -JAC ( 2 , 1 ) / DETJAC
JACINV ( 2 , 2 ) - JAC ( l , l ) / DETJAC
DO 80 N .. 1 , 8
DNDX ( N ) - JACINV ( l , l ) * DNDXI ( N ) + JAC INV ( 1 , 2 ) * DNDETA (N)
DNDY ( N ) .. JAC INV ( 2 , 1 ) * DNDXI ( N ) + JAC INV ( 2 , 2 ) * DNDETA ( N )
80 CONT INUE
DO 1 0 0 K .. 1, 8
DO 90 N .. 1 , 8
KE ( K,N ) - KE ( K , N) + We I ) * W ( J) * ( KXE * DNDX ( K ) *
1 DNDX (N) + KYE * DNDY ( K ) * DNDY ( N» * DETJAC
90 CONT INUE
100 CONTINUE
110 CONT INUE
12 0 CONTINUE
RETURN
END
352 Subroutine ASMBK

SUBROUT INE RQUA12(E,RE)


C*********************************************************************
C
C PURPOSE :
C TO COMPUTE THE ELEMENT CONDUCTANCE MATRIX FOR TWO-
C D IMENS IONAL, CUBIC QUADRILATERAL ELEMENT
C
C DEF INIT IONS OF VARIABLE S :
C DETJAC - DETERM INANT OF JACOB IAN MATRIX
C DNDXI ( I ) - PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION W I TH RESPECT TO XI AT NODE I
C DNDX ( I ) .. PART IAL DERIVAT IVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO X AT NODE I
C DNDETA ( I ) - PARTIAL DERIVATIVE OF INTERPOLAT ION
C FUNCT ION WITH RESPECT TO ETA AT NODE I
C DNDY ( I ) - PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO Y AT NODE I
C E - ELEMENT NUMBER
C ETA ( I ) - LOCATION OF GAUS S P OINT I IN ETA
C COORDINATE DIRECT ION
C JAC( I , J ) - JACOBIAN MATRIX
C JACINV (I , J) - INVERSE OF JACOBIAN MATRIX
C KE ( I , J ) - ELEMENT CONDUCTANCE MATRIX
C KXE - HYDRAULIC CONDUCTIV ITY IN X
C COORDINATE DIRECTION
C RYE - HYDRAULIC CONDUCTIVITY IN Y
C COORD INATE D IRECTION
C W ( I ) . WE IGHT FOR GAUSS POINT I
C XI (I ) . LOCATION OF GAUSS POINT I IN XI
C COORDINATE D I RECTION
C
C REFERENCES :
C I S TOR , J . D . GROUNDWATER FLOW AND SOLUTE TRANSPORT
C MODELING BY THE F INITE ELEMENT METHOD , CHAPTER 4 ,
C F IGURE 4 . 1 2 , EQUATION 4 . 62
C
C*********************************************************************
$ INCLUDE : ' COHALL '
REAL JAC ( 2 , 2 ) , JACINV ( 2,2 ) , KE (MAX 3 , MAX 3 ) , DNDXI( 1 2 ) ,
1 DNDX ( 1 2 ) , DNDETA ( 12 ) , DNDY ( 1 2 ) , W ( 4 ) , XI (12 ) , ETA ( 12 ) ,
2 S IGN 1 ( 12 ) , S I GN2 ( 1 2 ) , KXE , KYE , KZE
DATA S IGN1 / -l . , - 1 . , 1 . , 1 . , 1 . , 1 . , 1 . , 1 . , - 1 . , - 1 . , - 1 . , - 1 . 1
DATA S I GN2 / -l . , - 1 . ,- 1 . , - 1 . , - 1., 1 . , 1 . , 1 . ,1 . , 1 . , 1 . , - 1.1
C
XI ( 1) - SORT ( ( 3. - 2 . * SQRT ( 6 . I 5 . » I 7. )
X I ( 2 ) • -XI ( 1 )
XI ( 3 ) SORT ( ( 3 . + 2 . * SQRT ( 6 . I 5 . » I 7. )
XI ( 4 ) -XI ( 3 )
ETA ( 1 ) • XI ( l )
ETA ( 2 ) - XI ( 2 )
ETA ( 3 ) - X I ( 3 )
ETA ( 4 ) - XI ( 4 )
WIl l - 0 . 5+ 1 . I ( 6 . * SQRT ( 6 . I 5 . »
W ( 2) - W I ll
W ( 3 ) .. 0 . 5 - 1 . I ( 6 . * SQRT ( 6 . I 5 . » )
W ( 4) • W ( 3 )
KXE - PROP (MATSET ( E ) , l )
KYE - PROP (MATSET ( E ) , 2 )
DO 20 K - 1 , 1 2
D O 10 N • 1 , 12
KE ( K , N ) - O.
Chapter 12 353

10 CONTINUE
20 CONTINUE
DO 11 0 I = 1, 4
DO 1 0 0 J - 1, 4
DO 4 0 K = 1 , 2
DO 30 N = 1, 2
JAC ( K,N) - O.
30 CONTINUE
40 CONTINUE
DO 5 0 N - 1, 12
I F «N . EO . 1 ) . OR . ( N . EO . 4 ) . OR .
1 (N . EO . 7 ) . OR . (N . EO . 1 0 » THEN
DNDXI ( N ) - ( 1. / 3 2 . ) * (1. + S I GN2 ( N ) * ETA ( J» *
1 (18 . * X I ( I) + 2 7 . * S IGN1 ( N) * X I ( I ) * *2 +
2 9 . * SIGN1 ( N) * ETA ( J) * * 2 - 1 0 . * SIGN1 ( N »
DNDETA ( N) - ( 1 . / 32 . ) * ( 1.+ S IGN1 ( N) * XI ( I» *
1 ( 18 . * ETA ( J ) + 27. * S IGN2 ( N ) * ETA ( J ) **2 +
2 9 . * SIGN2 ( N) * XI ( I ) * *2 - 1 0 . * SIGN2 (N»
ELS E I F « N . EO . 2) . OR . (N . EO . 3) . OR .
1 (N . EO. 8) . OR . (N . EO . 9» THEN
DNDXI ( N ) = ( 9 . / 32 . ) * ( 1 . + SIGN2 ( N) * ETA ( J» *
1 ( 9 . * S IGN1 ( N ) / 3 . - 2 . * X I ( I) - 2 7 . *
2 SIGN1 ( N ) / 3 . * XI ( I ) **2 )
DNDETA ( N ) = ( 9 . / 32 . ) * (1. - X I ( I ) * * 2 ) * ( SIGN2 ( N ) +
1 9 . * SIGN1 ( N ) / 3 . * SIGN2 ( N ) * XI (I »
ELSEIF «N . E O . 5 ) . OR. (N . EO . 6 ) . OR .
1 (N . EO . 11 ) . OR . (N . EO . 12» THEN
DNDXI ( N ) • ( 9 . / 32 . ) * ( 1 . - ETA ( J ) **2 ) * ( S IGN1 ( N ) +
1 9 . * SIGN2 ( N ) / 3 . * SIGN1 (N) * ETA ( J »
DNDETA ( N ) = ( 9 . / 32 . ) * ( 1 . + S IGN1 ( N ) * XI ( I » *
1 ( 9 . * S I GN2 ( N ) /3 . - 2 . * ETA ( J) - 2 7 . *
2 SIGN2 (N) / 3 . * ETA ( J ) **2 )
END IF

50 CONTINUE
DO 6 0 N = 1, 12
JAC (l, l ) - JAC (l , l ) + DNDXI ( N) * Xl (IN ( E , N »
JAC ( 1,2 ) - JAC ( 1,2 ) + DNDXI ( N) * X2 ( IN ( E,N»
JAC ( 2, 1) - JAC ( 2, 1 ) + DNDETA ( N ) * Xl (IN ( E , N»
JAC (2,2 ) - JAC (2,2 ) + DNDETA ( N ) * X2 (IN ( E,N »

60 CONTINUE
DETJAC = JAC ( l, l ) * JAC (2,2 ) - JAC (1,2 ) * JAC ( 2 , 1 )
JACINV ( l , l ) - JAC ( 2,2 ) / DETJAC
JACINV ( 1,2 ) - -JAC ( 1 , 2 ) / DETJAC
JACINV ( 2,1) - -JAC ( 2,1) / DETJAC
JACINV (2,2 ) = JAC ( l,l ) / DETJAC
DO 7 0 N - 1 , 12
DNDX ( N ) - JACINV (l,l ) * DNDXI ( N ) + JACINV ( 1,2 ) * DNDETA ( N )
DNDY ( N ) - JACINV (2,1 ) * DNDXI ( N ) + JACINV ( 2 , 2 ) * DNDETA ( N)
70 CONTINUE
DO 9 0 K = 1, 12
DO 8 0 N = 1, 12
KE ( K,N ) = KE ( K , N ) + W (I ) * W ( J ) * ( KXE * DNDX ( K ) *
1 DNDX(N) + KYE * DNDY ( K) * DNDY (N» * DETJAC

80 CONTINUE
90 CONTINUE
100 CONTINUE
110 CONT INUE
RETURN
END
354 Subroutine ASMBK

SUBROUTINE KPAR 8 ( E,KE )


C**** **** ** ** ************* ** * * ** * ** * ** ** ** ***** ****** ** * ** * **** * * * * * * *
C PURPOSE:
C TO COMPUTE THE ELEMENT CONDUCTANCE MATRIX FOR THREE -
C DIMENSIONAL, LINEAR PARALLELEPIPED ELEMENT
C
C DEF INITIONS OF VARIABLES:
C DETJAC - DETERMINANT OF JACOBIAN MATRIX
C DNDXI (I ) .. PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO XI AT NODE I
C DNDX (I) = PART IAL DERIVATIVE OF INTERPOLAT ION
C FUNCTION WITH RESPECT TO X AT NODE I
C DNDETA (I) - PART IAL DERIVATIVE OF INTERPOLAT ION
C FUNCTION WITH RESPECT TO ETA AT NODE I
C DNDY ( I ) .. PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO Y AT NODE I
C DND ZETA ( I ) .. PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCT ION WITH RE SPECT TO ZETA AT NODE I
C DND Z ( I ) ... PART IAL DER IVA T IVE OF INTERPOLAT ION
C FUNCTION WITH RESPECT TO Z AT NODE I
C E .. ELEMENT NUMBER
C ETA (I ) - LOCATION OF GAU S S POINT IN ETA
C COORDINATE DIRECTION
C JAC ( I, J) - JACOB IAN MATRIX
C JACINV (I,J) - INVERSE OF JACOBIAN MATRIX
C KE ( I,J) - ELEMENT CONDUCTANCE MATRIX
C KXE • HYDRAUL IC CONDUCTIVITY IN X
C COORDINATE D IRECTION
C KYE - HYDRAULIC CONDUCTIVITY IN Y
C COORDINATE DIRECTION
C KZE - HYDRAULIC CONDUCTIVITY IN Z
C COORDINATE DIRECTION
C W (I ) .. WEIGHT FOR GAUSS POINT I
C XI ( I ) - LOCATION OF GAU S S POINT IN XI
C COORDINATE DIRECT I ON
C ZETA ( I ) - LOCATION OF GAUSS POINT IN ZETA
C COORDINATE DIRECTION
C REFERENCES:
C I STOK,J . D . GROUNDWATER FLOW AND SOLUTE TRAN SPORT
C MODELING BY THE FINITE ELEMENT METHOD, CHAPTER 4,
C F I GURE 4 . 1 3, EQUATION 4. 6 3
C * * ***** ********************************* ** ** ************** * * * ** * * * * * *
$INCLUDE : ' COHALL '
REAL JAC ( 3, 3 ) ,JACINV ( 3, 3 ) ,KE (MAX3,MAX3 ) ,DNDXI ( 8 ) ,DNDX ( 8 ) ,
1 DNDETA (8 ) ,DNDY (8 ) ,DNDZETA (8 ) ,DND Z ( 8 ) ,W (2 ) ,XI (8 ) ,
2 ETA (8 ) , ZE TA ( 8 ) , SIGN1 ( 8 ) ,S IGN2 (8 ) ,SIGN3 (8 ) ,KXE,KYE , KZE
DATA SIGN1 / - 1 . , 1 . , 1 . , - 1 . , -1.,1 . , 1 . , - 1 . /
DATA S IGN2 / - l . , - 1 . , 1 . , 1 . , - 1 . , -1 . ,1 . , 1 . /
DATA SIGN3 / - l . , - 1 . ,- 1., - 1 . , 1 . ,1 . , 1., 1 . /
C
XI ( 1 ) .. 1 . / SQRT ( 3 . )
XI ( 2 ) .. -XI (l )
ETA (l ) .. XI (l )
ETA ( 2 ) .. XI (2 )
ZETA (l ) .. XI (l )
ZETA (2 ) .. XI (2 )
W I ll .. l .
W (2 ) .. l .
KXE .. PROP (MATSET ( E ) , l )
KYE .. PROP (MATSET (E ) ,2 )
KZE .. PROP (MATSET ( E ) , 3 )
Chapter 12 355

DO 2 0 K - 1 , 8
DO 10 N = 1 , 8
KE ( K , N ) = O.
10 CONTINUE
20 CONT INUE
DO 12 0 I - 1, 2
DO 11 0 J = 1 , 2
DO 1 0 0 K - 1 , 2
DO 4 0 L - 1, 3
DO 30 N .. 1 , 3
JAC ( L , N ) = O.
30 CONTINUE
40 CONTINUE
DO 5 0 N '" 1 , 8
DNDXI ( N ) - 0 . 125 * S IGN1 ( N ) * (1 . + S IGN2 ( N ) *
1 ETA ( J» * ( 1 . + SIGN3 ( N ) * ZETA ( K»
ONDETA ( N ) '" 0 . 1 2 5 * S IGN2 ( N ) * (1 . + S IGN1 ( N ) *
1 XI ( I» * ( 1 . + S IGN3 ( N ) * ZETA ( K»
OND ZETA ( N ) - 0 . 12 5 * S IGN3 (N) * (1 . + S IGN1 ( N ) *
1 XI ( I» * (1 . + S IGN2 ( N ) * ETA ( J»
50 CONT INUE
00 60 N '" 1, 8
JAC (1 , 1 ) - JAC ( l , l ) + DNDX I ( N ) * X1 ( IN ( E , N»
JAC (1 , 2 ) '" JAC (1 , 2 ) + ONDXI ( N ) * X2 (IN ( E , N»
JAC ( 1 , 3 ) .. JAC ( 1 , 3 ) + ONDX I ( N ) * X3 ( IN ( E , N»
JAC (2 , 1 ) .. JAC ( 2 , 1 ) + DNDETA ( N ) * X1 ( I N ( E , N»
JAC ( 2 , 2 ) .. JAC (2 , 2 ) + DNDETA ( N ) * X2 ( IN ( E , N»
JAC (2 , 3 ) = JAC ( 2 , 3 ) + DNDETA ( N) * X3 ( IN ( E , N»
JAC ( 3 , 1 ) = JAC ( 3 , 1 ) + DND ZETA ( N ) * X1 ( IN ( E , N»
JAC ( 3 , 2 ) = JAC ( 3 , 2 ) + DND ZETA ( N ) * X2 ( IN ( E , N»
JAC ( 3 , 3 ) - JAC ( 3 , 3 ) + 'DND ZETA ( N ) * X3 ( IN ( E , N»
60 CONT INUE
DETJAC .. JAC (l , l ) * ( JAC (2 , 2 ) * JAC ( 3 , 3 ) - JAC ( 3 , 2 ) *
1 JAC ( 2 , 3» - JAC ( 1 , 2 ) * ( JAC (2 , 1 ) * JAC ( 3 , 3 ) -
2 JAC (3 , 1 ) * JAC (2 , 3 » - JAC (1 , 3 ) * (JAC (2,1 ) *
3 JAC ( 3 , 2 ) - JAC ( 3 , 1 ) * JAC (2 , 2»
JACINV (1 , 1 ) '" ( JAC (2 , 2 ) * JAC ( 3 , 3 ) - JAC (2 , 3 ) *
1 JAC ( 3 , 2» I DETJAC
JACINV (1 , 2 ) .. ( -JAC ( 2 , 1 ) * JAC ( 3 , 3 ) + JAC ( 2 , 3 ) *
1 JAC ( 3 , 1» I DETJAC
JAC INV ( 1 , 3 ) .. ( JAC (2 , 1 ) * JAC ( 3 , 2 ) - JAC ( 3 , 1 ) *
1 JAC ( 2 , 2» I DETJAC
JACINV (2 , 1 ) = ( -JAC (1 , 2 ) * JAC ( 3 , 3 ) + JAC (1 , 3 ) *
1 JAC ( 3 , 2» I DETJAC
JAC INV (2 , 2 ) - ( JAC ( l , l ) * JAC ( 3 , 3 ) - JAC (1 , 3 ) *
1 JAC ( 3 , 1» I DETJAC
JACINV (2 , 3 ) ( -JAC ( 1 , 1 ) * JAC ( 3 , 2 ) + JAC (1 , 2 ) *
1 JAC ( 3 , 1» I DETJAC
JACINV ( 3 , 1 ) .. ( JAC (1 , 2 ) * JAC ( 2 , 3 ) - JAC (1 , 3 ) *
1 JAC (2 , 2» I DETJAC
JAC INV ( 3 , 2 ) ( -JAC (1 , 1 ) * JAC (2 , 3 ) + JAC ( 1 , 3 ) *
1 JAC (2 , 1» I DETJAC
JAC INV ( 3 , 3 ) = ( JAC ( 1 , 1 ) * JAC (2 , 2 ) - JAC (1 , 2 ) *
1 JAC ( 2 , 1» I DETJAC
DO 7 0 N .. 1 , 8
DNDX ( N ) - JACINV ( l , l ) * DNDXI ( N ) + JACINV ( 1 , 2 ) *
1 DNDETA ( N ) + JAC INV (1 , 3 ) * DND ZETA ( N )
DNDY (N) .. JACINV (2 , 1 ) * DNDX I ( N ) + JACINV ( 2 , 2 ) *
1 DNDETA ( N ) + JACINV ( 2 , 3 ) * DND ZETA ( N )
DNDZ ( N ) - JACINV ( 3 , 1 ) * DNDX I ( N ) + JACINV ( 3 , 2 ) *
1 DNDETA (N) + JACINV ( 3 , 3 ) * DND ZETA ( N )
356 Subroutine ASMBK

70 CONTINUE
DO 90 L - 1 , 8
DO 80 N .. 1,8
KE(L,N) '" KE(L , N ) + W e I ) * W ( J ) * W (K ) * ( KXE *
1 DNDX ( L ) * DNDX ( N ) + KYE * DNDY ( L ) *
2 DNDY (N) + KZE * DND Z ( L ) * DND Z ( N » * DETJAC
80 CONTINUE
90 CONTINUE
100 CONT INUE
110 CONTINUE
120 CONTINUE
RETURN
END

SUBROUTINE KPAR20(E,KE)
C**************************************************************** *****
C
C PURPOSE:
C TO COMPUTE THE ELEMENT CONDUCTANCE MATRIX FOR THREE-
C D IMENS I ONAL, QUADRATIC PARALLELEP IPED ELEMENT
C
C DEF INITIONS OF VARIABLES:
C DETJAC DETERMINANT OF JACOBIAN MATRIX
C DNDXI (I) '" PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO XI AT NODE I
C DNDX ( I ) z PARTIAL DERIVAT IVE O F INTERPOLAT ION
C FUNCTION WITH RESPECT TO X AT NODE I
C DNDETA (I ) z PARTIAL DERIVAT IVE OF INTERPOLAT ION
C FUNCTION WITH RESPECT TO ETA AT NODE I
C DNDY ( I ) .. PART IAL DERIVATIVE OF INTERPOLATION
C FUNCT ION WITH RESPECT TO Y AT NODE I
C DNDZETA ( I ) - PARTIAL DERIVATIVE OF INTERPOLAT ION
C FUNCTION WITH RESPECT TO ZETA AT NODE I
C DND Z ( I ) - PARTIAL DERIVAT IVE OF INTERPOLAT ION
C FUNCTION WITH RESPECT TO Z AT NODE I
C E � ELEMENT NUMBER
C ETA ( I ) � LOCAT ION OF GAUSS POINT IN ETA
C COORDINATE DIRECT I ON
C JAC ( I,J) = JACOBIAN MATRIX
C JAC INV ( I,J) '" INVERSE OF JACOB IAN MATRIX
C KE ( I, J) .. ELEMENT CONDUCTANCE MATRIX
C KXE .. HYDRAULIC CONDUCTIVITY IN X
C COORDINATE D IRECT ION
C KYE HYDRAULIC CONDUCTIVITY IN Y
C COORDINATE DIRECT ION
C KZE .. HYDRAULIC CONDUCTIV ITY IN Z
C COORDINATE DIRECT I ON
C W e I ) .. WE IGHT FOR GAUSS POINT I
C XI ( I ) .. LOCATION OF GAUSS P O INT IN XI
C COORDINATE DIRECTION
C ZETA ( I ) = LOCATION OF GAUSS PO INT I N ZETA
C COORD INATE DIRECT ION
C
C REFERENCES:
C ISTOK, J . D. GROUNDWATER FLOW AND SOLUTE T RAN S P ORT
C MODELING BY THE FINITE ELEMENT METHOD, CHAPTER 4,
C FIGURE 4 . 1 4, EQUATION 4 . 6 3
C
C*********************************************************************
Chapter 12 357

$ INCLUDE : ' COHALL '


REAL JAC ( 3 , 3 ) , JAC INV ( 3 , 3 ) , KE (MAX3 , MAX3 ) , ONDXI ( 2 0 ) , ONDX ( 2 0 ) ,
1 ONDETA ( 2 0 ) , DNDY ( 2 0 ) , DNDZETA ( 2 0 ) , DNDZ ( 2 0 ) , W ( 3 ) , XI ( 2 0 ) ,
2 E TA ( 2 0 ) , ZETA ( 2 0 ) , S IGN1 ( 2 0 ) , S IGN2 ( 2 0 ) , S IGN3 ( 2 0 ) , KXE , KYE , KZE
DATA S IGN1 / - 1 . , 0 . , 1 . , 1 . , 1 . , 0 . , - 1 . , - 1 . , - 1 . , 1 . , 1 . , - 1 . , - 1 . ,
1 0 . , 1 . , 1 . , 1 . , 0 . , -1 . , -1 . 1
DATA S IGN2 / - 1 . , - 1 . , - 1 . , 0 . , 1 . , 1 . , 1 . , 0 . , - 1 . , - 1 . , 1 . , 1 . , - 1 . ,
1 -1 . , -1 . , 0 . , 1 . , 1 . , 1 . , 0 . 1
DATA S IGN3 / - 1 . , - 1 . , - 1 . , - 1 . , - 1 . , -1 . , - 1 . , - 1 . , 0 . , 0 . , 0 . , 0 . , 1 . ,
1 1.,1.,1.,1.,1.,1.,1./
C
XI ( l ) = O.
X I ( 2 ) � 1 . 1 SORT ( 3 . / 5 . )
X I ( 3 ) - -XI ( 2 )
ETA ( l ) - XI ( l )
ETA ( 2 ) - X I ( 2 )
ETA ( 3 ) = XI ( 3 )
ZETA ( l ) - X I ( l )
ZETA ( 2 ) - XI ( 2 )
ZETA ( 3 ) - XI ( 3 )
W e ll - 8 . / 9 .
W (2) - 5 . / 9 .
W ( 3 ) - W( 2 )
KXE = PROP (MATSET ( E ) , l )
KYE = PROP (MATSET ( E ) , 2 )
KZE = P ROP (MATSET ( E ) , 3 )
DO 2 0 K - 1 , 2 0
D O 10 L - 1 , 2 0
KE ( K , L ) = O.
10 CONT INUE
20 CONT INUE
DO 1 2 0 I = 1, 3
DO 1 1 0 J = 1 , 3
DO 1 0 0 K - 1 , 3
DO 4 0 L = 1 , 3
DO 3 0 N = 1 , 3
JAC ( L , N ) - o.
30 CONTINUE
40 CONT INUE
DO 50 N - 1 , 2 0
IF ( ( N . EO . 1 ) . OR . ( N . EO . 3 ) . OR . (N . EO . 5 ) . OR .
1 (N . EO . 7 ) . OR . (N . EO . 1 3 ) . OR . (N . EO . 1 5 ) . OR .
2 (N . EO . 1 7 ) . OR . (N . EO . 1 9 » THEN
DNDXI ( N ) - 0 . 1 2 5 * S IGN1 ( N ) * ( 1 . + S I GN2 ( N ) *
1 ETA ( J » * ( 1 . + S I GN3 ( N ) * ZETA ( K » *

2 ( 2 . * S I GN 1 ( N ) * XI ( I ) + S IGN2 ( N ) *
3 ETA ( J ) + S IGN3 ( N ) * ZETA ( K ) - 1 . )
DNDETA ( N ) = 0 . 1 2 5 * S I GN2 ( N ) * ( 1 . + S IGN1 ( N ) *
1 XI ( I » * ( 1 . + S I GN3 ( N ) * ZETA ( K » *
2 ( 2 . * S IGN2 ( N ) * ETA ( J ) + S IGN1 ( N ) *
3 XI ( I ) + S IGN3 ( N ) * ZETA ( K ) - 1 . )
DNDZETA (N) - 0 . 12 5 * S IGN3 ( N ) * ( 1 . + S I GN1 ( N ) *
1 XI ( I » * ( 1 . + S I GN2 (N) * ETA ( J » *

2 ( 2 . * S I GN3 ( N ) * ZETA ( K ) + S IGN 1 ( N ) *


3 XI ( I ) + S I GN2 ( N ) * ETA ( J) - 1 . )
ELSE IF ( ( N . EO . 2 ) . OR . ( N . EO . 6 ) . OR .
1 (N . EO . 1 4 ) . OR . (N . EO . 1 8 » THEN
DNDXI ( N) = - 0 . 5 * X I ( I ) * ( 1 . + S IGN2 ( N ) *
1 ETA ( J » * ( 1 . + S IGN3 ( N ) * ZETA ( K »
358 Subroutine ASMBK

DNDETA (N) - U . 2 5 * S IGN2 ( N ) * (1 . - X I ( I ) * *2 ) *


1 ( 1 . + S IGN3 ( N ) * ZETA ( K ) )
DNDZ E TA ( N ) 0 . 2 5 * S IGN3 ( N ) * (1 . - X I ( I ) * * 2 ) *
1 (1 . + S I GN 2 ( N ) * ETA ( J »
ELSE IF « (N . EO . 4 ) . OR . (N .EO . 8 ) . OR .
1 ( N . EO . 1 6 ) . OR . ( N . EO . 2 0 » THEN
DNDXI ( N ) .. 0 . 2 5 '" S IGN1 ( N ) '" ( 1 . - ETA ( J) * * 2 ) *
1 ( 1 . + S IGN3 ( N ) '" ZETA ( K »
DNDE TA ( N ) .. - 0 . 5 '" ETA ( J ) '" ( 1 . + S I GN1 ( N ) * XI ( I » *
1 ( 1 . + S I GN3 ( N ) * ZETA ( K »
DNDZETA ( N ) - 0 . 2 5 * S IGN3 ( N ) '" ( 1 . + S IGN1 ( N) '"
1 XI ( I » * ( 1 . - ETA ( J ) * *2 )
ELSE I F ( (N . GE . 9 ) . AND . ( N . LE . 1 2 » THEN
DNDXI ( N ) - 0 . 2 5 * S IGN1 ( N ) * ( 1 - ZETA ( K ) * "' 2 ) *
1 ( 1 . + S I GN2 ( N ) '" ETA ( J »
DNDETA (N) .. 0 . 2 5 '" S I GN2 ( N ) * ( 1 . - ZETA ( K ) "' ''' 2 ) *
1 (1 . + S IGN1 ( N ) * X I ( I »
DNDZETA ( N ) .. - 0 . 5 * ZETA ( K ) * ( 1 . + S IGN1 ( N ) *
1 XI ( I » * ( 1 . + S IGN2 ( N ) * ETA ( J »
ENDIF
50 CONTINUE
DO 60 N - 1, 2 0
JAC ( l , l ) .. JAC ( l , l ) + DNDXI ( N ) * X 1 ( IN ( E , N »
JAC ( 1 , 2 ) .. JAC ( 1 , 2 ) + DNDXI ( N ) '" X2 ( IN ( E , N »
JAC ( 1 , 3 ) .. JAC ( 1 , 3 ) + DNDXI ( N ) '" X3 ( IN ( E , N »
JAC (2 , 1 ) .. JAC ( 2 , 1 ) + DNDETA ( N ) .. X1 ( IN (E , N »
JAC (2 , 2 ) .. JAC (2 , 2 ) + DNDETA ( N ) .. X2 ( IN ( E , N »
JAC ( 2,3 ) .. JAC ( 2 , 3 ) + DNDETA ( N ) .. X3 ( IN ( E , N » )
JAC ( 3 , 1 ) .. JAC (3 , 1 ) + DNDZETA ( N ) '" X1 ( IN ( E , N ) )
JAC (3 , 2 ) = JAC (3 , 2 ) + DNDZETA ( N ) * X2 ( IN ( E , N ) )
JAC (3 , 3 ) .. JAC ( 3 , 3 ) + DNDZETA ( N ) '" X3 ( IN ( E , N )
60 CONT INUE
DETJAC " JAC ( l , l ) '" ( JAC ( 2 , 2 ) * JAC (3 , 3 ) - JAC (3 , 2 ) *
1 JAC (2 , 3 ) ) - JAC ( 1 , 2 ) '" ( JAC ( 2 , 1 ) * JAC ( 3 , 3 ) -
2 JAC ( 3 , 1 ) * JAC (2,3 ) ) - JAC ( 1 , 3 ) * ( JAC ( 2 , 1 ) *
3 JAC ( 3 , 2 ) - JAC (3, 1 ) * JAC (2, 2 »
JAC INV ( l ' l ) .. ( JAC ( 2 , 2 ) * JAC (3 , 3 ) - JAC ( 2 , 3 ) *
1 JAC (3 , 2 » / DETJAC
JAC INV ( 1 , 2 ) .. ( -JAC ( 2 , 1 ) * JAC ( 3 , 3 ) + JAC ( 2 , 3 ) *
1 JAC ( 3 , 1 » / DETJAC
JAC INV ( l,3 ) .. ( JAC ( 2 , 1 ) .. JAC (3 , 2 ) - JAC (3 , 1 ) ..
1 JAC (2 , 2 ) / DETJAC
JAC INV ( 2 , 1 ) .. ( -JAC ( 1 , 2 ) .. JAC (3 , 3 ) + JAC ( 1 , 3 ) ..
1 JAC ( 3 , 2 » / DETJAC
JAC INV ( 2 , 2 ) ( JAC ( l , l ) * JAC ( 3 , 3 ) - JAC ( 1 , 3 ) ..
1 JAC (3 , 1 » ) / DETJAC
JAC INV ( 2 , 3 ) ( -JAC ( l , l ) * JAC ( 3 , 2 ) + JAC ( 1 , 2 ) *
1 JAC ( 3 , 1 ) ) / DETJAC
JACINV (3 , 1 ) = ( JAC ( l , 2 ) .. JAC (2 , 3 ) - JAC ( 1 , 3 ) ..
1 JAC ( 2 , 2 ) ) / DETJAC
JACINV (3 , 2 ) .. ( -JAC ( l , l ) .. JAC (2 , 3 ) + JAC (1 , 3 ) *
1 JAC ( 2 , 1 ) / DETJAC
JAC INV (3 , 3 ) -( JAC ( l , l ) * JAC ( 2 , 2 ) - JAC ( 1 , 2 ) *
1 JAC ( 2 , 1 ) / DETJAC
DO 7 0 N .. 1 , 2 0
DNDX ( N ) .. JAC INV ( l , l ) * DNDXI ( N ) + JACINV ( 1 , 2 ) ..
1 DNDETA ( N ) + JAC INV ( 1 , 3 ) * DNDZETA ( N )
DNDY ( N ) - JACINV ( 2 , 1 ) * DNDXI ( N ) + JAC I NV ( 2 , 2 ) ..
1 DNDETA ( N ) + JACINV ( 2,3 ) * DNDZETA ( N )
DNDZ ( N ) - JACINV (3, 1) * DNDXI ( N ) + JACINV ( 3,2 ) *
1 DNDETA ( N) + JACINV ( 3, 3 ) * DNDZETA ( N )
Chapter 12 359

70 CONT INUE
00 90 L - 1 , 2 0
0 0 8 0 N .. 1 , 2 0
KE ( L , N ) = KE ( L, N ) +W ( I ) * W ( J ) * W ( K ) *
1 (KXE * DNDX ( L ) * DNDX ( N ) + KYE * DNDY ( L ) *
2 DNDY ( N ) + KZE * DNDZ ( L ) * DNDZ (N» * DETJAC
80 CONT INUE
90 CONTINUE
100 CONT INUE
110 CONTINUE
1 2 0 CONT INUE
RETURN
END

SUBROUT INE KPAR3 2 ( E , KE )


C* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * * * * * * * * * * * * * * * * * * * * * * * * *
C
C PURPOSE :
C TO COMPUTE THE ELEMENT CONDUCTANCE MATRIX FOR THREE -
C D IMENS IONAL , CUBIC PARALLELEPIPED ELEMENT
C
C DEF INITIONS OF VARIABLES :
C DETJAC .. DETERMINANT OF JACOB IAN MATRIX
C DNDXI ( I ) = PART IAL DERIVAT IVE OF INTERPOLAT ION
C FUNCTION WITH RESPECT TO XI AT NODE I
C DNDX ( I ) .. PART IAL DERIVAT IVE OF INTERPOLAT ION
C FUNCTION WITH RESPECT TO X AT NODE I
C DNDETA ( I ) - PARTIAL DERIVATIVE OF INTERPOLAT ION
C FUNCTION WITH RESPECT TO ETA AT NODE I
C DNDY ( I ) - PARTIAL DERIVATIVE OF INTERPOLAT ION
C FUNCTION WITH RESPECT TO Y AT NODE I
C DNDZETA ( I ) .. PARTIAL DERIVATIVE OF INTERPOLAT ION
C FUNCTION WITH RESPECT TO ZETA AT NODE I
C DNDZ ( I ) ,. PART IAL DERIVATIVE OF INTERPOLATION
C FUNCT ION WITH RESPECT TO Z AT NODE I
C E = ELEMENT NUMBER
C ETA ( I ) - GAUSS POINT I N ETA COORDINATE D IRECT ION
C JAC ( I , J ) - JACOBIAN MATRIX
C JAC INV ( I , J) .. INVERSE OF JACOBIAN MATRIX
C KE ( I , J ) . - ELEMENT CONDUCTANCE MATRIX
C KXE .. HYDRAULIC CONDUCTIVITY IN X
C COORDINATE D IRECTION
C KYE .. HYDRAULIC CONDUCTIVITY IN Y
C COORDINATE D IRECT ION
C KZE .. HYDRAULIC CONDUCTIVITY IN Z
C COORDINATE D IRECT ION
C W ( I ) .. WEIGHT FOR GAU S S PO INT I
C XI ( I ) .. LOCATION OF GAUSS PO INT IN XI
C COORDINATE D IRECT ION
C ZETA ( I ) .. LOCATION OF GAUSS POINT I N ZETA
C COORDINATE D IRECT ION
C
C REFERENCES :
C I S TOK , J . D . GROUNDWATER FLOW AND SOLUTE TRANSPORT
C MODEL ING BY THE F INITE ELEMENT METHOD , CHAPTER 4 ,
C F I GURE 4 . 1 5 , EQUATION 4 . 6 3
C
C* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
360 Subroutine ASMBK

$ INCLUDE : ' COMALL '


REAL JAC ( 3 , 3 ) , JACINV ( 3 , 3 ) , KE (MAX3 , MAX3 ) , DNDXI ( 3 2 ) , DNDX ( 3 2 ) ,
1 DNDETA ( 3 2 ) , DNDY ( 3 2 ) , DNDZETA ( 3 2 ) , DND Z ( 3 2 ) , W ( 4 ) , XI ( 32 ) ,
2 ETA ( 32 ) , ZETA ( 3 2 ) , S IGNl ( 3 2 ) , S IGN2 ( 3 2 ) , S IGN3 ( 32 ) , KXE , KYE , KZE
DATA S IGNI / 2 * - 1 . , 6 * 1 . , 5 * - 1 . , 2 * 1 . , 2 * - 1 . , 2 * 1 . , 3 * - 1 . , 6 * 1 . , 4 * - 1 . /
DATA S IGN2 / 5 * - 1 . , 6 * 1 . , 3 * - 1 . , 2 * 1 . , 2 * - 1 . , 2 * 1 . , 5 * - 1 . , 6 * 1 . , - 1 . /
DATA S IGN3 / 1 6 * - 1 . , 1 6 * 1 . /
C
XI ( l ) - SORT « 3 . - 2 . * SORT ( 6 . / 5 . » / 7.)
XI ( 2 ) - -XI ( 1 )
XI ( 3 ) - SORT « 3 . + 2 . * SORT ( 6 . / 5 . » / 7.)
XI ( 4 ) - -XI ( 3 )
ETA ( 1 ) - X I ( 1 )
ETA ( 2 ) - X I ( 2 )
ETA ( 3 ) - X I ( 3 )
ETA ( 4 ) - X I ( 4 )
ZETA ( l ) - X I ( l )
ZETA ( 2 ) - XI ( 2 )
ZETA ( 3 ) - XI ( 3 )
ZETA ( 4 ) - X I ( 4 )
W ( l ) = 0 . 5 + 1 . / 1 6 . * SORT I 6 . / 5 . »
W (2) - W ( l)
W ( 3 ) - 0 . 5 - 1 . / 1 6 . * SORT I 6 . / 5 . »
W ( 4) - W (3)
KXE - PROP (MATSET I E ) , I )
KYE - PROP (MATSET ( E ) , 2 )
KZE - PROP (MATSET ( E ) , 3 )
DO 2 0 K - 1 , 3 2
DO 1 0 N - 1 , 3 2
KE ( K , N ) - O .
10 CONT INUE
20 CONT INUE
DO 1 2 0 I - 1 , 4
DO 1 1 0 J - 1 , 4
DO 1 0 0 K - 1 , 4
DO 40 L - 1, 3
DO 3 0 N - 1 , 3
JAC ( L , N ) ., O .
30 CONT INUE
40 CONT INUE
DO 50 N - 1, 3 2
IF I I N . EO . 1 ) . OR . (N . EO . 4 ) . OR . I N . EO . 7 ) . OR .
1 I N . EQ . 1 0 ) . OR . I N . EO . 2 1 ) . OR . I N . EO . 2 4 ) . OR .
2 IN . EO . 2 7 ) . OR . (N . EQ . 3 0 » THEN
DNDXI I N ) - 1 9 . / 6 4 . ) * I I . + S IGN2 (N) * ETA ( J » *
1 I I . + S IGN3 I N ) * ZETA I K » * I S IGN1 I N ) *
2 1 - 1 1 9 . / 9 . ) + 3 . * XI ( I ) * * 2 +
3 ETA ( J ) * * 2 + ZETA I K ) * * 2 ) + 2 . * XI ( I »
DNDETA ( N ) - 1 9 . / 6 4 . ) * ( 1 . + S IGN1 I N ) * XI ( I » *
1 I I . + S IGN3 ( N ) * ZETA I K » * I S IGN2 I N ) *
2 ( - 1 1 9 . / 9 . ) + XI I I ) * * 2 + 3 . *
3 ETA I J ) * * 2 + ZETA I K ) * * 2 ) + 2 . * ETA I J »
DNDZETA ( N ) • ( 9 . / 6 4 . ) * ( 1 . + S IGN1 ( N ) * XI ( I » *
1 (1 . + S IGN2 ( N ) * ETA I J » * ( S IGN3 ( N ) *
2 1 - 1 1 9 . / 9 . ) + XI I I ) * * 2 + ETA I J ) * * 2 +
3 3 . * ZETA I K ) * * 2 ) + 2 . * ZETA I K »
ELSEIF I IN . EO . 2 ) . OR . ( N . EO . 3 ) . OR .
1 I N . EQ . 8 ) . OR . ( N . EQ . 9 ) . OR .
2 I N . EO . 2 2 ) . OR . ( N . EQ . 2 3 ) . OR .
3 I N . EQ . 2 8 ) . OR . ( N . EO . 2 9 » THEN
DNDXI I N ) - 1 8 1 . I 6 4 . ) * I I . + S IGN2 I N ) * ETA ( J »
Chapter 12 361

1 * ( 1 . + S IGN3 ( N ) * ZETA ( K »
2 * ( S I GN1 ( N ) 1 3 . - 2 . / 9 . * XI ( I ) -
3 3 . * S IGN1 ( N ) / 3 . * XI ( I ) * * 2 )
DND E TA ( N) � ( 8 1 . 1 6 4 . ) * S IGN2 ( N ) * (1 . - XI ( I ) * * 2 )
1 * ( 1 . 1 9 . + S IGN1 ( N ) / 3 . *XI ( I »
2 * ( 1 . + S I GN3 ( N ) * ZETA ( K »
DNDZETA ( N ) - ( 8 1 . 1 6 4 . ) * S IGN3 ( N ) * ( 1 . - X I ( I ) * * 2 )
1 * ( 1 . 1 9 . + S IGN1 ( N ) / 3 . * X I ( I »
2 * ( 1 . + S I GN2 ( N ) * ETA ( J »
ELSEIF « N . EO . 5 ) . OR . ( N . EO . 6 ) . OR .
1 ( N . EO . 1 1 ) . OR . ( N . EO . 1 2 ) . OR .
2 ( N . EO . 2 5 ) . OR . ( N . EO . 2 6 ) . OR .
3 I N . EO . 3 1 ) . OR . IN . EO . 3 2 » THEN
DNDXI ( N ) .. ( 8 1 . / 6 4 . ) * S IGN1 ( N ) * ( 1 . - ETA ( J ) * * 2 )
1 * ( 1 . 1 9 . + S IGN2 ( N ) 1 3 . * ETA ( J »
2 * ( 1 . + S IGN3 ( N ) * ZETA ( K »
DNDETA ( N ) - ( 8 1 . / 6 4 . ) * ( 1 . + S IGN1 ( N ) * X I ( I »
1 * ( 1 . + S IGN3 ( N) * Z ETA ( K » * ( S IGN2 ( N ) / 3 . -
2 2 . / 9 . * ETA ( J ) - 3 . * S IGN2 ( N ) / 3 . * ETA ( J ) * * 2 )
DNDZETA ( N ) - ( 8 1 . / 6 4 . ) * S IGN3 ( N ) * ( 1 . - ETA ( J ) * * 2 )
1 * ( 1 . / 9 . + S I GN2 ( N ) 1 3 . * ETA ( J ) )
2 * ( 1 . + S IGN1 ( N ) * XI ( I ) )
ELSE IF « N . GE . 1 3 ) . AND . (N . LE . 2 0 » THEN
DNDXI ( N ) .. ( 8 1 . / 6 4 . ) * S I GN1 ( N ) * ( 1 . - ZETA ( K ) * * 2 )
1 * ( 1 . / 9 . + S IGN3 ( N ) 1 3 . * ZETA ( K »
2 * ( 1 . + S IGN2 ( N ) * ETA ( J »
DNDETA ( N ) ( 8 1 . / 6 4 . ) * S IGN2 ( N ) * ( 1 . - ZETA ( K ) * * 2 )
1 * ( 1 . 1 9 . + S IGN3 (N ) / 3 . * ZETA ( K »
2 * ( 1 . + S IGN1 ( N ) * X I ( I »
DNDZETA ( N ) .. ( 8 1 . / 6 4 . ) * ( 1 . + S IGN1 ( N ) * XI ( I »
1 * ( 1 . + S IGN2 ( N ) * ETA ( J » * ( S IGN3 ( N ) / 3 . -
2 2 . / 9 . * ZETA ( K ) - 3 . * S IGN3 ( N ) / 3 . * Z ETA ( K ) * * 2 )
END I F
50 CONT INUE
DO 60 N = 1, 3 2
"
JAC ( l , l ) = JAC ( l , l ) + DNDXI ( N ) * X1 ( IN ( E , N »
JAC ( 1 , 2 ) = JAC ( 1 , 2 ) + DNDXI ( N ) * X2 ( IN ( E , N »
JAC ( 1 , 3 ) = JAC ( 1 , 3 ) + DNDXI ( N ) * X3 ( IN ( E , N »
JAC ( 2 , 1 ) = JAC ( 2 , 1 ) + DNDETA ( N ) * X1 ( IN ( E , N »
JAC ( 2 , 2 ) = JAC ( 2 , 2 ) + DNDETA ( N ) * X2 ( IN ( E , N »
JAC ( 2 , 3 ) = JAC ( 2 , 3 ) + DNDETA ( N ) * X3 ( IN ( E , N »
JAC ( 3 , 1 ) = JAC ( 3 , 1 ) + DNDZETA ( N ) * X1 ( IN ( E , N »
JAC ( 3 , 2 ) .. JAC ( 3 , 2 ) + DND ZETA ( N ) * X2 ( IN ( E , N »
JAC ( 3 , 3 ) = JAC ( 3 , 3 ) + DNDZETA ( N ) * X3 ( IN ( E , N »
60 CONT INUE
DETJAC = JAC ( l , l ) * ( JAC ( 2 , 2 ) * JAC ( 3 , 3 ) - JAC ( 3 , 2 ) *
1 JAC ( 2 , 3 » - JAC ( 1 , 2 ) * ( JAC ( 2 , 1 ) * JAC ( 3 , 3 ) -
2 JAC ( 3 , 1 ) * JAC ( 2 , 3 » - JAC ( 1 , 3 ) * ( JAC ( 2 , 1 ) *
3 JAC ( 3 , 2 ) - JAC ( 3 , 1 ) * JAC ( 2 , 2 »
JACINV ( l , l ) = ( JAC ( 2 , 2 ) * JAC ( 3 , 3 ) - JAC ( 2 , 3 ) *
1 JAC ( 3 , 2 » 1 DETJAC
JACINV ( 1 , 2 ) .. ( -JAC ( 2 , 1 ) * JAC ( 3 , 3 ) + JAC ( 2 , 3 ) *
1 JAC ( 3 , 1 » 1 DETJAC
JACINV ( 1 , 3 ) .. ( JAC ( 2 , 1 ) * JAC ( 3 , 2 ) - JAC ( 3 , 1 ) *
1 JAC ( 2 , 2 » 1 DETJAC
JAC INV ( 2 , 1 ) � ( -JAC ( 1 , 2 ) * JAC ( 3 , 3 ) + JAC ( 1 , 3 ) *
1 JAC ( 3 , 2 » 1 DETJAC
JACINV ( 2 , 2 ) = ( JAC ( l , l ) * JAC ( 3 , 3 ) - JAC ( 1 , 3 ) *
1 JAC ( 3 , 1 » 1 DETJAC
JAC INV ( 2 , 3 ) ( -JAC ( l , l ) * JAC ( 3 , 2 ) + JAC ( 1 , 2 ) *
1 JAC ( 3 , 1 » / DETJAC
362 Subroutine ASMBK

JACINV ( 3 , 1 ) -( JAC ( 1 , 2 ) * JAC ( 2 , 3 ) - JAC ( 1 , 3 ) *


1 JAC ( 2 , 2 ) ) I DET JAC
JAC INV ( 3 , 2 ) '" ( -JAC ( l , l ) * JAC ( 2 , 3 ) + JAC ( 1 , 3 ) *
1 JAC ( 2 , 1 ) I I DET JAC
JACINV ( 3 , 3 ) '" ( JAC ( l , l ) * JAC ( 2 , 2 ) - JAC ( 1 , 2 ) *
1 JAC ( 2 , 1 » I DET JAC
DO 70 N = 1, 32
DNDX ( N ) '" JACINV ( l , l ) * DNDXI ( N ) + JACINV ( 1 , 2 ) *
1 DNDETA ( N ) + JAC I NV ( 1 , 3 ) * DNDZETA ( N )
DNDY ( N ) '" JACINV ( 2 , 1 ) * DNDXI ( N ) + JACINV ( 2 , 2 ) *
1 DNDETA ( N ) + JACINV ( 2 , 3 ) * DND Z ETA ( N )
DNDZ ( N ) - JACINV ( 3 , 1 ) * DNDXI ( N ) + JAC INV ( 3 , 2 ) *
1 DNDETA ( N ) + JACINV ( 3 , 3 ) * DNDZETA ( N )
70 CONT INUE
DO 90 L '" 1, 32
DO 8 0 N = 1, 32
KE ( L , N) '" KE ( L , N ) + W e I ) * W ( J ) * W ( K ) *
1 ( KXE * DNDX ( L ) * DNDX ( N ) + KYE * DNDY ( L ) *
2 DNDY ( N ) + KZE * DNDZ ( L ) * DNDZ ( N » * DETJAC
80 CONTINUE
90 CONT INUE
100 CONTINUE
110 CONTINUE
120 CONT INUE
RETURN
END
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 13

SUBROUTINES DECOMP AND SOLVE

13.1 PURPOSE

Subroutines
DECOMPandSOLVEsolvea system
of linearequations
of theform

[M] {X} = {B} (13.1)


where[M] is a banded
matrixof knowncoefficients
(symmetric
or not), {X} arethe
unknowns,and {B } is a vectorof knownvalues.

13.2 INPUT

None

13.3 OUTPUT

None

13.4 DEFINITIONS OF VARIABLES

B(I) = Vector of known values.

M(IJ) = Matrix of known cofficientsin vectorstorage.

NDOF = Numberof unknownvaluesin {X}.

SBW = Semi-bandwidth of [M].

SYMM = Logicalvariable
= •rrue'if [M] is symmetric
= 'False'if [M] is nonsymmetric.
x(I) = Vectorof unknownvaluesto be compted.

13.5 USAGE

Subroutine DECOMPperformstriangulardecomposition on the matrixof known


coefficients
in vectormatrixstorage {M} (seeChapter 5). Theresulting
upper-,andlower-
triangular
matrices arestoredin {M} (theoriginal contentsof {M} areoverwritten
during
the decomposition process).Subroutine SOLVE solvefor valuesof the unknownsby
backwardsubstitution.Once{M } hasbeendecomposed SOLVE canbe usedto obtain
valuesof {X} for anynumber of differentvectors{B}.
Forexample,consider thesystem of linearequations

363
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

364 Subroutines
DecompandSolve

2 1 -1 1 xl 1

-1 4 1-• x2=
-2 -1 4 x•
-1 -2 1 .2 x4

[M] is a nonsymmetric
matrix (SYMM = 'False')with NDOF = SBW = 4. For usein
DECOMPandSOLVE [M] mustbe in vectorstorage.Usingtheprocedure in Section
5.1.3 we can write

(M) =
Before
Decompostion

After executingsubroutineDECOMP, [M] containsthe upperand lower triangular


matricesfor {M] in vectorstorage

2.0
0.5
-0.5
0.5
-1.0 12
4.5
0.11 U23l
-o.11•
= u2n/

Decomposition
0.0
3.0
0.67
U34f
141
/
-1.0 la2
/
-1.5 143
/
0.67 la
1.89J aj

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter13 365

where
lij anduijaretheentries
intheithrowandjthcolumn
ofthelower
andupper
triangularmatricesthat wouldhavebeenstoredin ILl and [U] if the decomposition
had
beenperformedin full matrixstorage.
After [M] hasbeendecomposed, subroutine
SOLVE can be usedto find a solution
IX} for anyknownright-hand-side vector[B }. For thisexample
1

andafterexecuting
SOLVE (withNDOF = SBW = 4, andSYMM = 'False')we have

0.411
0.12•.
{X}= 0.24J
0.17/
SOLVEcanbeexecuted
repeatedly
toobtaina setof solutions
{X1}, {X2}.... fora setof
knownvectors{B1}, {B2}.....
As another
exampleconsider thetwosystem
of equations

3200 xl 1

242x2
024
002
x3
xn

and

3200 X1 0

24 X3
O2 X4

Writingthemawixof coefficients
in vectorstorage
gives

{M} =

De•ompostioa

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

366 Subroutines
DecorapandSolve

After executingDECOMP with N-DOF= 4, SBW = 2, andSYMM = True', we have

1.7321ull ,

•M] -- 11.225[--
u2
1.s81
/
Decomposfion
u, Ll.183J u4

wher
uijisanen• intheithrow•d j • column
of•e upper
•an•l• ma•xthatwould
havebeenstoredin [• • thedecomposition
hadbeenpefforedin fu• ma•x storage.
SubroutineSOLVE will • executedtwice, oncefor eachvectbr [B }. The •st time
SOLVE is execute, •OF = 4, SBW = 2, SY• = True',

{B}=
!
and the solution is

0.71]
-0.57L
{X}= -0.29J
0.43/
The secondtime SOLVE is executed,bIDOF = 4, SBW = 2, SYMM = 'True',

{B}=
!
and the solution is

--0.571
0.86[
{x}-- -o.•4|
0.43J

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter13 36'7

13.6 SOURCE CODE LISTING

SUBROUTINE DECOMP (NDOF• SBW, SYMM, M)


**********************************************************************
c
C 13.1 PURPOSE:
C SUBROUTINES DECOMP AND SOLVE SOLVE A SYSTEM OF
C LINEAR EQUATIONS OF THE FORM
c [M] {X} -
C WHERE [M] IS a BANDED MATRIX OF KNOWN COEFFICIENTS
C (SYMMETRIC OR NONSYMMETRIC), { X } ARE THE UNKNOWNS,
C AND {B} IS A VECTOR OF KNOWN VALUES
C
C 13.2 INPUT:
C NONE
C
C 13.3 OUTPUT:
C NONE
C
C 13.4 DEFINITIONS OF VARIABLES:
C B(I) - VECTOR OF KNOWN VALUES
C M(IJ) - MATRIX OF KNOWN COEFFICIENTS IN VECTOR STORAGE
C NDOF - NUMBER OF UNKNOWN VALUES IN {X}
C SBW • SEMI-BANDWIDTH OF [M]
C SYMM - LOGICAL VARIABLE
C • 'TRUE' IF [M] IS SYMMETRIC
C - 'FALSE' IF [M] IS NONSYMMETRIC
C X(I) - VECTOR OF UNKNOWN VALUES TO BE COMPUTED
c
C 13.5 USAGE:
SUBROUTINE DECOMP PERFORMS TRIANGULAR DECOMPOSITION
ON THE MATRIX OF KNOWN COEFFICIENTS IN VECTOR MATRIX
STORAGE, {M}. THE RESULTING UPPER-, AND LOWER-
TRIANGULAR MATRICES ARE STORED IN {M} (THE ORIGINAL
CONTENTS OF {M} ARE OVERWRITTEN DURING THE
DECOMPOSITION PROCESS). SUBROUTINE SOLVE SOLVES FOR
VALUES OF THE UNKNOWNS BY BACKWARD SUBSTITUTION. ONCE
{M} HAS BEEN DECOMPOSED SOLVE CAN BE USED TO OBTAIN
VALUES OF {X} FOR ANY NLFMBEROF DIFFERENT VECTORS {B}.

SUBROUTINES CALLED:
LOC

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, CHAPTER 13.

**********************************************************************
INTEGER NDOF, SBW
LOGICAL SYMM
REAL M(1)

IF (SYMM) THEN
M IS A SYMMETRIC MATRIX
J2 = SBW
IJ= 0
DO 30 I • 1, NDOF
II-- IJ + i

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

368 Subroutines
DecompandSolve

DO 20 J -. I, J2
IJ • IJ + 1
IF (I .GT. 1) THEN
K1 - J - SBW + 1
IF (K1 .LT. I) THEN
IF (K1 .LE. 0) K1- 1
DO 10 K - K1, (I-1)
CALL LOC (K, I,KI,NDOF, SBW, SYMM)
CALL LOC (K, J, KJ, NDOF, SBW, SYMM)
M(IJ) - M(IJ) - M(KI) * M(KJ)
10 CONTINUE
ENDIF
ENDIF
IF (I .EQ. J) THEN
M(IJ) - SQRT(M(IJ))
ELSE
M(IJ) - M(IJ) / M(II)
ENDIF
20 CONTINUE
IF (J2 .LT. NDOF) J2 - J2 + 1
3O CONTINUE
ELSE
C M IS A NONSYMMETRIC MATRIX
Jl' 1
J2 - SBW
IJ- 0
DO 60 I • 1, NDOF
I I - IJ + I - J1 + 1
K1 - J1
IKBEG - IJ + 1
DO 50 J - J1, J2
IJ- IJ + 1
IF (J .GT. SBW .AND. i .LT. J) THEN
K1 -K1 + 1
IKBEG = IKBEG + 1
ENDIF
K2 - MIN(I,J) - 1
IF (K2 .GE. K1) THEN
IK ' IKBEG
DO 40 K = K1, K2
CALL LOC (K, J, KJ, NDOF, SBW, SYMM)
M(IJ) f M(IJ) - M(IK) * M(KJ)
IK f IK + 1
4O CONTINUE
ENDIF
IF (I .LT. J) THEN
M(IJ) - M(IJ) / M(II)
ENDIF
5O CONTINUE
IF (I .GE. SBW) J1 -- J1 + 1
IF (J2 .LT. NDOF) J2 = J2 + 1
60 CONTINUE
ENDIF
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter13 369

SUBROUTINE SOLVE (NDOF, $BW, SYMM, M, B, X)


**********************************************************************
c
c 13.1 PURPOSE:
C SUBROUTINES DECOMP AND SOLVE SOLVE A SYSTEM OF
C LINEAR EQUATIONS OF THE FORM
C [M] {X) - (B}
C WHERE [M] IS A BANDED MATRIX OF KNOWN COEFFICIENTS
C (SYMMETRIC OR NONSYMMETRIC), {X} ARE THE UNKNOWNS,
C AND {B} IS A VECTOR OF KNOWN VALUES
C
C 13.2 INPUT:
c NONE
C
C 13.3 OUTPUT:
C NONE
C
C 13.4 DEFINITIONS OF VARIABLES:
C B(I) - VECTOR OF KNOWN VALUES
C M(IJ) - MATRIX OF KNOWN COEFFICIENTS IN VECTOR STORAGE
C NDOF - NUMBER OF UNKNOWN VALUES {X}
C SBW - SEMI-BANDWIDTH OF [M]
C SYMM - LOGICAL VARIABLE
C - 'TRUE' IF [M] IS SYMMETRIC
C - 'FALSE' IF [M] IS NONSYMMETRIC
C X(I) - VECTOR OF UNKNOWN VALUES TO BE COMPUTED
C
C 13.5 USAGE:
SUBROUT INE DECOMP PERFORMS TRIANGULAR DECOMPOS IT ION
ON THE MATRIX OF KNOWN COEFFICIENTS IN VECTOR MATRIX
STORAGE, {M}. THE RESULTING UPPER-, AND LOWER-
TRIANGULAR MATRICES ARE STORED IN {M} (THE ORIGINAL
CONTENTS OF {M} ARE OVERWRITTEN DURING THE
DECOMPOSITION PROCESS). SUBROUTINE SOLVE SOLVES FOR
VALUES OF THE UNKNOWNS BY BACKWARD SUBSTITUTION. ONCE
{M} HAS BEEN DECOMPOSED SOLVE CAN BE USED TO OBTAIN
VALUES OF {X} FOR ANY NUMBER OF DIFFERENT VECTORS {B}.

SUBROUTINES CALLED:
LOC

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, CHAPTER 13.

**********************************************************************
INTEGER NDOF, SBW
LOGICAL SYMM
REAL M(1),B(1),X(1)
C
DO 10 I = 1, NDOF
X(I) - B(I)
10 CONTISSUE
IF (SYMM) THEN
M IS A SYMMETRIC MATRIX
K2 = SBW
IK = 0
DO 30 I • 1, NDOF
DO 20 K • I, K2

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

3'70 Subroutines
Decorap
and
Solve
IK I IK + 1
IF (K .EQ. I) THEN
X(K) • X(K) / M(IK)
ELSE
X(K) w X(K) -M(IK) * X(I)
ENDIF
2O CONTINUE
IF (K2 .LT. NDOF) K2 w K2 + 1
3O CONTINUE
K2- 0
DO 50 I • NDOF, 1, -1
IF (K2 .GT. 0) THEN
DO 40 K I (I + K2), (I + 1), -1
X(I) - X(I) - M(IK) * X(K)
IK - IK - 1
40 CONTINUE
ENDIF
X(I) - X(I) / M(IK)
IK- IK - 1
IF (K2 .LT. (SBW - 1)) K2 - K2 + 1
5O CONTINUE
ELSE
M IS A NONSYMMETRIC MATRIX
X(1) I X(1) / M(1)
IF (NDOF .GT. 1) THEN
K2- 1
DO 70 I - 2, NDOF
IF (I .GT. SBW) K2 • K2 + 1
CALL LOC (I, I, II,NDOF, SBW, SYMM)
IF (I .GT. K2) THEN
IK- II - 1
DO 60 K = (I - 1), K2, -1
X(I) - X(I) - M{IK) * X(K)
IK - IK - 1
60 CONTINUE
ENDIF
X(I) • X(I) / M(II)
70 CONTINUE
ENDIF
J • NDOF - SBW + 1
K2 - NDOF
IF (NDOF .GT. 1) THEN
DO 90 I - (NDOF - 1), 1, -1
IF (I .LT. J) K2 • K2 - 1
IF (I .LT. K2) THEN
CALL LOC (I, I, II,NDOF, SBW,SYMM)
IK- II + 1
DO 80 K = (I + 1), K2
X(I) = X(I) -M(IK) * X(K)
IK = IK + 1
80 CONTINUE
ENDIF
90 CONTINUE
ENDIF
ENDIF
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 14

SUBROUTINE VELOCITY

14.1 PURPOSE

To computethecomponents
of apparentgroundwater
velocityfor eachelementin the
mesh.

14.2 INPUT

None

14.3 OUTPUT

The components of apparentgroundwatervelocityare writtento the user-definedfile


assignedto unit "OUTF".

14.4 DEFINITIONS OF VARIABLES

Typeof coordinate systemusedin thisproblem(Figure8.1).


1, problemis one-dimensional.
2, problemis two-dimensional.
3, problemis three-dimensional.
4, problemis two-dimensional
(axisymmetric).
E = Element number.

ELEMTYP(I) = Elementtypefor elementI.


NUMELM = Number of elements in the mesh.

VI(I) = Apparentgroundwater
velocityin x coordinate
direction(DIM =1,2,
or 3).
= Apparent
groundwater
velocityin r coordinate
direction(DIM = 4).
v2(D Unused(DIM = 1).
Apparentgroundwater
velocityin y coordinate
direction(DIM = 2 or
3).
Apparentgroundwater
velocityin z coordinate
direction(DIM = 4).
= Unused(DIM = 1, 2, or 4).
= Apparentgroundwatervelocityin z coordinate
direction(DIM = 3).

371

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

372 Subroutine
Velocity

14.5 USAGE

The components
of apparentgroundwater
velocityarecomputedin a setof subroutines,
onesubroutine foreachelementtype(Table14.1). Eachsubroutine namein thissetbegins
with theletter"V" (for velocity)followedby threeor fourlettersthatidentifytheelement
typeandthe numberof nodesin elements of thattype. For example,subroutineVBAR2
computes
thesingle
component
ofapparent
groundwater
velocity
(v?))
forone-dimensional,
linearbar elements
and subroutine
VPAR32 computes
thethreecomponents
of apparent
groundwater
velocity
(v•),v(y
e),v?)) forthree-dimensional,
cubic
parallelepiped
elements.

Table 14.1 Subroutines used to compute componentsof apparent groundwater velocity


in VELOCITY.

ElementType Description Subroutine


Name DIM

1 Linear bar VBAR2 1


2 Quadraticbar VBAR3 1
3 Cubic bar VBAR4 1
4 Lineartriangle VTRI3 2
5 Lineal'teetangle VREC4 2
6 Linearquadrilateral VQUA4 2
7 Quadratic quadrilateral VQUA8 2
8 Cubicquadrilateral VQUA12 2
9 Linearparallelepiped VPAR8 3
10 Quadratic parallelepiped VPAR20 3
11 Cubicparallelepiped VPAR32 3
12 Lineartriangle(axisymmetric) VTRI3A* 4
13 Linearteetangle (axisymme•c) VREC4A* 4

* Source
codelistingnotprovided
forthesesubroutines.

The sourcecodelistingsfor eachof theelementvelocitysubroutines givesthefigure


numberthatshowstheinterpolation functions for thatelementtypeandtheequationusedto
computethevelocitycomponents.For thelinearrectangleandquadrilateral elementsthe
components of apparentgroundwater velocityarecomputedat thecenterof theelement. A
list of many of the FORTRAN variable names used in these subroutinesand the
corresponding textbooksymbolsarein Table 12.2. The variablenamesandsymbolsfor
thevelocitycomponents arein Table 14.2
The meshin Figure14.1consistsof three,linearbarelements(ELEMTYP(I) -- 1, I --
1, 2, 3). Apparentgroundwater velocitiesare computedusingsubroutineVBAR2. The
outputlists the computedvalue of apparent.groundwater velocity in the x coordinate
direction for each element.
The meshin Figare14.2consists
of twelvelineartriangleelements(ELEMTYP(I) = 4,
I -- 1..... 12). Apparentgroundwater
velocitiesarecomputed usingsubroutine VTRI3.
The outputliststhe computedvaluesof apparentgroundwater velocityin the x and y
coordinate directions for each element.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

CMptcr14 373

Table 14.2 FORTRAN variable names and textbook symbols for components of
apparent groundwater velocity in VELOCITY.

FORTRAN Variable Der'tuition Symbolin Text


Name

Velocitycomponent
in x coordinate
direction

Velocitycomponent
in y coordinate
direction
Velocitycomponent
in z coordinate
direction v?
Velocitycomponent
in r coordinate
direction v?)

element

(•) (2) (3)


J numbers
Node Hydraulic
1 2 3 4 Number Head (cm)
I 20.00
(x = 0) (x = 4) (x = 8) (x = 12) 2 17.33
3 6.67
4 4.00

K{x•)
= K?)=0.04crrds,
K?)=0.01cm/s

Output:
COMP•D VALUES OF APPAKE• GROUNDWATER VELOCrl•

ELEMENT VX

1 2.666668E-02
2 2.666666E-02
3 2.666666E-02

Figure 14.1 Example output for subroutine VELOCITY.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

374 Subroutine
Velocity

3 6 9 12
(5,15) (10,15) (15,15) (20,15)
Node Hydxaulic
Number Head(ft)
1 4.60
2 4.73
3 6.00
4 4.58
(5,10)
r _ rS(10,10)•'
8(15,10)•
(20,10) 6 5 4.69
5.50
7 4.55
8 4.61
9 5.00
10 4.50
1 4 7 10 11 4.50
12 4.5O
(5,5) (10,5) (15,5) (20,5)

• • oo.

Output'
COMP•D VALUES OF APPARENT GROUNDWATER VELOCITY

1 7.999995E-05 -2.600000E-05
2 4.000018E-05 -2.200002E-05
3 1.599997E-04 -2.200002E-05
4 5.999957E-05 -1.20(•1E-05
5 2.200000E-04 - 1.200001E-05
6 1.000001E-05 2.235174E-11
7 2.000000E-03 -2.540000E-04
8 1.600003E-04 -1.620000E-04
9 2.000000E-03 -1.620000E-04
10 3.199996E-04 -7.799997E-05
11 2.000000E-03 -7.799997E-05
12 4.400007 E-04 2.235174 E- 11

Figure 14.2 Example output for subroutine VELOCITY.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter14 375

14.6 SOURCE CODE LISTING

SUBROUTINE VELOCITY
**********************************************************************
c
c 14.1 PURPOSE:
C TO COMPUTE THE COMPONENTS OF APPARENT GROUNDWATER
C VELOCITY FOR EACH ELEMENT IN THE MESH
C
C 14.2 INPUT.-
C NONE
C
C 14.3 OUTPUT:
C THE COMPONENTS OF APPARENT GROUNDWATER VELOCITY ARE
C WRITTEN TO THE USER-DEFINED FILE ASSIGNED TO UNIT
C "OUTF".
C
C 14.4 DEFINITIONS OF VARIABLES:
DIM • COORDINATE SYSTEM TYPE
E • ELEMENT NUMBER
ELEMTYP (I) • ELEMENT TYPE FOR ELEMENT I
NUMELM • NUMBER OF ELEMENTS IN THE MESH
Vl (I) • APPARENT GROUNDWATER VELOCITY IN X
COORDINATE DIRECTION (DIM•i, 2, OR 3)
• APPARENT GROUNDWATER VELOCITY IN R
COORDINATE DIRECTION (DIM-4)
V2(I) • UNUSED (DIM-l)
• APPARENT GROUNDWATER VELOCITY IN Y
COORDINATE DIRECTION (DIM•2 OR 3)
• APPARENT GROUNDWATER VELOCITY IN Z
COORDINATE DIRECTION (DIM-4)
V3(I) - UNUSED (DIM•i, 2, OR 4)
• APPARENT GROUNDWATER VELOCITY IN Z
COORDINATE DIRECTION (DIM•3)

14.5 USAGE:
THE COMPONENTS OF APPARENT GROUNDWATER VELOCITYARE
COMPUTED IN A SET OF SUBROUTINES, ONE SUBROUTINE
FOR EACH ELEMENT TYPE.

SUBROUTINES CALLED .'


VBAR2, VBAR3, VBAR4 , VTRI 3, VREC 4 , VQUA4, VQUA8 , VQUA12, VPAR8 ,
VPAR20, VPAR32, VTRI 3A, VREC4A

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, CHAPTERS 6
AND 14.

**********************************************************************
$ INCLUDE: ' COMALL '
C
WRITE ( OUTF, 10 )
10 FORMAT(//70('*')//llX,'COMPUTED VALUES OF APPARENT ',
I 'GROUNDWATER VELOCITY'/11X, 48 ( •-' ) )
IF (DIM .EQ. 1) THEN
WRITE(OUTF, 20) t ', 'VX', t •, ' '
ELSEIF (DIM .EQ. 2) THEN
WRITE(OUTF,20) • •, tVX• tVY • • '
ELSEIF (DIM .EQ. 3) THEN
WRITE(OUTF, 20) ' •, •VX •, •VY' 'VZ'

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

376 Subroutine
Velocity

ELSEIF (DIM .EQ. 4) THEN


WRITE(OUTF,20) ' ', 'VR', 'VZ',' '
ENDIF
20 FORMAT(/7X, A, 'ELEMENT', 10X,A, 2 (13X, A)/)
C COMPUTE THE COMPONENTS OF APPARENT GROUNDWATER VELOCITY
C FOR EACH ELEMENT
DO 40 g = 1, NUMELM
IF (ELEMTYP(E) .EQ. 1) THEN
ELEMENT IS A LINEAR BAR
CALL VBAR2 (E, Vl (E))
ELSEIF (ELEMTYP(E) .EQ. 2) THEN
ELEMENT IS A QUADRATIC BAR
CALL VBAR3 (E, V1 (E))
ELSEIF (ELEMTYP(E) .EQ. 3) THEN
ELEMENT IS A CUBIC BAR
CALL VBAR4 (E, Vl (E))
ELSEIF (ELEMTYP(E) .EQ. 4) THEN
ELEMENT IS A LINEAR TRIANGLE
CALL VTRI3 (E, V1 (E), V2 (E))
ELSEIF (ELEMTYP(E) .EQ. 5) THEN
ELEMENT IS A LINEAR RECTANGLE
CALL VREC4 (E, V1 (E), V2 (E))
ELSEIF (ELEMTYP(E) .EQ. 6) THEN
ELEMENT IS A LINEAR QUADRILATERAL
CALL VQUA4 (E, Vl (E), V2 (E))
ELSEIF '(ELEMTYP(E) .EQ. 7) THEN
ELEMENT IS A QUADRATIC QUADRILATERAL
CALL VQUA8 (E, V1 (E), V2 (E))
ELSEIF (ELEMTYP(E) .EQ. 8) THEN
ELEMENT IS A CUBIC QUADRILATERAL
CALL VQUA12 (E, V1 (E), V2 (E))
ELSEIF (ELEMTYP(E) .EQ. 9) THEN
ELEMENT IS A LIN•.AR PARALLELEPIPED
CALL VPAR8 (E, V1 (E), V2 (E), V3 (E))
ELSEIF (ELEMTYP(E) .EQ. 10) THEN
ELEMENT IS A QUADRATIC PARALLELEPIPED
CALL VPAR20 (E, Vl (E), V2 (E), V3 (E))
ELSEIF (ELEMTYP(E) .EQ. 11) THEN
ELEMENT IS A CUBIC PARALLELEPIPED
CALL VPAR32 (E, V1 (E), V2 (E), V3 (E))
ELSEIF (ELEMTYP(E) .EQ. 12) THEN
ELEMENT IS A LINEAR TRIANGLE (AXISYMMETRIC)
CALL VTRI3A (E, V1 (E), V2 (E))
ELSEIF (ELEMTYP(E) .EQ. 13) THEN
ELEMENT IS A LINEAR RECTANGLE (AXISYMMETRIC)
CALL VREC4A (E, V1 (E), V2 (E))
ENDIF
IF (DIM .EQ. 1) THEN
WRITE(OUTF, 30) ' ',E,VI(E)
ELSEIF (DIM .EQ. 2) THEN
WRITE(OUTF, 30) ' ',E,VI(E),V2(E)
ELSEIF (DIM .EQ. 3) THEN
WRITE(OUTF, 30) ' ',E,VI(E),V2(E),V3(E)
ELSE
WRITE(OUTF, 30) ' ',E,Vl(E),V2(E)
ENDIF
30 FORMAT (7X, A, I5, 4X, 1P3E15.6)
40 CONTINUE
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
14 377

SUBROUT INE VBAR2 (E, VXE)


C**********************************************************************

PURPOSE:
TO COMPUTE APPARENT GROUNDWATER VELOCITY FOR A
ONE-DIMENSIONAL, LINEAR BARELEMENT

DEFINITIONS OF VARIABLES:
DHDX - PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO X
E m ELEMENT NUMBER
KXE m HYDRAULIC CONDUCTIVITY IN X COORDINATE DIRECTION
LE = ELEMENT LENGTH
VXE • APPARENT GROUNDWATER VELOCITY IN
X COORDINATE DIRECTION
X(IN(E,I)) - COMPUTEDHEAD FOR NODE I, ELEMENT E
XI(IN(E,I)) - X COORDINATE FOR NODE I, ELEMENT E

REFERENCES:
ISTOK, J.D. GROUNDWATER
FLOWAND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.5,
C E•UATIONS 6.10A, 6.12A.
C
***********************************************************************
$INCLUDE:tCOMALL t
REAL KXE,LE

KXE • PROP (MATSET (E), 1)


LE = XI(IN(E,2)) - XI(IN(E,1))
DHDX -- (X(IN(E,2)) - X(IN(E,1))) / LE
VXE = -KXE * DHDX
RETURN
END

SUBROUT INE VBAR3 (E, VXE)


***********************************************************************

PURPOSE:
TO COMPUTE APPARENT GROUNDWATER VELOCITY FOR A
ONE-DIMENSIONAL, QUADRATIC BAR ELEMENT

DEFINITIONS OF VARIABLES:
DHDX = PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO X
DNDXI(I) • PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO XI FOR NODE I
E • ELEMENT NUMBER
JAC • JACOBIAN MATRIX
JACINV = INVERSE OF JACOBIAN MATRIX
KXE = HYDRAULIC CONDUCTIVITY IN X COORDINATE DIRECTION
VXE m APPARENT GROUNDWATER VELOCITY IN
X COORDINATE DIRECTION
X(IN(E,I)) = COMPUTED HEAD FOR NODE I, ELEMENT E
Xi(IN(E,I)) = X COORDINATE FOR NODE I, ELEMENT E

REFERENCES:
ISTOK, J.D. GROUNDWATERFLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.9B,
EQUATIONS 6.18 AND 6.26A:

***********************************************************************

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

B?8 Subroutine
Velocity

$ INCLUDE: ' COMALL '


PEAL DNDXI (3) , JAC, JACINV, KXE

KXE • PROP (MATSET (E) , 1)


DNDXI(1)- -0.5
DNDXI (2)- 0.0
DNDXI (3) - 0.5
JAC - 0
DO 10 I .- 1, 3
JAC m JAC + DNDXI(I) * XI (IN (E, I) )
10 CONTINUE
JACINV .- 1 / JAC
DHDX m 0.
DO 20 I - 1, 3
DHDX .- DHDX + JACINV * DNDXI(I) * X(IN(E,I))
20 CONTINUE
VXE = -KXE * DHDX
RETURN
END

SUBROUTINE VBAR4 (E,VXE)


***********************************************************************

PURPOSE:
TO COMPUTE APPARENT GROUNDWATER VELOCITY FOR A
ONE-DIMENSIONAL, CUBIC BAR ELEMENT

DEFINITIONS OF VARIABLES:
DHDX = PARTIAL DERIVATIVE OF HEAD WITH RESPECT
TO X COORDINATE DIRECTION
DNDXI (I) •. PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO XI FOR NODE I
E • ELEMENT NUMBER
JAC = JACOBIAN MATRIX
JACINV • INVERSE OF JACOBIAN MATRIX
KXE -- HYDRAULIC CONDUCTIVITY IN X COORDINATE DIRECTION
VXE = APPARENT GROUNDWATER VELOCITY IN
X COORDINATE DIRECTION
X(IN(E,I)) = COMPUTED HEAD FOR NODE I, ELEMENT E
Xl (IN (E, I) ) = X COORDINATE OF NODE I, ELEMENT E

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.9C,
EQUATIONS 6.18 AND 6.26A.

***********************************************************************
$ INCLUDE: ' COMALL '
REAL DNDXI ( 4 ) , JAC, JACINV, KXE
C
KXE = PROP (MATSET (E), 1)
DNDXI(1) = 1. / 16.
DNDXI(2) • -27. / 16.
DNDXI(3) - -DNDXI(2)
DNDXI(4) •. -DNDXI(1)
JAC = 0
DO 20 I = 1, 4
JAC - JAC + DNDXI(I) * X(IN(E,I))
20 CONTINUE
JACINV • i / JAC

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
14 379

DHDX - 0.
DO30 I • 1, 4
DHDX = DHDX '+ JACINV * DNDXI(I) * X(IN(E,I))
30 CONTINUE
VXE • -KXE * DHDX
R•TURN

SUBROUTINE VTRI3 (E, VXE, VYE)


***********************************************************************
PURPOSE:
TO COMPUTE COMPONENTS OF APPARENT GROUNDWATER
VELOCITY FOR A TWO-DIMENSIONAL, LINEAR TRIANGLE ELEMENT

DEFINITIONS OF VARIABLES:
DHDX • PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO X
DHDY = PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO Y
DNDX(I) = PARTIAL DERIVATE OF INTERPOLATION
FUNCTION WITH RESPECT TO X FOR NODE I
DNDY(I) • PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Y FOR NODE I
E = ELEMENT NUMBER
KXE • HYDRAULIC CONDUCTIVITY IN X COORDINATE DIRECTION
KYE • HYDRAULIC CONDUCTIVITY IN Y COORDINATE DIRECTION
VXE • APPARENT GROUNDWATER VELOCITY IN
X COORDINATE DIRECTION
VYE • APPARENT GROUNDWATER VELOCITY IN
Y COORDINATE DIRECTION
X(IN(E,I) ) • COMPUTED HEAD FOR NODE I, ELEMENT E
XI(IN(E,I) ) • X COORDINATE FOR NODE I, ELEMENT E
X2 (IN(E,I)) • Y COORDINATE FOR NODE I, ELEMENT E

REFERENCES:
ISTOK, J.D. GROUNDWATERFLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.6,
EQUATIONS 6.10A, 610B, 6.12A, AND 6.12B.
***********************************************************************
$INCLUDE: 'COMALL'
REAL DNDX(3),DNDY(3),KXE,KYE

KXE = PROP (MATSET (E), 1)


KYE • PROP (MATSET (E), 2)
AE2 = XI(IN(E,2)) * X2(IN(E,3)) + Xi(IN(E,1)) * X2(IN(E,2)) +
1 X2(IN(E,1)) * Xi(IN(E,3)) - X2(IN(E,3)) * Xi(IN(E,1)) -
2 Xi(IN(E,3)) * X2(IN(E,2)) - Xl(IN(E,2)) * X2(IN(E,1))
DNDX(1) = (X2(IN(E,2)) - X2(IN(E,3))) / AE2
DNDX(2) = (X2(IN(E,3)) - X2(IN(E, 1))) / AE2
DNDX(3) = (X2(IN(E,1)) - X2(IN(E,2))) / AE2
DNDY(1) = (XI(IN(E,3)) - Xl(IN(E,2))) / AE2
DNDY(2) • (Xi(IN(E,1)) - Xi(IN(E,3))) / AE2
DNDY(3) • (Xl(IN(E,2)) - Xl(IN(E,1))) / AE2
DHDX = 0.
DHDY • 0.
DO 20 I = 1, 3
DHDX = DHDX + DNDX(I) * X(IN(E,I))
DHDY = DHDY + DNDY(I) * X(IN(E,I))
20 CONTINUE
VXE • -KXE * DHDX
VYE = -KYE * DHDY
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

380 Subroutine
Velocity

SUBROUTINE VREC4 (E, VXE, VYE)


***********************************************************************

PURPOSE:
TO COMPUTE COMPONENTS OF APPARENT GROUNDWATER
VELOCITY FOR A TWO-DIMENSIONAL, LINEAR RECTANGLE ELEMENT

DEFINITIONS OF VARIABLES:
DHDX - PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO X
DHDY - PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO Y
DNDX ( I } • PARTIAL DERIVATE OF INTERPOLATION
FUNCTION WITH RESPECT TO X FOR NODE I
DNDY (I) - PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Y FOR NODE I
E • ELEMENT NUMBER
KXE • HYDRAULIC CONDUCTIVITY IN X COORDINATE DIRECTION
KYE - HYDRAULIC CONDUCTIVITY IN Y COORDINATE DIRECTION
VXE • APPARENT GROUNDWATER VELOCITY IN
X COORDINATE DIRECTION
VYE - APPARENT GROUNDWATER VELOCITY IN
Y COORDINATE DIRECTION
X(IN(E,I)) - COMPUTED HEAD FOR NODE I, ELEMENT E
XI(IN(E,I) ) - X COORDINATE FOR NODE I, ELEMENT E
X2(IN(E,I) ) - Y COORDINATE FOR NODE I, ELEMENT E

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.7,
EQUATIONS 6.10A, 6.10B, 6.12A, AND 6.12B.

***********************************************************************
$ INCLUDE: • COMALL •
REAL DNDX ( 4 ), DNDY ( 4 ), KXE, KYE
C
KXE - PROP (MATSET (E), 1)
KYE - PROP (MATSET (E) ,2)
AE • ABS(X2(IN(E, 1)) - X2(IN(E,3))) / 2.
BE - ABS(XI(IN(E, 1)) - XI(IN(E,3))) ! 2.

DNDX(1) -- 1. / (2.*BE)
DNDX(2) - -DNDX(1)
DNDX (3) = 0
DNDX (4) - 0
DNDY(1) •- 1. ! (2.*AE)
DNDY (2) - 0
DNDY (3) • 0
DNDY(4) • -DNDY(1)

DHDX • 0.
DHDY • 0.
DO 10 I -. 1, 4
DHDX - DHDX + DNDX(I) * X(IN(E,I))
DHDY - DHDY + DNDY(I) * X(IN(E,I))
10 CONTINUE

VXE - -KXE * DHDX


VYE - -KYE * DHDY
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter!4 381

SUBROUTINE VQUA4 (E, VXE, VYE)

C
C PURPOSE:
C TO COMPUTE COMPONENTS OF APPARENT GROUNDWATER
C VELOCITY FOR A TWO-DIMENSIONAL, LINEAR QUADRILATERAL
C ELEMENT

DEFINITIONS OF VARIABLES:
DETJAC • DETERMINANT OF JACOBIAN MATRIX
DHDX • PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO X
DHDY - PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO Y
DNDXI (I) • PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO XI FOR NODE I
DNDX(I) -- PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO X FOR NODE I
DNDETA(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ETA FOR NODE I
DNDY(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Y FOR NODE I
E = ELEMENT NUMBER
JAC ( I, J) • JACOBIAN MATRIX
JACINV (I, J) = INVERSE OF JACOBIAN MATRIX
KXE • HYDRAULIC CONDUCTIVITY IN X COORDINATE DIRECTION
KYE = HYDRAULIC CONDUCTIVITY IN Y COORDINATE DIRECTION
VXE = APPARENT GROUNDWATER VELOCITY IN
X COORDINATE DIRECTION
VYE = APPARENT GROUNDWATER VELOCITY IN
Y COORDINATE DIRECTION
X(IN(E,I)) = COMPUTED HEAD FOR NODE I, ELEMENT E
Xl (IN(E, I)) = X COORDINATE FOR NODE I, ELEMENT E
X2 (IN(E,I)) • Y COORDINATE FOR NODE I, ELEMENT E

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.10,
EQUATIONS 6.14A, 6.14B, 6.17, 6.22A, AND 6.22B.

***********************************************************************

$ INCLUDE: ' COMALL '


REAL JAC(2,2),JACINV(2,2),DNDXI(4),DNDX(4),
1 DNDETA (4) ,DNDY (4) , SIGN1 (4) , SIGN2 (4) , KXE, KYE
DATA SIGN1/-1.,1.,1.,-1./
DATA SIGN2/-1.,-1.,1.,1./
C
KXE = PROP (MATSET (E) , 1)
KYE m PROP (MATSET (E), 2)

DO 20 I = 1, 2
DO 10 J• 1, 2
JAC(I,J) = 0.
10 CONTINUE
20 CONTINUE

DO 30 I - 1, 4
DNDXI(I) m 0.25 * SIGNI(I)
DNDETA(I) •= 0.25 * SIGN2(I)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

382 Subroutine
Velocity

30 CONTINUE

DO 40 I- 1, 4
JAC(1,1) - JAC(1,1) + DNDXI{I) * Xi (IN (E, I) )
JAC(1,2) - JAC(1,2) + DNDXI(I) * X2(IN(E,I))
JAC(2,1) - JAC(2,1) + DNDETA(I) * Xi (IN (E, I) )
JAC(2,2) - JAC(2,2) + DNDETA(I) * X2 (IN (E, I) )
40 CONTINUE

DETJAC - JAC(1,1) * JAC(2,2) - JAC(1,2) * JAC(2,1)


JACINV(1,1)" JAC(2,2) / DETJAC
JACINV(1,2) --JAC(1,2) / DETJAC
JACINV(2,1) - -JAC(2,1) / DETJAC
JACINV(2,2) = JAC(1,1) / DETJAC

DO 50 I • 1, 4
DNDX(I) - JACINV(1,1) * DNDXI(I) + JACINV(1,2) * DNDETA(I)
DNDY(I) - JACINV(2,1) * DNDXI(I) + JACINV(2,2) * DNDETA(I)
50 CONTINUE

DHDX • 0.
DHDY • 0.

DO 60 I• 1, 4
DHDX - DHDX + DNDX(I) * X(IN(E,I))
DHDY - DHDY + DNDY(I) * X(IN(E,I))
60 CONTINUE

VXE - -KXE * DHDX


VYE - -KYE * DHDY
RETURN
END

SUBROUTINE VQUA8 (E, VXE, VYE)


***********************************************************************

PURPOSE:
TO COMPUTE COMPONENTS OF APPARENT GROUNDWATER
VELOCITY FOR A TWO-DIMENSIONAL, QUADRATIC QUADRILATERAL
ELEMENT

DEFINITIONS OF VARIABLES:
DETJAC m DETERMINANT OF JACOBIAN MATRIX
DHDX = PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO X
DHDY - PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO Y
DNDXI(I) - PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO XI FOR NODE I
DNDX (I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO X FOR NODE I
DNDETA(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ETA FOR NODE I
DNDY(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Y FOR NODE I
E - ELEMENT NUMBER
JAC (I, J) - JACOBIAN MATRIX
JACINV ( I, J) = INVERSE OF JACOBIAN MATRIX
KXE - HYDRAULIC CONDUCTIVITY IN X COORDINATE DIRECTION
KYE - HYDRAULIC CONDUCTIVITY IN Y COORDINATE DIRECTION
VXE - APPARENT GROUNDWATER VELOCITY IN X
COORDINATE DIRECTION

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
]4 383

VYE - APPARENT GROUNDWATER VELOCITY IN Y


COORDINATE DIRECTION
X(IN(E,I)) • COMPUTEDHEAD FOR NODE I, ELEMENT E
Xl(IN(E,I) ) • X COORDINATE FOR NODE I, ELEMENT E
X2(IN(E,I) ) • Y COORDINATE FOR NODE I, ELEMENT E

REFERENCES '.
ISTOK, J.D. GROUNDWATERFLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.11,
EQUATION 6.14A, 6.14B, 6.17, 6.22A, AND 6.22B.
***********************************************************************
$ INCLUDE: • COMALL '
REAL JAC (2,2) , JACINV(2,2) , DNDXI (8) ,DNDX(8) ,DNDETA(8) ,
1 DNDY(8),SIGNI(8),SIGN2(8),KXE,KYE
DATA SIGN1/-1.,0.,1.•I.,1.,0.,-1.,-1./
DATA SIGN2/-1.,-1.,-1.,0.,1.,1.,1.,0./

KXE w PROP (MATSET (E), 1)


KYE • PROP (MATSET (E) , 2)
DO 20 I • 1, 2
DO 10 J • 1, 2
JAC(I,J) = 0.
10 CONTINUE
20 CONTINUE
DO 30 I • 1, 8
IF ((I .EQ. 1) .OR. (I .EQ. 3) .OR.
I (I .EQ. 5) .OR. (I .EQ. 7)) THEN
DNDXI(I) = 0.
DNDETA(I) - 0.
ELSEIF ((I .EQ. 2) .OR. (I .EQ. 6)) THEN
DNDXI(I) = 0.
DNDETA(I) = 0.5 * SIGN2(I)
ELSEIF ((I .EQ. 4) .OR. (I .EQ. 8)) THEN
DNDXI(I) • 0.5 * SIGNI(I)
DNDETA (I) = 0.
ENDIF
30 CONTINUE
DO 40 I = 1, 8
JAC(1,1) = JAC(1,1) + DNDXI(I) * Xl(IN(E,I))
JAC(1,2) = JAC(1,2) + DNDXI(I) * X2(IN(E,I))
JAC(2,1) = JAC(2,1) + DNDETA(I) * Xi(IN(E,I))
JAC(2,2) = JAC(2,2) + DNDETA(I) * X2(IN(E,I))
40 CONTINUE
DETJAC • JAC(1,1) * JAC(2,2) - JAC(1,2) * JAC(2,1)
JACINV(1, 1) -- JAC(2,2) / DETJAC
JACINV(1,2) • -JAC(1,2) / DETJAC
JACINV(2, 1) • -JAC(2, 1) / DETJAC
JACINV(2,2) • JAC(1,1) / DETJAC
DO 50 I - 1, 8
DNDX(I) • JACINV(1,1) * DNDXI(I) + JACINV(1,2) * DNDETA(I)
DNDY(I) • JACINV(2,1) * DNDXI(I) + JACINV(2,2) * DNDETA(I)
50 CONTINUE
DHDX- 0.
DHDY - 0.
DO 60 I • 1, 8
DHDX'- DHDX + DNDX(I) * X(IN(E,I))
DHDY - DHDY + DNDY(I) * X(IN(E,I))
60 CONTINUE
VXE • -KXE * DHDX
VYE - -KYE * DHDY

END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

384 Subroutine
Velocity

SUBROUTINE VQUA12 (E, VXE, VYE)


***********************************************************************

PURPOSE:
TO COMPUTE COMPONENTS OF APPARENT GROUNDWATER
VELOCITY FOR A TWO-DIMENSIONAL, CUBIC QUADRILATERAL
ELEMENT

DEFINITIONS OF VARIABLES:
DETJAC m DETERMINANT OF JACOBIAN MATRIX
DHDX - PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO X
DHDY - PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO Y
DNDXI (I) • PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO XI FOR NODE I
DNDX (I) - PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO X FOR NODE I
DNDETA(I) • PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ETA FOR NODE I
DNDY(I) - PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Y FOR NODE I
E m ELEMENT NUMBER
JAC (I, J) -- JACOBIAN MATRIX
JACINV ( I, J) "INVERSE OF JACOBIAN MATRIX
KXE = HYDRAULIC CONDUCTIVITY IN X COORDINATE DIRECTION
KYE -- HYDRAULIC CONDUCTIVITY IN Y COORDINATE DIRECTION
VXE -- APPARENT GROUNDWATER VELOCITY IN X
COORDINATE DIRECTION
VYE - APPARENT GROUNDWATER VELOCITY IN Y
COORDINATE DIRECTION
X(IN(E,I) ) - COMPUTED HEAD FOR NODE I, ELEMENT E
X1 (IN(E, I)) • X COORDINATE FOR NODE I, ELEMENT E
X2 (IN(E, I) ) • Y COORDINATE FOR NODE I, ELEMENT E

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.12,
EQUATIONS 6.14A, 6.14B, 6.17, 6.22A, AND 6.22B.

***********************************************************************

INCLUDE: wCOMALL w
REAL JAC (2,2) , JACINV(2,2) ,DNDXI (12) ,DNDX (12) ,DNDETA(12) ,
i DNDY ( 12 ) , SIGN1 ( 12 ) , S IGN2 ( 12 ) , KXE, KYE
DATA SIGN1/-1.,-1.,1.,1.,1.,1.,1.,1.,-1.,-1.,-1.,-1./
DATA SIGN2/-1.,-1.,-1.,-1.,-1.,1.,1.,1.,1.,1.,1.,-1./

KXE m PROP (MATSET (E) , 1)


KYE ' PROP (MATSET (E) , 2)
DO 20 I ' 1, 2
DO 10 J• 1, 2
JAC(I,J) - 0.
10 CONTINUE
20 CONTINUE
DO 30 I ' 1, 12
IF ((I .EQ. 1) .OR. (I .EQ. 4) .OR.
i (I .EQ. 7) .OR. (I .EQ. 10)) THEN
DNDXI(I) - -(10. / 32.) * SIGNi(I)
DNDETA(I) '-(10. / 32.) * SIGN2(I)
ELSEIF ((I .EQ. 2) .OR. (I .EQ. 3) .OR.
1 (I .EQ. 8) .OR. (I .EQ. 9)) THEN
DNDXI(I) ' (81. / 32.) * SIGNi(I)/3.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
14 385

DNDETA(I) - (9. / 32.) * SIGN2(I)


ELSEIF ((I .EQ. 5) .OR. (I .EQ. 6) .OR.
I (I .EQ. 11) .OR. (I .EQ. 12)) THEN
DNDXI(I) - (9. / 32.) * SIGNI(I)
DNDETA(I) m (81. / 32.) * SIGN2(I)/3.
ENDIF
30 CONTINUE
DO 40 I • 1, 12
JAC(1,1) m JAC(1,1) + DNDXI(I) * XI (IN (E, I) )
JAC(1,2) -- JAC(1,2) + DNDXI(I) * X2 (IN (E, I) )
JAC(2,1) - JAC(2,1) + DNDETA(I) * XI(IN(E,I))
JAC(2,2) -- JAC(2,2) + DNDETA(I) * X2 (IN (E, i) )
40 CONTINUE
DETJAC - JAC(1,1) * JAC(2,2) - JAC(1,2) * JAC(2,1)
JACINV(1,1) • JAC(2,2) / DETJAC
JACINV(1,2) -- -JAC(1,2) / DETJAC
JACINV(2, 1) • -JAC (2, 1) / DETJAC
JACINV(2,2) - JAC(1,1) / DETJAC
DO 50 I f 1, 12
DNDX(I) m JACINV(1,1) * DNDXI(I) + JACINV(1,2) * DNDETA(I)
DNDY(I) - JACINV(2,1) * DNDXI(I) + JACINV(2,2) * DNDETA(I)
50 CONTINUE
DHDX - 0.
DHDY -- 0.
DO 60 I -- 1, 12
DHDX • DHDX + DNDX(I) * X(IN(E,I))
DHDY • DHDY + DNDY(I) * X(IN(E,I))
60 CONTINUE
VXE -- -KXE * DHDX
VYE -- -KYE * DHDY
RETURN
END

SUBROUT INE VPAR8 (E, VXE, VYE, VZE)


***********************************************************************

PURPOSE:
TO COMPUTE COMPONENTS OF APPARENT GROUNDWATER
VELOCITY FOR A THREE-DIMENSIONAL, LINEAR
PARALLELEP IPED ELEMENT

DEFINITIONS OF VARIABLES:
DETJAC - DETERMINANT OF JACOBIAN MATRIX
DHDX - PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO X
DHDY - PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO Y
DHDZ - PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO Z
DNDXI (I) -- PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO XI FOR NODE I
DNDX(I) - PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO X FOR NODE I
DNDETA (I) - PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ETA FOR NODE I
DNDY (I) - PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Y FOR NODE I
DNDZETA(I) - PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ZETA FOR NODE I
DNDZ(I) m PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Z FOR NODE I
E - ELEMENT NUMBER
JAC (I, J) - JACOBIAN MATRIX
JACINV ( I, J) - INVERSE OF JACOBIAN MATRIX

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

386 Subroutine
Velocity

KXE " HYDRAULIC CONDUCTIVITY IN X COORDINATE DIRECTION


KYE - HYDRAULIC CONDUCTIVITY IN Y COORDINATE DIRECTION
KZE - HYDRAULIC CONDUCTIVITY IN Z COORDINATE DIRECTION
VXE • APPARENT GROUNDWATER VELOCITY IN X
COORDINATE DIRECTION
VYE = APPARENT GROUNDWATER VELOCITY IN Y
COORDINATE DIRECTION
VZE = APPARENT GROUNDWATER VELOCITY IN Z
COORDINATE DIRECT ION
X(IN(E,I) ) = COMPUTED HEAD FOR NODE I, ELEMENT E
X1 (IN(E, I) ) = X COORDINATE FOR NODE I, ELEMENT E
X2 (IN(E,I)) • Y COORDINATE FOR NODE I, ELEMENT E
X3(IN(E,I) ) = Z COORDINATE FOR NODE I, ELEMENT E

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.13,
EQUATIONS 6.14, 6.16, AND 6.22

***********************************************************************
$ INCLUDE: i COMALL I
REAL JAC(3,3),JACINV(3,3),DNDXI(8),DNDX(8),DNDETA(8),DNDY(8),
1 DNDZETA (8) ,DNDZ (8), SIGN1 (8), SIGN2 (8), SIGN3 (8), KXE, KYE,
2 KZE
DATA SIGN1/-1.,1.,1.,-1.,-1.,1.,1.,-1./
DATA SIGN2/-1.,-1.,1.,1.,-1.,-1.,1.,1./
DATA SIGN3/-1.,-1.,-1.,-1.,1.,1.,1.,1./

KXE = PROP (MATSET (E) , 1)


KYE = PROP (MATSET (E) , 2)
KZE = PROP (MATSET (E) , 3)
DO 20 I • 1, 3
DO 10 J = 1, 3
JAC(I,J) • 0.
10 CONTINUE
20 CONTINUE
DO 30 I • 1, 8
DNDXI(I) - 0.125 * $IGNI(I)
DNDETA(I) "= 0.125 * SIGN2(I)
DNDZETA(I) - 0.125 * SIGN3(I)
30 CONT INUW•
DO 40 I • 1, 8
JAC(1,1) • JAC'(1,1) + DNDXI(I) * Xi(IN(E,I))
JAC(1,2) ' JAC(1,2) + DNDXI(I) * X2(IN(E,I))
JAC(1,3) = JAC(1,3) + DNDXI(I) * X3(IN(E,I))
JAC(2,1) = JAC(2,1) + DNDETA(I) * Xi(IN(E,I))
JAC(2,2) ' JAC(2,2) + DNDETA(I) * X2(IN(E,I))
JAC(2,3) = JAC(2,3) + DNDETA(I) * X3 (IN (E, I) )
JAC(3,1) - JAC(3,1) + DNDZETA(I) * Xi (IN (E, I) )
JAC(3,2) = JAC(3,2) + DNDZETA(I) * X2(IN(E,I))
JAC(3,3) = JAC(3,3) + DNDZETA(I) * X3 (IN (E, I) )
40 CONTINUE
DETJAC' JAC(1,1) * (JAC(2,2) * JAC(3,3)- JAC(3,2) *
1 JAC(2,3)) -JAC(1,2) * (JAC(2,1) * JAC(3,3) -
2 JAC(3,1) * JAC(2,3) ) - JAC(1,3) * (JAC(2,1) *
3 JAC(3,2) - JAC(3,1) * JAC(2,2))
IF ( DETJAC .EQ. 0 ) STOP ' DETERMINANT IS ZERO
JACINV(1,1) = (JAC(2,2) * JAC(3,3) -JAC(2,3) *
1 JAC(3,2)) / DETJAC
JACINV(1,2) = (-JAC(2,1) * JAC(3,3) + JAC(2,3) *
1 JAC (3, 1) ) / DETJAC

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
14 387

JACINV(1,3) - (JAC(2,1) * JAC(3,2) -JAC(3,1) *


1 JAC(2,2)) / DETJAC
JACINV(2,1) = (-JAC(1,2) * JAC(3,3) + JAC(1,3) *
I JAC(3,2)) / DETJAC
JACINV(2,2) = (JAC(1,1) * JAC(3,3) -JAC(1,3) *
1 JAC(3, 1) ) / DETJAC
JACINV(2,3) - (-JAC(1,1) * JAC(3,2) + JAC(1,2) *
i JAC(3,1)) / DETJAC
JACINV(3,1) = (JAC(1,2) * JAC(2,3) -JAC(1,3) *
1 JAC(2,2)) / DETJAC
JACINV(3,2)- (-JAC(1,1) * JAC(2,3)+ JAC(1,3) *
i JAC(2, 1) ) / DETJAC
JACINV(3,3) - (JAC(1,1) * JAC(2,2) - JAC(1,2) *
1 JAC(2,1) ) / DETJAC
DO50 I = 1, 8
DNDX(I) = JACINV(1,1) * DNDXI(I) + JACINV(1,2) *
1 DNDETA(I) + JACINV(1,3) * DNDZETA(I)
DNDY(I) = JACINV(2,1) * DNDXI(I) + JACINV(2,2) *
i DNDETA(I) + JACINV(2,3) * DNDZETA(I)
DNDZ(I) TMJACINV(3,1) * DNDXI(I) + JACINV(3,2) *
i DNDETA(I) + JACINV(3,3) * DNDZETA(I)
50 CONTINUE
DHDX = 0.
DHDY = 0.
DHDZ = 0.
DO 60 I = 1, 8
DHDX - DHDX + DNDX(I) * X(IN(E,I))
DHDY = DHDY + DNDY(I) * X(IN(E,I))
DHDZ TMDHDZ + DNDZ(I) * X(IN(E,I))
60 CONTINUE
VXE = -KXE * DHDX
VYE = -KYE * DHDY
VZE = -KZE * DHDZ
RETURN
END

SUBROUTINE VPAR20 (E, VXE, VYE, VZE)


***********************************************************************

PURPOSE:
TO COMPUTE COMPONENTS OF APPARENT GROUNDWATER
VELOCITY FOR A THREE-DIMENSIONAL, QUADRATIC
PARALLELEP IPED ELEMENT

DEFINITIONS OF VARIABLES:
DETJAC = DETERMINANT OF JACOBIAN MATRIX
DHDX • PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO X
DHDY m PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO Y
DHDZ - PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO Z
DNDXI(I) - PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WiTH RESPECT TO XI FOR NODE I
DNDX(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO X FOR NODE I
DNDETA(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ETA FOR NODE I
DNDY(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Y FOR NODE I
DNDZETA(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ZETA FOR NODE I
DNDZ(I) -- PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Z FOR NODE I

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

388 Subroutine
Velocity

JAC (I, J) • JACOBIAN MATRIX


JACINV ( I, J) • INVERSE OF JACOBIAN MATRIX
KXE • HYDRAULIC CONDUCTIVITY IN X COORDINATE DIRECTION
KYE - HYDRAULIC CONDUCTIVITY IN Y COORDINATE DIRECTION
KZE • HYDRAULIC CONDUCTIVITY IN Z COORDINATE DIRECTION
VXE • APPARENT GROUNDWATER VELOCITY IN X
COORDINATE DIRECTION
VYE • APPARENT GROUNDWATER VELOCITY IN Y
COORDINATE DIRECTION
VZE • APPARENT GROUNDWATER VELOCITY IN Z
COORDINATE DIRECTION
X(IN(E, I)) • COMPUTED HEAD FOR NODE I, ELEMENT E
Xl (IN(E,I)) • X COORDINATE FOR NODE I, ELEMENT E
X2 (IN(E,I)) - Y COORDINATE FOR NODE I, ELEMENT E
X3(IN(E,I) ) • Z COORDINATE
FOR NODEI, 'ELEMENTE
REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.14,
EQUATIONS 6.14, 6.16, AND 6.22

***********************************************************************
INCLUDE: ' COMALL '
REAL JAC(3,3),JACINV(3,3),DNDXI(20),DNDX(20),DNDETA(20),
1 DNDY (20), DNDZETA (20),DNDZ (20), SIGN1 (20), SIGN2 (20),
3 SIGN3 (20), KXE, KYE, KZE
DATA SIGN1/-1.,0.,1.,1.,1.,0.,-1.,-1.,-1.,1.,1.,-1.,-1.,
I 0.,1.,1.,1.,0.,-1.,-1./
DATA SIGN2/-1.,-1.,-1.,0.,1.,1.,1.,0.,-1.,-1.,1.,1.,-1.,
i -1.,-1.,0.,1.,1.,1.,0./
DATA SIGN3/-1.,-1.,-1.,-1.,-1.,-1.,-1.,-1.,0.,0.,0.,0.,1.,
I 1.,1.,1.,1.,1.,1.,1./

KXE • PROP (MATSET (E), 1)


KYE • PROP (MATSET (E), 2)
KZE - PROP (MATSET (E), 3)
DO 20 I • 1, 20
DO 10 J • 1, 20
JAC(I,J) • 0.
10 CONTINUE
20 CONTINUE
DO 30 I ' 1, 20
IF ((I .EQ. 1) .OR. (I .EQ. 3) .OR. (I .EQ. 5) .OR.
1 (I .EQ. 7) .OR. (I .EQ. 13) .OR. (I .EQ. 15) .OR.
2 (I .EQ. 17) .OR. (I .EQ. 19)) THEN
DNDXI(I) - -0.125 * SIGNI(I)
DNDETA(I) •-0.125 * SIGN2(I)
DNDZETA(I) •-0.125 * SIGN3(I)
ELSEIF ((I .EQ. 2) .OR. (I .EQ. 6) .OR.
i (I .EQ. 14) .OR. (I .EQ. 18)) THEN
DNDXI {I) - 0.
DNDETA(I) • 0.25 * SIGN2(I)
DNDZETA(I) - 0.25 * SIGN3(I)
ELSEIF ((I .EQ. 4) .OR. (I .EQ. 8) .OR.
i (I .EQ. 16) .OR. (I .EQ. 20)) THEN
DNDXI(I) - 0.25 * SIGNi(I)
DNDETA (I) • 0.
DNDZETA(I) - 0.25 * SIGN3(I)
ELSEIF ((I .GE. 9) .AND. (I .LE. 12)) THEN

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
14 389

DNDXI(I) • 0.25 * SIGNI(I)


DNDETA(I) • 0.25 * SIGN2(I)
DNDZETA(I) • 0.
ENDIF
30 CONTINUE
DO 40 I • 1, 20
JAC(1,1) -- JAC(1,1) + DNDXI(I) * Xi (IN (E, I) )
JAC(1,2) • JAC(1,2) + DNDXI(I) * X2 (IN (E, I) )
JAC(1,3) • JAC(1,3) + DNDXI(I) * X3 (IN (E, I) )
JAC(2,1) - JAC(2,1) + DNDETA(I) * XI (IN (E, I) )
JAC(2,2) • JAC(2,2) + DNDETA(I) * X2 (IN (E, I) )
JAC(2,3) • JAC(2,3) + DNDETA(I) * X3 (IN (E, I) )
JAC(3,1) • JAC(3,1) + DNDZETA(I) * Xl (IN (E, I) )
JAC(3,2) --JAC(3,2) + DNDZETA(I) * X2(IN(E,I))
JAC(3,3) • JAC(3,3) + DNDZETA(I) * X3(IN(E,I))
40 CONTINUE
DETJAC • JAC(1,1) * (JAC(2,2) * JAC(3,3)- JAC(3,2) *
I JAC(2,3)) -JAC(1,2) * (JAC(2,1) * JAC(3,3) -
2 JAC(3,1) * JAC(2,3))- JAC(1,3) * (JAC(2,1) *
3 JAC(3,2) - JAC(3,1) * JAC(2,2))
JACINV(1,1) -- (JAC(2,2) * JAC(3,3) -JAC(2,3) *
i JAC(3,2)) / DETJAC
JACINV(1,2) • (-JAC(2,1) * JAC(3,3)+ JAC(2,3) *
i JAC(3,1)) / DETJAC
JACINV(1,3) • (JAC(2,1) * JAC(3,2) -JAC(3,1) *
I JAC(2,2) ) / DETJAC
JACINV(2,1) - (-JAC(1,2) * JAC(3,3) + JAC(1,3) *
1 JAC(3,2)) ! DETJAC
JACINV(2,2) • (JAC(1,1) * JAC(3,3)- JAC(1,3) *
i JAC(3,1)) / DETJAC
JACINV(2,3) • (-JAC(1,1) * JAC(3,2)+ JAC(1,2) *
i JAC(3,1)) / DETJAC
JACINV(3,1) -- (JAC(1,2) * JAC(2,3) -JAC(1,3) *
I JAC (2,2)) / DETJAC
JACINV(3,2) • (-JAC(1,1) * JAC(2,3) + JAC(1,3) *
i JAC (2,1)) / DETJAC
JACINV(3,3) • (JAC(1,1) * JAC(2,2) -JAC(1,2) *
1 JAC(2,1) ) / DETJAC
DO 50 I • 1, 20
DNDX(I) • JACINV(1,1) * DNDXI(I) + JACINV(1,2) *
I DNDETA(I) + JACINV(1,3) * DNDZETA(I)
DNDY(I) - JACINV(2,1) * DNDXI(I) + JACINV(2,2) *
1 DNDETA(I) + JACINV(2,3} * DNDZETA(I)
DNDZ(I) - JACINV(3,1) * DNDXI(I) + JACINV(3,2) *
1 DNDETA(I) + JACINV(3,3) * DNDZETA(I)
50 CONTINUE
DHDX • 0.
DHDY • 0.
DHDZ • 0.
DO 60 I - 1, 20
DHDX • DHDX + DNDX(I) * X(IN(E,I))
DHDY • DHDY + DNDY(I) * X(IN(E,I))
DHDZ = DHDZ + DNDZ(I) * X(IN(E,I))
60 CONTINUE
VXE = -KXE * DHDX
VYE - -KYE * DHDY
VZE -- -KZE * DHDZ
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

390 Subroutine
Velocity

SUBROUTINE VPAR32 (E, VXE, VYE, VZE)


***********************************************************************

PURPOSE:
TO COMPUTE COMPONENTS OF APPARENT GROUNDWATER
VELOCITY FOR A THREE-DIMENSIONAL, CUBIC
PARALLELEP IPED ELEMENT

DEFINITIONS OF VARIABLES:
DETJAC • DETERMINANT OF JACOB IAN MATRIX
DHDX -- PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO X
DHDY = PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO Y
DHDZ • PARTIAL DERIVATIVE OF HEAD WITH RESPECT TO Z
DNDXI (I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO XI FOR NODE I
DNDX(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO X FOR NODE I
DNDETA(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ETA FOR NODE I
DNDY (I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Y FOR NODE I
DNDZETA (I) • PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ZETA FOR NODE I
DNDZ(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Z FOR NODE I
E = ELEMENT NUMBER
JAC(I,J) = JACOBIAN MATRIX
JACINV(I, J) • INVERSE OF JACOBIAN MATRIX
KXE - HYDRAULIC CONDUCTIVITY IN X COORDINATE DIRECTION
KYE - HYDRAULIC CONDUCTIVITY IN Y COORDINATE DIRECTION
KZE • HYDRAULIC CONDUCTIVITY IN Z COORDINATE DIRECTION
VXE • APPARENT GROUNDWATER VELOCITY IN X
COORDINATE DIRECTION
VYE - APPARENT GROUNDWATER VELOCITY IN Y
COORDINATE DIRECTION
VZE - APPARENT GROUNDWATER VELOCITY IN Z
COORDINATE DIRECTION
X(IN(E,I)) = COMPUTED HEAD FOR NODE I, ELEMENT E
XI (IN (E, I) ) = X COORDINATE FOR NODE I, ELEMENT E
X2(IN(E,I) ) - Y COORDINATE FOR NODE I, ELEMENT E
X3(IN(E,I) ) • Z COORDINATE FOR NODE I, ELEMENT E

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.15,
EQUATIONS 6.14, 6.16, AND 6.22.

***********************************************************************
$INCLUDE: 'COMALL'
REAL JAC(3,3),JACINV(3,3),DNDXI(32),DNDX(32),DNDETA(32),
I DNDY (32), DNDZETA (32) ,DNDZ (32), SIGN1 (32), SIGN2 (32),
3 SIGN3 (32), KXE, KYE, KZE
DATA SIGN1/ -1.,-1., 6'1., 5'-1.,
I 1.,1., -1.,-1., 1.,1., 3'-1., 6'1., 4'-1.
DATA SIGN2/ 5'-1., 6'1., 3'-1.,
I 1.,1., -1.,-1., 1.,1., 5'-1., 6'1., -1 /
DATA SIGN3/ 16'-1., 16'1. /

KXE - PROP (MATSET (E) , 1)


KYE - PROP (MATSET (E) , 2)
KZE - PROP (MATSET (E) , 3)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
14 391

DO 20 I - 1, 32
DO 10 J i 1, 32
JAC (I, J) i 0.
10 CONTINUE
20 CONTINUE
DO 30 I • 1, 32
IF ((I .EQ. 1) .OR. (I .EQ. 4) .OR. (I .EQ. 7) .OR.
I (I .EQ. 10) .OR. (I .EQ. 21) .OR. (I .EQ. 24) .OR.
2 (I .EQ. 27) .OR. (I .EQ. 30)) THEN
DNDXI(I) - (-19. / 64.) * SIGNi(I)
DNDETA(I) • (-19. / 64.) * SIGN2(I)
DNDZETA(I) - (-19. / 64.) * SIGN3(I)
ELSEIF ((I .EQ. 2) .OR. (I .EQ. 3) .OR. (I .EQ. 8) .OR.
I (I .EQ. 9) .OR. (I .EQ. 22) .OR. (I.EQ.23) .OR.
2 (I .EQ. 28) .OR. (I .EQ. 29)) THEN
DNDXI(I) = (81. / 64.) * SIGNI(I) /3.
DNDETA(I) -' (9. / 64.) * SIGN2(I)
DNDZETA(I) - (9. / 64.) * SIGN3(I)
ELSEIF ((I .EQ. 5) .OR. (I .EQ. 6) .OR. (I .EQ. 11) .OR.
i (I .EQ. 12) .OR. (I .EQ. 25) .OR. (I .EQ. 26) .OR.
2 (I .EQ. 31) .OR. (I .EQ. 32)) THEN
DNDXI(I) = (9. / 64.) * SIGNI(I)
DNDETA(I) • (81. / 64.) * SIGN2(I) /3.
DNDZETA(I) = (9. / 64.) * SIGN3(I)
ELSEIF ((I .GE. 13) .AND. (I .LE. 20)) THEN
DNDXI(I) - (9. / 64.) * SIGNI(I)
DNDETA(I) - (9. / 64.) * SIGN2(I)
DNDZETA(I) -- (81. / 64.) * SIGN3(I) /3.
ENDIF
30 CONTINUE
DO 40 I = 1, 32
JAC(1,1) = JAC(1,1) + DNDXI(I) * XI(IN(E,I))
JAC(1,2) = JAC(1,2) + DNDXI(I) * X2(IN(E,I))
JAC(1,3) • JAC(1,3) + DNDXI(I) * X3(IN(E,I))
JAC(2,1) • JAC(2,1) + DNDETA(I) * XI(IN(E,I))
JAC(2,2) - JAC(2,2) + DNDETA(I) * X2(IN(E,I))
JAC(2,3) - JAC(2,3) + DNDETA(I) * X3(IN(E,I))
JAC(3,1) - JAC(3,1) + DNDZETA(I) * Xl(IN(E,I))
JAC(3,2) = JAC(3,2) + DNDZETA(I) * X2(IN(E,I))
JAC(3,3) • JAC(3,3) + DNDZETA(I) * X3 (IN (E, I) )
40 CONTINUE
DETJAC" JAC(1,1) * (JAC(2,2) * JAC(3,3) - JAC(3,2) *
i JAC(2,3)) - JAC(1,2) * (JAC(2,1) * JAC(3,3) -
2 JAC(3,1) * JAC(2,3))- JAC(1,3) * (JAC(2,1) *
3 JAC(3,2) - JAC(3,1) * JAC(2,2))
JACINV(1,1) - (JAC(2,2) * JAC(3,3) - JAC(2,3) *
i JAC(3,2)) / DETJAC
JACINV(1,2) - (-JAC(2,1) * JAC(3,3) + JAC(2,3) *
1 JAC(3,1)) / DETJAC
JACINV(1,3) "(JAC(2,1) * JAC(3,2) -JAC(3,1) *
1 JAC(2,2)) / DETJAC
JACINV(2,1) - (-JAC(1,2) * JAC(3,3) + JAC(1,3) *
i JAC(3,2)) / DETJAC
JACINV(2,2) - (JAC(1,1) * JAC(3,3) -JAC(1,3) *
i JAC(3,1)) / DETJAC
JACINV(2,3) • (-JAC(1,1) * JAC(3,2) + JAC(1,2) *
1 JAC(3,1)) / DETJAC
JACINV(3,1) = (JAC(1,2) * JAC(2,3) - JAC(1,3) *
1 JAC(2,2)) / DETJAC
JACINV(3,2) • (-JAC(1,1) * JAC(2,3) + JAC(1,3) *
1 JAC(2,1)) / DETJAC

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

392 Subroutine
Velocity

JACINV(3,3) (JAC(1,1) = * JAC(2,2) -JAC(1,2) *


1 JAC(2,1)) / DETJAC
DO 50 I - 1, 32
DNDX(I) • JACINV(1,1) * DNDXI(I) + JACINV(1,2) *
1 DNDETA(I) + JACINV(1,3) * DNDZETA(I)
DNDY(I) -- JACINV(2,1) * DNDXI(I) + JACINV(2,2) *
I DNDETA(I) + JACINV(2,3) * DNDZETA(I)
DNDZ(I) • JACINV(3,1) * DNDXI(I) + JACINV(3,2) *
1 DNDETA(I) + JACINV(3,3)' * DNDZETA(I)
50 CONTINUE
DHDX • 0.
DHDY • 0.
DHDZ - 0.
DO 60 I = 1, 32
DHDX • DHDX + DNDX(I) * X(IN(E,I))
DHDY = DHDY + DNDY(I) * X(IN(E,I))
DHDZ • DHDZ + DNDZ(I) * X(IN(E,I))
60 CONTINUE
VXE - -KXE * DHDX
VYE - -KYE * DHDY
VZE = -KZE * DHDZ
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 15

SUBROUTINE DUMP

15.1 PURPOSE

Subroutine
DUMP writesthecontentsof variousvariablesandarraysto friesfor usein
othercomputerprograms
(e.g.plotting
packages).
DIJMPis alsousedtopassvelocities
computedin groundwater
program GW1(seeChapters
7 and14)to thesolutetransport
programST1.

15.2 INPUT

Controlinformationis read"flee-format"from the user-suppliedfile assignedto unit


"INF". The controlinformationconsistsof a code(ICODE) thatindicateswhicharraysare
to bewrittento a user-defined
file (FNA•), followedby thefile name(two-linesof input
for eachchoiceof ICODE). Thisinformation canberepeatedasoftenasdesired.Inputis
terminatedbyplacinga -1 in thefirstfieldof anyline.'

15.3 OUTPUT

Thearraysarewrfftento a setof user-defined


files. DUMPopensthefilesusingthe
file namesreadfromINF. Thecontents of requestedvariablesandarraysarewrittento the
files "free-format"
(i.e., withoutcolumnheadingsor titles).

15.4 DEFINITIONS OF VARIABLES

FNAME = File namefor a user-definedf'fie(20 charactersor less).

ICODE = Codeindicatingwhichvariablesand arraysare to be writtento file


FNAME.

= 1, a list of nodenumbersandcoordinatesis written.

= 2, a list of elementnumbers,types,andnodenumbersis written.

= 3, a list of element numbersand material set numbersis written


followedby thenumber
of material
properties
anda listof properties
for
each material set.

= 4, a list of nodenumbersandspecifiedvaluesof the field variableis


written for Dirichlet nodes,followed by a list of node numbersand
specifiedvaluesof groundwater
flow or soluteflux for Neumann
nodes.

393
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

394 Subroutine
Dump

-- 5, the relaxationfactor, rs, is writtenfirst. Then a list of time step


intervalsis writtenfollowedby a listof valuesof thetimefunctiong(t),
thetotallengthof timefor whichcalculations will be performed,anda
list of node numbers and initial values of the field variable at each node.

= 6, a list of nodenumbersandcomputedvaluesof the field variableat


each node is written.

= 7, a list of elementnumbersand computedcomponentsof apparent


groundwater velocityfor eachelementis written.

15.5 USAGE

A list of the FORTRAN variable names written to file FNAME for each choice of
ICODEis in Table15.1. Additional information
aboutthesevariables
is in thechapters
listedin Table15.1. If the•e "FNA•" doesnotyetexist,DUMPwill createandopenit
for writing. If the file FNAME alreadyexists,DUMP will overwriteit's contents.An
exception
is whenDUMP isusedto writeoutheadsandvelocities
in programs
GW2 and
GW4, or soluteconcentrations
in programST1. In thesecasesDUMP appends the
computedheads,velocities,andsoluteconcentrations
ontothe bottomof the friesaftereach
time step.
An exampleinputf'rieforDUMP asusedin programGW1 is shownbelow

1
NOD.LST
2
ELEM.LST
6
HEAD.LST
7
VELO. LST
-1

In this exampleDUMP would write a list of nodenumbersand coordinatesto the file


NOD.LST,a listof elementnumbers
andelementnodenumbers to file ELEM.LST,a list
of nodenumbersandcomputed valuesof hydraulicheadto file HEAD.LST, anda list of
elementnumbers andcomputed components of apparentgroundwater velocityfor each
element to file VELO.LST.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapt•15 395

i
i
i
i

i
!

i
i

i
i
i
i

i
i
i
i
i

i
i

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

396 Subroutine
Dump

i
i
i

i
i
i

I
i

i
i

i
i
i
i

i
i

I
i

I
i
!

i
i
i
l
i

I
i

I
i

i
l

l
l
i

[,
l
l

!
I

l
l

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter15 397

15.6 SOURCE CODE LISTING

SUBROUTINE DUMP (LOOP, HDF, VLF)


**********************************************************************
C
C 15.1 PURPOSE:
C TO WRITE CONTENTS OF ARRAYS TO USER-SUPPLIED DATA
C FILES
C
C 15.2 INPUT:
C CONTROL INFORMATION IS READ FROM USER-SUPPLIED FILE
C ASSIGNED TO UNIT "INF". FIRST LINE iS CODE INDICATING
C WHICH ARRAYS ARE TO BE WRITTEN TO A OUTPUT FILE, THE
C SECOND LINE IS THE NAM• OF THE OUTPUT FILE. THESE
C TWO LINES CAN BE REPEATED AS OFTEN AS DESIRED. INPUT
C IS TERMINATED BY PLACING A -1 ON FILE "INF".
C
C 15.3 OUTPUT:
C CONTENTS OF ARRAYS ARE WRITTEN TO A SET OF OUTPUT
C FILES.
C
C 15.4 DEFINITIONS OF VARIABLES:
C FNAME = OUTPUT FILE NAME
C ICODE = ARRAYS TO BE WRITTEN TO FNAME:
C = 1, NODE NUMBERS AND COORDINATES
C = 2, ELEMENT NUMBERS, TYPES, AND NODE NUMBERS
C - 3, ELEMENT NUMBERS, MATERIAL SET NUMBERS,
C AND MATERIAL SET PROPERTIES
C = 4, NODE NUMBERS AND SPECIFIED VALUES OF HEAD
C OR SOLUTE CONCENTRATION (DIRICHLET BOUNDARY
C CONDITIONS) AND SPECIFIED RATES OF GROUNDWATER
C FLOW OR SOLUTE FLUX (DIRICHLET AND NEUMANN
C BOUNDARY CONDITIONS)
C - 5, RELAXATION FACTOR, TIME FUNCTION, AND INITIAL
C VALUES OF HEAD OR SOLUTE CONCENTRATION
C = 6, COMPUTED VALUES OF HEAD OR SOLUTE CONCENTRATION
C ' 7, ELEMENT NUMBERS AND COMPONENTS OF APPARENT
C GROUNDWATER VELOCITY
C
C 15.5 USAGE:
C THE CONTENTS OF THE ARRAYS ARE WRITTEN "FREE-FORMAT" TO
C EACH DATA FILE.
C
C SUBROUTINES CALLED:
C NONE
C
C REFERENCES:
C ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
C MODELING BY THE FINITE ELEMENT METHOD, CHAPTER 15.
C
**********************************************************************
$ INCLUDE : ' COMALL '
INTEGER DMPF, HDF,VLF
LOGICAL LOOP, OPNED
CHARACTER*20 FNAME
DIMENSION XYZ (MAX1,3) ,V(MAX2,3) ,NODETBL (13)
EQUIVALENCE (XI,XYZ(1,1)), (X2,XYZ(1,2)), (X3,XYZ(1,3)),
1 (V1,V(1,1)), (V2,V(1,2)), (V3,V(1,3))
DATA NODETBL/2,3,4,3,4,4,8,12,8,20,32,3,4/

HDF = 0
VLF = 0

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

398 Submurine
Dump

10 READ (INF, *,END=140,ERR=140) ICODE


IF (ICODE .LE. 0) GOTO 140
READ (INF, 20, END=140, ERR=10) FNAME
20 FORM.AT (A)
IF (ICODE .LE. 6) THEN
DMPF • 1
ELSE
DMPF ' 2
ENDIF
INQUIRE (UNIT'DMPF, OPENED-OPNED )
IF (.NOT. OPNED)
OPEN (DMPF, FILE'FNAME, STATUS = 'NEW ', FORM= ' FORMATTED ' )
IF (ICODE .EQ. 1) THEN

WRITE OUT NODE NUMBERS AND COORDINATES

IF (DIM .LT. 4) THEN


IDIM = DIM
ELSE
IDIM = 2
ENDIF
DO 30 I - 1, NUMNOD
WRITE (DMPF, *) I, (XYZ (I, J) , J=l, IDIM)
30 CONTINUE
ELSEIF (ICODE .EQ. 2) THEN

WRITE OUT ELEMENT NUMBERS, TYPES, AND NODE NUMBERS

DO 40 I=l, NUMELM
WRITE (DMPF, *) I, ELEMTYP (I) , (IN (I, J) , J-l, NODETBL (ELEMTYP (I)) )
40 CONTINUE
ELSEIF (ICODE .EQ. 3) THEN

WRITE OUT ELEMENT AND MATERIAL SET NUMBERS AND MATERIAL


PROPERTIES

DO 50 I = 1, NUMELM
WRITE (DMPF, *) I,MATSET (I)
SO CONTINUE
WRITE (DMPF, *) NUMPROP
DO 60 I = 1, NUMMAT
WRITE(DMPF,*) I, (PROP(I,J) ,J-1,NUMPROP)
60 CONTINUE
ELSEIF (ICODE .EQ. 4) THEN

WRITE OUT SPECIFED VALUES OF FIELD VARIABLE AND GROUNDWATER


FLOW OR SOLUTE FLUX

IF (NDN .GT. 0) THEN


DO 70 I = 1, NUMNOD
IF (ICH(I) .NE. 0) WRITE(DMPF,*) I,X(I)
7O CONTINUE
ENDIF
IF (NNN .GT. 0) THEN
DO 80 I = 1, NUMNOD
IF (FLUX(I) .NE. 0.) WRITE(DMPF,*) I,FLUX(I)
80 CONTINUE
ENDIF
ELSEIF (ICODE .EQ. 5) THEN

WRITE OUT RELAXATION FACTOR, TIME FUNCTION, AND INITIAL

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
15 399

VALUES OF FIELD VARIABLE

IF (LOOP) THEN
WRITE (DMPF, *) OMEGA
ISTART = 1
IT = 1
TOTALT = 0.
90 WRITE (DMPF, *) ISTART,DTSTEP (IT) ,DELTAT (IT)
TOTALT - TOTALT + (DTSTEP(IT) - ISTART + 1) * DELTAT(IT)
IF (DTSTEP (IT) .LT. MXSTEP) THEN
ISTART - DTSTEP(IT) + 1
IT = IT + 1
GOTO 90
ELSE
WRITE (DMPF,*) TOTALT
IT = 1
•oo WRITE(DMPF,*) TIME(IT),GT(IT)
IF (TIME(IT) .GE. 0. .AND. TIME(IT) .LT. TOTALT) THEN
IT- IT + 1
GOTO 100
ELSE

IF (ICH(I) .EQ. 0) WRITE(DMPF,*) I,X(I)


11o CONTINUE
ENDIF
ENDIF
ENDIF
ELSEIF (ICODE .EQ. 6) THEN

WRITE OUT COMPUTED VALUES OF FIELD VARIABLE

IF (LOOP) THEN
HDF - DMPF
ELSE
DO 120 I = 1, NUMNOD
WRITE (DMPF, *) I, X(I)
12o CONTINUE
ENDIF
ELSEIF (ICODE .EQ. 7) THEN

WRITE OUT ELEMENT NUMBERS AND COMPUTED COMPONENTS


OF APPARENT GROUNDWATER VELOCITY

IF (LOOP) THEN
VLF = DMPF
ELSE
IF (DIM .LT. 4) THEN
IDIM = DIM
ELSE
IDIM = 2
ENDIF
DO 130 I = 1, NUMELM
WRITE(DMPF,*) I, (V(I,J),J=i, IDIM)
130 CONTINUE
ENDIF
ENDIF
IF (ICODE .LE. õ .OR. (ICODE .GT. 5 .AND. .NOT. LOOP))
1 CLOSE (UNIT-DMPF)
GOTO 10
140 RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 16

SUBROUTINE INITIAL

16.1 PURPOSE

SubroutineINITIAL inputscontrolparameters andinitialconditions


neededto solve
transientgroundwaterflow andsolutetransport problems.Subroutine INITIAL is also
usedto inputconu:olparametersandinitial estimates
for pressure
headneededto solve,
unsaturated
flow problems.

16.2 INPUT

All dataareread"free-format" fromtheuser-supplied file assigned


to unit "IN". INF
is passedto INITIAL througha labeledcommonblockcontainedin the file "COMALL"
(Chapter7). The relaxationfactorusedin the finite differenceapproximation of the time
derivative,a list of timestepintervals,anda listof valuesof thetimefunction(seebelow)
arealsoread. Thesearefollowedby a listof initialvaluesof thefieldvariable(hydraulic
head,pressurehead,or soluteconcentration)
for eachnodein themesh.

16.3 OUTPUT

The relaxationfactor,timestepintervals,valuesof the timefunction,andinitial values


of thefieldvariablearewrittento theuser-definedfile assignedto unit"OUTF".

16.4 DEFINITIONS OF VARIABLES

DELTAT0) Sizeof timestepI.


DTSTEP(I) Lasttimestepto takeusinga timestepof sizeDELTAT0).
GT(I) Value of time function at time I.

ICH(I) 1 if thevalueof thefieldvariableis specified


at nodeI.
0 otherwise.

Charactervariableusedto label columnheadingsfor specified


valuesof thefield variableon file assigned
to unitOUTF. LABEL1
= "HYDRAULIC HEAD", "PRESSURE HEAD", OR "SOLUTE
FLUX". '

MXSTEP = Numberof differenttimestepintervals.


NUMNOD = Number of nodes.

OMEGA = Relaxationfactor,

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter16 401

OMOMEGA = 1 - to.

-- Startingtimefor timefunctionvalueGT(I).
TOTALT = Totallengthof timeforwhichcalculations
areperformed.
X(I) -- Valueof thefieldvariable(hydraulichead,pressure
head,or solute
concentration)at nodeI.

16.5 USAGE

The relaxationfactor OMEGA is readf•rst,followedby a list of time stepsandtime


intervals.Eachrecordin thelistcontains thelasttimestepto takewith a specifiedtimestep
interval. Inputof timestepsandtimestepintervalsis terminatedby placinga -1 in both
fields. This is followedby a list of timesandvaluesof the time functionfor eachtime.
Inputis terminated by placinga -1 in bothfields. Finally,theinitialvaluesof the field
variablearereadfor eachnode. The subroutine will "generate"initialvaluesof thefield
variablefor nodes"missing" fromtheinputfile. However,thespecified valuesof thefield
variablefor Dirichlet nodesread by subroutineBOUND will not be changed. Input is
tenuinatedby placinga -1 in bothfields.
In themeshin Figure16.1,nodes1, 2, 3, 12, 13, and 14 havespecifiedvaluesof pressure
head. Theseboundary conditionswould be read by subroutineBOUND. For this
problemco= 0.5, anda solutionis requiredfor 6 timesteps.The timestepintervalwill be
1 minutefor time steps1, 2, and3 andthe time stepintervalwill be 3 minutesfor time
steps4, 5, and6. The specifiedflow ratefor thepointsinkat node8, F(8), varieswith
time as shown below

1.0

0.8

0.6

g(t )
0.4

0.2

0 2 4 6 8 10 12
time, t (minutes)

whereF(8) = g(t) * FLUX(8) andFLUX(8) is the specifiedflow ratefor node8 readin


subroutine
BOUND. For thisproblemwe chooseto useaninitialvalueof pressure head
of- 15 for all nodesnot on a constantheadboundary.Note thatthe sametime functionis
appliedto everyNeumannnode.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

402 SubroutineInitial

3 6 9 11

h=10
•5 ''/'•Q
=Flux(8)
"8 13
h=30

1 4 7 10 12

InputData- 0.5
3 1.0
6 3.0
-! -1
0.0 0.0
4.0 1.0
12.0 1.0
-1 -1
1 15.
14 15.
-1 -1

Output- OMEGA = 0.5000

START END DELTA T

1 3 1.0000
4 6 3.0OO0

TOTAL TIME = 12.0000

TIME T G(T)
.0000 .0000
4.0000 1.0000
12.0000 1.0000

INITIAL VALUES OF HYDRAULIC HEAD

NODE NO. HYDRAULIC HEAD

1 10.0000'
2 10.0000'
3 10.0000'
4 15.0000
5 15.0000
6 15.0000
7 15.0000
8 15.0000
9 15.0000
10 15.0000
11 15.0000
12 30.0000*
13 30.0000
14 30.0000*

* = SPECIFIED

Figure 16.1 Example input data and output for subroutine INITIAL.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter! 6 403

16.6 SOURCE CODE LISTING

SUBROUTINE INITIAL
**********************************************************************
c
c 16.1 PURPOSE:
C SUBROUTINE INITIAL INPUTS CONTROL PARAMETERS AND INITIAL
C CONDITIONS NEEDED TO SOLVE TRANSIENT GROUNDWATER FLOW AND
C SOLUTE TRANSPORT PROBLEMS. SUBROUTINE INITIAL IS ALSO
C USED TO INPUT CONTROL PARAMETERS AND TO SPECIFY INITIAL
C ESTIMATES FOR PRESSURE HEAD NEEDED TO SOLVE STEADY-STATE,
C UNSATURATED FLOW PROBLEMS.
C
C 16.2 INPUT:
C ALL DATA ARE READ "FREE-FORMAT" FROM THE USER-SUPPLIED
C FILE ASSIGNED TO UNIT "INF". THE RELAXATION FACTOR
C USED IN THE FINITE DIFFERENCE APPROXIMATION OF THE TIME
C DERIVATIVE, A LIST OF TIME STEP INTERVALS, AND A LIST OF
C VALUES OF THE TIME FUNCTION (SEE BELOW) ARE ALSO READ.
C THESE ARE FOLLOWED BY A LIST OF INITIAL VALUES OF THE
C FIELD VARIABLE FOR EACH NODE IN THE MESH.
C
C 16.3 OUTPUT:
C THE RELAXATION FACTOR, TIME STEP INTERVALS, VALUES OF
C THE TIME FUNCTION, AND INITIAL VALUES OF THE FIELD
C VARIABLE ARE WRITTEN TO THE USER-DEFINED FILE ASSIGNED
C TO UNIT "OUTF".
C
C 16.4 DEFINITIONS OF VARIABLES:
C DELTAT(I) • SIZE OF TIME STEP I
C DTSTEP (I) • NUMBER OF TIME STEPS TO TAKE USING A TIME
C STEP OF SIZE DELTAT(I)
C GT (I) • VALUE OF TIME FUNCTION AT TIME I
C ICH(I) = 1 IF THE VALUE OF THE FIELD VARIABLE IS
C SPECIFIED FOR NODE I,
C • 0 OTHERWISE
C LABEL1 • CHARACTER VARIABLE USED TO LABEL COLUMN
C HEADINGS FOR SPECIFIED VALUES OF THE FIELD
C VARIABLE ON FILE ASSIGNED TO UNIT OUTF.
C LABEL1 = "HYDRAULIC HEAD", "PRESSURE HEAD",
C OR "SOLUTE FLUX"
C MXSTEP = NUMBER OF DIFFERENT TIME STEP INTERVALS
C NUMNOD • NUMBER OF NODES
C OMEGA • RELAXATION FACTOR
C OMOMEGA • 1. - OMEGA
C TIME(I) • STARTING TIME FOR TIME FUNCTION VALUE GT(I)
C TOTALT • TOTAL LENGTH OF TIME FOR WHICH CALCULATIONS
C ARE PERFORMED
C X(I) = VALUE OF THE FIELD VARIABLE (HYDRAULIC
C HEAD, PRESSURE HEAD, OR SOLUTE CONCENTRATION)
C AT NODE I
C
C 16.5 USAGE:
THE RELAXATION FACTOR OMEGA IS READ FIRST. THIS
IS FOLLOWED BY A LIST OF TIME STEPS AND TIME STEP
INTERVALS. EACH LINE OF INPUT CONTAINS THE NUMBER OF
TIME STEPS TO TAKE FOLLOWED BY A SPECIFIED TIME STEP
INTERVAL. INPUT OF TIME STEPS AND TIME STEP INTERVALS
IS TERMINATED BY PLACING A -1 IN BOTH FIELDS.
THIS IS FOLLOWED BY A LIST OF TIMES AND VALUES OF THE
TIME FUNCTION FOR EACH TIME. INPUT IS TERMINATED BY

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

404 $ubroutin• Initial

PLACING A -1 IN BOTH FIELDS. FINALLY, THE INITIAL


VALUE OF THE FIELD VARIABLE IS READ FOR EACH NODE.
INPUT IS TERMINATED BY PLACING A -1 IN BOTH FIELDS.

SUBROUTINES CALLED:
NONE

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, CHAPTER 16.

**********************************************************************
$INCLUDE:'COMALL'
C
C INPUT OMEGA FROM INPUT FILE
READ ( INF, *) OMEGA
WRITE (OUTF, 10) OMEGA
10 FORMAT(//2X, 'OMEGA = ',F15.4)
OMOMEGA ' 1. - OMEGA
C INPUT LIST OF TIME STEPS AND TIME STEP INTERVALS FROM INPUT FILE
IT = 1
MXSTEP - 0
2O READ(INF, *) DTSTEP (IT) ,DELTAT (IT)
IF (DTSTEP(IT) .LE. 0) GOTO 30
IF (DTSTEP (IT) .GT. MXSTEP) MXSTEP = DTSTEP (IT)
IT - IT + 1
GOTO 20
30 IT • IT - 1
WRITE (OUTF, 40 )
4O FORMAT(//2X,'START',SX,' END ',10X,'DELTA T'/
2X, 5 ( '-' ), 8X, 5 ('-') ,8X, 11 ( '-' ))
ISTART - 1
TOTALT - 0.
DO 60 I - 1, IT
WRITE (OUTF, 50) ISTART,DTSTEP (I) ,DELTAT (I)
5O FORMAT (2X, I4, 9X, I4,3X, F15.4)
TOTALT • TOTALT + (DTSTEP(I) - ISTART + 1) * DELTAT(I)
ISTART - DTSTEP(I) + 1
60 CONTINUE
WRITE (OUTF, 70) TOTALT
7O FORMAT(/10X, 'TOTAL TIME •',F15.4)
INPUT LIST OF TIME STEPS AND VALUES OF TIME FUNCTION
IT- 1
80 READ(INF,*) TIME(IT),GT(IT)
IF (TIME (IT) .LT. 0.) GOTO 90
IT • IT + 1
GOTO 80
9O IT - IT - 1
IF (TIME (IT) .LT. TOTALT) TIME (IT) - TOTALT
WRITE (OUTF, 100)
lOO FORMAT(//SX,'TIME T',11X, 'G(T) '/7X, 8('-') ,9X, 6('-') )
DO 120 I = 1, IT
WRITE(OUTF, 110) TIME(I),GT(I)
11o FORMAT (2F15.4)
12o CONTINUE
c INPUT INITIAL VALUES OF FIELD VARIABLE FROM INPUT FILE
I START = 1
13o READ(INF,*) IT, HINIT
IF (IT .LE. 0) GOTO 150
IF (IT .GT. MAX1) IT = MAX1

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
16 405

DO 140 I = ISTART, IT
IF (ICH(I) .NE. 1) X(I) = HINIT
140 CONTINUE
ISTART - IT + 1
IF (ISTART .LE. MAX1) GOTO 130
150 WRITE (OUTF, 160) LABEL1, LABEL1
160 FORMAT
(/ /2X, ' INITIAL VALUESOF ' ,A/2X, 38 ( '- ' ) / /
2X,'NODE NO.',10X, A/2X, 8('-'),10X, 20('-'))
DO 180 I ' 1, NUMNOD
IF (ICH(I) .EQ. 0) THEN
WRITE(OUTF, 170) I,X(I),' '
ELSE
WRITE(OUTF, 170) I,X(i),'*'
ENDIF
170 FORMAT(2X, I5, 12X, F15.4, A)
1BO CONTINUE
WRITE (OUTF, 190)
190 FORMAT (/23X, ' * - SPECIFIED ' )
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 17

SUBROUTINE ASMBKC

17.1 PURPOSE

SubroutineASMBKC assembles the combinedglobalconductance andcapacitance


matrix(equation5.30a)andtheglobalspecified flow matrix{F}. The globalmatricesare
modifiedto accountfor specified
valuesof thefield variable(hydraulicheador pressure
head)andfor specifiedratesof groundwater flow. ASMBKC alsocomputes the semi-
bandwidthandnumberof degrees of freedomfor themodifiedsystemof equations.

17.2 INPUT

None

17.3 OUTPUT

The semi-bandwidth andnumberof degreesof freedomfor the modifiedsystemof


equations
arewrittento theuser-defined
f'aleassigned
to unit"OUTF".

17.4 DEFINITIONS OF VARIABLES

B(I) = Modifiedspecified
flow matrix.

CE(I,J) = Capacitance
matrixforelement
e in fullmatrixstorage.
E = Element number.

ELEMTYP(E)= Elementtype for elementE (seeTable 9.1 for a list of element


types).

FLUX(I) = Specifiedrateof groundwater


flow at nodeI.

ICH(I)= = 1 if thevalueof thefieldvariableis specified


at nodeI,
= 0 otherwise.

IJSIZE = Lengthof array[M] in vectorstorage


([M] is symmetric).
KE(IJ) = Conductance
matrixforelement
E infullmatrixstorage.
I

LCH(I) = EICH(k).
The arrays
k=l
ICH
and
LCH
are
used
tomodify
theglobal
systemof equations
for specifiedvaluesof thefield variable.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter17 407

M(IJ) Modified, combinedglobalconductance


and capacitancematrix in
vector storage.

NDOF = Number of nodes where the value of the field variable is unknown.

NODETBL(I) = Numberof nodesin elementtypeI.


Number of elements in mesh.

SBW Semi-bandwidthof modified,combinedglobal conductanceand

x(i) Valueof thefieldvariable(hydraulicheador pressure


head)at node
I.

17.5 USAGE

SubroutineASMBKC assembles
the combinedglobalconductance
and capacitance

[M] = [C] + mat [K] (17.1)

andthe specifiedgroundwater flow matrix {F}. [lVl]and {F} aremodifiedto accountfor


specifiedvaluesof thefieldvariable(hydraulicheador pressure head),duringtheassembly
process,usingthe procedures in Chapter4. [M] is assembledand modifiedin vector
storagein thearrayM. Themodified,globalspecified flow matrixis storedin thearrayB.
Furthermodifications to B aremadein subroutine RHS (seeChapter15).
The numberof degreesof freedom(numberof unknownvaluesof the field variable)
NDOF is computed in subroutineBOUND as
NDOF' = NUMNOD - NDN

where•OD is thenumberof nodesin themesh(Chapter8) andNDN is thenumber


of nodeswith specifiedvaluesof the field variable(Chapter11). The semi-bandwidth,
SBW for themodifiedsystemof equations is computed in ASMBKC using
SBW = R + 1 (17.2)

whereR is themaximumdifferencein nodenumbers for anytwonodeswithinanyelement


in themesh. However,if thevalueof thefield variableis specifiedfor a nodethatnodeis
not used in the calculation of R (becausethe row in [M] for that node will be eliminated
when[M] is modifiedfor thespecified
valueof head).
The elementconductanceand capacitancematricesare computedin two setsof
subroutines.Theelementconductance matricesarecomputed usingthesetof subroutines
in Table 12.1. The elementcapacitancematrices(consistentformulation)are computed
usingthesetof subroutinesin Table17.1. Eachsubroutine
in thissetbeginswiththeletter
"C"(fortheelement
capacitance
matrix
[C(e)])
followed
bythree
orfourletters,
that
identifytheelementtype,andthenumberof nodesin elementsof thattype. Forexample,
subroutineCBAR2 computestheelementcapacitance matrixfor one-dimensional,linear
barelements andCPAR8computes theelementcapacitancematrixfor three-dimensional,
linearparallelepiped
elements.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

408 Subroutine ASMBKC

Table 17.1 Subroutinesused to compute element conductancematrices in ASMBKC.

ElementType Description Subroutine


Name DIM
1 Linear bar CBAR2 1
2 Quadratic
bar CBAR3* 1
3 Cubic bar CBAR4* 1
4 Linearuiangle CTRI3 2
5 Linearrectangle CREC4 2
6 Linearquadrilateral CQUA4 2
7 Quadratic
quadrilateral CQUA8* 2
8 Cubicquadrilateral CQUA12' 2
9 Linearparallelepiped CPAR8 3
10 Quadratic
parallelepiped CPAR20* 3
11 Cubic
parallelepiped CPAR32* 3
12 Linear
triangle
(axisymmetric) C'I•I3A* 4
13 Linearrec•gle (axisymmetric) CREC4A* 4
*Sourcecodelistingnotprovided
for thesesubroutines.

The sourcecodelistingfor eachelementcapacitance


matrixgivesthefigurethatshows
theinterpolation
functions
andtheequation
usedtocompute
[C(e)]
forthat
element
type.A
list of manyof the importantFORTRAN variablesnamesandtheir symbolsis in Table
12.2. Additionalnamesandsymbolsfor thesubroutines
in Tables17.1 are shownbelow

FORTRAN Variable Definition Symbols(s)in Text '


or ArrayName

N(I) Interpolation
functionfor nodeI N?)(e)or N?)(e,q)
or N!e)(e,q,•)
SSE Specific
storage
forelement
e S?)

Theoperationof ASMBKCismosteasilyexplainedbyconsidering
a specificexample.
The mesh in Figure 17.1 containsfour nodes(NUMNOD = 4) and three elements
(NUMELM = 3).

h2 = 0, t= 0 h3 =0, t= 0
(1) (2) (3)
hi = 10m, t_>0 ß $ • •, h4 --0, t•_0
1 2 3 4

K?) I•(2) K?) 0.02m/day


S$ • s? • • 0.0
LO)= 5,L(2)= 6,L(3)= 4m,{o= 1.0,At= 1day
Figure 17.1 Example mesh for ASMBKC.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
17 409

Thevalueof hydraulic headis specified at nodeoneandfour(ICH(1) = ICH(4) = 1,


NDN = 2) andwill remainconstantforall timesteps.Theinitialvaluesof headatnodes2
and3 arezeroandwe axeto computetheheadat thesenodesfor subsequent time steps.
All elementsaxelinearbar elements,ELEMTYP(1) = ELEMTYP(2) = ELEMTYP(3) = 1.
Thiselementtypehastwonodes(NODETBL(1)= 2). Theelement
conductance
matrices
will becomputed
usingsubroutine
KBA• (Table12.1).Theresults
are:

for element 1

E=I
0.0040
-0.0040]
KE= -0.00400.00401
for element 2

E=2
0.0033
-0.0033]
KE= -0.00330.00331
for element 3

E=3
0.0050
-0.0050•
KE= -0.00500.0050.1
Theelement
capacitance
matrices
willbecomputed
using
subroutine
CBAR2(Table17.1).
The results are:

for element 1

E=I
CE
=[0.1667
0.0833]
0.0833 0.16673

for element 2

E=2
CE:
[0.2000
0.•0001
0.1000 0.20003

for element 3

E=3
0.1333
0.0667]
CE= 0.0667
0.13333

The globalsystemof equations


is

([C]
+o)z•t
[K]){h}t+4
, = ([C]
- (l-m)
At[K][h),
+z•t((l-m) +o)(•}t+,•
t)

0.1667 0.0833 0.0000 0.0000' 0.0040 -0.00•0 0.0000 0.0000

0.0833 0.3667 0.1000 0.00130 -0.0040 0.0073 -0.0033 0.0000


+ m•t
0.0000 0.1000 0.3333 0.0667 0.0000 -0.0033 0.0083 -0.0050

0.0000 0.0000 0.0667 0.1333 0.0000 0.0000 -0.0050 0.0050 t+At

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

410 SubroutineASMBKC

0.0040--0.0040o.oooo o.oooo' hi
0.1667
0.0833
0.0000
0.0000] -o.oo4o0.0073-o.oo33 o.oooo h2
0.0833
0.3667
0.1000
0.0000]
__(1-co)At o.oo00-0.0033 0.0083-0.0050 h3
0.0000 0.1000 0.3333 0.0667]
0.0000 0.0000 0.06(57 0.1333.1 0.ooooo.oooo
-0.00500.0050 h4 t
Thereareno specifiedratesof groundwater
flowin thisproblemandIF] = 0 for all time
steps.With m= 0.5 andAt = 1 daytheglobalsystemof equations
canbe simplifiedto'

0.1687
0.0183
0.0000
0.0000]
hi

0.0813
0.3704
0.0984
O.00001.
h2

0.0000
0.0984
0.3375
0.0642
/ h3
0.0000 0.0000 0.0642 0.1358.1 h4

[0.,647
o.o8•3
o.oooo 9 hi
0.000
I h2
/o.o•3o.3•3,o.,o,?o.oooo
/O.0000
0.1017
0.3292 I h3
0.0692
LO.0000 0.0000 0.0692 0.1308J h4 t

Buthl = 10 andh4= 0 andforthefast timestepthemodifiedglobalsystem


of equations
becomes

I O.
Of13
0.3704
0.0984
O. O0 h
{•0.•0•0•)•
0.0984
0.3375
u,.,.,.,,r,.,,.,
0.C•r• n•.n•'•a2
•.'f-"-'a,,v •t=lday

FZ.:647
o.ou:3z.•z [ 1.647]
= 10.0853
0.36310.1017
0.00001•
oL _/o. 8•3/
I •0.•0000
0.1017
0.3292
0.0692
I/0 /
0.000

or

0.3704
0.0984]
œ-- :F0.8531
_[(10)(0.0813)1:
ro.0400]
1dayLO.OOOJ (10)(o.oooo)jLO.OOOO]
This systemis storedin arraysM, X

0.3704]
M= 0.0984•(banded,symmetricmatrixin vectorstorage)
0.3375J

(obtainedusingDECOMP andSOLVE)
h3 t: 1day
Theright-hand
sidetermsareconstructed
in subroutine
RHS (seeChapter18).

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter17 411

17.6 SOURCE CODE LISTING

SUBROUTINE ASMBKC
**********************************************************************
c
c 17.1 PURPOSE:
c TO ASSEMBLE THE COMBINED GLOBAL CONDUCTANCE AND
c CAPACITANCE MATRIX (EQUATION 5.30A) AND THE GLOBAL
c SPECIFIED FLOW MATRIX FOR THE MESH AND TO MODIFY THE
c SYSTEM OF EQUATIONS FOR SPECIFIED HEAD AND GROUNDWATER
c FLOW BOUNDARY CONDITIONS
c
c 17.2 INPUT:
c NONE
c
c 17.3 OUTPUT:
c THE SEMI-BANDWIDTH AND NUMBER OF DEGREES OF FREEDOM
c FOR THE MODIFIED, COMBINED GLOBAL CONDUCTANCE AND
c CAPACITANCE MATRIX ARE WRITTEN TO THE USER-DEFINED
c FILE ASSIGNED TO UNIT "OUTF"
c
c 17.4 DEFINITIONS OF VARIABLES:
c B(I) = MODIFIED SPECIFIED FLOW MATRIX
c E(I,J) •- CAPACITANCE MATRIX FOR ELEMENT E IN
c FULL MATRIX STORAGE
c ELEMENT NUMBER
c ELEMTYP (E) = ELEMENT TYPE FOR ELEMENT E (SEE TABLE
c 9.1 FOR A LIST OF ELEMENT TYPES)
c FLUX(I) •- SPECIFIED RATE OF GROUNDWATER FLOW
c AT NODE I
c ICH(I) = 1 IF THE VALUE OF HYDRAULIC HEAD OR
c PRESSURE HEAD IS SPECIFIED FOR NODE I,
c -- 0 OTHERWISE
c IJSIZE - LENGTH OF ARRAY [M] IN VECTOR STORAGE
c KE (I, J) = CONDUCTANCE MATRIX FOR ELEMENT E IN
c FULL MATRIX STORAGE
c LCH(I) = ICH(I) + ICH(I-1) + ICH(I-2) + ...
c THE ARRAYS ICH AND LCH ARE USED TO MODIFY
c THE GLOBAL SYSTEM OF EQUATIONS FOR SPECIFIED
c VALUES OF THE FIELD VARIABLE
c M (IJ) = MODIFIED, COMBINED GLOBAL CONDUCTANCE
c AND CAPACITANCE MATRIX IN VECTOR STORAGE
c NDOF = NUMBER OF NODES WHERE THE VALUE OF
c THE FIELD VARIABLE IS UNKNOWN
c NODETBL (I) -- NUMBER OF NODES IN ELEMENT TYPE I
c NUMELM = NUMBER OF ELEMENTS IN MESH
c SBW = SEMI-BANDWIDTH OF MODIFIED, COMBINED
c GLOBAL CONDUCTANCE AND CAPACITANCE MATRIX
c X(I) = VALUE OF HYDRAULIC HEAD OR PRESSURE HEAD
c AT NODE I
c
c 17.5 USAGE:
c THE SEMI-BANDWIDTH OF THE COMBINED GLOBAL CONDUCTANCE AND
c CAPACITANCE MATRIX IS COMPUTED FIRST. THEN THE ENTRIES
c OF THE ELEMENT CONDUCTANCE AND CAPACITANCE MATRICES ARE
c COMPUTED IN A SET OF SUBROUTINES, TWO SUBROUTINES FOR
c EACH ELEMENT TYPE. THE COMBINED GLOBAL CONDUCTANCE AND
c CAPACITANCE MATRIX FOR THE MESH IS ASSEMBLED BY ADDING THE
c CORRESPONDING ENTRIES OF THE ELEMENT MATRICES TO THE GLOBAL
c MATRIX. DURING THE ASSEMBLY PROCESS THE GLOBAL MATRIX IS
c MODIFIED FOR SPECIFIED VALUES OF HEAD AND SPECIFIED VALUES
c OF GROUNDWATER FLOW ARE ADDED TO THE GLOBAL FLOW MATRIX.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

412 Subroutine ASMBKC

SUBROUTINES CALLED:
KBAR2, KBAR3, KBAR4, KTRI 3, KREC4 , KQUA4, KQUA8, KQUA12 , KPAR8 ,
KPAR20, KBAR32, KTRI3A, KREC4A, LOC (LISTED WITH SUBROUTINE
ASMBK IN CHAPTER 12)
CBAP,2
, CBAR3, CBAR4,CTRI3, CREC4, CQUA4,C.QUA8, CQUA12, CPAR8,
CPAR20, CBAR32, CTRI 3A, CREC4A

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, CHAPTER 17.

**********************************************************************
$ INCLUDE: ' COMALL '
PEAL KE (MAX3, MAX3 ), CE (MAX3, MAX3 )
INTEGER NODETBL (13)
DATA NODETBL/2,3, 4,3, 4, 4, 8,12, 8,20, 32,3, 4/

COMPUTE THE SEMI-BANDWIDTH

SBW • 1
DO 30 E - 1, NUMELM
DO 20 I = 1, NODETBL(ELEMTYP(E))
KI = IN(E,I)
IF (ICH(KI) .EQ. 0 .AND. I .LT. NODETBL(ELEMTYP(E))) THEN
II = KI - LCH(KI)
DO 10 J • I + 1, NODETBL(ELEMTYP(E))
KJ - IN(E,J)
IF (ICH(KJ) .EQ. 0) THEN
JJ • ABS(KJ - LCH(KJ) - II) + 1
IF (JJ .GT. SBW) SBW - JJ
ENDIF
10 CONTINUE
ENDIF
20 CONTINUE
30 CONTINUE
WRITE (OUTF, 40) NDOF, SBW
40 FORMAT (//' NUMBER OF DEGREES OF FREEDOM IN MODIFIED, '/
' GLOBAL COMBINED CONDUCTANCE AND CAPACITANCE'
' MATRIX
=', I5///' SEMI-BANDWIDTH
OFMODIFIED,
•/
' GLOBAL COMBINED CONDUCTANCE AND CAPACITANCE',
' MATRIX --',I5)
IF (SBW .GT. MAX6) STOP'** EXCEEDS MAXIMUM SEMI-BAND WIDTH **'
INITIALIZE ENTRIES OF GLOBAL MATRIX TO ZERO
IJSIZE • SBW * (NDOF - SBW + 1) + (SBW - 1) * SBW / 2
DO 50 IJ • 1, IJSIZE
M(IJ) • 0.0
Bi(IJ) • 0.0
50 CONTINUE

DO 56 I • 1, MAX1
56 FC(I) = 0.

INITIALIZE ENTRIES OF THE GLOBAL GROUNDWATER MATRIX TO ZERO


DO 60 I • NDOF
B(I) - o.o
6O CONTINUE
C LOOP ON THE NUMBER OF ELEMENTS
DO 90 E = 1, NUMELM
COMPUTE THE ELEMENT CONDUCTANCE AND CAPACITANCE MATRICES
FOR THIS ELEMENT TYPE
IF (ELEMTYP(E) .EQ. 1) THEN

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter17 413

ELEMENT IS A ONE-DIMENSIONAL, LINEAR BAR


CALL KBAE2 (E, KE )
CALL CBAR2 ( E, CE )
ELSEIF (ELEMTYP(E) .EQ .2) THEN
ELEMENT IS A ONE-DIMENSIONAL, QUADRATIC BAR
CALL KBAR3 (E, KE)
CALL CBAR3 (E, CE)
ELSEIF (ELEMTYP(E) .EQ. 3) THEN
ELEMENT IS A ONE-DIMENSIONAL, CUBIC BAR
CALL KBAR4 (E, KE)
CALL CBAR4 (E, CE)
ELSEIF (ELEMTYP(E) .EQ. 4) THEN
ELEMENT IS A TWO-DIMENSIONAL, LINEAR TRIANGLE
CALL KTRI3 (E, KE)
CALL CTRI 3 (E, CE)
ELSEIF (ELEMTYP(E) .EQ. 5) THEN
ELEMENT IS A TWO-DIMENSIONAL, LINEAR RECTANGLE
CALL KREC 4 (E, KE )
CALL CREC4 (E, CE)
ELSEIF (ELEMTYP(E) .EQ. 6) THEN
ELEMENT IS A TWO-DIMENSIONAL, LINEAR QUADRILATERAL
CALL KQUA4 (E, KE)
CALL CQUA4 (E,CE)
ELSEIF (ELEMTYP(E) .EQ. 7) THEN
ELEMENT IS A TWO-DIMENSIONAL, QUADRATIC QUADRILATERAL
CALL KQUA8 (E, KE)
CALL CQUA8 (E, CE)
ELSEIF (ELEMTYP(E) .EQ. 8) THEN
ELEMENT IS A TWO-DIMENSIONAL, CUBIC QUADRILATERAL
CALL KQUA12 (E, KE)
CALL CQUA12 (E,CE)
ELSEIF (ELEMTYP(E) .EQ. 9) THEN
ELEMENT IS A THREE-DIMENSIONAL, LINEAR PARALLELEPIPED
CALL KPAR8 (E, KE)
CALL CPAR8 (E, CE)
ELSEIF (ELEMTYP(E) .EQ. 10) THEN
ELEMENT IS A THREE-DIMENSIONAL, QUADRATIC PARALLELEPIPED
CALL KPAR20 (E, KE)
CALL CPAR20 (E, CE)
ELSEIF (ELEMTYP(E) .EQ. 11) THEN
ELEMENT IS A THREE-DIMENSIONAL, CUBIC PARALLELEPIPED
CALL KPAR32 (E,KE)
CALL CPAR32 (E,CE)
ELSEIF (ELEMTYP(E) .EQ. 12) THEN
ELEMENT IS A TWO-DIMENSIONAL, LINEAR TRIANGLE (AXISYMMETRIC)
CALL KTRI3A(E, KE)
CALL CTRI 3A (E, CE )
ELSEIF (ELEMTYP(E) .EQ. 13) THEN
ELEMENT IS A TWO-DIMENSIONAL, LINEAR RECTANGLE (AXISYMMETRIC)
CALL KREC4A (E, KE)
CALL CREC4A (E, CE)
ENDIF
c ADD THE ELEMENT CONDUCTANCE AND CAPACITANCE MATRICES FOR
c THIS ELEMENT TO THE GLOBAL MATRIX
c KE (I, J) ,CE (I, J) ........... > M(IJ) <=> M (KI, KJ)
c (FULL MATRIX STORAGE) (VECTOR MATRIX STORAGE) (FULL MATRIX STORAGE)
DO 80 I • 1, NODETBL(ELEMTYP(E))
KI - IN(E,I)
IF (ICH(KI) .EQ. 0) THEN
II • KI - LCH(KI)
DO 70 J-- 1, NODETBL(ELEMTYP(E))
KJ - IN(E,J)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

414 Subroutine ASMBKC

IF (ICH(KJ) .NE. 0) THEN


FC(II) s FC(II) - DELTAT(IDT) * KE(I,J) * X(KJ)
ELSEIF (J .GE. I) THEN
JJ s KJ - LCH(KJ)
CALL LOC (II, JJ, IJ, NDOF, SBW, SYMM)
M(IJ) - M(IJ) + CE(I,J) + OMEGA *
DELTAT(IDT) * KE(I,J)
Bi(IJ) • Bi(IJ) + CE(I,J) - OMOMEGA *
DELTAT(IDT) * KE(I,J)
ENDIF
7O CONTINUE
ENDIF
8O CONTINUE
9O CONTINUE
DO 999 I - 1,IJSIZE
W•ITE(*,*) M(I),B(I)
999 CONTINUE
RETURN
END

SUBROUTINE CBAR2 (E, CE)


**********************************************************************

PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT
CAPACITANCE MATRIX FOR A ONE-DIMENSIONAL, LINEAR
BAR ELEMENT

DEFINITIONS OF VARIABLES:
E -- ELEMENT NUMBER
CE (I, J) • ELEMENT CAPACITANCE MATRIX
SSE • ELEMENT SPECIFIC STORAGE
LE - ELEMENT LENGTH

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.5,
EQUATION 4.16a.

******************************************************************
$ INCLUDE: • COMALL •
REAL CE (MAX3, MAX3 ) , LE
C
SSE ' PROP (MATSET (E), 2)
LE • ABS(Xi(IN(E,2)) - XI(IN(E, 1)))
CE(1,1) ' SSE * LE / 3.
CE(1,2) - SSE * LE / 6.
CE(2,1) • CE(1,2)
CE(2,2) =" CE(1,1)
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
17 415

SUBROUTINE CTRI3 (E,CE)


**********************************************************************

PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT CAPACITANCE
MATRIX FOR TWO- DIMENSIONAL, LINEAR TRIANGLE ELEMENT

DEFINITIONS OF VARIABLES:
AE4 - FOUR TIMES ELEMENT AREA
E - ELEMENT NUMBER
CE (I, J) - ELEMENT CAPACITANCE MATRIX
SSE • ELEMENT SPECIFIC STORAGE

REFERENCES:
ISTOK, J.D. GROUNDWATERFLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.7,
EQUATION 4.22a

**********************************************************************
$ INCLUDE: • COMALL •
REAL CE (MAX3, MAX3 )

SSE - PROP (MATSET (E), 3}


AE4 - 2 * (XI(IN(E,2)) * X2(IN(E,3)) + Xi(IN(E,1)) *
X2(IN(E,2)) + X2(IN(E, 1)) * Xi(IN(E,3)) -
X2(IN(E, 3)) * XI(IN(E,1)) - XI(IN(E,3)) *
X2(IN(E,2)) - Xi(IN(E,2)) * X2(IN(E,1)))

CE(1,1} • SSE * AE / 6.
CE(1,2) • CE(1,1) / 2.
CE(1,3) = CE(1,2)
CE(2,1) • CE(1,2)
CE(2,2) = CE(1,1)
CE(2,3) = CE(1,2)
CE(3,1) = CE(1,2)
CE(3,2) = CE(1,2)
CE(3,3) - CE(1,1)
RETURN
END

SUBROUTINE CREC4(E, CE)


**********************************************************************
c
PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT CAPACITANCE
MATRIX FOR TWO- DIMENSIONAL, LINEAR RECTANGLE ELEMENT

DEFINITIONS OF VARIABLES:
E • ELEMENT NUMBER
CE(I,J) • ELEMENT CAPACITANCE MATRIX
SSE - ELEMENT SPECIFIC STORAGE

REFERENCES:
ISTOK, J.D. GROUNDWATERFLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.6,
EQUATION 4.27a

**********************************************************************

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

41(• Subroutine ASMBKC

INCLUDE: • COMALL w
REAL CE (MAX3, MAX3)

SSE m PROP (MATSET (E), 3)


AE - ABS(X2(IN(E,1)) - X2(IN(E,3))) / 2.
BE ' ABS(XI(IN(E,1)) - XI(IN(E,3))) / 2.
TEMP ' (SSE * .AE * BE) / 9
CE(1,1) ' 4. * TEMP
CE(1,2) m 2. * TEMP
CE(1,3) ' TEMP
CE(1,4) - CE(1,2)
CE(2,1) m CE(1,2)
CE(2,2) - CE(1,1)
CE(2,3) - CE(1,2)
CE(2,4) ' CE(1,3)
CE(3,1) = CE(1,3)
CE(3,2) - CE(1,2)
CE(3,3) • CE(1,1)
CE(3,4) • CE(1,2)
CE(4,1) • CE(1,2)
CE(4,2) - CE(1,3)
CE(4,3) - CE(1,2)
CE(4,4) • CE(1,1)
RETURN

SUBROUTINE CQUA4 (E, CE)


**********************************************************************

PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT CAPACITANCE
MATRIX FOR A TWO-DIMENSIONAL, LINEAR QUADRILATERAL ELEMENT

DEFINITIONS OF VARIABLES:
CE (I, J) m ELEMENT CAPACITANCE MATRIX
DETJAC = DETERMINANT OF JACOBIAN MATRIX
DNDXI (I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO XI AT NODE I
DNDX(I) • PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO X AT NODE I
DNDETA (I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ETA AT NODE I
DNDY (I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Y AT NODE I
XI (I) • LOCATION OF GAUSS POINT IN XI COORDINATE
DIRECTION
ETA(I) = LOCATION OF GAUSS POINT IN ETA COORDINATE
DIRECTION
JAC (I, J) • JACOBIAN MATRIX
E = ELEMENT NUMBER
SSE = ELEMENT SPECIFIC STORAGE
N(I) '- INTERPOLATION FUNCTION FOR NODE I
W(I) = WEIGHT FOR GAUSS POINT I
Xl(IN(E,I) = X COORDINATE FOR NODE I, ELEMENT E
X2(IN(E, I) = Y COORDINATE FOR NODE I, ELEMENT E

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.10,
EQUATION 4.65
C
******************************************************************

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
17 417

$ INCLUDE: ' COMALL '


REALJAC(2,2), JACINV(2, 2), CE(MAX3,MAX3)
,N(4) ,D•DXI (4),
1 DNDR (4), DNDETA (4), DNDZ (4), W(2), XI (2), ETA (2), SIGN1 (4),
2 SIGN2 (4)

DATA SIGN1/-1.,1.,1.,-1./
DATA SIGN2/-1.,-1., 1., 1. /

XI(1) = 1. / SQRT(3.)
XI(2) = -XI(1)
ETA(l) = XI(1)
ETA(2) = XI(2)
W(1) -- 1.
W(2) = 1.
SSE = PROP (MATSET (E), 3)

DO 30 I = 1, 4
DO 20 J = 1, 4
CE (I, J) = 0.
20 CONTINUE
30 CONTINUE

DO 120 I = 1, 2
DO 110 J-- 1, 2

DO 50 K- 1, 2
DO 40 K1 = 1, 2
JAC(K, K1) = 0.
4O CONTINUE
5O CONTINUE

DO 60 K1 = 1, 4
N(K1) = 0.25 * (1. '+ SIGNI(K1)* XI(I))
1 * (1. + SIGN2(K1) * ETA(J))
DNDXI(K1) = 0.25 * SIGNI(K1) * (1. + SIGN2(K1) * ETA(J))
DNDETA(K1) = 0.25 * SIGN2(K1) * (1. + SIGNi(K1) * XI(I))
60 CONTINUE
DO 70 K1 = 1, 4
JAC(1,1) = JAC(1,1) + DNDXI(K1) * Xi(IN(E,K1))
JAC(1,2) - JAC(1,2) + DNDXI(K1) * X2(IN(E,K1))
JAC(2,1) = JAC(2,1) + DNDETA(K1) * Xi(IN(E,K1))
JAC(2,2) - JAC(2,2) + DNDETA(K1) * X2(IN(E,K1))
70 CONTINUE
DETJAC - JAC(1,1) * JAC(2,2) - JAC(1,2) * JAC(2,1)
DO 100 K - 1, 4
DO 90 K1 = 1, 4
CE(K, K1) "CE(K, K1) + W(I) * W(J) * SSE* N(K) *
N(K1) * DETJAC
90 CONTINUE
100 CONTINUE
110 CONTINUE
120 CONTINUE
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

418 Subroutine
ASMBKC

SUBROUTINE CPAR8 (E, CE)


**********************************************************************

PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT
CAPACITANCE MATRIX FOR A THREE-DIMENSIONAL,
LINEAR QUADRILATERAL ELEMENT

DEFINITIONS OF VARIABLES:
CE (I, J) • ELEMENT CAPACITANCE MATRIX
DETJAC - DETERMINANT OF JACOBIAN MATRIX
DNDXI(I) • PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO XI AT NODE I
DNDX (I) -- PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO X AT NODE I
DNDETA(I) • PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ETA AT NODE I
DNDY (I) • PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Y AT NODE I
DNDZETA(I) - PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ZETA AT NODE I
DNDZ (I) - PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Z AT NODE I
XI (I) • LOCATION OF GAUSS POINT IN XI COORDINATE
DIRECTION
ETA(I) - LOCATION OF GAUSS POINT IN ETA COORDINATE
DIRECTION
ZETA(I) - LOCATION OF GAUSS POINT IN ZETA COORDINATE
DIRECTION
JAC (I, J) • JACOBIAN MATRIX
E • ELEMENT NUMBER
SSE • ELEMENT SPECIFIC STORAGE
N (I) • INTERPOLATION FUNCTION FOR NODE I
W(I) • WEIGHT FOR GAUSS POINT I
Xi(IN(E,I) • X COORDINATE FOR NODE I, ELEMENT E
X2 (IN(E,I) -- Y COORDINATE FOR NODE I, ELEMENT E
X3(IN(E,I) -- Z COORDINATE FOR NODE I, ELEMENT E

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.10,
EQUATION 4.66

**********************************************************************
$ INCLUDE: ' COMALL '
REAL JAC (3, 3) ,CE (MAX3,MAX3) ,DNDX(8) ,DNDY(8) ,DNDZ (8) ,
1 XI (8) , ETA (8) , ZETA (8) , DNDXI (8) , DND•.TA(8) ,DNDZETA (8) ,W(2) ,
2 N(8),SIGNI(8),SIGN2(S),SIGN3(8)
DATA SIGN1/-1.,1.,1.,-1.,-1.,1.,1.,-1./
DATA SIGN2/-1.,-1.,1.,1.,-1.,-1.,1.,1.!
DATA SIGN3/-1.,-1.,-1.,-1.,1.,1.,1.,1./

XI(1) - 1. / SQRT(3.)
XI(2) - -XI(1)
ETA(l) - XI(1)
ETA(2) = XI(2)
ZETA(l) = XI(1)
ZETA(2) - XI(2)
W(1) - 1.
W(2) - 1.
SSE - PROP (MATSET (E) , 4)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
17 419

DO 20 K = 1, 8
DO 10 N1 - 1, 8
CE (K, N1) - 0.
10 CONTINUE
20 CONTINUE

DO 120 I = 1, 2
DO 110 J = 1, 2
DO 100 K' 1, 2

DO 40 L= 1, 3
DO 30 N1 - 1, 3
JAC(L,N1) ' 0.
30 CONTINUE
40 CONTINUE

DO 50 N1 - 1, 8
N(N1) -0.125 * (1.+SIGNI(N1)*XI(I)) * (1.+SIGN2(N1) *
ETA(J)) * (1. + SIGN3(N1) * ZETA(K))
DNDXI (N1) = 0.125 * SIGNi(N1) * (1. + SIGN2 (N1) *
ETA(J)) * (1. + SIGN3(N1) * ZETA(K))
DNDETA(N1) - 0.125 * SIGN2 (N1) * (1. + SIGNI(N1) *
XI(I)) * (1. + SIGN3(N1) * ZETA(K))
DNDZETA(N1) - 0.125 * SIGN3(N1) * (1. + SIGNi(N1) *
XI(I)) * (1. + SIGN2(N1) * ETA(J))
50 CONTINUE

DO 60 N5 = 1, 8
JAC(1,1) = JAC(1,1) + DNDXI(MS) * XI(IN(E,M5))
JAC(1,2) ' JAC(1,2) + DNDXI(M5) * X2(IN(E,M5))
JAC(1,3) - JAC(1,3) + DNDXI(M5) * X3(IN(E,M5))
JAC(2,1) = JAC(2,1) + DNDETA(M5) * Xi(IN(E,MS))
JAC(2,2) = JAC(2,2) + DNDETA(MS) * X2(IN(E,M5))
JAC(2,3) = JAC(2,3) + DNDETA(M5) * X3(IN(E,M5))
JAC(3,1) - JAC(3,1) + DNDZETA(MS) * XI(IN(E,MS))
JAC(3,2) = JAC(3,2) + DNDZETA(M5) * X2(IN(E,M5))
JAC(3,3) ' JAC'(3,3) + DNDZETA(M5) * X3(IN(E,M5))
60 CONTINUE

DETJAC - JAC(1,1) *
(JAC(2,2) * JAC(3,3) - JAC(3,2) *
JAC(2,3))- JAC(1,2) * (JAC(2,1) * JAC(3,3) -
JAC(3,1) * JAC(2,3))- JAC(1,3) * (JAC(2,1) *
JAC(3,2) - JAC(3,1) * JAC(2,2))

DO 90 L=I, 8
DO 80 M5 - 1, 8
CE(L,M5) ' CE(L, M5) + W(I) * W(J) * W(K) * SSE *
N(L) * N(MS) * DETJAC

80 CONTINUE
90 CONTINUE

100 CONTINUE
110 CONTINUE
120 CONTINUE
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 18

SUBROUTINE RHS

18.1 PURPOSE

Subroutine RHS assemblesthe "right-hand-side"vector, for the transient,


groundwater
flow equation

([C] - (1 - o))At [K-J){h}t + At ((1 - e) {F}, + o) {F}t+a0 (18.1)

andfor thesolutetransport
equation

([A] - (1 - r•) At [D]) {C}t + At ((1- (18.2)

where[C] is thegobalcapacitance
matrix,cois therelaxationfactor,At is thetimestep
interval,['K']is theglobalconductance matrix,{h}t aretheheadsat timet, {F}t and
{F}t+at arespecifies ratesof groundwater flow(orsoluteflux)attimest andt+At,[A] is
theglobaladsorption matrix,[D] is thegobaladvection dispersion
matrix,and{C}t and
{C}t+atarethesoluteconcentrations at timest andt+At. RHSperforms thematrix
multiplications
andadditionsandmodif3rs
theresultingvectorfor specifiedvaluesof head
or solute concentration

18.2 INPUT

None

18.3 OUTPUT

None

18.4 DEFINITIONS OF VARIABLES

DELTAT(1) = Size of time stepI

FLUX(l) = Specifiedvalueof groundwater


flow or soluteflux at nodeI

GT(I) = Valueof timefunctionat timet (seeChapter16)

ICH(I) = 1 if thevalueof thefieldvariableis specifiedat nodeI


= 0 otherwise

BI(I) = Modifiedglobalmatxix(equation
18.1or 18.2)in vectorstorage
NDOF = Number of nodes where the value of the field variable is unknown

420
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapte•
18 421

NUMNOD = Number of nodes

OMEGA = Relaxation factor (co)

OMOMEGA = 1 -co

18.5 USAGE

Equation 18.1or 18.2isevaluated


foreachtimestep.Theglobalmatrices
[C],
['K],[A] and[D] areassembled in subroutines
ASMBKC(Chapter 17)andASMBAD
(Chapter19).

18.6 SOURCE CODE LISTING


SUBROUTINE RHS
**********************************************************************
c
c 18.1 PURPOSE:
c SUBROUTINE RHS ASSEMBLES THE RIGHT-HAND-SIDE VECTOR
c FOR TRANSIENT GROUNDWATER FLOW AND SOLUTE TRANSPORT
c PROBLEMS.
c
c 18.2 INPUT:
c NONE
c
c 18.3 OUTPUT:
c NONE
c
c 18.4 DEFINITIONS OF VARIABLES:
c DELTAT(I) = SIZE OF TIME STEP I
c FLUX(I) = SPECIFIED VALUE OF GROUNDWATER FLOW OR
c SOLUTE FLUX AT NODE I
c GT(I) • VALUE OF TIME FUNCITON AT TIME I
c ICH(I) • I IF THE VALUE OF THE FIELD VARIABLE IS
c SPECIFIED AT NODE I
c • 0 OTHERWISE
c Bi(IJ) • MODIFIED GLOBAL MATRIX IN VECTOR STORAGE
c NDOF • NUMBER OF NODES WHERE'THE VALUE OF THE
c FIELD VARIABLE IS UNKNOWN (NAMED FOR
c NUMBER OF DEGREES OF FREEDOM)
c NUMNOD • NUMBER OF NODES
c OMEGA • RELAXATION FACTOR
c OMOMEGA - 1 - OMEGA
c
c 18.5 USAGE:
c FOR EACH TIME STEP, THE RIGHT-HAND-SIDE VECTOR IS
c COMPUTED USING THE VALUES OF HEAD OR SOLUTE
c CONCENTRATION FOR THE PREVIOUS TIME STEP, AND THE
c MODIFIED COMBINED CONDUCTION AND CAPACITANCE MATRIX,
c RELAXATION FACTOR, AND TIME STEP INTERVAL FOR THAT
c TIME STEP
c
c SUBROUTINES CALLED:
c LOC
c
c REFERENCES:
c ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
c MODELING BY THE FINITE ELEMENT METHOD, CHAPTER 18.
c
**********************************************************************

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

422 SubroutineRH$

INCLUDE: • COMALL •

IF (T .GT. TIME(IGT)) IGT = IGT + 1


T • T + DELTAT(IDT)
IF (T .GT. TIME(IGTDT)) IGTDT = IGTDT + 1
I = 0
DO 10 J • 1, NUMNOD
IF (ICH(J) .EQ. 0) THEN
I = I + 1
B(I) = FC(I) + DELTAT (IDT) * (OMOMEGA * GT(IGT) * FLUX(J)
1 + OMEGA * GT(IGTDT) * FLUX(J))
ENDIF
10 CONTINUE
J1 = 1
J2 = S BW
DO 60 I = 1, NDOF
J=0
DO 20 K = 1, NUMNOD
IF (ICH(K) .EQ. 0) THEN
J= J+ 1
IF (J .EQ. J1) GOTO 30
ENDIF
20 C ONT I NUE
30 K = K- 1
DO 50 J = J1, J2
40 K =K + 1
IF (ICH(K) .NE. 0) GOTO 40
CALL LOC ( I, J, IJ, NDOF, SBW, SYMM)
B(I) -- B(I) + BI(IJ) * X(K)
50 CONTINUE
IF (I .GE. SBW) J1 = J1 + 1
IF (J2 .LT. NDOF) J2 = J2 + 1
60 CONTINUE
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 19

SUBROUTINE ASMBAD

19.1 PURPOSE

Subroutine ASMBAD assemblesthe combined global sorption and advection-


dispersion matrix[M] (equation5.48a)andthe globalspecifiedflux matrix {F}. The
globalmatricesare modifiedto accountfor specifiedvaluesof soluteconcentration
(at
Dirichlet nodes)and for specifiedrates of soluteflux (at Neumannnodes). [M] is
assembled andmodifiedin vectorstorage.ASMBAD alsocomputesthesemi-bandwidth
andnumberof degreesof freedomfor [MI.

19.2 INPUT

None

19.3 OUTPUT

The semi-bandwidth
andnumberof degreesof freedomfor the modified,combined
globalconductance
andcapacitance
matrixare writtento theuser-defined
file assignedto
unit "OUTF".

19.4 DEFINITIONS OF VARIABLES

AE(I,J) = Sorptionmatrixfor elemente in full matrixstorage.

DE(I,J) = Advection-dispersion
matrixforelemente in full matrixstorage.
ELEMTYP(E) = Elementtype for elementE (see Table 9.1 for a list of element
types).
F(I) = Global solute flux matrix.

FLUX(•) = Specifiedrateof soluteflux at nodeI.


X(•) = Value of solute concentration at node I.

if thevalueof soluteconcentration
is specified
at nodeI,
otherwise.

IJSIZE = Lengthof array[M] in vectorstorage.


I

LCH(I) = k•ICH(k). The arraysICH


= 1 systemof equations
and LCH areused tomodify the global
for specifiedvaluesof thefield variable.

423
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

424 Subroutine ASMBAD

M(I,J) = Modified,combinedglobalsorptionandadvection-dispersion
matrix
in vectorstorage.
: ([A] + o• At[D])

NDOF = Number of nodes where the value of solute concentration is


unknown.

NODETBL(I) -- Numberof nodesin elementtypeI.


NUMELM = Number of elements in mesh.

SBW = Semi-bandwidth of modified, combined global sorption and


advection-dispersion
matrix.

USAGE

SubroutineASMBAD assemblesthe combined global sorption and advection-


dispersion
ma•ix [MI

[M] = ([A] + toAt [D]) 19.1

andthespecified solutefluxmatrix{F}. [M] and{F} aremodifiedto accountfor specified


values of soluteconcentrationduring the assemblyprocess,using the proceduresin
Chapter4. The modified,globalspecifiedflux matrixis storedin the arrayB. Further
modificationsto B aremadein subroutineRI-IS(seeChapter18).

Table 19.1 Subroutines used to compute element advection-dispersionmatrices(DBAR2,


DBAR3, etc.) and element sorption matrices (ABAR2, ABAR3, etc.) in ASMBAD.
, ..

Element
Type Description Subroutine
Names DIM
[O(e)
l [A(e)]

1 Linearbar DBAR2 , ABAR2 1


2 Quadratic
bar DBAR3* , ABAR3* 1
3 Cubicbar DBAR4* , ABAR4* 1
4 Lineartriangle DTRI3 , ATRI3 2
5 ' Linearrectangle DREC4 , AREC4 2
6 Linearquadrilateral DQUA4 , AQUA4 2
7 Quadratic
quadrilateral DQUA8* , AQUA8* 2
8 Cubicquadrilateral DQUA12*,AQUA12* 2
9 Linearparallelepiped DPAR8 , APAR8 3
10 Quadratic
parallelepiped DPAR20*, APAR20* 3
11 Cubic
parallelepiped DPAR32*, APAR32* 3
12 Linear
tdangle
(axisymmetric) DTRI3A*, ATRI3A* 4
13 Linearrectangle
(axisymmetric) DREC4A*,AREC4A* 4
*Sourcecodelistingnotprovided
for thesesubroutines.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter19 425

Thenumberof degrees
of freedom,
NDOF,(number
of unknown
valuesof solute
concentration)
and semi-bandwith,
SBW, are computedthe sameway as in ASMBK(]
(Chapter17).
The elementsorptionandadvection - dispersion
matricesarecomputed in two setsof
subroutines
(Table 19.1). The firstsetof subroutines
beginswith theletter"A" (for the
element
sorption
matrix
[A(e)]
andthesecond
setbegins
withtheletter"D"(fortheelement
advection-dispersion
matrix[D(e)]). Additional
lettersandnumbers
in thesubroutine
namesidentifythe elementtypeandnumberof nodesin elementsof that type. For
example,subroutineATRI3 computesthe elementsorptionmatrixfor two-dimensional,
lineartriangle
elements
andsubroutine
DPAR8computes theelement advection-dispersion
matrixfor three-dimensional,
linearparallelepiped
elements.
The sourcecodelistingfor eachsubroutinegivesthefigarethatshowstheinterpolation
functionsandthe equationsusedto compute[A] and [D] for thatelementtype. Many of
theimportantFORTRAN variablenamesandtheirsymbolsarein Table 12.2. Additional
namesandsymbolsfor the subroutines in Table 19.1 are shownbelow

FOR'IRAN Variable Definition Symbol(s)in Text

ALE Longitudinal
dispersivity
forelement
ATE Transverse
dispersivity
forelement
E •Z(T
e)
KDE Solutedistribution
coefficient
for elementE Kat,)

LAMBAD Solutedecaycoefficient

NE Porosity
forelement
E n(e)
RHOBE bulk
density
forelement
E p(•e)
v?
VXEP Porewatervelocityin x coordinate
direction
n(•)

VYEP Porewatervelocityin y coordinate


direction
n(•)

Theoperation
of ASMBADisverysimilarto ASMBKCandneedsnospecial
explanation.
Remember thattheglobaladvection-dispersion
matfixis nonsymmetric
sothe
assemblyandmodification
processis somewhatdifferent(seeChapter5).

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

426 SubroutineASMBAD

19.6 SOURCE CODE LISTING

SUBROUTINE ASMBAD
**********************************************************************
c
C 19.1 PURPOSE:
C TO ASSEMBLE THE COMBINED GLOBAL SORPTION AND
c ADVECTION-DISPERSION MATRIX AND THE GLOBAL SPECIFIED
C SOLUTE FLUX MATRIX FOR THE MESH AND TO MODIFY THE
c SYSTEM OF EQUATIONS FOR SPECIFIED CONCENTRATION AND
C SOLUTE FLUX BOUNDARY CONDITIONS
C
c 19.2 INPUT:
C NONE
C
C 19.3 OUTPUT:
c THE SEMI-BANDWIDTH AND NUMBER OF DEGREES OF FREEDOM
C FOR THE MODIFIED, COMBINED GLOBAL SORPTION AND
C ADVECTION-DISPERSIONMATRIX ARE WRITTEN TO THE USER-
c DEFINED FILE ASSIGNED TO UNIT OUTF
c
c 19.4 DEFINITIONS OF VARIABLES:
c AE(I,J) - SORPTION MATRIX FOR ELEMENT E IN FULL
c MATRIX STORAGE
C B(I) = GLOBAL SPECIFIED SOLUTE FLUX MATRIX
C DE (I,J) = ADVECTION-DISPERSION MATRIX FOR ELEMENT
c E IN FULL MATRIX STORAGE
C ELEMENT NUMBER
C E LEMT YP (E) = ELEMENT TYPE FOR ELEMENT E (SEE TABLE
c 9.1 FOR A LIST OF ELEMENT TYPES)
C FLUX(I) SPECIFIED VALUE OF SOLUTE FLUX
c AT NODE I
c ICH (I) = I IF THE VALUE OF SOLUTE CONCENTRATION
C IS SPECIFIED FOR NODE I,
C 0 OTHERWISE
c IJSIZE = LENGTH OF ARRAY ADGLOBAL
C LCH (I) • ICH(I) + ICH(I-1) + ICH(I-2) + ...
C THE ARRAYS ICH AND LCH ARE USED TO
c MODIFY THE GLOBAL MATRIX
C M(IJ) = MODIFIED, COMBINED GLOBAL SORPTION AND
C ADVECTION-DISPERSIONMATRIX IN VECTOR
c STORAGE
C NDOF = NUMBER OF NODES WHERE THE VALUE OF
C THE FIELD VARIABLE IS UNKNOWN
c NODETBL (ELEMTYP (E)) = NUMBER OF NODES IN ELEMENT TYPE E
C NUMELM = NUMBER OF ELEMENTS IN MESH
c SBW = SEMI-BANDWIDTH OF MODIFIED, COMBINED
C GLOBAL SORPTION AND ADVECTION-
C DISPERSION MATRIX
c X(I) = VALUE OF SOLUTE CONCENTRATION
C AT NODE I
C
c 19.5 USAGE:
C THE SEMI-BANDWIDTH OF THE COMBINED GLOBAL SORPTION AND
C ADVECTION-DISPERSION MATRIX IS COMPUTED FIRST. THEN THE
C ENTRIES OF THE ELEMENT SORPTION AND ADVECTION-DISPERSION
C MATRICES ARE COMPUTED IN A SET OF SUBROUTINES, TWO
c SUBROUTINES FOR EACH ELEMENT TYPE. THE COMBINED GLOBAL
c SORPTION AND ADVECTION-DISPERSION MATRIX FOR THE MESH IS
C ASSEMBLED BY ADDING THE CORRESPONDING ENTRIES OF THE ELEMENT
C SORPTION AND ADVECTION-DISPERSION MATRICES TO THE GLOBAL

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter19 427

MATRIX. DURING THE ASSEMBLY PROCESS THE GLOBAL MATRIX IS


MODIFIED FOR SPECIFIED VALUES OF SOLUTE CONCENTRATION AND
SOLUTE FLUX ARE ADDED TO THE GLOBAL SOLUTE FLUX MATRIX.

SUBROUTINES CALLED:
ABAR2 , ABAR3, ABAR4, ATRI3, AREC4, AQUA4, AQUA8 , AQUA12 , APAR8 ,
APAR20, ABAR32, ATRI 3A, AREC4A
LOC (LISTED WITH SUBROUTINE ASMBK IN CHAPTER 12)
DBAR2 , DBAR3, DBAR4 , DTRI3, DREC4, DQUA4 , DQUA8 , DQUA12 , DPAR8 ,
DPAR20, DBAR32, DTRI3A, DREC4A

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT M•THOD, CHAPTER 19.

**********************************************************************
$ INCLUDE: ' COMALL '
REAL AE (MAX3, MAX3 ), DE (MAX3, MAX3)
INTEGER NODETBL ( 13 )
DATA NODETBL/2,3,4,3, 4, 4,8,12,8,20,32,3, 4/

COMPUTE THE SEMI-BANDWIDTH


SBW • 1
DO 30 E - 1, NUMELM
DO 20 I • 1, NODETBL(ELEMTYP(E) )
KI - IN(E, I)
IF (ICH(KI) .EQ. 0 .AND. I .LT. NODETBL(ELEMTYP (E)) ) THEN
II • KI - LCH(KI)
DO 10 J • I + 1, NODETBL(ELEMTYP(E))
KJ - IN(E,J)
IF (ICH(KJ) .EQ. 0) THEN
JJ -- ABS(KJ - LCH(KJ) - II) + 1
IF (JJ .GT. SBW) SBW • JJ
ENDIF
10 CONTINUE
ENDIF
20 CONTINUE
30 CONTINUE
WRITE (OUTF, 40) NDOF, SBW
40 FORMAT(//' NUMBER OF DEGREES OF FREEDOM IN MODIFIED, '/
t GLOBAL COMBINED SORPTION AND ADVECTION-DISPERSION',
' MATRIX -•,I5///' SEMI-BANDWIDTH OF MODIFIED, •/
' GLOBAL COMBINED SORPTION AND ADVECTION-DISPERSION',
' MATRIX -', I5)
INITIALIZE ENTRIES OF GLOBAL CONDUCTANCE MATRIX TO ZERO
IJSIZE -- NDOF * NDOF - (NDOF - SBW) * (1 + NDOF - SBW)
DO 50 I = 1, IJSIZE
M(I) - 0.0
Bi(I) -- 0.0
5O CONTINUE
C INITIALIZE ENTRIES OF THE GLOBAL SOLUTE FLUX MATRIX TO ZERO
DO 60 I -NDOF
B(I) - 0.o
60 CONTINUE

DO 56 I - 1, MAX1
56 FC(I) • 0.

LOOP ON THE NUMBER OF ELEMENTS


DO 90 E = 1, NUMELM
COMPUTE THE ELEMENT SORPTION AND ADVECTION-DISPERSION MATRICES

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

428 SubroutineASMBAD

C FOR THIS ELEMENT TYPE


IF (ELEMTYP(E) .EQ. 1) THEN
C ELEMENT IS A ONE-DIMENSIONAL, LINEAR BAR
CALL ABAR2 (E, AE)
CALL DBAR2 (E, DE)
ELSEIF (ELEMTYP(E) .EQ .2) THEN
C ELEMENT IS A ONE-DIMENSIONAL, QUADRATIC BAR
CALL ABAR3 (E, AE)
CALL DBAR3 (E, DE)
ELSEIF (ELEMTYP(E) .EQ. 3) THEN
C ELEMENT IS A ONE-DIMENSIONAL, CUBIC BAR
CALL ABAR4 (E, AE)
CALL DBAR4 (E, DE)
ELSEIF (ELEMTYP(E) .EQ. 4) THEN
C ELEMENT IS A TWO-DIMENSIONAL, LINEAR TRIANGLE
CALL ATRI 3 (E, AE )
CALL DTRI3 (E,DE)
ELSEIF (ELEMTYP (E) .EQ. 5) THEN
C ELEMENT IS A TWO-DIMENSIONAL, LINEAR RECTANGLE
CALL AREC4 (E, AE)
CALL DREC4 (E,DE)
ELSEIF (ELEMTYP(E) .EQ. 6) THEN
C ELEMENT IS A TWO-DIMENSIONAL, LINEAR QUADRILATERAL
CALL AQUA4 (E, AE)
CALL DQUA4 (E, DE)
ELSEIF (ELEMTYP(E) .EQ. 7) THEN
C ELEMENT IS A TWO-DIMENSIONAL, QUADRATIC QUADRILATERAL
CALL AQUA8 (E, AE)
CALL DQUA8 (E, DE)
ELSEIF (ELEMTYP(E) .EQ. 8) THEN
C ELEMENT IS A TWO-DIMENSIONAL, CUBIC QUADRILATERAL
CALL AQUA12 (E, AE )
CALL DQUA12 (E,DE)
ELSEIF (ELEMTYP(E) .EQ. 9) THEN
C ELEMENT IS A THREE-DIMENSIONAL, LINEAR PARALLELEPIPED
CALL APAR8 (E,
CALL DPAR8 (E, DE)
ELSEIF (ELEMTYP (E) .EQ. 10) THEN
C ELEMENT IS A THREE-DIMENSIONAL, QUADRATIC PARALLELEPIPED
CALL APAR20 (E,AE)
CALL DPAR20 (E,DE)
ELSEIF (ELEMTYP(E) .EQ. 11) THEN
C ELEMENT IS A THREE-DIMENSIONAL, CUBIC PARALLELEPIPED
CALL APAR32 (E,
CALL DPAR32 (E, DE)
ELSEIF (ELEMTYP(E) .EQ. 12) THEN
C ELEMENT IS A TWO-DIMENSIONAL, LINEAR TRIANGLE (AXISYMMETRIC)
CALL ATRI3A (E,
CALL DTRI 3A (E, DE)
ELSEIF (ELEMTYP (E) .EQ. 13) THEN
C ELEMENT IS A TWO-DIMENSIONAL, LINEAR RECTANGLE
(AXISYMMETRIC)
CALL AREC4A (E, AE)
CALL DREC4A (E, DE)
ENDIF
C ADD THE ELEMENT SORPTION AND ADVECTION-DISPERSION MATRICES
C FOR THIS ELEMENT TO THE GLOBAL MATRIX
C AE (I, J) ,DE (I, J) ........... > M(IJ) <=> M (KI, KJ)
C (FULL MATRIX STORAGE) (VECTOR MATRIX STORAGE) (FULL MATRIX
STORAGE)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter19 429

DO 80 I ' 1, NODETBL(ELEMTYP(E)}
KI • IN(E,I)
IF (ICH(KI) .EQ. 0) THEN
II t KI - LCH(KI)
DO 70 J • 1, NODETBL(ELEMTYP(E))
KJ = IN(E,J)
IF (ICH(KJ) .NE. 0) THEN
FC(II) ' FC(II) - DELTAT(IDT) * DE(I,J) * X(KJ)
ELSE
JJ - KJ - LCH(KJ)
CALL LOC (II, JJ, IJ, NDOF, SBW, SYMM)
M(IJ) ' M(IJ) + AE(I,J) + OMEGA *
DELTAT(IDT) * DE (I,J)
Bi(IJ) ' Bi(IJ) + AE(I,J) - OMOMEGA *
DELTAT(IDT) * DE(I,J)
ENDIF
70 CONTINUE
ENDIF
8O CONTINUE
9O CONTINUE
RETURN
END

SUBROUTINE ABAR2 (E, AE)


**********************************************************************

PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT
SORPTION MATRIX FOR A ONE-DIMENSIONAL, LINEAR
BAR E•EMENT

DEFINITIONS OF VARIABLES:
AE (I, J) • ELEMENT SORPTION MATRIX
E" ELEMENT NUMBER
KDE • ELEMENT DISTRIBUTION COEFFICIENT
LE " ELEMENT LENGTH
RROBE • ELEMENT BULK DENSITY

REFERENCE S:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.5,
EQUATION 4.19A.

**********************************************************************
$ INCLUDE: ' COMALL '
REAL AE (MAX3, MAX3) , KDE, LE, NE
C
RHOBE - PROP (MATSET (E), 3)
KDE "PROP (MATSET (E), 4)
NE • PROP (MATSET (E), 5)
LE • ABS(Xi(IN(E, 2)) - XI(IN(E,1)))
AE(1,1) - (1. + RHOBE*KDE/NE) * (LE / 6.) * 2.
AE(1,2) • AE(1,1) / 2.
AE(2,1) • AE(1,2)
AE(2,2) - AE(1,1)
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

430 Subroutine ASMBAD

SUBROUTINE ATRI3(E,AE)
**********************************************************************

PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT SORPTION
MATRIX FOR A TWO-DIMENSIONAL, LINEAR TRIANGLE ELEMENT

DEFINITIONS OF VARIABLES:
AE4 t FOUR TIMES ELEMENT AREA
AE(I,J) = ELEMENT SORPTION MATRIX
E t ELEMENT NUMBER
KDE • ELEMENT DISTRIBUTION COEFFICIENT
RHOBE • ELEMENT BULK DENSITY

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.6,
EQUATION 4.25A

**********************************************************************
$ INCLUDE: ' COMALL '
REAL AE (MAX3 , MAX3 ) , KDE, NE

RHOBE ' PROP (MATSET (E), 4)


KDE - PROP (MATSET (E), 5)
NE - PROP (MATSET (E), 6)
AE4 - 2. * (XI(IN(E,2)) * X2(IN(E,3)) + Xi(IN(E,1)) *
X2(IN(E,2)) + X2(IN(E,1)) * XI(IN(E,3)) -
X2(IN(E,3)) * Xi(IN(E,1)) - Xi(IN(E,$)) *
X2(IN(E,2)) - XI(IN(E,2)) * X2(IN(E,1)))
TEM•- AE4 / 12. / 4. * (1. + RHOBE*KDE/NE )
AE(1,1) - 2. * TEMP
AE(1,2) - TEMP
AE(1,3) - TEMP
AE(2,1) - TEMP
AE(2,2) - AE(1,1)
AE(2,3) - TEMP
AE(3,1) - TEMP
AE(3,2) = TEMP
AE(3,3) - AE(1,1)
RETURN
END

SUBROUTINE AREC4 (E,AE)


**********************************************************************

PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT SORPTION
MATRIX FOR A TWO-DIMENSIONAL, LINEAR TRIANGLE ELEMENT

DEFINITIONS OF VARIABLES:
AE(I,J) = ELEMENT SORPTION MATRIX
E - ELEMENT NUMBER
KDE = ELEMENT DISTRIBUTION COEFFICIENT
RHOBE = ELEMENT BULK DENSITY

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.7,
EQUATION 4.30A

**********************************************************************

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapt•19 431

$ INCLUDE: ' COMALL '


REAL AE (MAX3, MAX3) , KDE, NE
C
RHOBE ' PROP (MATSET (E) , 4)
KDE • PROP (MATSET (E) , 5)
NE • PROP (MATSET (E), 6)
TEMPt (RHOBE*KDE/NE + 1.) * ABS( (X2(IN(E,1))-X2(IN(E,3)))/2.
I .* (Xi(IN(E,1)) -Xi(IN(E,3)))/2. ) / 9.
AE(1,1) '-' 4. * TEMP
AE(1,2) - 2. * TEMP
AE(1,3) • TEMP
AE(1,4) • AE(1,2)
AE(2,1) .- AE(1,2)
AE(2,2) = AE(1,1)
AE(2,3) "AE(1,2)
AE(2,4) • AE(1,3)
AE(3,1) • AE(1,3)
AE(3,2) • AE(1,2)
AE(3,3) = AE(1,1)
AE(3,4) • AE(1,2)
AE(4,1) • AE(1,2)
AE(4,2) = AE(1,3)
AE(4,3) = AE(1,2)
AE(4,4) • AE(1,1)
RETURN
END

SUBROUTINE AQUA4 (E, AE)


**********************************************************************
PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT SORPTION
MATRIX FOR A TWO-DIMENSIONAL, LINEAR QUADRILATERAL ELEMENT

DEFINITIONS OF VARIABLES:
AE(I,J) = ELEMENT CAPACITANCE MATRIX
DETJAC = DETERMINANT OF JACOBIAN MATRIX
DNDXI(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO XI AT NODE I
DNDX (I) • PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO X AT NODE I
DNDETA(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ETA AT NODE I
DNDY(I) = PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Y AT NODE I
E = ELEMENT NUMBER
XI (I) • LOCATION OF GAUSS POINT IN XI COORDINATE
DIRECTION
ETA(I) '" LOCATION OF GAUSS POINT IN ETA COORDINATE
DIRECTION
JAC(I,J) • JACOBIAN MATRIX
N(I) • INTERPOLATION FUNCTION FOR NODE I
W(I) - WEIGHT FOR GAUSS POINT I
KDE • ELEMENT DISTRIBUTION COEFFICIENT
RHOBE - ELEMENT BULK DENSITY
Xl (IN(E,I) - X COORDINATE FOR NODE I, ELEMENT E
X2(IN(E,I) • Y COORDINATE FOR NODE I, ELEMENT E

REFERENCES:
ISTOK, J.D. GROUNDWATER
FLOW AND SOLUTE TRANSPORT
MODELINGBY THE FINITE ELEMENTMETHOD, FIGURE 4.10,
EQUATION 4.71
******************************************************************

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

432 SubroutineASMBAD

$ INCLUDE: ' COMALL '


REAL JAC (2,2), JACINV (2,2), CE (MAX3,MAX3) ,N(4) ,DNDXI (4),
I DNDETA(4) ,W (2), XI (2), ETA (2), SIGN1(4), AE (MAX3, MAX3),
2 SIGNm(4), KDE, NE
DATA $IGN1/-1.,1.,1.,-1./
DATA SIGNm/-1.,-1.,1.,1./

XI(1) = 1. / SQRT(3.)
XI(2) - -XI(1)
ETA(l) .. XI(1)
ETA(m) .. XI (2)
W (1) .. 1.
W(2)., 1.
RHOBE = PROP (MATSET (E), 4)
KDE .. PROP (MATSET (E), 5)
NE - PROP (MATSET(E), 6)

DO 30 I •. 1, 4
DO 20 J- 1, 4
AE(I,J) = 0.
20 CONTINUE
3O CONTINUE

DO 120 I .. 1, 2
DO 110 J- 1, 2

DO 50 K -- 1, 2
DO 40 K1 - 1, 2
JAC(K, K1) = 0.
40 CONTINUE
50 CONTINUE

DO 60 K1 •. 1, 4
N(K1) • 0.25 * (1.. + SIGNi(K1) * XI(I))
I * (1. + SIGNm(K1) * ETA(J))
DNDXI(K1) • 0.25 * SIGNi(K1) * (1. + SIGN2(K1) * ETA(J))
DNDETA(K1) - 0.25 * $IGNm(K1) * (1. + SIGNi(K1) * XI(I))
6O CONTINUE
DO 70 K1 •. 1, 4
JAC(1,1) -- JAC(1,1) + DNDXI(K1) * Xi(IN(E, K1))
JAC(1,2) - JAC(1,2) + DNDXI(K1) * xm(IN(E, K1))
JAC(2,1) - JAC(2,1) + DNDETA(K1) * Xi(IN(E, K1))
JAC(2,2) = JAC(2,2) + DNDETA(K1) * X2(IN(E, K1))
7O CONTINUE
DETJAC - JAC(1,1) * JAC(2,2) - JAC(1,2) * JAC(2,1)
DO 100 K - 1, 4
DO 90 K1 - 1, 4
AE(K, K1) = AE(K, K1) + W(I) * W(J) * (1. + RHOBE*KDE/NE)
1 * N(K) * N(K1) * DETJAC
90 CONTINUE
100 CONTINUE
110 CONTINUE
120 CONTINUE
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter19 433

SUBROUTINE APAR8 (E,AE)


**********************************************************************
c
c PURPOSE:
C TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT
C SOR•TION MATRIX FOR A THREE-DIMENSIONAL, ß
C LINEAR QUADRILATERAL ELEMENT
C
C DEFINITIONS OF VARIABLES:
C AE (I, J) - ELEMENT CAPACITANCE MATRIX
C DETJAC - DETERMINANT OF JACOBIAN MATRIX
C DNDXI (I) - PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO XI AT NODE I
C DNDX (I) - PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO X AT NODE I
C DNDETA (I) - PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO ETA AT NODE I
C DNDY (I) - PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO Y AT NODE I
C DNDZETA(I) - PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO ZETA AT NODE I
C DNDZ (I) - PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO Z AT NODE I
C E - ELEMENT NUMBER
C XI (I) - LOCATION OF GAUSS POINT IN XI COORDINATE
C DIRECTION
C ETA(I) - LOCATION OF GAUSS POINT IN ETA COORDINATE
C DIRECTION
C ZETA(I) m LOCATION OF GAUSS POINT IN ZETA COORDINATE
C DIRECTION
C JAC (I, J) - JACOBIAN MATRIX
C N(I) - INTERPOLATION FUNCTION FOR NODE I
C W(I) • WEIGHT FOR GAUSS POINT I
C KDE - ELEMENT DISTRIBUTION COEFFICIENT
C RHOBE • ELEMENT BULK DENSITY
C Xl(IN(E,I) - X COORDINATE FOR NODE I, ELEMENT E
C X2(IN(E,I) - Y COORDINATE FOR NODE I, ELEMENT E
C X3(IN(E,I) - Z COORDINATE FOR NODE I, ELEMENT E
C
C REFERENCES:
C ISTOK, J.D. GROUNDWATER FLOW. AND SOLUTE TRANSPORT
C MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.10,
C EQUATION 4.72
C
**********************************************************************
$ INCLUDE: ' COMALL '
REAL JAC (3,3), AE (MAX3,MAX3) ,DNDX(8) ,DNDY(8) ,DNDZ (8),
1 XI(8),ETA(8),ZETA(8),DNDXI(8),DNDETA(8),DNDZETA(S),W(2),
2 N(8) , SIGN1 (8) , SIGN2 (8) , SIGN3 (8) ,KDE, NE
DATA SIGN1/-1.,1.,1.,-1.,-1.,1.,1.,-1./
DATA SIGN2/-1.,-1.,1.,1.,-1.,-1.,1.,1./
DATA SIGN3/-1.,-1.,-1.,-1.,1.,1.,1.,1./

XI(1) = 1. / SQRT(3.)
XI(2) = -XI(1)
ETA(l) = XI(1)
ETA(2) - XI(2)
ZETA(l) - XI(1)
ZETA(2) - XI(2)
W(1) = 1.
W(2) = 1.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

434 Subroutine ASMBAD

RHOBE - PROP (MATSET (E), 4)


KDE s PROP (MATSET (E), 5)
N•. - PROP (MATSET (E), 6)

DO 20 K- 1, 8
DO 10 N1 - 1, 8
AE(K, N1) w 0.
10 CONTINUE
20 CONTINUE

DO 120 I - 1, 2
DO 110 J w 1, 2
DO 100 K s 1, 2

DO 40 L- 1, 3
DO 30 N1 • 1, 3
JAC(L, N1) - 0.
30 CONTINUE
40 CONTINUE

DO 50 N1 - 1, 8
N(N1) • 0.125 * (1.+$IGNi(N1)*XI(I)) * (1.+$IGN2(N1) *
ETA(J)) * (1. + SIGN3(N1) * ZETA(K))
DNDXI(N1) = 0.125 * SIGNi(N1) * (1. + SIGN2(N1) *
ETA(J)) * (1. + $IGN3(N1) * ZETA(K))
DNDETA(N1) = 0.125 * $IGN2(N1) * (1. + SIGNI(N1) *
XI(I)) * (1. + SIGN3(N1) * ZETA(K))
DNDZETA(N1) = 0.125 * SIGN3(N1) * (1. + SIGNi(N1) *
XI(I)) * (1. + SIGN2(N1) * ETA(J))
50 CONTINUE

DO 60 M5 - 1, 8
JAC(1,1) = JAC(1,1) + DNDXI(M5) * XI(IN(E,M5))
JAC(1,2) • JAC(1,2) + DNDXI(M5) * X2(IN(E,MS))
JAC(1,3) - JAC(1,3) + DNDXI(M5) * X3(IN(E,M5))
JAC(2,1) - JAC(2,1) + DNDETA(M5) * XI(IN(E,M5))
JAC(2,2) • JAC(2,2) + DNDETA(M5) * X2(IN(E,M5))
JAC(2,3) - JAC(2,3) + DNDETA(M5) * X3(IN(E,M5))
JAC(3,1) -- JAC(3,1) + DNDZETA(M5) * XI(IN(E,M5))
JAC(3,2) = JAC(3,2) + DNDZETA(M5) * X2(IN(E,M5))
JAC(3,3) • JAC(3,3) + DNDZETA(MS) * X3(IN(E,M5))
60 CONTINUE

DETJAC • JAC(1,1) * (JAC(2,2) * JAC(3,3) - JAC(3,2) *


JAC(2,3)) - JAC(1,2) * (JAC(2,1) * JAC(3,3) -
JAC(3,1) * JAC(2,3))- JAC(1,3) * (JAC(2,1) *
JAC(3,2) - JAC(3,1) * JAC(2,2))

DO 90 L - 1, 8
DO 80 M5 -, 1, 8
AE(L, MS) = AE(L, MS) + W(I) * W(J) * W(K) *
(1. + RHOBE*KDE/ NE) * N(L) * N(MS) * DETJAC
80 CONTINUE
90 CONTINUE

100 CONTINUE
110 CONTINUE
120 CONTINUE
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
19 435

SUBROUT INE DBAR2 (E, DE)


**********************************************************************

PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT
ADVECTION-DISPERSION MATRIX FOR A ONE-DIMENSIONAL,
LINEAR BAR ELEMENT

DEFINITIONS OF VARIABLES:
ALE • LONGITUDINAL DISPERSIVITY FOR ELEMENT
DE (I, J) - ELEMENT ADVECTION-DISPERSION MATRIX
DXE - ELEMENT DISPERSION COEFFICIENT
E - ELEMENT NUMBER
KDE • ELEMENT DISTRIBUTION COEFFICIENT
LAMBDA • SOLUTE DECAY COEFFICIENT
LE - ELEMENT LENGTH
NE - ELEMENT POROSITY
RHOBE - ELEMENT BULK DENSITY
VXE - APPARENT GROUNDWATER VELOCITY IN
X COORDINATE DIRECTION
VXEP • PORE WATER VELOCITY IN X COORDINATE DIRECTION

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.5,
EQUATION 4.18A, EQUATION AIII.12

**********************************************************************
$ INCLUDE: ' COMALL '
REAL DE (MAX3, MAX3), KDE, LAMBDA, LE,NE
C
ALE • PROP (MATSET (E) , 1)
LAMBDA • PROP (MATSET (E) , 2)
RHOBE • PROP (MATSET (E) , 3)
KDE - PROP (MATSET (E) , 4)
NE - PROP (MATSET (E) , 5)
VXE • Vl {E)
VXEP - VXE / NE
LE • ABS(XI(IN(E,2)) - XI(IN(E, 1)))
DXE = ALE * VXEP
TEMP3 = LAMBDA * (1. + RHOBE * KDE/NE) * (LE / 6.)
DE(l,1) = DXE / LE - VXEP / 2. + 2. * TEMP3
DE(l,2) -- -DXE / LE + VXEP / 2. + TEMP3
DE(2,1) = -DXE / LE - VXEP / 2. + TEMP3
DE(2,2) - DXE / LE + VXEP / 2. + 2. * TEMP3
RETURN
END

SUBROUTINE DTRI3 (E,DE)


***********************************************************************

PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT
ADVECTION- DISPERSION MATRIX FOR A TWO-DIMENSIONAL,
LINEAR TRIANGLE ELEMENT

DEFINITIONS OF VARIABLES:
AE4 - FOUR TIMES ELEMENT AREA
ALE - LONGITUDINAL DISPERSIVITY FOR ELEMENT
ATE - TRANSVERSE DISPERSIVITY FOR ELEMENT

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

436 Subroutine ASMBAD

DE (I, J) - ELEMENT ADVECTION-DISPERSION MATRIX


DXXE (ETC.) • ELEMENT DISPERSION COEFFCIENTS
E • ELEMENT NUMBER
KDE w ELEMENT DISTRIBUTION COEFFCIENT
LAMBDA - SOLUTE DECAY COEFFICIENT
NE • ELEMENT POROSITY
RHOBE • ELEMENT BULK DENSITY
VXE w APPARENT GROUNDWATER VELOCITY IN
X COORDINATE DIRECTION
VYE • APPARENT GROUNDWATER VELOCITY IN
Y COORDINATE DIRECTION
VXEP • PORE WATER VELOCITY IN X COORDINATE DIRECTION
VYEP • PORE WATER VELOCITY IN Y COORDINATE DIRECTION

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.6,
EQUATION 4.24A, EQUATION AIII.11

**********************************************************************
$INCLUDE: 'COMALL'
REAL DE (MAX3,MAX3), LAMBDA, •E, NE, BE (3) ,CE (3)

ALE ' PROP (MATSET (E) , 1)


ATE ' PROP (MATSET (E), 2)
LAMBDA - PROP (MATSET (E), 3)
RHOBE - PROP (MATSET (E), 4)
KDE ' PROP (MATSET (E), 5)
NE = PROP (MATSET (E), 6)
VXE - V1 (E)
VYE = v2 {E)
VXEP = VXE / NE
VYEP -VYE / NE
D•XE - (ATE * VYEP**2
+ ALE * VXEP**2) / SQRT(VYEP**2+VXEP**2)
DYYE - (ATE * VXEP**2 + ALE * VYEP**2) / SQRT(VYEP**2+VXEP**2)
DXYE - ((ALE - ATE) * VXEP * VYEP) / SQRT(VYEP**2 + VXEP**2)
DYXE - DXYE
BE(1) - X2(IN(E,2)) - X2(IN(E,3))
BE(2) - X2(IN(E,3)} - X2(IN(E,1))
BE(3) - X2(IN(E, 1)) - X2(IN(E,2))
CE(1) = Xi(IN(E, 3)) - Xi(IN(E,2))
CE(2) = XI(IN(E, 1)) - Xi(IN(E,3))
CE (3) = Xl(IN(E,2)) - Xi(IN(E,1))
AE4 - 2. * (XI(IN(E, 2)) * X2(IN(E,3)) + Xl(IN(E, 1)) *
1 X2(IN(E,2)) + X2(IN(E, 1)) * Xl(IN(E,3)) -
2 X2(IN(E,3)) * XI(IN(E, 1)) - Xi(IN(E,3)) *
X2(IN(E,2)) - Xl(IN(E,2)) * X2(IN(E,1)))
-- AE4 / 4.
TEMP = AE / 12. * LAMBDA * (1. + RHOBE * KDE/NE )

DO 20 I - 1, 3
DO 10 J- 1, 3
DE(I,J) - (DXXE*BE (I) *BE (J) + DYYE*CE(I)*CE(J) +
I DXYE*BE (I) *CE (J) + DYXE*CE (I) *BE (J)) / AE4
2 + VXEP/6.*BE (J) + VYEP/6.*CE (J) + TEMP
IF (I .EQ. J) DE(I,J)- DE(I,J) + TEMP
10 CONTINUE
20 CONTINUE

RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter19 437

SUBROUTINE DREC4 (E,DE)


***********************************************************************

PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT
ADVECTION-DISPERSIONMATRIX FOR A TWO-DIMENSIONAL,
LINEAR TRIANGLE ELEMENT

DEFINITIONS OF VARIABLES:
ALE - LONGITUDINAL DISPERSIVITY FOR ELEMENT
ATE - TRANSVERSE DISPERSIVITY FOR ELEMENT
DE(I,J) - ELEMENT ADVECTION-DISPERSIONMATRIX
DXXE (ETC.) - ELF/4ENT DISPERSION COEFFCIENTS
E - ELEMENT NUMBER
KDE I ELEMENT DISTRIBUTION COEFFCIENT
LAMBDA I SOLUTE DECAY COEFFICIENT
NE • ELEMENT POROSITY
RHOBE • ELEMENT BULK DENSITY
VXE • APPARENT GROUNDWATER VELOCITY IN
X COORDINATE DIRECTION
VYE • APPARENT GROUNDWATER VELOCITY IN
Y COORDINATE DIRECTION
VXEP • PORE WATER VELOCITY IN X COORDINATE DIRECTION
VYEP = PORE WATER VELOCITY IN Y COORDINATE DIRECTION

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.7,
EQUATION 4.29a, EQUATION AIII.11

**********************************************************************
$ INCLUDE: • COMALL •
REAL DE (MAX3,MAX3) , LAMBDA, KDE, NE
C
ALE • PROP (MATSET (E), 1)
ATE = PROP (MATSET (E), 2)
LAMBDA • PROP (MATSET (E), 3)
RHOBE • PROP (MATSET (E), 4)
KDE • PROP (MATSET (E), 5)
NE • PROP (MATSET (E), 6)
VXE -- Vl (E)
VYE -- V2 (E)
VXEP I VXE / NE
VYEP • VY• / NE
DXXE • (ATE * VYEP**2 + ALE * VXEP**2) / SQRT(VYEP**2 + VXEP**2)
DYYE = (ATE * VXEP**2 + ALE * VYEP**2) / SQRT(VYEP**2 + VXEP**2)
DXYE • ((ALE - ATE) * VXEP * VYEP) / SQRT(VYEP**2 + VXEP**2)
DYXE • DXYE
AE • ABS(X2(IN(E,1)) - X2(IN(E,3))) / 2.
BE • ABS(XI(IN(E, 1)) - XI(IN(E, 3))) / 2.
TEMP1 • (DXXE * AE) / (6. * BE)
TEMP2 • (D'fYE * BE) / (6. * AE)
TEMP3 • DXYE / 4.
TEMP4 • DYXE / 4.
TEMP5 • VXEP * AE / 6.
TEMP6 • VYEP * BE / 6.
TEMP7 • LAMBDA * (1. + RHOBE * KDE/NE) * (AE * BE) / 9.
DE (1, 1) • 2. *TEMPI+2. *TEMP2+TEMP3+TEMP 4-2. *TEMPS-2. *TEMP6+4. *TEMP7
DE (1,2) '-2. *TEMP 1+ TEMP2 +TEMP3-TEMP 4+2. *TEMPS- TEMP 6+2. *TEMP7
DE (1, 3) - - TEMP1- TEMP2-TEMP3-TEMP4+ TEMPS+ TEMP6+ TEMP7
DE (1, 4) • TEMP1-2. *TEMP2-TEMP3+TEMP4- TEMP5+2. *TEMP6+2. *TEMP7
DE (2, 1) '-2. *TEMPi+ TEMP2-TEMP3+TEMP 4-2. *TEMPS- TEMP6+2. *TEMP7

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

438 SubroutineASMBAD

DE (2,2) - 2. *TEMP 1+2. *TEMP2-TEMP3-TEMP4+2. *TEMPS-2. *TEMP 6+4. *TEMP7


DE (2, 3) - TEMP1-2. *TEMP2+TEMP3-TEMP4+ TEMPS+2. *TEMP6+2. *TEMP7
DE (2, 4) - - TEMP1- TEMP2+TEMP3+TEMP4- TEMPS+ TEMP6+ TEMP7
DE (3, 1) - - TEMP1- TEMP2-TEMP3-TEMP4- TEMPS- TEMP6+ TEMP7
DE (3,2) - TEMP1-2. *TEMP2-TEMP3+TEMP4+ TEMP5-2. *TEMP6+2. *TEMP7
DE (3, 3) "2. *TEMPI+2. *TEMP2+TEMP3+TEMP4+2. *TEMP5+2. *TEMP6+4. *TEMP7
DE (3, 4) "-2. *TEMPi+ TEMP2+TEMP3-TEMP4-2. *TEMP5+ TEMP 6+2. *TEMP7
DE (4, 1) - TEMP1-2. *TEMP2+TEMP3-TEMP4- TEMPS-2. *TEMP 6+2. *TEMP7
DE(4,2) - - TEMP1- TEMP2+TEMP3+TEMP4+ TEMPS- TEMP6+ TEMP7
DE (4,3) "-2. *TEMPI+ TEMP2-TEMP3+TEMP 4+2. *TEMP 5+ TEMP 6+2. *TEMP7
DE (4, 4) "2. *TEMPI+2. *TEMP2-TEMP3-TEMP4-2. *TEMP5+2. *TEMP6+4. *TEMP7
RETURN
END

SUBROUTINE DQUA4 (E, DE)


**********************************************************************
PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT
ADVECTION-DISPERSION MATRIX FOR A TWO-DIMENSIONAL,
LINEAR QUADRILATERAL ELEMENT

DEFINITIONS OF VARIABLES:
ALE • LONGITUDINAL DISPERSIVITY FOR ELEMENT
ATE - TRANSVERSE DISPERSIVITY FOR ELEMENT
DE(I, J) = ELEMENTADVECTION-DISPERSiONMATRIX
DETJAC • DETERMINANT OF JACOBIAN MATRIX
DNDXI(I) -- PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO XI AT NODE I
C DNDX(I) • PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO X AT NODE I
C DNDETA(I) i PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO ETA AT NODE I
C DNDY (I) • PARTIAL DERIVATIVE OF INTERPOLATION
C FUNCTION WITH RESPECT TO Y AT NODE I
C E • ELEMENT NUMBER
C XI (I) - LOCATION OF GAUSS POINT IN XI COORDINATE
C DIRECTION
C ETA(I) • LOCATION OF GAUSS POINT IN ETA COORDINATE
C DIRECTION
C JAC ( I, J) • JACOBIAN MATRIX
C JACINV ( I, J) • INVERSE OF JACOBIAN MATRIX
C N(I) • INTERPOLATION FUNCTION FOR NODE I
C W(I) • WEIGHT FOR GAUSS POINT I
C KDE = ELEMENT DISTRIBUTION COEFFICIENT
C LAMBDA • SOLUTE DECAY COEFFICIENT
C NE i ELEMENT POROSITY
C RHOBE • ELEMENT BULK DENSITY
C VXE • APPARENT GROUNDWATER VELOCITY IN X
C COORDINATE DIRECTION
C VYE - APPARENT GROUNDWATER VELOCITY IN Y
C COORDINATE DIRECTION
C VXEP - PORE WATER VELOCITY IN X COORDINATE DIRECTION
C VYEP i PORE WATER VELOCITY IN Y COORDINATE DIRECTION
C X1 (IN(E, I) = X COORDINATE FOR NODE I, ELEMENT E
C X2(IN(E,I) - Y COORDINATE FOR NODE I, ELEMENT E
C
C REFERENCES:
C ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
C MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.10,
C EQUATION 4.68
******************************************************************

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
19 439

$ INCLUDE: ' COMALL '


REAL JAC (2,2) , JACINV(2,2) ,DE (MAX3,MAX3) ,N(4) ,DNDXI (4) ,
I DNDX(4) , DNDETA(4) , DNDY(4) , W(2) , XI (2) , ETA(2) , SIGN1 (4) ,
2 S IGN2 ( 4 ), NE, KDE, LAMBDA
DATA $IGN1/-1.,1.,1.,-1./
DATA $IGN2/-1.,-1.,1.,1./

XI(1) = 1. / SQRT(3.)
XI(2) • -XI(1)
ETA(l) -- XI(1)
ETA(2) • XI(2)
W(1) • 1.
W(2) • 1.
ALE • PROP(M/%.TSET
(E), 1)
ATE • PROP (MATSET (E), 2)
LAMBDA• PROP (MATSET (E), 3)
RHOBE • PROP (MATSET (E), 4)
KDE • PROP (MATSET (E), 5)
NE • PROP (MATSET (E), 6)
VXE • V1 (E)
VYE -- V2
VXEP • VXE / NE
VYEP • VYE / NE
DXXE • (ATE * VYEP**2 + ALE * VXEP**2) / SQRT(VYEP**2 + VXEP**2)
DYYE • (ATE * VXEP**2 + ALE * VYEP**2) / SQRT(VYEP**2 + VXEP**2)
DXYE • ((ALE - ATE) * VXEP * VYEP) / SQRT(VYEP**2 + VXEP**2)
DYXE = DXYE
DO 30 I = 1, 4
DO 20 J • 1, 4
DE(I,J) = 0.
20 CONTINUE
30 CONTINUE
DO 120 I • 1, 2
DO 110 J- 1, 2

DO 50 K - 1, 2
DO 40 K1 = 1, 2
JAC(K,K1) = 0.
40 CONTINUE
50 CONTINUE

DO 60 K1 ' 1, 4
N(K1) = 0.25 * (1. + SIGNI(K1) * XI(I))
ß (1. + SiGN2(K1) * ETA(J))
DNDXI(K1) - 0.25 * SIGNI(K1) * (1. + SIGN2(K1) * ETA(J))
DNDETA(K1) ' 0.25 * SIGN2(K1) * (1. + SIGNI(K1) * XI(I))
60 CONTINUE
DO 70 K1 ' 1, 4
JAC(1,1) ' JAC(1,1) + DNDXI(K1) * Xl(IN(E, K1))
JAC(1,2) - JAC(1,2) + DNDXI(K1) * X2(IN(E, K1))
JAC(2,1) ' JAC(2,1) + DNDETA(K1) * XI(IN(E,K1))
JAC(2,2) ' JAC(2',2) + DNDETA(K1) * X2(IN(E,K1))
7O CONTINUE
DETJAC ' JAC(1,1) * JAC(2,2) - JAC(1,2) * JAC(2,1)
JACINV(1,1) = JAC(2,2) / DETJAC
JACINV(1,2) ' -JAC(1,2) / DETJAC
JACINV(2, 1) ' -JAC(2,1) / DETJAC
JACINV(2,2) ' JAC(1,1) / DETJAC
DO 80 K1 ' 1, 4
DNDX(K1) ' JACINV(1,1) * DNDXI(K1) + JACINV(1,2) * DNDETA(K1)
DNDY(K1) ' JACINV(2,1) * DNDXI(K1) + JACINV(2,2) * DNDETA(K1)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

440 Subroutine ASMBAD

80 CONTINUE
DO 100 K- 1, 4
DO 90 K1 = 1, 4
DE(K, K1) - DE(K, K1) + W(I) * W(J) *
(DXXE * DNDX(K) * DNDX(K1)
+ DXYE * DNDX(K) * DNDY(K1)
+ DYXE * DNDY(K) * DNDX(K1)
+ DYYE * DNDY(K) * DNDY(K1)
+ VXEP * N(K) * DNDX(K1)
+ VYEP * N(K) * DNDY(K1)
+ LAMBDA * (1. + RHOBE * KDE / NE )
ß N(K) * N(K1)) * DETJAC
90 CONTINUE
100 CONTINUE
110 CONTINUE
120 CONTINUE
RETURN
END

SUBROUTINE DPAR8 (E,DE)


**********************************************************************
PURPOSE:
TO COMPUTE THE CONSISTENT FORM OF THE ELEMENT
ADVECTION-DISPERSION MATRIX FOR A THREE-DIMENSIONAL,
LINEAR QUADRILATERAL ELEMENT

DEFINITIONS OF VARIABLES:
ALE - LONGITUDINAL DISPERSIVITY FOR ELEMENT
ATE • TRANSVERSE DISPERSIVITY FOR ELEMENT
DE (I, J) = ELEMENT ADVECTION-DISPERSION MATRIX
DNDXI (I) • PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO XI AT NODE I
DNDX (I) - PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO X AT NODE I
DNDETA ( I ) PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ETA AT NODE I
DNDY (I) PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Y AT NODE I
DNDZETA ( I ) PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO ZETA AT NODE I
DNDZ (I) PARTIAL DERIVATIVE OF INTERPOLATION
FUNCTION WITH RESPECT TO Z AT NODE I
ELEMENT NUMBER
XI (I) LOCATION OF GAUSS POINT IN XI COORDINATE
DIRECTION
ETA(I) LOCATION OF GAUSS POINT IN ETA COORDINATE
DIRECTION
ZETA (I) LOCATION OF GAUSS POINT IN ZETA COORDINATE
DIRECTION
JAC (I, J) JACOBIANMATRIX
DETJAC DETERMINANT OF JACOBIAN MATRIX
JACINV (I, J) INVERSE OF JACOBIAN MATRIX
N(I) INTERPOLATION FUNCTION FOR NODE I
W {I) WEIGHT FOR GAUSS POINT I
KDE ELEMENT DISTRIBUTION COEFFICIENT
LAMBDA SOLUTE DECAY COEFFICIENT
ELEMENT POROSITY
RHOBE ELEMENT BULK DENSITY
VXE APPARENT GROUNDWATER VELOCITY IN X
COORDINATE DIRECTION
VYE APPARENT GROUNDWATER VELOCITY IN Y
COORDINATE DIRECTION

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
19 441

VXEP = PORE WATER VELOCITY IN X COORDINATE DIRECTION


VYEP - PORE WATER VELOCITY IN Y COORDINATE DIRECTION
X1 (IN(E,I) -- X COORDINATE FOR NODE I, ELEMENT E
X2(IN(E,I) - Y COORDINATE FOR NODE I, ELEMENT E
X3(IN(E,I) - Z COORDINATE FOR NODE I, ELEMENT E

REFERENCES:
ISTOK, J.D. GROUNDWATER FLOW AND SOLUTE TRANSPORT
MODELING BY THE FINITE ELEMENT METHOD, FIGURE 4.10,
C EQUATION 4.69 .
**********************************************************************
$ INCLUDE: ' COMALL '
REAL JAC (3, 3), JACINV(3, 3), DE (MAX3,MAX3) ,DNDX(8) ,DNDY(8) ,DNDZ (8),
1 XI (2), ETA (2) ,ZETA(S), DNDXI (8}, DNDETA (8), DNDZETA (8) ,W(2),
2 N(S),SIGNI(8),SIGN2(8),SIGN3(8),NE, KDE,LAMBDA
DATA SIGN1/-1.,l.,1.,-1.,-1.,1.,1.,-1./
DATA SIGN2/-1.,-1.,1.,1.,-1.,-1.,1.,1./
DATA SIGN3/-1.,-1.,-1.,-1.,1.,1.,1.,1./
C
XI(1) = 1. / SORT(3.)
XI(2) = -XI(1)
ETA(l) = XI(1)
ETA(2) = XI(2)
ZETA(l) -- XI(1)
ZETA(2) = XI(2)
W (1) = 1.
W(2) -- 1.

ALE • PROP (MATSET (E), 1)


ATE = PROP (MATSET (E), 2)
LAMBDA = PROP (MATSET (E), 3)
RHOBE = PROP (MATSET (E), 4)
KDE = PROP (MATSET (E), 5)
NE = PROP (MATSET (E), 6)
VXE -- Vl (E)
VYE - V2 (E)
VZE -- V3(E)
VXEP = VXE / NE
VYEP = VYE / NE
VZEP • VZE / NE
VXYZ = SQRT(VXEP**2 + VYEP**2 + VZEP**2)
DXXE == (ATE * (VYEP**2 + VZEP**2) + ALE * VXEP**2 ) / VXYZ
DXYE • ((ALE - ATE) * VXEP * VYEP) / VXYZ
DYXE = DXYE
DYYE = (ATE * (VXEP**2 + VZEP**2) + ALE * VYEP**2 ) / VXYZ
DXZE -- ((ALE - ATE) * VXEP * VZEP) / VXYZ
DZXE - DXZE
DZZE = (ATE * (VXEP**2 + VYEP**2) + ALE * VZEP**2 ) / VXYZ
DYZE = ((ALE - ATE) * VYEP * VZEP) / VXYZ
DZYE = DYZE

DO 20 K = 1, 8
DO 10 N1 = 1, 8
DE (K, N1) = 0.
lO CONTINUE
20 CONTINUE

DO 120 I = 1, 2
DO 110 J = 1, 2
DO 100 K = 1, 2
DO 40 L=i, 3
DO 30 N1 = 1, 3
JAC(L, N1) = 0.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

442 Subroutine
ASMBAD

30 CONTINUE
4O CONTINUE
DO 50 N1 = 1, 8
N(N1) = 0.125 * (1.+SIGNI(N1)*XI(I)) * (1.+SIGN2(N1) *
ETA(J)) * (1. + SIGN3(N1) * ZETA(K))
DNDXI(N1) • 0.125 * SIGNi(N1) * (1. + SIGN2(N1) *
ETA(J)) * (1. + SIGN3(N1) * ZETA(K))
DNDETA(N1) -0.125 * SIGN2(N1) * (1. + SIGNI(N1) *
XI(I)) * (1. + SIGN3(N1) * ZETA(K))
DNDZETA(N1) • 0.125 * SIGN3(N1) * (1. + SIGNI(N1) *
1 XI(I)) * (1. + $IGN2(N1) * ETA(J))
50 CONTINUE
DO 60 M5 = 1, 8
JAC(1,1) = JAC(1,1) + DNDXI(M5) * XI(IN(E,M5))
JAC(1,2) • JAC(1,2) + DNDXI(MS) * X2(IN(E,M5))
JAC(1,3) = JAC(1,3) + DNDXI(M5) * X3(IN(E,M5))
JAC(2,1) = JAC(2,1) + DNDETA(M5) * Xi(IN(E,M5))
JAC(2,2) • JAC(2,2) + DNDETA(M5) * X2(IN(E, M5))
JAC(2,3) • JAC(2,3) + DNDETA(M5) * X3(IN(E,MS))
JAC(3,1) = JAC(3,1) + DNDZETA(M5) * XI(IN(E,M5))
JAC(3,2) = JAC(3,2) + DNDZETA(M5) * X2(IN(E,M5))
JAC(3,3) = JAC(3,3) + DNDZETA(M5) * X3(IN(E,M5))
60 CONTINUE

DETJAC • JAC(1,1) * (JAC(2,2). * JAC(3,3) - JAC(3,2) *


JAC(2,3))- JAC(1,2) * (JAC(2,1 ) * JAC(3,3) -
JAC(3,1) * JAC(2,3)) - JAC(1,3) ß (JAC(2,1) *
JAC(3,2) - JAC(3,1) * JAC(2,2))
JACINV(1,1) = (JAC(2,2)*JAC(3,3)-JAC(2, 3) *JAC (3,2))/DETJAC
JAC INV ( 1, 2) = (-JAC(2,1)*JAC(3,3)+JAC(2, 3) *JAC (3, 1) )/DETJAC
JAC INV ( 1, 3) • ( JAC(2,1)*JAC(3,2)-.JAC(3, 1) *JAC (2, 2) )/DETJAC
JAC I NV (2, 1) = (-JAC(1,2)*JAC(3,3)+JAC(1, 3) *JAC (3, 2) )/DETJAC
JACINV ( 2, 2) • ( JAC(1,1)*JAC(3,3)-JAC(1, 3) *JAC (3, 1) )/DETJAC
JAC INV ( 2, 3) = (-JAC (1, 1) *JAC (3,2) +JAC (1, 2 ) * JAC ( 3, 1 ) )/DETJAC
JAC INV ( 3, 1) • ( JAC(1,2)*JAC(2,3)-JAC(1, 3) *JAC (2, 2) )/DETJAC
JAC INV ( 3, 2) - (-JAC(1,1)*JAC(2,3)+JAC(1, 3) *JAC (2, 1) )/DETJAC
JAC INV ( 3, 3) = ( JAC(1,1)*JAC(2,2)-JAC(1, 2 ) * JAC (2, 1) )/DETJAC

DO 70 M5 = 1, 8
DNDX(MS) m JACINV(1,1) * DNDXI(M5) + JACINV(1,2) *
DNDETA(M5) + JACINV(1,3) * DNDZETA(M5)
DNDY(MS) - JACINV(2,1) * DNDXI(M5) + JACINV(2,2) *
DNDETA(M5) + JACINV(2,3) * DNDZETA(M5)
DNDZ(M5) = JACINV(3,1) * DNDXI(M5) + JACINV(3,2) *
1 DNDETA(MS) + JACINV(3,3) * DNDZETA(MS)
7O CONTINUE
DO 90 L" 1, 8
DO 80 M5" 1, 8
DE(L, M5) "DE(L, M5)+ W(I) * W(J) * W(K) * (
1 DNDX(L) * (DXXE*DNDX(MS) + DXYE*DNDY(M5) + DXZE*DNDZ (MS)) +
2 DNDY (L) * (DYXE*DNDX (M5) + DYYE*DNDY (M5) + DYZE*DNDZ (MS)) +
3 DNDZ (L) * (DZXE*DNDX(MS) + DZYE*DNDY(MS) + DZZE*DNDZ (MS))
4 + N(L) * (VXEP*DNDX(MS) + VYEP*DNDY(MS) + VZEP*DNDZ (M5))
5 + LAMBDA * (1. + RHOBE*KDE/NE ) * N(L) * N(M5) )
6 ß DETJAC

80 CONTINUE
90 CONTINUE
100 CONTINUE
110 CONTINUE
120 CONTINUE
RETURN
END

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 20

MODELING REGIONAL GROUNDWATER FLOW

20.1 PURPOSE OF GROUNDWATER FLOW MODELING

To "model regional groundwater"flowmeans todevelop mathematical andnumerical


models of theaquifersystem beingstudied andtousethese models topredictthevalueof
hydraulicheadatpoints(andtimes)of interest. Forexample, thevaluesof headmaybe
needed to determine theimpactof pumping onwatertablelevels(e.g.,to determine if a
proposed wellwillcause excessive
drawdown atanexisting well)ortopredictthedirection
and rate of groundwater flow (e.g., to computegroundwater travel times for site
assessment or to predictthe rateof movement of groundwater contaminants). The
numericalprocedures forsolvingthesteady-stateandtransientgroundwater flowequations
by thefiniteelementmethodweredescribed in Part 1 andtheimplementation of these
procedures in computer programs wasdescribed in Pan 2. However,beforethese
procedures andprograms canbeapplied to anactualfieldproblem theanalyst mustcollect
andanalyzea varietyof information
aboutthestudyarea:
1) to identifythetypeof modelthatshouldbe used,
2) to identifythelocations
of aquiferboundaries,
3) to determine
valuesfor aquifermaterialproperties,
4) to determine
valuesandtypesof boundary
andinitialconditions,and
5) to calibrateandverifythemodel.

20.2 TYPES OF GROUNDWATER FLOW MODELS

Severaltypesof models(e.g.,one-,two-,andthree-d/mensional
models;steady-state,
saturatedflow models; transient,unsaturatedflow models;fracture flow models) can be
usedto studygroundwater flow systems.The selection of thetypeof modelto applyto a
particularfieldproblemcanbedifficult,particularlyif fielddataarescarceor if theanalyst
hasnoprevious experiencein thestudyarea.Ultimately, thechoiceismadebyselecting a
model1) thatrepresents thephysical(andperhapschemicalandbiological)processes that,
in theopinionof the analyst,aremostimportantin determining aquiferbehavior,and2)
that is consistentwith the availabledata. Panieularattentionshouldbe paid to the
assumptions usedin thederivationof the differentialequation(s)on whichthe modelis
based. The assumptions usedto derivethe four typesof groundwater flow equations
presentedin this book (steady-state, saturatedflow; steady-state,unsaturated flow;
transient,saturatedflow; and transient,unsaturatedflow) are discussed in AppendicesI
andII. Caremustbe takento avoidtheapplication of theseequations (andtheprocedures
and computerprogramsin Parts 1 and 2 that are basedon theseequations)to field
situations
wheretheassumptions maynot be valid.
For example,in thesederivations,Darcy'sLaw is assumedto be valid and we can
immediately concludethatproblems involvingflow throughfractured
rock,largecavitiesin
Karst limestone,lava tubes,etc. can not be solvedwith modelsbasedon theseequations

445
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

446 ModelingRegionalGroundwater
Flow

because it is likely thatgroundwater


velocitieswill be toolargefor Darcy'sLaw to bevalid
(Hillel, 1980, pp. 181-182). Darcy'sLaw may also not be valid whcn groundwater
velocitiesare extremelysmall,e.g. in flow throughcompactedclay with smallhydraulic
gradicnts($warzendruber,1962). Further,aquiferstress:strain behavioris assumedto be
elastic,and thc changein thickncssof the aquifcrin responseto changesin headis
assumed to be small;thusinvalidatingthe useof theseequations to solvcproblemsof
consolidation (thelargcandusuallyirreversible
reductionin aquiferthickncss
thatoccurs
bencathmanyfoundations andearthsu'ucturcsasa resultof surfaceloading,or thatcan
occurin anyarcaducto cxccssive groundwater withdrawIs).
Recallalsothatgroundwater densityis assumedconstantthereforeinvalidatingtheuse
of theseequations to predictheadsin problemswheredensityvariationsareexpected to be
largee.g.,nearthefreshwater:salty waterinterfacethatdevelopsin coastalaquifersor in
brine fields, or in problemsinvolvingmultiplcfluid phasessuchas the flow of non-
aqueous
phascliquidsinto groundwater
at hazardous
wastesitcs.Flowof groundwater
abovethewatertableas watervaporis alsoassumed
to be negligiblysmall.

20.3 CONFINED V$ UNCONFINED AQUIFERS

The steady-stateandtransicnt,
saturatedgroundwaterflow cquations presented
in this
bookcan be appliedto confinedandunconfinedaquifcrs(sece.g., Bcar, 1979). In a
confinedaquifer,a truewatertablc(thcsurfacewherewaterpressure equalsatmospheric
pressure)doesnot exist; the upperlimit of the saturatedzone is the baseof a low-
pcrmcabilitylayer calledan aquitard (Figurc20.1). Hydraulicheadis measured with
piezometersandthehcightthatwaterrisesin thepiczometersdefincsthepiezornetric
surface. The procedurcs
andcomputerprogramsin Parts1 and2 can be usedto solve
steady-state
andtransient,
saturated
groundwaterflow problemsfor confinedaquifers
in
one-,two-,andthree-dimensions
usingasaquifermaterialproperties
thecomponents of
saturated
hydraulic
conductivity,
Kx,Ky,andKz, andspccific
storage,
Ss. However,
in
two-dimensional
(mapview) problems
it is commonto uscas aquiferproperties
transmissivity,
T, andstorativty,S. Storativity
is thenamegivento specificstorage
in
confined
aquifers.
Thetwocomponents
oftransmissivity,
TxandTyaredef'med
as
Tx = bKx (20.la)
Ty = bKy (20.lb)
whereb is thesaturated
thickness
of theaquifer(Figure20.1). In thiscasethesteady-
state,saturated
groundwater
flow equation(e.g.equation3.45)canbe written

•xx•T•xl+
•-•T•-•=0 (20.2)

Themethodof weighted
residuals
canbeappliedto equation
20.2andtheresults
fromPart
1canbeusedtosolveforunknown
values
ofhead,h(x,y). Wcsimplysubstitute
Tx(e)for
Kx(e)andTy(e)
forKy(e)intheequations
for[K(e)]foranyof thetwo-dimensional
elements.
Othcrwise thesolution
procedure
is identical
andprogram GW1canbeused
withoutmodification
(However,whenspecifyinggroundwater
flow ratesat Neumann
nodes,
wemust
becareful
touseunits
forqthatareconsistent
withTxandTy).
Thetransient,
saturated
groundwater
flowequation
(e.g.equation
3.79)canbewritten

•'•, x•'•j+•-•[Ty• = S•. (20.3)

whereS is the aquiferstorativity

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
20 447

iii I'

la•d

•k

Figure 20.1 Confined aquifer.

The methodof weightedresidualscanalsobe appliedto equation20.3 andtheresults


from Part 1 can be usedto solvefor unknownvaluesof head,h(x, y, t). We simply
substitute
Tx(e)
forKx(e),
Ty(c)
forKy(O,
andS(•)forSs
(e)intheequations
for[K(O]and
[C(e)]for any for the two-dimensional
elements.Otherwisethe solutionprocedure is
identicalandprogramGW3 canbe usedwithoutmodification(if the unitsfor specified
groundwater
flowrates
areconsistent
withTx,Ty,and$).
In anunconfinedaquifer theupperlimit of thesaturatedzoneis thewatertable(Figure
20.2). Hydraulicheadis measuredwith wells. If thepositionof thewatertableis known
(not common)the entire surfaceof the water table is treatedas a Dirichlet boundary

well

. land,surf,
ace
,, •

'.'.•
....................................
..C'.•..ß ,••'"••'
bedrock
......'
Figure 20.2 Uneonfined
aquifer.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

448 ModelingRegionalGroundwater
Flow

earth tlnrn
henriwater .............................watertable

'Dirichlet
reservoir
B.C •li!'•"-..•......:•i•ii•i•i•:..`..............•?•i..........•............
:•..
,..'.?...
••
•. tailwater
....
:ii::'.....•2•

bedrock

Figure 20.3 Saturated flow through earth dam, position of water table is assumed
known.

condition.ProgramsGW1 or GW3 couldbe usedto computeheadsat pointswithin the


aquifer(Figure20.3). However,in mostsituations thepositionof the watertableis not
known(exceptat a few locations)andwe wishto computeit from the availabledata. Three
approaches havebeenusedto solvethistypeof problem.
In thefirstapproachwe assumethattheslopeof thewatertableis smallsothat 1) the
saturatedthicknessof the aquiferis approximatelyconstantand 2) groundwaterflow is
approximatelyhorizontal(i.e., the Dupuit-Forchheimerassumption,see Freeze and
Cherry,1979). This approach is particularlyusefulin studiesof regionalgroundwater
How wherethe lateralextentof the aquiferis muchlargerthan the saturatedthickness.
With this approachthe steady-state,saturatedgroundwaterflow equationfor two-
dimensional flow in anunconfinedaquifercanbewritten(seee.g.Bear,1979)

•x(Kxh•x
) 8 •)h (20.4)

But since

82h
2= 2h
•h (20.5)

equation20.4canbewritten

(20.6)

The resultsfrom Part 1 can be usedto solveequation20.4 for unknownvaluesof head,


h(x,y). Toseethis,define
anewvariable
u = h2 sothatequation
20.6becomes

(20.7)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter20 449

Now
wecan
substime
-•.for and for inthe
equations
for[K(e)]
forany
ofthe
two-dimensional elements.Dirichletboundary
conditions
arespecified
for u by squaring
specifiedvaluesof hydraulichead. ProgramGW1 canthenbe usedwithoutmodification
tosolveformunknown
values
of u andvalues
of headcanbecomputed
ateachnode,hi =
•, foreach
node
i. Ifvelocities
arerequired,
program
GW1could
easily
bemodified
by
the additionof the followingFORTRAN statements
just before(above)the statement
"CALL VELOCITY"

DO 99 I = 1, NUMNOD
X(I) - SQRT(X(I))
99 CONTINUE

The transient,saturatedgroundwaterflow equationfor two-dimensionalflow in an


unconfmexiaquifercanbewritten

(20.8)

where
Syistheaquifer
specific
yield.Defining
u=h2with
8h •u la 1 8u
' = (20.9)
•t •t 2'•'u&

equation20.8 canbe written

(20.10)

Equation
20.10isanonlinear
differential
equation
(because
oftheterm1/'•'•') andGann0t
be solvedusingprogramGW3 unlessit is modified(e.g. by usingPicarditerationasin
programGW4). ProgramGW3 couldbefurthermodifiedto computeheadsandvelocities
usingthesameFORTRAN statementsgivenfor programGWl above.
The secondapproachthatcanbe usedto solvethe transientand steady-state,
saturated
groundwaterflow equationsfor an unconfinedaquiferis basedon the definitionof the
watertableasa surfacewherewaterpressure is equalto atmospheric
pressure(zerogage
pressure).Fromthedefinitionof hydraulichead

0 on water table

h=z+j• (20.11)
wherez is the elevationhead. The solutionprocedureis very simple. We guessthe
positionof thewatertableanddrawa f'miteelementmesh.We thencomputethevalueof
headat eachnodein themesh. For eachnodeon thewatertablethe computedvalueof
headshouldequalthe elevationof the node. If the valuesare not equalwe set the
coordinates of the nodeson the watertableequalto thecomputexi valuesof head. The
processis repeateduntil a convergencecriteriais satisfied(NeumannandWitherspoon,
1970). The shapeof themeshchanges witheachiteration(Figure20.4). Programs
and GW3 could be easily modifiedto use this method. This approachis usefulfor
problemswherethe Dupuit-Forscheimer assumption is not valid (e.g. neara pumping
well).

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

450 ModelingRegionalGroundwater
Flow

Dirichlet
B.C.
Neumann
B.C.

Z• ?J/J/J/J/'
'
.....•
x

Figure 20.4 Example problem for unconfined aquifer. z coordinate of nodes marked
with asterisk change during solution procedure until hI = zI for each
node i.

In thethirdapproach we solvethesteady-state or transientunsaturated


flow equations
andthe positionof the watertableis indicatedby nodeswith computedpressureheads
equalto zero. We use this approachwhengroundwaterflow abovethe water table is
consideredto be significant(e.g., in a studyof the responseof a shallowwater table to
rechargeduringa rainstorm).

20.4 SENSITIVITY ANALYSIS

The developmentof a mathematicalmodelfor an aquifersystemis a difficult task.


Aquifersystems axecomplexandtheinterpretation of field andlaboratorydatafor usein a
regional groundwaterHow model requiresa considerableamount of professional
judgement(whichis why groundwatermodelingis sometimesreferredto as an "art").
Measuredvaluesof aquiferpropertiesaxeusuallyscarceandwell logsoftengive a rather
incomplete description of thestratigraphy, structure,
andlithologyof subsurface materials.
Forexample,thelocations of aquiferboundaries axeneededto spec• thesizeandshapeof
theproblemdomainandto drawthefiniteelementmesh.In manyproblems encountered in
practice,thereareinsuffi•ent datato tn,eciselydeterminethepositionof aquiferboundaries
e.g., in a valley-f'Hlaquiferit may be difficultto determinethe positionof the contact
betweenthealluviumandthe underlyingbedrock.In thiscase,thepositionsof aquifer
boundaxies mustbeinf• fromtheavailabledata(e.g.,theelevations of aquifercontacts
recordedin well logs). This can be done quantitatively(e.g., using someform of
interpolation) or qualitatively(e.g.,usingthejudgement of persons knowledgable aboutthe
geologyandgeomorphology of thestudyarea).In anycasetheeffectof uncertainty in the
positions of aquiferboundaries onmodelresultsshouldbe investigated usinga sensitivity
analysis. In a sensitivityanalysis,the valuesof model parameters(in this casethe
positionsof aquiferboundaries) arevariedacrosstherangeof likely valuesandtheeffect
uponcomputed headsis noted.The mosteffortis expended to identifyparameters that
havethemosteffecton computed results(in mostcasesthepositions of aquiferboundaries
haverelativelylittle effectrelativeto aquifermaterialpropertiesandboundaryandinitial
conditions).

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter20 451

Lack of datacanmakeit particularlydifficultto specifyaquifermaterialproperties.


Realaquifersarerarelyhomogeneous andisotropic.Thefiniteelementmethodallowsthe
analystto specifya differentsetof materialproperties for eachelementin themeshbuta
methodis neededto obtainthesepropertiesfrom a (usually)limiteddataset (e.g., the
resultsof pumpingtestsfor a few wells). Althoughit maybepossible to estimate aquifer
properties usingstatisticalmethods (e.g.,geostatistics)
or by solvingtheinverseproblem
(seebelow)considerable uncertaintywill remainandtheeffectof uncertainty in valuesof
aquiferproperties onmodelresults should beinvestigatedin a sensitivity
analysis.
The mostcommonlyoccurring boundary conditions arethespecifiedhead(Dirichlet)
andspecified flow (Neumann) boundary conditionsdescribed in Part 1. Specifiedhead
boundary conditions arecommonlyusedwherea surfacewaterbody(lake,river,etc.)is in
hydraulicconnection withgroundwater alonga portionof theaquiferboundary.Specified
flow boundaryconditions arecommonlyusedto represent groundwater withdrawalor
rechargee.g.,fromwells,infiltration,andleakagebetweenaquiferunits. However,the
interpretation of the availabledata (e.g., pumpingrates, precipitationdata,irrigation
schedules, streamflow records,lake watersurfaceelevations)to determineappropriate
boundaryheador flow valuesis rarelystraightforward.Also,it cansometimes be very
difficultto decidewhichtypeof boundary conditiona particularfeaturerepresents (e.g.,
shoulda lakeberepresented asa constant heador specifiedflow boundary condition,or as
somecombination of thetwo). The effectsof alternativetypesandvaluesof boundary
conditions onmodelresultsalsoshouldbeinvestigated usinga sensitivityanalysis.

20.5 CALIBRATION, VERIFICATION AND PREDICTION

Calibrationistheprocessof adjustingmodelparameters (material


properties,
boundary
conditions,andinitial conditions)until l) the modelis consistent with the analyst's
understandingof thegroundwaterflowsystem andwithall available
data,and2) computed
valuesof headcloselymatchmeasured valuesat selectedpointsin theaquifer(locations
of
wells,springs,etc). The procedure is essentiallyanexercisein "trialanderror"whereina
plausiblesetof modelparameters areproposed, computed andmeasmvA valuesof headare
compared, andmodelparameters areadjusted to improvethefit. Unfortunately thereis no
guarantee thatthevaluesof modelparameters obtainedby thisprocedure areunique.For
thisreasonit is bestto calibratethemodel•isingonlya portionof theavailableheaddata(or
to makeadditional measurements aftercalibration).Thefittedmodelis thenusedto predict
these"reserved" headmeasurements. Theresultsareusedasa quasi-independent checkon
the modelparameters arrivedat by calibration.For example,it is sometimespossibleto
calibratea modelusingmeasurements madeat one time andto verify the modelusing
measurements madeat a differenttime (possiblyusingthe samewells). This stepis
sometimes calledmodelverification.Oncethemodelis calibrated
andverifiedit is ready
for usein prediction (e.g., predictingwatertableresponseto pumping,predicting
groundwater velocitiesfor usein a solutetransport model,etc.).
An alternativeapproach to calibrationis to solvethe inverseproblem,i.e., to compute
thevaluesof modelparameters directlyfrommeasured valuesof head. This approachis
analogousto fittinga lineto a datasetusingregression, exceptthatthenumberof unknown
parameters is muchlarger.An objective functionis defined(e.g.,thesumof thesquares
of thedifferencesbetween measured andcomputed heads)andvaluesof theparameters are
soughtthatmakethevalueof thefunctiona minimum.Thereis a greatdealof literatureon
thissubjectbuttheapproach hasnotbeenwidelyusedin practice(in partbecause of the
theoreticalandcomputational difficultiesinvolvedin succcessfullyfitting a modelwith
manyplausiblecombinations of parameters, a commonsituation). Menke (1984) is an
excellentintroductionto techniquesfor solvingtheinverseproblem.Reviewsof different
approaches for solvingtheinverseproblemin groundwater hydrologyare in Neumanand
Yakowitz (1979), Neuman (1980), and Yeh et al. (1983).

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

452 ModelingRegional
Groundwater
Flow

20.6 MASS BALANCE CALCULATIONS

An additionalcheckon model behaviorthat shouldalwaysbe performedis a mass


balancefor water.If themodelis performing
properly,thechangein theamountof water
stored
in theaquifershould
equaltheinflow(e.g.,through
s•ecifiedheadboundaries
or
injectionwells)minusthe outflow(e.g.,from pumpingwells). For a steady-state flow
problem,thechangein storagewill be zero. For a transientflow problem.thechangein
storagecanbe computed for eachelementin themeshusingthechangein headfor each
nodein theelementandthevalueof storafivity,
specificyield,or storagecoefficientfor that
element. Inflow and outflow at Neumannnodeswill be knownfrom the boundary
conditions, andinflowandoutflowacross Dirichletboundaries canbecomputed usingthe
components of apparent
groundwater velocityfor eachelementon the boundary.If the
resultsof themassbalancecalculationsarepoor,it is probablyan indicationthatthemesh
is toocoarse.Numericalerrorsin computed headsobtained usinga coarsemeshwill cause
errorsin thecalculation
of aquiferstorageandapparentgroundwater velocites.Errorsin
computedvelocitieswill mostimpactmassbalancecalculations at Dirichletboundaries,
wherewateris enteringor leavingthemesh.Refiningthemeshwill alwaysimprovethe
massbalance(unlessthereare grosserrors,e.g., enteringspecifiedgroundwater flows
with the wrongsignor magnitude,etc.).

20.7 REPORTING MODEL RESULTS

Becauseof thevarietyof procedures thatmaybe usedto developa groundwater flow


model it is essentialthatthe analystdocumenteachstepof the processusedto obtain
predictions
in theprojectreport. As a minimumsucha reportshouldcontainthefollowing
information:

1. Assumotions about the eroundwater flow orocesses considered:


For example"two-diniensional,
steadySstate,
saturated
flow of groundwater
with
constant
densitythrougha rigid(nondeformable)
aquifer".Alwaysgive thegoverning
equation(s)
used.
2. I)escriptionof NumericalProcedures
Used:
Show the finite element mesh. Label Dirichlet and Neumann nodes. Give a reference
for thecomputer
programused.
3. Data sources and orocedures used to identify aouifer boundaries:
Forexample
"Th•lowerboundary
of thea•luvial
aquifer
wasassumed
tovarylinearly
betweenalluvium-bedrockcontactsreportedin well logs". In this casethe report
shouldcontaina map showingwell locationsandcomputedelevationsof alluvium-
bedrockcontactandanappendix
containing thewell logs.
4. Data sources
andorocedures
usedto determineaauifermaterialproper0½$,
Forexample,
"Tileaquiferwasassumed
to behomogeneous
andisotropic.Aquifer
hydraulicconductivitywas setequalto the averagevalueof hydraulicconductivity
obtainedfor threewellsusingtheTheissolution(see,e.g.,Bear,1972)andtheresults
of constant
discharge
pumpingtests".In thiscasethereportshouldcontaina map
showingpumpingandobservation
well locations,
drawdown curvesfor thepumping
tests,anda summaryof calculations.

5. Data sources
andprocedures!•sedto determinebounq!0Xy
conditions.
For example,"Theportionof theaquiferboundaryalongtheRedRiver wasmodeled
asa specified
headboundary.Thevalueof headfor thisboundary
wastakento bethe
averageriver stagefor the monthsof OctoberthroughDecember.Dischargefrom

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter
20 453

severaldomestic
water-supply
wellsin thestudyareawereassumed to havenegligible
impactonmodelresults
andwereneglected". In thiscase,thereportshouldcontain
the
stageanddischarge
records
for theriverandthelocationandestimated discharge
rate
for the wells.

6. Resultsof Model Calibration.Verification. and Mass BalanceCalculations.


For example,"Themodelwas calibratedusingten of the availablewaterlevel
measurements(show well locationson a map). Values of model parameterswere
adjusted
bytrialanderroruntilthedifference
between
measured
andpredicted
headsat
eachwell was lessthan0.5 m. The modelwas thenverified usingmeasuredwater
levelsin thefive remainingwells. The maximumdifferencebetweenmeasured
and
predicted
headat thesewellswas1.3m. Results of a massbalance for theaquifer,
performedaftercalibration,indicatedthat 95% of the waterin the aquiferwas
conserved."

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter 21

MODELING SOLUTE TRANSPORT

21.1 PURPOSE OF SOLUTE TRANSPORT MODELING

To "modelsolutetransport" meansto developmathematical andnumericalmodelsof


theaquifersystembeingstudied andto usethesemodelsto predicttheconcentration of a
solute(radionuclide,hazardous waste,pesticide,plantnutrient,etc.) at pointsof interest
for a setof specifiedtimes.. For example,it maybe necessary to estimatethepotential
impacts onhumanhealthof a proposed wastedisposal site,e.g.,a municipal landfill.A
solutetransportmodelcouldbe usedto predictthelikelyconcentration of contaminants
leachedfrom the site in the groundwaterat nearbywells. This is an exampleof site
assessment,the determinationif a site is suitablefor somepurposebasedon the likely
impactof proposed activitieson groundwaterquality. Solutetransport modelsarealso
usedas a basisfor the designof contaminantrecoveryand treatmentsystemsat sitesof
existingcontamination. Forexample,it maybenecessary to installa setof capture
wellsat
a hazardouswastesiteto preventcontaminantmovement off-site.A solutetransport model
couldbeusedto selectthemosteffectivecombination of well locationsandpumpingrates.
Thisis anexampleofperformance assessment,
theevaluation of howeffectivea proposed
designis at meetingtheprojectobjectives.
The first stepin developinga solutetransportmodel is to calibrateand verify a
groundwater flow modelandthecomments in Chapter20 apply. Duringthecalibrationof
the groundwaterflow modelthe emphasisshouldbe on producinga goodfit between
measuredandpredictedaquiferheadsnearsolutesourcesand sinks(e.g., neara waste
injection well). Theseheadswill be usedto computegroundwatervelocitieswhich are
neededas inputfor the solutetransportmodel(recallthatapparentgroundwatervelocities
are usedto computethe rate of solutetransportby advectionand to computedispersion
coefficients,seeAppendixIII). The accuracyof predictedsoluteconcentrations will to a
largepartbe determined by the accuracyof predictedgroundwater velocitiesnearsolute
sources and sinks.
The developmentof a solutetransportmodelwill requireadditionalinformationabout
thestudyarea:

1) to identifythetypeof solutetransportmodelthatshouldbe used,

2) to determine
valuesfor additionalproperties
of theaquiferandthesolute,
3) to det•xmine
valuesandtypesof boundary
andinitialconditions,
and

4) to calibrateandverifythemodel.

21.2 TYPES OF SOLUTE TRANSPORT MODELS

Severaltypesof modelscan be usedto predictsoluteconcentrations in groundwater


flow systems. The modelsdiffer 1) in thetypeof groundwater flow equationusedto obtain
groundwater velocities(e.g.,steady-state
or transientflow, saturated
or unsaturated flow),
and2) in the typesof physical,chemical,and biologicalprocesses consideredin the solute
transportequation(s).In this book we haveuseda form of the solutetransportequation

454
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapt½•
21 455

thatincludesprocesses of advection,dispersion, diffusion,anddecay. The assumptions


usedtoderivethisequation arediscussed in AppendixllI. Caremustbetakento avoidthe
application of thisequation to fieldsituations wheretheassumptions maynotbevalid.
For example,in thisderivation, theaquiferis assumed to beisotropicwithrespectto
dispersionprocesses.This assumption is madeprimarilyfor convenience sincefield
proceduresfor measuringall the coefficientsof a generaldispersionmodel are not
available.Transport by advection is limitedto Darcy-type flow throughtheporespaceand
the equationcannot be usedto predictratesof solutetransportthroughfracturedrock,
largecavitiesin Karstlimestone, lavatubes,etc. Recallalsothatthedensityof thesolute-
groundwater mixtureis assumed constant thereforeinvalidating theuseof thisequationto
predictsoluteconcentrations in thepresence of veryhighsoluteconcentrations or multiple
liquid phases(e.g.,cases with simultaneous flow of gasolineandgroundwaterphases).
Transportin thegasphasewasassumed to be small,thusinvalidatingtheapplication of
thisequation to thetransportof highlyvolatilecompounds abovethewatertable.
A very importantassumption wasthatsorptionprocesses canbe describedusingan
equilibriumdistributioncoefficient,Kd. Althoughthisis a commonassumption in
practice,it shouldbeconsidered a crudeapproximation because of theimportance of other
processes includingcompetition amongdifferentsolutes for exchange sites,reactionsthat
requirerelativelylong periodsof time to reachequilibrium,andmultiple-stepsorption
processes (e.g.,involvingdiffusionthroughan irmnobilewaterlayerbeforesorptioncan
occurat the solidsurface). Severalalternativeformulationsfor the sorptionprocessare
givenin de Marsily(1986) andBear(1979). Similarly,theassumption thatsolutedecay
can be describedusinga simpledecayconstant,)•, althoughappropriatefor certain
radionuclides, shouldbe a considered a crudeapproximation for biologicaldegradation
(e.g.,microbialmetabolism).

21.3 SENSITIVITY ANALYSIS

Justasin thecaseof a groundwater Howmodel,theeffectof uncertainty in thevalues


of model parameters(boundaryand initial conditionsand the valuesof lateral and
transversedispersivity, distribution
coefficient,anddecayconstant)on computedsolute
concentrations shouldbe investigated usinga sensitivityanalysis.In mostsituations the
greatestuncertaintyinvolvesthe selectionof dispersivifies.Ideally theseshouldbe
measuredat the site usinga tracertestbut in mostcasesthey mustbe estimatedfrom
tabulatedvalues(e.g.,AppendixV). However,for longtimesor largedistances advection
tendsto be a muchmoreimportant process thandispersion,andtheeffectsof uncertainties
in dispersivifies
tendsto havelesseffectoncomputed soluteconcentrations,thanfor short
timesand smalldistances.Sometimesthe effectsof dispersion,sorpfion,anddecayare
neglectedentirelyandcomputed soluteconcentrations
basedonlyon ad-vecfion areusedto
assess thegreatestlikelytraveldistancesalonga particularflow path(or theshortestlikely
traveltimesto a particularpoint),whichis sometimescalleda worstcasescenario.
The mostcommonlyoccurringboundaryconditionsare the specifiedconcentration
(Dirichlet) and specifiedflux (Neumann)boundaryconditionsdescribedin Part 1.
Dirichletboundary conditions arecommonlyusedwherea surfacewaterbody(waste
storagelagoon,fiver,etc.)with a fixedsoluteconcentration
is in hydraulicconnection
with
groundwateralonga portionof theaquiferboundary.Specifiedflow boundaryconditions
arecommonlyusedto representsoluteleakageinto theaquiferandsolutewithdrawaland
injectionby wells. However,thedataneededtodecidewhichtypeof boundary condition
a
particularfeaturerepresents
areoftenunavailable,for examplein thepreliminarystagesof
aninvestigationat anuncontrolled
wastesite. Theeffectsof alternative
typesandvaluesof
boundaryconditionson model resultsalso shouldbe investigatedusing a sensitivity
analysis.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

456 ModelingSoluteTransport

21.4 CALIBRATION, VERIFICATION, AND PREDICTION

In thecaseof a solutetransport
model,calibrationconsists of proposinga plausibleset
of modelparameters, comparing measured andpredictedsoluteconcentrations at a setof
points, and adjustingmodel parametersto improve the fit. As in the case of the
groundwaterflow equationthereis no guaranteethat the valuesof modelparameters
obtainedby thisprocedure areunique.For thisreasonit is bestto calibratethemodelusing
onlya portionof theavailabledataandto predicttheremainingconcentrations asa check
onthemodelparameters arrivedatbycalibration. Oncethemodelis calibrated andverified
it is readyfor usein prediction.It may alsosometimes be possibleto obtainvaluesof
certainmodelparameters by solvingthe inverseproblem(e.g., dispersivities are often
computed frommeasm'ed concentrations
in a tracertesO.

21.5 MASS BALANCE CALCULATIONS

Just as in the case of groundwaterflow a massbalancefor the solute shouldbe


computed asa checkon modelbehavior.If themodelis performingproperly,thechange
in the amountof solutestoredin the aquifer shouldequal the inflow (e.g., through
specifiedconcentration boundaries or injectionwells)minustheoutflow(e.g.,pumping
wells). The changein storagecanbe computedfor eachelementin the meshusingthe
changein concentration for eachnodein theelementandthe element'ssize,shape,and
porosity. Inflow and outflow at Neumannnodeswill be known from the boundary
conditions,and inflow and outflow acrossspecifiedconcentrationboundariescan be
computed usingthecomponents of apparent groundwatervelocityandthecomputedsolute
concentration at the nodesof eachelementon the boundary.If theresultsof themass
balancecalculations arepoor,it is probablyanindicationthatthemeshis toocoarse.

21.6 REPORTING MODEL RESULTS

Because of thevarietyof procedures


thatmaybeusedto developa solutetransport
model it is essential
thatthe analystdocument
eachstepof theprocessusedto obtain
predictions
in theproject
report.Asa minimumsucha reportshould
containthefollowing
information:

1. Assumotions about the solute u'ansoort orocesses considered:


Listth•assumptions
usedtoderiv•the-governing
equation(s)
used.Comment
onthe
applicability
of theseassumptions
to theconditions
at thesite.
2. Descriution of Numerical ProceduresU•½d;
_

Show the finite element mesh. Label Dirichlet and Neumann nodes. Give a reference
for thecomputer
programused.

3. Datasources
andurocedures
usedtodetermine
aquifermatexial
properties.
Forexample,
"Theaquifer
wasassumed
tobehomogeneous
andisotropic
withrespect
to dispersion.Lateralandtransversedispersivities
wereestimated usingtabulated
values(givereference).Decayandsorption wereassummed to be negligible".Or,
"Lateralandtransverse
dispersivities
wereestimatedusinga tracertest(givereferences
and showdata)".

4. Data sourcesandurocedures
usedto determineboundgryconditions.
Forexample,
"TEeportion
of theaquifer
boundary
alongtheRedRiverwasmodeled
as a specifiedconcentration
boundary.The valueof concentration
for this boundary
wasassurereed
to bezerobasedonwaterqualitymeasurements
takenupstream
of point

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Chapter21 457

5. Results of Model Calibration. Verification. and Mass Balance Calculations.


For example,"Themodelwascalibratedusingmeasured concentrationsin five wells
(showwell locations ona map). Valuesof modelparameters
wereadjusted by trial and
erroruntil thedifferencebetweenmeasured andpredictedconcentrationsat eachwell
waslessthan25 ppm. The modelwasthenverifiedusingmeasured waterlevelsin the
six remainingwells. The maximumdifferencebetweenmeasuredand predicted
concentration at thesewellswas47 ppm. Resultsof a massbalancefor theaquifer,
performedafter calibration,indicatedthat 95% of the solutein the aquifer was
conserved.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Appendix I

DERIVATION OF EQUATIONS OF
STEADY-STATE GROUNDWATER FLOW

Considera unitvolumeof saturated


porousmedia(FigureAI. 1). In fluid mechanics,
such a volume is called a control volume. The boundaries of the element are called control
surfaces.

portionof
control surface

pt):

@l)y •z
p13y+
•'•(p'Oy)
pt)x+
•x Y
control volume

Figure AI.1 Control volume for groundwater flow through porous media.

Thelaw of conservationof massfor steady-state


flowrequiresthattherateat whichfluidis
enteringthecontrolvolumeisequalto therateat whichfluidis leavingthecontrolvolume
or

net rate of inflow = inflow - outflow = 0 (AI. 1)

For purposes
of analysis,considertherateat whichgroundwater
entersthecontrolvolume
perunitsurface
areatoconsist
of threecomponents
P•x,PUy,andpx>
z wherep isthe
density
ofwaterand•x, uyand•z aretheapparent
velocities
ofgroundwater
flowentering
thecontrolvolumethroughcontrolsurfacesperpendicularto the x, y, and z coordinate
axes.
Thedimensions
ofpvx,pry,
and
pvzare
M/L2T.
Using a Taylor Seriesapproximation,the rate at which groundwaterleavesthe control
volume in the x direction can be written

458

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Appendix
I 459

If we make the size of thecontrolvolumesmall,we canneglecthigher-order


terms(i.e.,
thoseinvolving
A2,A3etc.)
and,because
wehavechosen
aunitcontrol
volume(Ax=Ay
= 1)therate
atwhichgroundwater
leaves
thecontrol
volume
isph+•x(pOx).
Thenetrate
of
inflow in the x direction is then

net rate of inflow = rate of inflow - rate of outflow


in x direction in x direction in x directon

=- (AI.3)

and
the
net
rate
ofinflow
inthe
yand
zdirections • ) and
are-•(O• - -•(put),
respectively.
Becausethe netrateof inflow for theentirecontrolvolumemustequalzeroif the law of
conservationof massis to be satisfied,we can write

- •x(pU,,)
- •(p•)y)
o
• - •(p•),)
o
• =o (AI.4)

If we assume
thatgroundwater density,p is constant(i.e., thefluid is incompressible),
we
canusetheproductroleof calculus
toevaluate a typicaltermin equation AI.4

a
- •'•(PUx)
= - P'•'•'+
= -P •x
(AI.5)

Similarlyfor the x andy directions.Becausegroundwater


densityappearsoutsidethe
derivativeit cancelsfromequationAI.4 andwe have

i•x i•y /}z= 0 (AI.6)


Now theapparent
groundwater
velocitiesaregivenby Darcy'sLaw

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

460 Derivationof Equations


of Steady-State
Groundwater
FlowProblems

whereKx, Ky andKz arethehydraulic


conductivities
in thex, y, andz directions,
respectivelyandh is the hydraulichead. Substituting
equationAI.7 into equationAI.6.
We arriveat thesteady-state,
saturatedflow equation.

If flow is two.dimensional,
equation
AI.8 simplifiesto

+ o (^I.9)

and if the flow is one-dimensional,we have

•'•k,x•'•',y:0 (AI.10)
If a componentof hydraulicconductivityis independent of positionfor a particular
direction(i.e., is the sameat all pointsalonga line orientedin that direction),we can
furthersimplifyequationAI.8 usingtheproductrule. For example,if K x is independent
of postionx

•)f0h'•
_O2h
0h•
=

•2h
= Kx
•x2
(ALIi)

Similar
terms
can
beobtained KzifaKv
forKyand aK'z
a•':'•' =0.Inthis
case
wesay
the
porous
mediais homogenous
andequationAI.8 simplifiesto

K •2h _ •)2h _ •)2h


(AI. 12)
--+Ky•y2
X•}x2 +• • =0
Finally,if Kx = Ky= Kz = K, a constant
wesaytheporous
mediais homogeneous
and
isotropicandequation
AI.8 simplifies
to

•)2h •)2h •)2h


•-+-•+-• = 0 (AI. 13)
•x2 •y2 •z2
whichis knownto mathematicians
asLa Place'sequation.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Appendix
I 461

If theporousmediais notsaturated,
thevalueof hydraulicconductivity
at a pointis a
functionof thepressure
headof thewaterin thevoidsat thatpoint

K = K(W) (AI. 14)

where•Fisthepressure
head.Substituting
equation
AI.14intoequation
AI.8 yields
• •h • •h • •h
+ +•(Iq(v)•)=0
for thecasewheretheunsaturated hydraulicconductivity functionis differentin thex, y,
andz dir•fion$. Recallingthedefinitionof hydraulichead

h -- ß + z* (AI. 16)

wherez* is theelevationhead( i.e., theverticaldistancefrom anypointto an arbitrary


datum). If thez coordinate
axisis assumedto bevertical

• = (v+z*) = •+
=•
(AI.•?)

s'nnilarly

and

ah a • •
a'•= •(V+z*)= •+ •+ •
(AI. 19)

Substituting
equations
AI. 17, 18, and 19 intoequationAI. 15 gives

(AI. 20)

whichis thesteady-state,
unsaturated
flow equation.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

462 Derivation
of Equations
of Steady-State
Groundwater
FlowProblems

Problems

1. AppendixI haspresented thederivationof theequations of steady-stategroundwater


flow for a rectangularcoordinate •ystemi.e., a coordinate
systemdefinedby thethree
orthogonal coordinateaxesx, y, andz. In somesituations, for examplein thecaseof
groundwater flow to a well,it is moreconvenient to workin a cylindricalcoordinate
systemi.e.,in a coordinatesystem der'reed
by thetwoorthogonal coordinate axesr, 0,
and z (Fig. AI.2).

(r + Ar)fil3

Figure AI.2 Control volume for groundwater flow through porous media in
cylindrical coordinates.

a. Usingthesameapproach presented
in thischapterderivethe steady-state,
saturated
flow equationin cyh'ndrical
coorob'nates

J/ •}hX KrSh 1 J/ Jh • J/ •}h'•


(AI.20)

b. Derivethesteady-state,
unsaturated
flow equationin cylindricalcoordinates

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Appendix
I 463

2. We can often use symmetryto reducethe dimensionalityof a flow problemin


cylindricalcordinates.In thecaseof groundwater flow to a well, it is commonto
considerthewell to be an axisof symmetry.This is only role howeverif the aquifer
geometry(i.e., the positionof the soil surfaceand soil and rock layers), the
components of hydraulicconductivity, andthe specifiedboundaryconditionsare all
independent of angular
coordinate 0. In thiscasethederivativesof headwithrespectto
0 vanishandwe saytheproblemis axisymmetric.Showthattheaxisymmetric forms
of the steady-state
saturatedandthe steady-state unsaturatedflow equationscan be
written

(AI.22a)

•(Kr(¾)•)
+ r-•--•
+•, ,.(••,•.+1))=0 (AI.22b)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Appendix II

DERIVATION OF EQUATIONS OF
TRANSIENT GROUNDWATER FLOW

The law of conservation


of massfor transientflow requiresthatthenetrateat which
fluidentersa controlvolumeis equalto thetimerateof changeof fluidmassstoragewithin
the control volume.

netrateof inflow = inflow- outflow = rateof changein storage (AII. 1)

Fromequations
AI. 1 andAI.4 we canwrite

netrate
ofinflow
= -•(P")x)- (P")y)
- (Pt)z) (AII.2)

In steady-state
flow, thechangein storagewithin thecontrolvolumeis zero. In transient
flow, thechangein storageis notzeroandequationAH.2 becomes

-•(P'Ox) (p'0y)
- •zz(p'0z)
= (AII.3)

I I
netrateof inflow rateof change
in storage

where
nistheporosity
oftheporous
media.
Thedimensions
oftheterm•(pn)areM/L3T
or the timerate of changeof fluid massper unit volumeof the controlvolume. Now
assume thattheporous mediais saturated.
Thenusingthechain-rule wecanexpandthe
right-handsideof equationAH.3

• (pn)= •-•(pn)
• 8h •- (AII.4)

wherewecanseethat,in transient,
saturated
flow,therateof change
in fluidstoragein the
control
volumeisrelatedtotherateof changein hydraulic
head.Usingtheproduct rulewe
canexpandthefirsttermontheright-handsideof equation
AH.4

•h(pn)= p•-•
•n+ n•-•.
•p (AII.5)

ThefLrSt
termontheright-hand sideof equation
AII.5 is themassof waterproduced bythe
expansionor compression
of theporousmediaandthe secondtermis themassof water
produceby the expansionor compression of the fluid. In the caseof saturated
flow,
water
canonly
enter
thecontrol
volume
ffthe
porosity
increases
• >0 orthe
fluid
density
464
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Appendix
II 465

To continuewe mustdefinetwo new terms:theporousmediacompressibilityczand


thefluid compressibility
•. Compression orexpansionof theporous
mediais caused
by a
change in effective
stress
oe. If theporous
mediais saturated

dae = -pgdxl/ (An.6)

where
¾isthepressure
head.
Butsince
dxl/=
d(h- z*)= dh- wecan
write
doe = -pgdh (ArL7)

Nowdefinetheporous
mediacompressibility
dVf 1 dn
(An.8)
•x=- V dae doe
whereVf isthevolumeof fluidandV is thecontrol
volume.Combining
equations
AH.7
and AH.8 we have

• = o•pg (AH.9)
Thefluidcompressibility
[•isdefinedas

dVf 1
[•: -•f-f
• (,aJI.
10)
wherep is thefluid pressure.The changein pressure
is givenby

dp = pgdv = pgdh (AII. 11)

andwithdVi/Vf = dp/pequation
AH.10becomes

[•=dp 1
-•-pg• (AII.
12)
or

dp
•' = p2g[• (AII.
13)
Substituting
equations
AH.9 andAH.13 intoequationAII.4 gives

-•(pn)
: (•)n
p•-•+ _•p•h

: (p2ga+np2g]3)•
- (AII. 14)

Nowdefinethespecific
storageSsas
$. -- pg(o•+ (AII. 15)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

466 Derivation
of Equations
of Transient
Groundwater
FlowProblems

Thedimensions
ofSsareL-1representing
thevolume
ofwater
that
aunit
volume
ofaquifer
releases
fromstorage for.a unitdeclinein hydraulichead. Substituting
equation
AII. 15into
equationAII. 14 gives

•(pn)
= P$s•'
•)h (AII.16)
andsubstituting
equationAH.16 intoequationAII.3 we have

•'(p't)y)
- (AII. 17)

If we assumethatdensityis constantin the threecoordinatedirectionsequationAII. 17


becomes

P(- •(3!J
x- •-
•Uy c•U,
- -•-•..)3h
=pS,.•]- (AII.
18)
Cancellingp frombothsidesof equation
AH.18 andusingDarcy'sLaw we arriveat the
transient,saturated-flowequation.

• / •h'• • / •h'• • / 3h'• S•h


(AII. 19)

If theporous
mediais homogeneous,
Kx,Ky,andKz areconstant
andequation
AH.19
reduces to

Kx•)2h
•x2 _ •)2h
Ky•y2_ •)2h
Kz•z •)h
2 Ss• (AII.20)
If •e porous
me•ais•soiso•pic,Kx= Ky= • = K,equation
AH.20is•uen
•)2h •)2h •)2h= --..--
Ss•)h
----+----+----. (An.21)
•)x2 3y2 •)z2 K •t
whichis knownto mathematicians
as thediffusionequation. For thespecialcaseof
horizontal,
two-dimensional
groundwaterflowin a confined
aquiferof constant
thickness
b
equationAH.21 simplifiesto

•)2h 32h So3h


(A1'I.22)
(3x
2 (3y2 T
whereS = SsbandT = Kb.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Appendix
II 467

In transient,
unsaturated
flow,thedegreeof saturationof theporous
mediawithinthe
controlvolumechanges
with time

6' -- o'(t) (AH.23)

where0' is thedegreeof saturation.Themassof fluid,withinthecontrolvolumeis now


pn0'instead of lan.Substituting
thistermintoequationAH.3gives

- - - =•(pn0
a ,) (AII.24)
Expanding
thetermontheright-hand
sid•of equation
AII.24 usingtheproduct
rulegiv•

• (pn0')= pn•-
•0'+ p0,•}n ,•p
•. + nO
•. (AII.25)

Now
ifweassume
that
•. >>•. and
•. >> , thelast
two
terms
ontheright-
hand
side
of
equationAII.25 canbediscarded.
Takingp'soutsidethederivativesin theleft-handside
of equation
AH.24andcancellingp frombothsidesof equation
AII.24 gives

- •x(•X)_
3 - •z(uz)
•(Uy) = n-•- (AII.26)
If wc nowsubstitute
Darcy'slaw for unsaturated
HowintoequationAII.26 wc have
• ah • •h • ah
•(K•(¾)•)
+ •(Kz(¾)•) (AII.27)
Recallingthedefinitionof volumetric
watercontent(0 = nO')we canwrite

n-•- = •, (AII.28)
If we definethespecificmoisturecapacityC(¾)
dO
(AII.29)

where
Wisthepressure
headandrecallthedefinition
ofhydraulic
head(h= ¾ + z* ), we
canrewriteequationAII.27 as

(AII. 30)

whichis the equationfor transientunsaturated


flow. EquationAII.30 is alsoknownas
Richardsequation.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

468 Derivation
of Equations
of Transient
Groundwater
FlowProblems

Problems

1. Derive thetransient,saturated
How equationin cylindricalcoordinates

•)(KC3h'•
Kr•)h1 c3
Z' •)h• •)/ c3h\ c3h
(AH.31)

2. Derivethetransient,unsaturated
flow equationin cylindricalcoordinates

+ + + + = C(v)•
(AII.32)

3. Rewriteequations
AII.31 andAII.32 for problems
withaxisymmctry.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Appendix III

DERIVATION OF EQUATIONS OF
SOLUTE TRANSPORT

Consider
a unitvolumeof porous
media(FigureAIH.1). Asin Appendix
I, wereferto
sucha volumeasa controlvolumewith boundaries
calledcontrolsurfaces

•(Fz)
portionof
control surface

Fx

Fy+•(Fy)
F•+
control volume

FZ

Figure AIH.I Control volumefor solutetransportthroughporousmedia.


The law of conservation
of massfor solutewansport requiresthattherateof changeof
solutemasswithinthecontrolvolumeisequalto thenetrateat whichsoluteis entering
the
controlvolumethroughthecontrolsurfacesplusthenetrateatwhichsolute is produced
withinthecontwlvolumebyvariouschemical andphysical processes.
rateofchange= netrateof + netrateof
of solutemass soluteinflow soluteproduction (Alii. 1)

Forpurposes
of analysis,
consider
therateat whichsoluteentersthecontrolvolumeto
consist
ofthree
components
Fx,Fy,andFz thatareparallel
tothex,y,andz coordinate
axes,
respectively.
Thedimensions
ofFx,Fy,and
FzareM/L2T.
The rates at which solute leaves the control volume are

in the x direction,
F•+ •(F•)
Fy
+•-•(Fy)
in they direction,and

in the z direction,
F,.+ •(Fz)

469
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

470 Derivationof Equations


of SoluteTransport
Problems

(which
canbeobtained
froma Taylor's
series
approximation
asinAppendix
I). Thenet
rate of soluteinflow is thedifferencebetweenthe inflowandoutflowfor each component

(ALII.2)

In porousmedia,solutetransport
occursby threeprocesses:
advection,diffusion,and
mechanical
dispersion.

Advection

The processby which solutesare transportedby the bulk motionof the flowing
groundwateris calledadvection. The rateof solutetransportthatoccursby advectionis
givenby the productof the soluteconcentrationC andthe components of the apparent
groundwater
velocity
vx,Vy,andvz. In terms
ofthethree
components
ofsolute
transport
in thex, y, andz directions,
therateof solutetransportby advectionis

Fx)Advectio
n = vxC

Fy)Advection
= vyC (AIII.3)
Fz)Adve.
ction= vzC

Diffusion

Theprocess by whichsolutesaretransported by therandomthermalmotionof solute


moleculesis calleddiffusion.Therateof solutetransportthatoccursbydiffusionis given
byFickøsLaw. In termsof thethreecomponents of solutetransport
in thex, y, andz
directions,
therateof solutetransport
bydiffusion is givenby
,•c
Fx)Diffusio
n= - D •
,3C
Fy)Diffusio
n= --D• (ALII.4)

Fz)Diffusion
= --D*3C

where
D*isthesolute's
apparent
diffusion
coefficient.
Theapparent
diffusion
coefficient
for a solutein porousmediais muchsmallerthanthe diffusioncoefficientfor the same
solute
in aqueous
solution,
D0. An empirical
relationship
forD* canbewritten

D* = m(0)D
0
orous'• (aq.ue.ous'•
rn•a ) k,solut•on
)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

AppendixIH 471

wherem(0)isanempirical correction
factor thatis a function
of thevolumetric
water
content.Valuesof mtypically
rangefrom0.01forverydrysoilsto 0.5forsaturated soils.
Valuesof theapparent
diffusion
coefficients
forthemajor,naturally-occurringconstituents
of groundwater
(eg.,Na+, K+, Mg2+,Ca2+,CI-,HCO•,andSO•
ß
2-)areintherange
1x10-sto1x10
-løm2/sat25'C. Apparent
diffusion
coefficients
arestrongly
temperature
dependent (forexample,valuesof theapparent
diffusion
coefficient
areabout50%smaller
at 5' C thanat 25' C), but are only weaklydependent on the concentrations
of other
dissolved species.
The smallsizeof apparentdiffusioncoefficientmeansthattherateof solutetransport
by diffusionis usuallynegliblysmallrelativeto theratesof solutetransport
by advection
anddispersion.

Mechanical Dispersion

Mechanicaldispersion(or hydraulicdispersion) is a mixing or spreadingprocess


causedby small-scale fluctuations
in groundwater velocityalongthe tortuousflow paths
withinindividualpores.On a muchlargerscalemechanical dispersion canalsobecaused
bythepresence of heterogeneifies
(e.g.claylenses or faults)withintheaquifer.Therateof
solutetransportby mechanicaldispersion is givenby a generalized formof Fick'sLaw of
diffusion. In terms of the three componentsof solute transportin the x, y, and z
directions,
therateof solutewansportby mechanical dispersion is givenby

Fx)M•:hanical
Dbpersion
----
--Dxx3-•(ec)-
Dxy•(0C)-
Dxz•(0C)
Fy}M•:hanical
Disp•ion-----
DyX•x(eC)-Dyy•y(ec)-Dyz3
(Am.6)

Fz)Mechanica•
Dispersion---
Dzx•x(OC)
- Dzy•y(OC)
- Dzz•z(OC)
where
Dxx,Dxy,etcarethecoefficients
ofmechanical
&'spersion.
These
coefficients
can
becomputed
fromtheexpression.

Vm Vn
(AIII.7)
Dij
=aijkm
•2m+_
2 Vn

wherethesubscripts
i andj refertothethreecoordinate
directions
x, y, andz, •mand•n are
the components of thepore water velocity (as opposedto the apparentgroundwater
velocity usedin Darcy'sLaw),andthe subscripts m and n refer to the directionsof the
principalcomponents of porewatervelocity. Componentsof theporewatervelocityare
computedfrom
ß

•x = vx/O

= vy/O (Am.8)

•,_ = v,/0

where0 is thevolumetric
watercontentof theporousmedia.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

472 Derivation
of Equations
of SoluteTransport
Problems

Theterms
aijkm
arethecomponents
oftheaquifer's
dispersivity.
If theaquifer
is
assumed
to be isotropic
withrespect
to dispersion,
all components
of theaquifer's
dispersivity
arezeroexcept
for
aiiii --a L

aiiij = aT (Am.9)
1
aijij= aijji= •(aL- aT),i • j
whereaLis thelongitudinal dispersivity
andaT is thetransversedispersivity
of the
aquifer."Longitudinal"
refers
toadirection
along theflowpathand"l•ansverse"
refers
toa
directionat rightangles
to theflowpath. In thiscase,thecoefficients
of mechanical
dispersion
canbecomputed
fromthefollowing
expressions
--_ -2 -2 -2

D•y= D,x= t(aL-aT


)•'x•y
] I I•1
Dxz
= D== [(al.
'- aT)•'x•z
] I I•1 (ALII.
10)
-2 -2
•,, = [ar(v,+,z)+ a,_v, ] [ I•1
V,z= % = [(a,.-a•)O, Oz] / I•1
D= [aT
----
(v,,+ v,) + a•.v•
-2 -2 -2
] ! I•i
where
]•l = 4.V2 -2+ V-2
x 4-Vy z . Inatwo-dimensional
problem
equation
AIII.
10becomes

D•--'[aTgx
2+ally
2] I I•1
(AIII. 11)

]ol = 4•x2
where -2 Inaone-dimensional
+Vy. problem,
equation
A1U.
10becomes
Du = Dx = alex (Alii.12)
If wehaveuniformflowin thex-direction
(vx• 0, Vy= vz = 0) in a three-dimensional
aquifer,equation
AIII.6 simplifies
to

Fx)Mechanical
Disix'rsion
-----Dx•-•(0C)
Fy)M•hanical
Dispersion
TM
-Dy
•y(0C) (ALII.
13)
Fz,)Mechanical
Dispersion
=- Dz
•(0C)
where
Dx= aLvx,
Dy= Dz= aTV
x.If we substitute
equations
A1TI.
13 andAffl.3into
equation
AIII.2 andneglect
theconuibution
of diffusion
wehave

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

AppendixrrI 473

net
rate
ofsolute
inflow
=

3z
or

Net Rate of Solute Production

Severalprocesses
can act as sourcesor sinksfor solutewithin the controlvolume
includingsorption/desorption,
chemicalor biological
reactions,
andradioactive
decay.
Considerthecaseof transport
involvinga sorption/desorption
reaction

between
adissolved
species
A anda sorbed
species
,•. Thenetrateofreaction
r, canbe
written

r = O•- =-Pb•' (Am.15)


where0 andPb,respectivelyaretheporosityandbulkdensityof theporousmedia,C is
theconcentration
of thedissolved
species
A (massof solute
/ volumeof groundwater
), and
[2istheconcentration
ofthesorbed
species
• (mass
ofsolute
/ mass
ofdryporous
media).
EquationAlii. 15 canalsobe written

r = -kfC + Icrc (Am.•6)

wherekf istheconstant
fortheforwardreaction(A--•A) and kr is therateconstant
for
thereversereaction
(•---)A).A ratelawofthismathematicalform,for examplecouldbe
usedif thesorption
process canbedescribedby a first-order,
reversible
reaction
or by a
combinationof lineardiffusionanda linearequilibrium
isotherm.
If we assumethat thenetrateof reactionis zero (i.e.,thereaction
is in equilibrium),
equation
Alii. 16canbesolved directlyfortheconcentration
of thesorbed
species A

• =•C=KoC (AITI.
17)
whereKd is theequilibriumdistributioncoefficient(L3/M). The net rateof solute
productiondueto a sorption/desorption
reactionbetween a soluteandtheporous media
withinthecontrolvolumecanbeobtained
bycombining equations AIII. 15andA_UI.
17and
introducing
thevolumetric
watercontent
of theporous
media0

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

474 Derivationof Equations


of SoluteTransport
Problems

(AIII. 18)

If the solutealso undergoesradioactivedecayor biologicaldegradation,the net rate of


soluteproduction by thismechanismcanbe written

a(oc)'l =4,(oc+bKC) (Am. 19)

where•. is thedecayconstant
for thesolute.
IntegratingequationAHI. 19 gives

(0C+PbKdC)t
= (0C+PbKdC)%e
-xt (ALII.20)

wherethe left-handsideis themassof solute(dissolvedandsorbed)in thecontrolvolume


at somefuturetimet andthefirsttermon theright-handsideis theinitialmassof solutein
thecontrolvolume.We canseethatequation
AHI.19 appliesto processes
thatdisplay
exponential
decay.The half-lifeT for sucha process
is def'med
by
(0C + @bKdC), 1
•'0C
+PbKaC)%
= -• att=T (ALII.21)
whichgives

-•T 1 ln2 0.693


e =• or X= T = T (ALII.22)

Solute Transport Equation

If we substitute
equations
AIH.14, AIII. 18,andAIH.19 intoequation
Alii. 1 andwrite
therate
ofchange
ofsolute
mass
inthecontrol as••(•c), wearrive
volume atthesolute
transportequation
for uniformflow
,, , ,

z(Oc)
(AIII.23)

If theporousmediais saturated,
0 = n, andequation
Arrl.23canbewritten

(Am.24)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

AppendixlII 475

Similarequations
canbewrittenforuniformgroundwater
flowin they or z dixections.
If
we definea retardan'on
factor, R to be

PbKd
R = 1+ (ALII.25)

equationAK[.24 canbewritten

(Am.26)

If thegroundwater
flowisnotuniform
(vx • 0, Vy• 0, vz • 0)therateof solute
transport
bymechanical
dispersion
is givenbyequation
Am.6. Thenetrateof soluteinflowintothe
control volume becomes

net
rate
ofsolute
inflow
----•xlvxC
- D(OC)
-Dxx - D(OC)-DxzD(•z
•}X -Lixy C))
-••--•(vyC
-•}(OC)
-Dyx _ •}(0C)_
•x -DYY'•y -uyz•}(OC)'•
8z j

- D•, 8y -
or

net
rate
ofsolut•
inflow---
•-•
(vxC)-•-•(vyC)-•(vzC)
+Dxx ,,, - 8•(oc)_ 8•(oc)
ø•2(0C)
a +D•y8xay'
ax +•" axSz
- a2(0c)+D
8•(0C)
- a•(0C)
+Dyx
8ySxYY8y2
'+Dyz'
8y•iz
ø•2(0C)-- a2(0C)
D
+Dz•az•x+u• az•Y+ • •z•
(AIII. 27)

If we substitute
equations
AIR.18,ALII.19,andAIII.27 intoequationAm. 1 andwritethe
rate
ofchange
ofsolute
mass
inthecontrol
volumea(0C),we
as-•- arrive
atthesolute
transport
equationfor nonuniformflow

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

4?6 Derivationof Equations


of SoluteTransponProblems

a(ec)
,,,

(AIII. 28)

If theporousmediais saturated,O= n, andequationALII.28canbe written

EquationAHI.29 canalsobe writtenusingtheretardation


factor(equationAIII.25)

-•xk n ]- o•yk
n Y- c3zk
n ]-),.RC (Am. a0)

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

AppendixIII 477

Problems

1. Derivethesolutetransport
equation
for problemswithaxisymmetry.

0(0c)
Ot

(Am.31)

2. Rewriteequation
AIII.26 if theporousmediais saturated

(AIII.32)

3. Usingdatafroma fieldtracertest,thelongitudinal
andtransverse
dispersivity
of an
aquiferweredeterminedto bc 12m and1 m, respectively.
Computethecoefficients
for mechanical
dispersion
for eachelementin themeshshownbelow

element v v

1 2 -2

'(1)/ 2
3
3
3
-1
0

(2)
4 3 1
5 2 2
q,

6 2 3
7 3 -1
8 3 0
9 3 0
qw 10 2 1
11 2 1
12 2 2

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Appendix IV

CONCEPTS FROM LINEAR ALGEBRA USED IN


THE FINITE ELEMENT METHOD

Thefiniteelementmethodinvolvesmanyoperations onsystems of equations


andthese
arebesthandledusingmatrices.A typicalsystem
of linearalgebraic
equationshastheform

(AIV.•)

whereeachof then equations containsm unknowns ( x1,x2..... xm) andm+l known


coefficients
( theall, ai2,.... aim,fi, wherei is anyequation ). Equation
AIV. 1 canalso
be writtenin matrixform as

a• a•2'" a•m][X• f•
(AIV.2)

where each set of terms enclosedin bracketsor bracesis a matrix (plural matrices).A
matrixis simplya rectangular
arrayof numbers.If we usecapitallettersto denotedeach
mau'ixin equation
AIV.2 wecanrewritethatequation in theform
[A] {X} = {F} (AIV.3)

where

alla12
'" aim] Xl
(AIV.4)

A matrix consists of one or more rows of numbers and one or more columns of numbers.
Thus the matrix A containsn rows and m columns,the matrices {X} and {F} containm
rows and 1 column. A matrix with 1 row is termed a row matr/x. A matrix with 1 column
is termeda columnmatrix or vector. Thusmatrices{X} and {F} arevectors. Someother
der'tuitions are

478

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

AppendixIV 479

1. The size of a matrix is the number of rows and columns the matrix contains. The size
is writtenastwo numbersseparated
by an "x"representing
a cartesian
producte.g. 3 x
2 where the first number is the number of rows and the second is the number of
columns. Someexamplesare

4
35 12
size: 3x 3 3 xl 2x 3

2. A squarematrixhasanequalnumber
of rowsandcolumns
( n = m ). Someexamples

13
lxl 2x2 3x3

3. The main diagonal of a matrixis the setof positionsin the matrixwherethe row
numberandcolumn numbersareequal.If weuseaijtodesignateanynumber
thatisin
rowi andcolumn
j thenthemaindiagonalisgiven
byaijforalli =j. Some
examples

4. In a symmetric
matrix thenumbers
in positions
on opposites
sidesof themaindiagonal
areequal.Thatisaij= ajiforalli,j. Some
examples

2
a12 = a21 a12 = a21
a13 = a31
az• = a•

5. In a diagonalmarr/x,all positionsin thematrixnoton themaindiagonalarezero. That


isaij= 0 foralli •ej. Anexample

/ 1
o o',.A LO ',.J

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

480 Concepts
fromLinearAlgebrausedin theFiniteElement
MethodProblems

6. Theidentity
matrixisadiagonal
matrix
where
aij= 1foralli =j. Anexample

1 also written 1
0

An identitymatrixis usuallydesignated
by the letter[I] regardless
of the sizeof the
matrix.

7. In upperandlowertriangularmatricesall positions
belowandabovethemaindiagonal,
respectively
areoccupiedby zeros.Someexamples

2 also written 4
54 543
lowertriangularmatrix

2 also written 2
00
uppertriangularmatrix

8. Thetranspose
ofa matrixisamatrixobtained
byinterchanging
numbers
usipgtherule
aij = aji
transpose original

The superscript
"T" isusedtodesignate
thetranspose
of a matrix.Someexamples

lB]:[4
5 3
9. Matrix addition involvesthe additionof entriesin corresponding
positionsof two
matrices
toformanewmatrix.
If [C]= [A]+ [B]thencij= aij+ bijforalli andj. An
example

[A] = 5 lB]= 4
8 7

[C] = [AI + lB] =


(4+3)
(5+4)
(6+5)•
= 173171
(7+6) (8+7)

Matrix additionis commutative(i.e., [A] + [B] = [B] + [A]) andassociative(i.e., ([A] +


[B]) + [C] = [A] + (lB] + [el).

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

AppendixIV 481

10. Matrix subtractioninvolvesthesubtraction


of numbersin corresponding
positionsin
twomatrices
toformanewmatrix.If [C']= [A]- [B]thencij= aij- bijforall i andj.
An example
1

(6-2) (3-1) (4-0), 2


Matrix subtraction is commutativc and associative.

11. Matrixmultiplicationof a pairof matrices


[A] and[B] to forma newmatrix[C] is only
definedif thenumberof columnsof [A] is equalto thenumberof rowsof lB]. If the
sizeof [A] is n x m andthethesizeof [B] is m x r, thenmultiplication
of thesetwo
matricesis givenby

It] = [AI [B]


nxr nxm mxr
where

cij--•a•bkj
k=l
i=lton,j=ltor
The numberof rowsof [C] is thesameasthenumberof rowsof [A] andthenumberof
columnsof [C] is thesameasthenumber of columns
of [B]. An example

[C]
=[Ai[B]
=[(1)(5)+(2)(8)
2x32x22x3(1)(6)+(2)(9)
(1)(7)+(2)
(3)(5)+(4)(8)
(3)(6)+(4)(9)
(3)(7)+(4)(0)J

_[21
24
7]
47 54 21

Matrix multiplication is notcommunative


(i.e., [A][B] ½ [B][A]) but it is associative
(i.e., ([A][B])[C] = [A]([B][C])).

12.Thedeterminant of a matrixis a singlenumber


thatisonlydefinedforsquarematrices.
Thedeterminant hasseveraluses,principlyin matrixinversion
(to bedescribed
next).
Although
it is possibleto calculatethedeterminant
fora squarematrixof anysizewe
only needto considerthreecases:

a.Let[A]= [all]. Then


thedeterminant
of[A]written
[A[ =all
lxl

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

482 Concepts
fromLinearAlgebrausedin theFiniteElementMeff•odProblems

b.Let[A]
=La21
[al!a22J
a121
2x2

Then IAI= alia22-a12a21

Example

[AI = (2)(4)-(1)(3)= 5

c. Let [A] =
alla12
a131
a21a22a23[
3x3 a•l a•2 a•.{

Then IAI= all(a22a33


- a32a23)
- a12(a21a33
- a31a23)
+ a13(a21a32
- a3]a22)
Example

[A] = 0 1
32

{A{ = 1(1 - 0) - 2(0 - 0) + 3(0 - 3) = -8

13. The inverse of a matrixis a new matrixof the samesizeas theoriginalmatrix. The
inverseoperationis only definedfor squarematriceswith nonzerodeterminants.
Althoughit is possibleto calculatetheinverseof a squarematrixof anysize(althoughit
is verydifficultfor largematrices), we onlyneedto considerthreecases:

a. Let[A]= [all].Then
theinverse
matrix
for[A]written
[A]-] is

a2] a22.] [A]-I 1 r a22


-al2]
='{•'•L-a2!
allj
Example

{A{= (2)(3)-(5)(1)
=1

[A]-I=
11-[_31
-253
= [__31
-253
alla12
a13]
c.Let
[A]
--a21
a22
a23
{. Then
[A]
-1--
i--•{[B]T
a•l a32 a33.1

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

AppendixIV 483

b12
b13] .
TI•
matrix
[B]
=[bb::
b22
b23
Lbs•
t•2 is
called
the
classicaladjoint
matrix
of
the
matrix
[A].
The entriesof lB] aregivenby

bll = a22a33- a23a32


b12=-a21a33 + a23a31
b13= a21a32- a31a22
b21=-a12a33 + a13a32
b22= alla33 - a13a31
b23=-a•a32 + a•2a3!
b3! = a12a23- a13a22
b32=-alia23 + a13a21
b33= alla22 - a12a21

Example

Let[A] = -4
-1

Then IAI = -46 and

bll = (-4)(5) - (2)(-1) =-18


b12=-( 0)(5) + ( 2)( 1)= 2
b13= (0)(-1) - (-4)( 1)= 4
b21=-( 3)(5) + (-4)(-1) = -11
b22-- (2)(-5)- (-4)( 1)= 14
b23=-(2)(-1) + ( 3)( 1)= 5
b31= ( 3)( 2)- (-4)(-4)=-10
b32=--( 2)(2) + (-4)(0) = -4
b33= ( 2)(-4)- (0)( 3)= -8

10/46]
18/46
11/46
and [A]-•=-2/46-14/46
- 4/46 - 5/46
4/46[
8/4• j

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

484 Concepts
fromLinearAlgebra
usedintheFiniteElement
Method
Problems

Problems

1. Given thefollowingmatrices,

find:

a.[A]'r,[B]'r d. [AI[B],
b. [A] + [B], []{] + [A]
c. [A] - [B], [B] - [A] f. [A-•],[B-•]

2. Given thefollowingmatrices,

[A] =
[!'i]
4
2
is]= 12
1 1

f'md:

a.[A]'r,[tq'r d. [AI[B], [B][A]


b. [A] + [B], [B] + [A]
c. [A] - [B], [B] - [A] f. [A-•],[•-•1

3. Given thefollowingmatrices,

[B]-- 21
f'md:

a.[B]T[K] d.[BIT[j-I]
T [K][J-•][B]
b. [K][B] ½.Let[C]= [B]T[K][B],find[C-']andIcl
½.[J"l][K][B]

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

Appendix V

PROPERTIES OF SELECTED AQUIFER


MATERIALS

Table AV.1 Physical properties of selectedaquifer materials.

Hydraulic Specific Bulk


Material Conductivity,
K Storage,
Ss* Porosity,
n Density,
Pb
(m/s) (m-1) (kg/m
3)

Gravel 10ø - 10'a 0.1- 0.3 0.20-0.40 1200-1800


Sand 10'2 - 10'6 0.1- 0.4 0.25- 0.55 1300-1900
Silt 10'$ - 10'7 0.2- 0.4 0.35- 0.60 1200-1800
Clay 10'? - 10'•ø 0.05- 0.2 0.35- 0.55 1000-1600
Sandstone 10'• - 10'•ø 0.01- 0.2 0.25- 0.$0 2000-2400
Siltstone 10's - 10'•2 0.01- 0.2 0.20- 0.40 2000-2400
Shale 10'9 - 10'13 0.01- 0.08 0.01- 0.10 2000-2400
Limestone

(Nosolution
cavities) 10'• - 10'•ø 0.01- 0.05 0.01- 0.20 2000- 2500
(solution
cavities) 10'2 - 10'6 0.01- 0.20 0 05- 0.55 1800- 2000
Igneous& Metamorphic
(fractured) 10'4- 10's 0.01- 0.05 0.05- 0.15 2000-2500
(unfractured) 10'lø-10'!4 ~0 0.01- 0.05 2400-3000
Basalt

(fractured) 10'2- 10'7 0.01- 0.20 0.05- 0.35 2000-2400


(unfractured) 10'lø-10'14 ~0 0.01- 0.10 2400-2800
Tuff/Brex:cia 10'• - 10'9 0.01- 0.05 0.05- 0.25 2000-2400

* These values areforunconfined aquifers


will bc 100 to 1000 times smaller.
(see
Chapter
20).Values
forconf'med
aquifers

485

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

486 Appendix
V

Table AV.2 Aquifer dispersivitiesafter Anderson(1979).

Porosity,
n aL aT/aL
(m) (m)
,

Alluvium 0.40 61 0.3


0.40 61 0.01
0.30 30.5 1.0
- 30.5 1.0
- 15 0.067
0.20 12 0.33
0.20 3.05 0.3

GlacialDeposits 0.35 21.3 0.2

Limestone 0.35 61 0.3


0.25 6.7 0.1

Fractured Basalt 0.10 91 1.5


0.10 91 1.0
- 30.5 0.6

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

REFERENCES

Ames, W. F. 1977. Numericalmethodsfor partial differentialequations,2nd Ed.


Academic Press. New York.

Anderson,
M.P. 1979. Usingmodelsto simulate
themovement
of contaminants
through
groundwater flow systems.CriticalReviewsin EnvironmentalControl,Vol. 9, No. 2,
pp.97- 156.

Ashcroft, G., D. D. Marsh, D. D. Evans, and L. Boersma. 1962. Numerical methodfor


solvingthediffusionequation:1. Horizontalflow in semi-infinitemediasoil. Science
Societyof AmericaProceedings, Vol. 26, pp.522- 525.
Bachmat, Y., B. Andrews, D. Holtz, S. Sebastian. 1978. Utilization of Numerical
GroundwaterModelsfor WaterResourceManagement.ReportNo. EPA -600/8-78-
012, Robert S.' Kerr EnvironmentalResearchLaboratory,Office of Researchand
Development,
U.S.Environmental
Protection
Agency,Ada,OK 74820.
Bear,J. 1972. Dynamicsof Fluidsin PorousMedia,Elsevier,New York.

Bear,J. 1979. Hydraulicsof Groundwater,


McGraw-Itill, New York.

Bear, I. and A. Verruijt. 1987. ModelingGroundwaterFlow andPollution,D. Reidel


Publishing Company, Dordrecht.
Bennett,G. D. 1978. Introductionto GroundwaterHydraulics:A ProgrammedText for
Self-Instruction.
Book3, Techniques of Water-ResourcesInvestigations
of theUnited
StatesGeologicalSurvey,U.S. Government PrintingOffice.

Bruce,G. H., D. W. Peaceman,


andH. H. Rachford,Jr. 1953. Calculationof unsteady-
stategasflow throughporousmedia.Petrol.Trans.AIME 198. pp.74- 92.

Brutsaert,
W. 1973. Numericalsolutionof multiphase
well flow.Journalof theHydraulic
Division,AmericanSocietyof Civil Engineers,
Vol. 99, No. HY1, pp.1981- 2001.

Concus,P. 1967. Numericalsolution


of thenonlinear
ma•etostaticfieldequationin two-
dimensions.Journalof Computational Physics,Vol. 1, pp.330- 342.

Cook, R.D. 1981. Conceptsandapplications


of finite elementanalysis,2nd ed. John
Wiley & Sons,New York.

Davis, L. A. and S. P. Neumann.1983. Documentationand user'sguide UNSAT2 -


Variably saturatedflow model. Final Report NUREG/CR-3390, U.S. Nuclear
Regulatory Commission, Divisionof WasteManagement,
Washington,D.C.

deMarsily,G. 1986. Quantitative


Hydrogeology,
Academic
Press,New York.
deWiest,R.J.M.1969. FlowThrough
Porous
Media,Academic
Press,New York.
Dhatt,G. andG. Touzot1984. The FiniteElementMethodDisplayed,JohnWiley &
Sons, New York.

Ergatoudis,I., B. M. Irons, and O. C. Zienkiewiez. 1968. Curved, isoparametic


"quadrilateral"elementsfor finite element analysis. InternationalJournal Solids
Smactures,Vol. 4, pp.31 -42.

487
Copyright American Geophysical Union
Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

488 References

Eversfine,G. C. 1979. A comparison of threeresequencingalgorithmsfor thereduction


of matrix, proffie and wavefront. InternationalJournalfor NumericalMethods in
Engineering,Vol. 14, No. 6, pp.837- 853.
Fleck, W. B. and M .G. McDonald. 1978. Three-dimensional finite-difference model of
ground-water
systemunderlying
theMuskegonCountywastewater disposal system,
Michigan.U.S.Geological
SurveyJournal
of Research,
Vol. 6, No. 3, pp.307- 318.
Freeze, R. A. 1971. Three-dimensional, transient saturated-unsaturatedflow in a
groundwater
basin.WaterResources
Research,
Vol. 7, No. 2, pp.347- 366.
Freeze,R. A. andJ. A. Cherry.1979. Groundwater,
Prentice-Hall,EnglewoodCliffs,
New Jersey.

Freeze,R. A. andP. A. Witherspoon.


1966. Theoreticalanalysis
of regionalgroundwater
flow; 1. Analytical and numerical solutionsto the mathematicalmodel. Water
Resources
Research,
Vol. 2, pp.641- 656.
Fried, I. 1979. Foundationsof Solid Mechanics,Academic Press,New York.

Gambolaft, G., P. Gatto, and R. A. Freeze. 1973. Mathematical simulation of the


subsidence
of Venice,2, results.WaterResources
Research,
Vol. 9, pp.721- 733.
Gardner,W. R. andM. S. Mayhugh.1958. Solutions andtestsof thediffusionequation
for themovement of waterin soil. SoilScienceSocietyof AmericaProceedings,
Vol.
22, pp.197 - 201.

Gupta,S. K. andK. K. Tahiti. 1976. A three-dimensionalGalerkinf'miteelementsolution


of flow throughmultiaquifers in SutterBasin,California.WaterResources Research,
Vol. 12, No. 2, pp.155 - 162.

Gureghian,
A. B., D. S.Ward,andR. W. Cleary.1979. Simultaneous
transport
of water
and reactingsolutesthroughmultilayeredsoils under transientunsaturatedflow
conditions.Journalof Hydrology,Vol. 41, pp.253- 278.
Guymon,G. L., V. H. Scott,andL. R. Hermann.1970. A generalnumericalsolutionof
thetwo-dimensional diffusion- convectionequationby finiteelementmethod.Water
ResourcesResearch, Vol. 6, No. 6, pp.1611- 1617.
Hillel, D. 1980. Fundamentals
of SoilPhysics,
AcademicPress,New York.
Huyakorn,P.S. and G. F. Pinder.1983. Computational
Methodsin Subsurface
Flow,
Academic Press,New York.

Irons,B. M. 1970. A frontalsolution


programfor finiteelementanalysis.International
Journalfor NumericalMethodsin Engineering,Vol. 2, No. 1, pp.5- 32.
Javandel,I. andP. A. Witherspoon.1968. Applicationof the finite elementmethodto
transientflow in porousmedia. Societyof PetroleumEngineersJournal,Vol. 8, No.
3, pp.241 - 252.

Javandel,
I., C. Doughty,andC. F. Tsang.1984. Groundwater
Transport:
Handbookof
MathematicalModels,WaterResourcesMonograph10,AmericanGeophysical
Union,
Washington,D.C.

Jensen,
H. G. andG. A. Parks.1970. Efficientsolutions
for linearmatrixequations.
Journal
of thestmcnnal
Division,
Proceedingsof AmericanSocietyof CivilEngineers,
Vol. 96, No. ST1, pp.49 - 64.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

References 489

Kirkner,D. J., T. L. Theis,andA. A. Jennings.


1984. Multicomponent
solutetransport
with sorptionand solublecomplexation. Advancesin Water Resources,Vol. 7,
pp.120 - 125.
Klute, A., F. D. Whisler, and E. J. Scott. 1965. Numerical solution of the nonlinear
diffusionequationfor waterflow in a horizontalsoil columnof finite length. Soil
ScienceSocietyof America.Proceedings,Vol. 29, pp.353- 358.

Konikow,L. F. andJ. D. Bredehoeft.1978. Computermodelof two-dimensional solute


transportanddispersion in groundwater.U.S. GeologicalInvestigation,
Book7.

Lapidus,L. andG. F. Pinder.1982. NumericalSolutionof Pax•ialDifferentialEquations


in ScienceandEngineering, $olmWiley & Sons,New York.

Maadooliat,R. 1983. ElementandTime StepCriteriafor SolvingTime - Dependent


Field
Problems UsingtheFiniteElementMethod,Ph.DThesis,MichiganStateUnversity.

Matanga,G. B. andE. D. Frind. 1981. An evaluationof mathematical


modelsfor mass
transportin saturated- unsaturated
porousmedia. FinalReport,Departmentof Earth
Science,Universityof Waterloo,Ontario,Canada.
Menke, W. 1984. Geophysicaldataanalysis:discreteinversetheory,AcademicPress,
New York.

Meyer, C. 1973. Solutionof linearequations


- stateof theart. Sourealof the Structural
Division,Proceedings of AmericanSocietyof Civil Engineers,Vol. 99, No. ST'/,
pp.1507- 1526.

Mualem,Y. 1976. A newmodelfor predictingthehydraulicconductivityof unsaturated


porousmedia.WaterResources Research, Vol. 12,No. 3, pp.513- 522.

Myers,G. E. 1971. AnalyticalMethodsin Conduction


HeatTransfer,McGraw-Hill,New
York.

Mitchell, A. R. and D .F. Griffiths. 1980. The finite difference method in partial
differentialequations,
Wiley, New York.

Neuman,S. P. 1973. Samrated-unsaturatedseepageby finite elements. Proceedings


AmericanSocietyof Civil Engineers,
Vol. 99, No. HY12, pp.2233- 2250.
Neuman,S. P. 1980. A statisticalapproachto the inverseproblemin hydrology.3.
Improvedsolutionmethodandaddedperspective.WaterResources
Research,
Vol.
16, No. 4, pp.845- 860

Neuman,S. P. and S. Yakowitz. 1979. A statisticalapproachto the inverseproblemin


hydrology.1. Theory.WaterResources
Research,
Vol. 15,No.4,pp.845- 860.
Neumann,S. P. andP. A. Witherspoon.
1970. Finite-element
methodof analyzingsteady
seepagewitha freesurface.WaterResources Research,
Vol. 6, No. 3, pp.889- 897.
Ogata,
A. 1970.Theory
of dispersion
in a granular
medium.
U.S.Geological
Survey
Professional
Paper411-I, pp.134.
Orlob,G. T. andP. C. Woods.1967. Water-qualitymanagement in irrigationsystems.
Journalof theIrrigationandDrainageDivision,Americansocietyof Civil Engineers,
Vol. 93, pp.49 - 66.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

490 References

Oster, C.A. 1982. Review of Ground-WaterFlow and TransportModels in the


UnsaturatedZone, Report No. NUREG/CR-2917, PNL-4427, Pacific Northwest
Laboratory,P.O. Box 999, Richland,WA 99352.
Oster, C. A., J. C. Sonnichsen, and P. T. Jaske. 1970. Numerical solution of the
convectivediffusionequation.WaterResources
Research,
Vol. 6, pp.1746- 1752.
Peaceman, D. W. and H. H. Rachford, Ft. 1962. Numerical calculation of
multidimensionalmiscibledisplacement.
Societyof PetroleumEngineers
Journal,Vol.
2, pp.327- 339.
Phfiip,I. R. 1957. The theoryof inf'fitration:1. The infiltrationequationandits solution.
Soil Science,Vol. 83, pp.345- 357.
Pickens,J. F. andR. W. Gillham. 1980. Finiteelementanalysisof solutetransportunder
hystereficunsaturatedflow conditions. Water ResourcesResearch,Vol. 16, No. 6,
pp.1071- 1078.

Piekens,$. F., R. W. Gillham, andD. R. Cameron.1979. Finite-elementanalysisof the


transportof waterandslotiresin tile-drainedsoils. Journalof Hydrology,Vol. 40,
pp.243- 264.
Pinder,G. F. 1973. A Galerkinfinite elementsimulationof groundwater contamination
in
LongIsland,New York. WaterResources Research, Vol. 9, No. 6, pp.1657- 1669.
Pinder,G. F. andI.D. Bredehoeft.1968. Applicationof the digitalcomputerfor aquifer
evaluation.WaterResourcesResearch,Vol. 4, pp.1069- 1093.

Pinder,G. F. and E. O. Frind. 1972. Applicationof Galerkin'sprocedureto aquifer


analysis.WaterResources Research, Vol. 8, No. 1, pp.108- 120.

Pinder, G. F. and W. G. Gray. 1977. Finite Element Simulation in Surface and


Subsurface Hydrology,AcademicPress,New York.

Price, H. S., J. C. Cavendish,and R. A. Varga. 1968. Numericalmethodsof higher


orderaccuracyfor diffusionconvectionequations.Societyof PetroleumEngineers
Journal,pp.293- 303.
Pricket, T. A. 1975. Modeling techniquesfor groundwaterevaluation.In: Advancesin
Hydroscience,
Vol. 10, AcademicPress,New York, pp.1- 143.
Raats,P, A. (2. andW. R. Gardner,1971, A comparison of someempiricalrelationships
betweenpressure headandhydraulicconductivity,andsomeobservations on radially
symmetricflow. WaterResources Research,Vol. 7, pp.921- 928.

Rao, S.S. 1982. The FiniteElementMethodin Engineering,PergamonPress,New York. ß

Reeves,M. and J. O. Duguid. 1975. Water movementthroughsaturated- unsaturated


porousmedia: A f'mite-elementGalerkinmodel. ORNL-4927,Oak RidgeNational
Laboratory,Oak Ridge,Tennessee 37830.

Remson,I., C. A. Appel, and R. A. Webster.1965. Groundwatermodelssolvedby


digital computer. Journalof the HydraulicsDivision, AmericanSocietyof Civil
Engineers,Vol. 91, No. HY3, pp.133- 147.
Remson,I., G. M. Hornberger,andF. J. Molz. 1971. NumericalMethodsin Subsurface
Hydrologywith an Introductionto the Finite ElementMethod,JohnWiley & Sons,
New York.

Copyright American Geophysical Union


Groundwater Modeling by
Water Resources Monograph the Finite Element Method Vol. 13

References 491

Senger,R. K. andG. E.Fogg.1987. Regionalunderpressuring in deepbrineaquifers,


Palo Dura Basin, Texas I, Effects of hydrostratigraphyand topography. Water
Resources Research,Vol. 23, No. 8, pp.1481- 1493.

Segerlind,L. $. 1984. AppliedFinite ElementAnalysis,2nd Ed., JohnWiley & Sons,


New York.

Segol,G., G. F. Pinder,andW. G. Gray. 1975. A Galerkin- finiteelementtechnique


for
calculatingthe transitionpositionof the salt-waterfront. Water ResourcesResearch,
Vol. 11, No. 2, pp.343- 347.

Stone,H. L. and P. T. L. Brian. 1963. Numericalsolutionof convectivetransport


problems.AICHE J. Vol. 9, pp.681- 688.
Swarzendruber,
D. 1962. Non Darcybehaviorin liquidsaturated
porousmedia. Journal
of Geophysical
Research,
Vol. 67, pp.5205- 5213.

Tanji, K. K., G. R. Dutt, J. L. Paul,andL. D. Doneen.1967. A computermethodfor


pr•icting saltconcentrations in soilsatvariablemoisture
contents.Hilgardia,Vol. 38,
pp.307- 318.

Trcscott,P. C. andS. P. Larson.1977. Comparisonof iterativemethodsfor solvingtwo-


dimensional groundwater flow equations.WaterResources Research,
Vol. 13, No. 1,
pp.125- 136.
Trescott,P. C., G. F. Pinder,andS. P. Larson.1976. Finitedifferencemodelfor aquifer
simulation in twodimensions withresultsof numericalexperiments. U.S. Geological
Survey,Techniquesof Water Resources Investigation,Book 7, AutomatedData
Processing andcomputations, pp.116.

Van Genuchten, M.Th., G. F. Pinder, and E. O. Frind. 1977. Simulation of two-


dimensionalcontaminanttransportwith isoparametric- Hermitianf'miteelements.
WaterResourcesResearch,Vol. 13,No. 2, pp.451- 458.

Wang,H. F. andM.P. Anderson.1982. Introduction


to Groundwater
Modeling: Finite
DifferenceandFiniteElementMethods,W.H. FreemanandCompany,SanFrancisco.

Wierenga,P. J. 1977.Solutedistribution
profilescomputed
withsteadystateandu'ansient
watermovement models.SoilScience Societyof AmericaJournal,
Vol. 41, pp.1050-
1055.

Yeh, W. W., Y. S. Yoon, andK. S. Lee. 1983. Aquiferparameter'identification


with
Kriging andoptimumparameterization.Water Resources Research,Vol. 19, No. 1,
pp.225- 233.

Zienkiewicz,O. C. 1971.The finiteelementmethodin engineering


science,
McGraw-Hill,
London.

Zienkiewicz,O. C., P. Meyer,andY. K. Cheung.1966.Solutionof anisotropic


seepage
problemsby f'miteelements.ProceedingsAmericanSocietyof Civil Engineers,Vol.
92 EMI, pp.111- 120.
Zienkiewicz,O. C. andC. J. Parekh.1970. Transientfield problems:Two-dimensional
andthree-dimensionalanalysisby isoparametricfiniteelements.International
Journal
of NumericalMethodsin Engineering, Vol. 2, pp.61- 71.

Copyright American Geophysical Union


INDEX

Advection, 470 Coordiaate


systemtransformations:
Analyticalmethod,5-9 one-dimensional,103, 115-117
Apparentgroundwater velocities, two-dimensional,117-118
232-248 three-dimensional,118-119
Aquiferproperties,
485-486 Crank-NicholsonMethod, 57
Assemblingglobalsystemof equations,
142-151
Decayconstant, 65, 474
Axisymmetric
problems,
21, 79-80, Derivationof governingequations:
166-167, 462-463, 468, 477
soluteu'ansport,464-476
steady-state,
saturatedflow, 458-461
Backward difference,57
steady-state,
unsaturated flow,
Bandwidth(seeSemi-bandwidth) 460-461
Boundaryconditions: transient,saturatedflow, 464-467
(seeDirichletandNeumannboundary transient,unsaturatedflow, 465-467
conditions) Diffusion, 470-471
Boundaryvalueproblem,5 Diffusivity,220
DirichletBoundaryConditions,
152
Centraldifference,57 Dirichlet Nodes, 16
Choleski Method:
Dispersion
coefficients,
470-471
nonsymmetric
matfix, 177-181, Dispersivity,
471-472
185-189
Distributioncoefficient, 64, 473
solutetransport,198-200 Distributed sourceor sink, 159
steady-state,
saturated flow, 191
symmetric matrix,181-185,189-191
transient,saturatedflow, 203-212 Effective stress,465
CollocationMethod, 33 Eigenvalues,
194
Element matrix formulas:
ComputerPrograms:
mainprograms: advection-dispersion
matrix,87-88,
GW1,257-262 123-125, 133-135
GW2, 262-267 linear bar element, 89
GW3, 267-280 linearrectangleelement,98-99
GW4, 280-283 lineartriangleelement,93-94
ST1,283-302 capacitance matrix,86-87, 122-123,
132-133
subprograms:
ASMBAD, 423-443 linear bar element, 89
ASMBK, 331-362 linearrectangleelement,97-98
ASMBKC, 406-419 lineartriangleelement,93
BOUND, 325-330 conductancematrix, 86, 120-121, 136,
DECOMP, 363-370 131-132
DUMP, 393-399 linearbar element,89
ELEMENT, 311-317 linearrectangle
element,97
INITIAL, 400-405 lineartdangleelement,92-95
NODES, 303-310 sorptionmatrix,88, 125
MATERL, 318-324 linear bar element,90
RHS, 420-422 linearrectangleelement,98-99
SOLVE, 363-370 lineartriangle,94
VELOCITY, 371-392 Elementmatrixsubprograms:
Confinedaquifer,446-448 advection-dispersion
matrix[D(e)]:
Consistentformulation,52, 62-63 linear bar element,435
Coordinatesystems: linearparallelepiped
element,440
local, 101 linearquadrilateral
element,438
global,101 linearrectangleelement,437

493
494 Index

lineartriangleelement,435 concentration
at pointwithinelement,
apparentgroundwater velocity: 229
cubic bar element,378 conductancematrixcalculation(linear
cubicparallelepipedelement,390 quadrilateral),138-141
cubicquadrilateral
element,384 conductancematrixcalculation(linear
linear bar element,377 triangle),95
linearparallelepiped
element,
385 conductancematrixderivation(linear
linearquadrilateral
element,381 triangle),94
linearrectangleelement,380 headat pointwithinelement,227-228,
lineartriangleelement,379 229
quadraticbar element,377 lacobianmatrix calculation,117,
quadratic
parallelepiped
element,387 119-120
quadratic
quadrilateral
element,382 modification
of globalsystem
of
capacitance
matrix
[C(e)]: equations,154-155
linearbar element,414 Newton-Raphson method,210-212
linearparallelepiped
element,418 numberof Gausspoints,138
linearquadrilateral
element,416 numericalintegration,128-130
linearrectangleelement,415 Picarditeration,203-205, 206-208
lineartriangleelement,415 semi-bandwidthcalculation,16
conductance
matrix[K(e)l: sizeof timestep,194-195,199-200
cubicbar element,345 solutetransport
equation,69-73
cubicparallelepipedelement,359 sorpfionmatrixderivation(linear
cubicquadrilateral
element,352 triangle),91-92
linear bar element,344 specifiedflow matrix, 47, 158, 159, 160,
162-165
linearparallelepiped
element,354
linearquadrilateral
element,348 steady-state,
saturated
groundwater
flow,
35-42
linearrectangleelement,347
lineartriangleelement,346 transient,
saturated
groundwater
flow,
57-60
quadraticbarelement,344
quadratic
parallelepiped
element,356
quadratic element,350 Finite differencemethod,9-10, 55-57
quadrilateral
Finite element mesh:
sorpfion
matrix[A(e)]:
linear bar element,429 examples,22-27
linearrectangleelement,430 rulesfor drawing,16-21
Finite elementmethod,9-11
lineartriangleelement,
430
linearquadrilateral
element,431 Fluidcompressibility,
465
Forwarddifference,57
linearparallelepiped
element,
433
Elementresultants,226 Full matrixstorage,
177
Examples:
advection-dispersion matrixcalculation Galerkin's method, 34
(lineartriangle),95-96 Gausspoint,126
advection-dispersion matrixderivation Gausspoints(table), 127
(linearrectangle),99-100 Gaussquadrature, 126-131
analyticalsolution,8
apparentgroundwater velocity Hysteresis,213
calculation,235,236, 240-248
assemblingglobalsystemof equations,Initial valueproblem,5
143-144, 144-145, 147-152 Interpolation functions:
averagevalue of head,231-232 continuity,80-81
capacitance
matfixderivation(linear convergence, 81-82
rectangle),100-101 definition, 30
Choleskimethod,178-179, 180-181, one-dimensionalelements,32, 89,
184-185, 187, 188-189, 190 103-105
Index 495

two-dimensionalelements,90, 96, Picm.diteration,202-208, 213-219


105-109 Point source or sink, 155
three-dimensionalelements,109-115
Relativelydry porousmedia,220
Instability,192 Residual, 30
Integrationby parts,37 Retardation factor, 475
Isoparametric
elements,
82-85 Richm'd's
equation,467
$acobianmatrix, 116-120 Sensitivityanalysis,450
$acobian matrix inverse, 116 Semibandwidth, 16
Shapefunctions,82-85
Linearalgebra,478-483 Solutetransport:
Lumpedformulation,53-54,63-64 saturatedgroundwaterflow, 76-78
steady-stategroundwaterflow, 65-69
Mass balancecalculations,452-456 transientgroundwater
flow, 73-76
Matrix operations,
478-483 uniform flow, 64-65
Mechanicaldispersion,
471 Sorpfion,473
Methodof weightedresiduals,
30 Specificmoisturecapacity,61
Model calibration,451,456 Specificstorage,
465
Modelprediction,
451,456 Subdomainmethod,33-34
Model verification, 451,456 SUbparametric
elements,
82-85
Modificationof systemof equations, Superparametric
elements,82-85
152-165
Time step(choiceof), 191-200
Neumannboundaryconditions,155-165
Neumann nodes, 16 Unconfinedaquifer,447-450
NewtonRaphsonMethod,208-212 Uniform groundwaterflow, 64, 474
Nodenumbering,16-18
Nodeplacement,16-18 V ariationalmethod, 30
Nonuniform flow, 475 Vectorstorage,185-190
Numericalintegration,126 Verification, 451, 456
Numericaloscillations,192-198
Numericalstability,192 Weightingfunction,30-34

You might also like