advertisement

AN ABSTRACT OF THE THESIS OF WILLIAM EDGAR AVERA prese9d on GEOPHYSICS in Title: ITERATIVE TECHN Abstract approved for the degree of MASTER OF SCIENCE April 30, 1981 LIEARiZEDfREE SURFACE FLOW Redacted for Privacy Gunnar Bodvarsson The displacement of the free liquid surface in geothermal and hydrologic reservoirs is an important capacitance factor. An iterative approach to determining the drawdown of the free liquid surface for a single sink region in a homogeneous, isotropic, Darcytype porous mediums is discussed. The iterative approach involves a stepwise adjustment of the pressure, on the reference surface which replaces the time-dependent free surface condition by a fixed plane Dirichlet type condition so that readily availiable, standard techniques can be applied. Grouping of producing wells into a single analogous well may be used to treat multiple well cases with the iterative approach. An analytic solution for the infinite half space situation is used to compare solutions with the iterative technique. The analytic solution is derived for a point sink within an infinite, homogeneous, isotropic, Darcy-type porous half space. It is obtained by linearizing the free liquid boundary condition provided that the free surface deviates from its equilibrium reference position by only a small slowly undulating displacement h . The flow pressure at the equilibrium surface is then approximated by the hydrostatic pressure for a column of height h A standard model is designed to be analogous to the analytic solution. Testing the iterative-procedure calculations for this model against the derived analytic solution produces very satisfactory results provided that the numerical grid spacing is adequately chosen for the problem. Calculations of the linear and quadratic terms of the free surface condition indicate that the neglected quadratic terms are in general small, and the approximation is reasonable. Iterative Techniques in Linearized Free Surface Flow by William Edgar Avera A THESIS submitted to Oregon State University in partial fulfillment of the requirements for the degree of Master of Science Completed April 1981 Commencement June 1981 APPROVED: Redacted for Privacy Professor of Geophysics and Mathematics in charge of major Redacted for Privacy Dean 'ôf School of Oceanography Redacted for Privacy Dean o Graduate Sdhool Date thesis is presented Typed by William Avera for April 30, 1981 William Edgar Avera ACKNOWL EDGMENTS My most sincere appreciation goes to my major professor, Dr. Gunnar Bodvarsson, for his guidance to me as a student, and for the opportunity to become involved with his work and ideas. During my studies here I have gained an insight to his philosophy of science which will benefit me throughout my career. In addition, I will always be indebted to him for his advice and critical reviewing of this manuscript. Dr. Elliot Zais has also been a good influence on my character and science as a student at OSU. His encouragement and helpful discussions will always be appreciated. I am grateful to Dr. Richard Couch for his guidance and for entrusting me with the use of his HP-41C which has contributed a valuable part in this research. Also, the assistance of Dr. Jonathan M. Hanson in attaining the group of subroutines PWSCYL and of Dr. F.T. Lindstrom in getting it operative is greatly appreciated. The encouragement and discussion from all of my fellow students is deeply appreciated; in particular, G. Stephen Pitts and Osvaldo Sanchez Zamora have been particuarly helpful. Also the assistance in drafting from Paula Pitts is very much appreciated. The encouragement and love from my parents, Joseph A. Avera and Jane Y. Avera, is the source of my strength. Their guidance plus that of Jesus has brought me through the difficulties. I am also grateful to the Milne Computer Center at OSU for a grant to fund the use of the CYBER 7300 computer. TABLE OF CONTENTS Chapter Page I. INTRODUCTION 1 Relative Importance of the Free Liquid Surface Capacitance II. CONSIDERATIONS WITH AN ANALYTIC SOLUTION 2 6 The Concept of Drawdown 7 Analytic Solution for a Point Sink with a Linearized Free Surface Condition 7 Discussion of Assumptions 15 Other Reservoir Models and the Motivation of the Present Investigation 17 The Reference Numerical Model (RM1) 18 Borehole Grouping 20 III. THE TIME ITERATION TECHNIQUE 25 Technique 25 The Analytic Time Step Approximation 28 Computer Programs 31 IV. COMPARISON BETWEEN ANALYTIC AND NUMERICAL MODELS 34 Relationship Between the Analytic and Numerical Models 34 Comparison of the Models 36 The Homogeneous Boundary Value Solution 37 Approximation of dp/dz by a Polynomial 42 The Validity of the Linearized Free Surface Approximation 43 The Time Iterative Solution 45 BIBLIOGRAPHY 55 APPENDICES 56 Appendix A: Appendix B: Development of a Fourth Order Polynomial Derivative 56 Program Listings 59 LIST OF FIGURES Figure Page 1. Schematic cartoon of the time step process. 28 2. Profile of R values for the homogeneous boundary value solution for three different boundary distances relative to a constant point sink location. 39 Profile of R values for the homogeneous boundary value solution along the radial axis for three different boundary distances relative to a constant point sink location. 40 Profile of R values for the homogeneous boundary value solution radially just below the free surface for three different boundary distances relative to a constant point sink location. 41 Profile of the free liquid surface radially outward from the central axis for several different times of the model RH1 with t= 4XlO7sec. 46 R values plotted radially out from the point sink at several different times for RM1 with t 4XlO7sec. 48 3. 4. 5. 6. 7. values plotted radially out along the reference surface at several different times for RM1 with R t= 4XlO7. 8. 49 Maximum time steps before reversal of pressure gradient as a function of the characteristic interval for RM1 . 54 LIST OF TABLES Table Page 1. Selected parameters for model RM1. 19 2. Brief discussion of numerical parameters used in the time iterative technique. 33 3. Selected examples of the maximum QR for different times using a time step of 4X107 sec with model RM1 4. 5. 45 . Comparison between analytic and RM1 polynomial derivative values for t= 4XIO7sec at two selected points on the reference surface. The maximum flow rate om 50 kg/sec) possible for RM1 to maintain the established limits on QR through successive time iterations. Based on the largest QR value for each iteration (Time is sec X107) 52 Input for subroutines DIFTBL and DERVZO to calculate the polynomial derivative fo the free surface 57 . 6. ITERATIVE TECHNIQUES IN LINEARIZED FREE SURFACE FLOW I. INTRODUCTION The production of fluid from a liquid dominated geothermal reservoir is generally associated with changes in the free liquid surface position. Changes in the liquid level depend largely on how the production has affected the reservoir pressure field. The lowering of the pressure field releases stored fluid for production. The three main storage capacitances within the reservoir are the compressibility of the reservoir rock and fluid, the displacement of the liquid surface, and the vaporization of liquid (Zais and Bodvarsson, 1980). The free surface capacitance is of particular importance, and the mechanism of the liquid surface response is very important in estimating the production capabilities of a reservoir. The purpose of this study is to develop an iterative technique which can be used with existing numerical potential field programs to model the changes in the free liquid surface. A linearized form of the free-surface boundary condition is used in an iterative technique that calculates the pressure field solution at finite time increments incorporating an existing program obtained from the Lawrence Livermore Laboratory. We compare the iterative solution to an availiable analytic form for a particular case, and illustrate how the iterative technique can be used. Relative Importance of the Free Liquid Surface Capacitance We want to compare the relative importance of the free liquid surface with that of compressibility and liquid vaporization which can occur within a reservoir. Each of these physical processes releases fluid upon a decrease in pressure. Knowing the relative amount of fluid released for each will give us an idea as to which process is most itiportant for the production capacity of the reser- voir. Zais and Bodvarsson (1980) have carried out an investigation of this type. Starting with a reservoir of thickness in equilibrium, the H production of fluid results in a change in pressure that propagates through the system. The amount of fluid that can be produced upon a given unit reduction in pressure is the fluid capacitance of the system. First, compare the relative fluid storage or release by the compressibility of the reservoir formation with that of the level of the free liquid surface. The reservoir is assumed to be an isotropic and homogeneous slab with a porosity S , and fluid density p . , storage capacitivity The amount of fluid mass released due to compressibility for a small change in pressure of unit area and height H p on a column is = 2pH . The specific capacitance per unit area is defined as (1.1) 3 dq/dP = pSH (1.2) . Secondly, the displacement of the liquid surface by = ip/pg (1.3) , corresponding to a pressure reduction of qf = (iip/pg)(p4) = p releases (1.4) g and hence the specific capacitance of the free surface dqf/dp = p/g (1.5) . The relative amounts of fluid released for these two mechanisms can be compared by the ratio dqf/dp dq/dp 4/psHg (1.6) Common reservoir field cases may involve a thickness H= 1 X103m, capacitivity S= 2Xl0h1Pa 0.2 . , and a porosity in the range 4 0.01 to Substituting into the ratio (eq. 1.6) we find that the displacement of the free surface releases about 50 to 1000 times as much liquid mass as the compressibility effect. Finally we will want to examine the significance of the fluid release due to liquid vaporization within the reservoir. The relationship for the change in vapor pressure PS with temperature degrees Kelvin along the saturation line denoted by the subscript v is given by the Clausius-Clapeyron equation that we can T 4 approximate by dp F where p5 S\ - (1.7) is the vapor density, and is the latent heat of L vaporization for the liquid. Rearranging and assuming saturation conditions the temperature change is = TAp/p5L for a change in the pressure or specific heat and r ip . (1.8) If is the heat capacitivity Cf the density of the wet formation then the heat released per unit volume of wet formation is = PrCfTsL (1.9) . The mass of vapor released by a unit volume upon a change in pressure tp at saturation conditions is = zh/L = (pprCfT)/psL2 The specific capacitance for a column of height dq/dp = (PrCfTH)/Ps2 (1.10) . H is then . (1.11) We compare the vaporization with the compressibility effects on the basis of dq/dP (dq/dp) = rCfTs (1.12) 5 Assuming some typical values of 1=200°C (473°K), Cf TX1O3J/kg°K , s= 2Xl0hiPa, p5=7 kg/rn3 , r=2500 kg/rn3 L= 2X106J/kg a value of about 2000 is obtained for the ratio. Comparing this ratio to the values obtained previously for the free surface and the compressibility this result indicates that unlike the compressibility effects, total vaporization within the reservoir material could theoretically release as much fluid mass as the free surface effect. In most cases, however, in liquid dominated systems vaporization is confined to the immediate vicinity of the producing boreholes. The relative effects of the free surface would then be about 10 times that of vaporization. In the following discussion we will restrict ourselves to cases in which vaporization is not significant and compression will be negligible. This will involve not only geothermal situations but also many hydrologic reservoirs as well. The iterative technique we describe is equally suited for both situations provided that a free liquid surface effect remains dominant. II. CONSIDERATIONS WITH AN ANALYTIC SOLUTION In the most general sense, a reservoir is a collection or storage place for anything in quantity. The particular situation which we will consider involves the collection of a liquid within a large volume of porous and permeable rock that extends to the surface. Small interconnecting cavities or openings between grains of the rock provide the space for the fluid storage and movement. In some instances a reservoir may be bounded by fault planes, lithologic changes, or layers of low permeability which restrict fluid flow into or out of the reservoir area. The interconnection of pore space within the rock allows for fluid movement and the formation of a fluid level or liquid surface. Particuarly in our case, the fluid surface is a liquid interface free to move and respond to pressure changes exerted on it. Basically the reservoir to be considered here is composed of a porous, isotropic, homogeneous rock volume within the earth, containing a liquid (water) with a freely moving liquid-air interface and possibly bounded from above by some impermeable layer. We assume that the fluid motion within the reservoir obeys Darcy's law, that is, the fluid mass flow density is proportional to the local pressure gradient induced. For the analytic model used, we will consider the reservoir as infinite in extent. 7 The Concept of Drawdown The free liquid surface of the reservoir responds to changes in the pressure field. The gas phase above the liquid in our model can be at atmospheric pressure or be confined by impermeable overlying material. A homogeneous static pressure field acts on the liquid surface, and by the principle of superposition we can subtract the gas pressure from the pressure field within the fluid. The ambient pressure field around a borehole withdrawing liquid from the reservoir will be depressed. The decrease in local pressure results in an observable lowering of the liquid surface in the vicinity of the borehole. The drawdown is defined as the lowering of the free liquid surface below the equilibrium position. Analytic Solution for a Point Sink with a Linearized Free Surface Condition The following development is in part an overview of a paper written by Bodvarsson (1977) with an emphasis on particular items that are essential to the understanding of the material in the next chapters. Although our notation will be adapted for the specific case of radial symetry, we will maintain similar notational symbols. In all cases the z-axis is defined as positive downward using cylindrical coordinates. Consider an isotropic, incompressible, homogeneous half space of porous material with an area porosity . The area porosity is defined as the fractional area of fluid conductive pores in a given [:3 cross section surface. The material is saturated with a liquid of density p . Choose an equilibrium reference surface which corresponds to the initial liquid surface position at z=O and let c represent the liquid surface at a later time. The points on are S=(r,O) E and let P=(r,z) be the general field point within , the half space z>O Our basic assumption is that flow within the porous medium obeys Darcy's law - p) (P,t) = -C(v where C=K/y conductivity (P,t) = total fluid pressure ; K= permeability ; -= kinematic viscosity ; (2.1) = mass flow vector g = acceleration of gravity The second term on the right of equation 2.1 accounts for the gravitational pull on a fluid flowing in the z-direction. If there is given a mass flow source density as a function of position and time f(P,t) then, + v.q = f (2.2) We now assume that the total pressure is the superposition of the fluid hydrostatic pressure pressure p h and the flow or perturbation due to the source density, that is, (2.3) where initially h = pgz . The external pressure on c zero. Since the second partial derivative with respect to will be z of is zero, equation 2.2 reduces in a homogeneous isotropic space to -v2p = f/C (2.4) The boundary condition on the free surface is =0 Ot where D/Dt (2.5) is the material (or total) derivative. This is a non- linear condition which results in the loss of the principle of superposition. Consequently we are interested in a method of linearizing this condition without placing too rigid a restriction on the reservoir model. If the position of the free surface only a small, slowly undulating amplitude c deviates from h(S,t) by z that is positive up, we can modify the free surface condition by moving the fluid half space boundary to pressure on c2 z and replacing the condition of zero by the condition p = pgh on plane . (2.6) In other words, we replace the undulating surface c by the and assume that to the first order the pressure difference between the two surfaces is only hydrostatic. Moreover, assuming that h(S,t) is very small compared to the source depth, we can take that the flow pressure p at E is a small perturbation of the total pressure and that to the first order p on c2 is equal 10 to on p E In addition, the motion of the fluid at the free surface can be approximated as strictly vertical. Then the kinematic condition on the boundary represents the strictly vertical flow in a column just below the free surface. Hence, the mass flow to raise the free surface is pth t(Ph) = (2.7) and since by equation 2.1 = C3P (2.8) we obtain the relation pth = CP - aap = 0 or a = Cg/q where (2.9) z=0 at (2.10) is a characteristic fluid velocity for a porous medium. Equation 2.10 represents the linearization of equation 2.5 where the only major restrictions imposed have been that the free surface c deviate only by a small amplitude from the horizontal reference surface z , and that the hydrostatic reservoir pressure be much larger than the flow pressure in the neighborhood of the free surface. A peculiarity about these conditions is that takes on negative values when the ci surface is below total pressure on the reference surface E E h(P,t) , and the is then negative. However, negative pressures in this situation represent a mathematical abstraction and do not present any physical problems. Now that we have gained a physical feeling for how the free surface condition (eq. 2.5) is approximated by equation 2.10 , it will be helpful to look at the form of the terms neglected by the linearization. The magnitude of the neglected terms will be useful later to determine the error involved in using this approximation. Starting with the original boundary condition (eq. 2.5) for the free surface and the definition of the total pressure (eq. 2.3) we expand the material derivative into its component terms. In our case of axial symmetry where r = ..2 r + wa + Dt . ' (2.11) --) = (pg z (2.12) . =(s,w) is the velocity vector of the pore fluid within the reservoir. The pore fluid velocity can be expressed in terms of the mass flow flow /p by first dividing by the density to obtain a volume , then by dividing by the area porosity we get an expression which represents the velocity of the fluid elements. = (2.13) /pt Rewriting the mass flow due to the flow pressure as = -Gyp = -C[ r + z ] (2.14) 12 the pore velocity is then = where S 5r (2.15) z ] + W_2. p ar p Sz Sz / (2.16) The free surface condition then becomes Dt + 5t St o = p Sr p at - Sr Sr p (2.17) (2.18) az p4) a[ ()2 a()] pg Sr ()2 az ] (2.19) Neglected Quadratic Linearized Free Term Surface Approximation Thus in cases where the quadratic derivative term is small compared to the linear derivative term - a (2.20) we may neglect the quadratic and obtain the linearized free-surface condition just as before. Using the basic equation 2.4 and the linearized free-surface condition (eq. 2.10) we can solve for the pressure field within the half space. Consider first the solution obtained for the source-free case where f0=0 13 The basic equations are where c for p = pgh0 and (2.21) z > 0 v2p = 0 t 0 , z = 0 . (2.22) is the initial vertical amplitude for the free surface h0(S) relative to z and , is some general point on the S surface. Bodvarsson (1977) observes that the solution for the pressure field will be of the form p = p(r,z+at) (2.23) which satisfies the boundary condition (eq. 2.10) for all time. Since p as expressed by equation 2.23 is for t>O a potential (r,z+at) in z>O , we can continue the function into function of z>0 by standard potential theoretical formulas (Duff and Naylor 1966) and hence p(P,t) = [pg(z+at)/2ir] for with and t > 0 , z > 0 , rp I (l/r) h0(u) d: (2.24) U(r' ,0) = [ (r-r')2 + (z+at)2 dz = 2irr'dr' (2.25) (2.26) . The corresponding motion of the fluid surface setting z=0 in equation 2.24 and 2.25 giving c is found by 14 h(S,t) = (at/2r) J (1/rt)h0(U) dE = [ (r-r')2 + (at)2 and ] (2.27) ; t>O (2.28) . Next we will examine the pressure field due to a concentrated point sink of strength at a position Q=(0,d) within the half f0 space. At t0 the fluid is in a static equilibrium with the fluid surface corresponding to the reference surface begins withdrawing fluid at t=O+ z The point sink . with a constant rate f0 . The basic equation to be solved then takes the form -v2p = where I(0)=0 1(t) (P-Q) 1(t) -fe/C) ( (2.29) is the causal unit step function that takes the value for t=0 and for t>0 I(t)=l . Equation 2.10 represents the boundary condition placed on the free surface, and there is now an initial condition of p=0 in z>0 , at t=0 . Bodvarsson (1977) solves this problem by applying the method of images. To obtain the stationary pressure field as t an image of strength f0 is placed at Q'=(O,-d) giving the Neumann type solution of no flow through E = (- f0/4irC)[ (1/rQ) + (l/rQI) 1 , t (2.30) and on the basis of equation 2.6 , the surface amplitude is h5(S) = - fQ/2TrCP9rSQ where rpQ [ r2 + (z-d)2 ] (2.31) (2.32) 15 rpQI= [ r + (z+d)2 rSQ = [ r + d2 (2.33) ] (2.34) J The general solution for t>0 is obtained by adding to the stationary pressure field (eq. 2.30) a time varying component which is initially equal and opposite to the stationary field thus satisfying the initial condition of p=0 at t=0 . The time varying component is given by equation 2.24 with h0(U)= -.h5(S) (eq. 2.31) which upon adding to that of 2.30 results in the solution p (P,t) = (-f0/41TC)[ (l/rQ) + (1/rQI) where rpQIt= [ r (2.35) (2/rpQIt) ] + (z+at+d)2 (2.36) . By setting z0 we obtain the flow pressure at the reference surface and using our approximation (eq. 2.6) the vertical amplitude of the free surface relative to the reference surface h(S,t) = (-f0I4TrCpg)[ (l/rSQ) rSQIt- [ r2 + (at-Fd)2 : (l/r$Q.t) ] ] is (237) (2.38) for S=(r,0) on the surface. Equations 2.35 and 2.36 represent the analytic solution which we will refer to later. Discussion of Assumptions In the previous developement we made several approximations. iI Some of these have already been pointed out. One is using the hydrostatic approximation to derive the pressure on the reference surface, and another is assuming a constant liquid velocity in the z-direction during each incremental time. In addition to these, we have neglected capillary pressure as a force on the free liquid surface. This is probably quite reasonable provided that we restrict the applications to porous materials such as sandstone etc. in which capillary forces are known to be small. The flow pressure within the reservoir is being calculated as a pure potential field neglecting compressibility and the resulting pressure diffusion. In other words, we have assumed that the pressure diffusion through the reservoir requires much less time than the response of the free liquid surface. This is a reasonable assumption because the time required for the pressure signal to diffuse to one half of its full value over a distance d within the reservoir is on the order of (Carsiaw and Jaeger, 1959) (2.39) tD where K is the diffusivity of the reservoir formation. Conversely equations 2.31 and 2.37 indicate that the time required for the free surface to reach one half of its stationary drawdown is on the order tn where a d (2 40) . is the characteristic velocity of the reservoir. The ratio of the two times is 17 = tFi/tD where s /gpsd (2.41) is the capacitivity or storage coefficient that has values of a few times 10_li Pa values as (d/Cg)(C/psd2) q=0.l and (Bodvarsson, 1970). Hence for such common d=l03 m , the ratio is a few times io2 Other Reservoir Models and the Motivation of the Present Investigation The above results are quite simple and have been obtained by an elementary method. Several alternative procedures including HankelLaplace transform techniques are also applicable for the same purpose. The transform techniques are of a more general scope and can also be applied to models of other geometries, in particular, to the case of a reservoir of a finite thickness with the same free surface boundary condition as above. This case is of considerable practical interest. Bodvarsson (personal communication, 1981) has investigated such cases and shown that a solution is readily availiable in the transform space, but the Hankel-inversion is not elementary and can not be expressed in a closed analytic form. It is a complex double series where convergence poses a non-trivial problem. It is interesting that because of the parculiarities of the free surface condition a simple method of images technique breaks down in the case of the finite thickness reservoir. To cope with such problems, it may in many cases appear to be of interest to modify the free surface condition such that the Hankel inversion iE3 becomes elementary. As will be elaborated on below, we will present one such technique that replaces the free surface condition by an iterative approach and has the following two advantages. (1) The time-dependent free-surface condition is replaced by a stationary fixed plane Dirichiet type condition that moves the problem back to conventional potential theory where availiable standard solution techniques and numerical procedures can be applied. (2) The iterative approach is equally applicable to models with more complex boundary conditions. Our principle goal is to test the iterative approach on the infinite reservoir case where the computational results can be compared with a simple analytic solution. The Reference Numerical Model (RM1) In this section a model will be developed that will approximate the analytic situation for the infinite reservoir with the iterative technique. The magnitudes of the parameters selected for the numerical model are strictly relative and represent a reference case called Reference Model 1 (RM1) upon which other models can be based. Parameter values are chosen as reasonable values for a particular case of a Darcy flow type sandstone reservoir with very distant lateral boundaries from a borehole penetrating below a free liquid surface within the reservoir. The multi-hole case will be discussed later. The selected parameters are listed in Table 1 Table 1. Selected parameters for model RM1 Parameter Area Porosity 0.2 1 Xl07 sec Conductivity C Radius (to boundary) r 14.4 km z 14.4 km Borehole Flow Strength f0 50.0 kg/sec Depth of Borehole Flow d 1.4 km Flow Across Lower Boundaries - 0.0 kg/km2sec Pressure at Free Liquid Surface - 0.0 kg/kin sec2 Depth (to bottom) The radius and depth of the reservoir are selected as convienient approximations to the infinite half space of the analytic model. They are convienient because they give a grid spacing of 0.1 km for the numerical model when 144 numerical divisions are used to calculate the solution values. The borehole flow strength chosen is a reasonable figure for the rate of production by a single well within a geothermal field. In the numerical case the allowed drawdown is limited by the requirement that it be small compared to the borehole depth and the radial scale of the free surface response. Preferably, the total drawdown of the free fluid surface not exceed borehole depth. The 1,'5 1/5 of the limitation is based on experience with the perturbation techniques (Dr. G. Bodvarsson, personal communication, 1981). The depth of the borehole was chosen to be approximately 1/10 the distance to the bottom and side boundaries. This puts the bottorn and sides sufficiently far away from the borehole that their 20 overall influence on the pressure solution values will be small. The flow across the bottom and side boundaries is set to zero. Since the boundaries are relatively far from the borehole, the effects of this assumption are small within the borehole vicinity. Borehole Grouping A practical problem which may arrise is to determine at what distance R0 can a particular group of boreholes be replaced by a single borehole having a flow strength equal to the combined strength of the group of boreholes and yielding nearly the same pressure field. In particular, we want to know the distance beyond which the pressure field due to the single borehole will be approximately equal (within 10% for example) to the value from the borehole group. Take Mf mf as the flow strength of each of the grouped boreholes and as the flow strength for the single borehole representing the group. Assume for example that we have a distribution of boreholes such that the flow points are placed at the vertices of a cube. At some distance R0 the pressure field due to this group of wells will be within a given fraction of that due to a single well with a flow point located at the center of the grouping. The distance at which the group of wells can be replaced by a single well will depend on the group spacing. Solving for the whole-space, homogeneous, isotropic, Darcy-type porous medium pressure solution with the origin at the center of the cubic grouping 21 MfS(r) 2 -7 p (2.42) 41TCr we obtain the pressure field for the single grouped well (2.43) PS = Mf/4TrCrS where r5 (x2 + y2 + z2) (2.44) . Likewise the solution for each of the distributed boreholes is p. where mf/4JrCr (2.45) + (y-y')2 + (z-z')2 = [ (x-x ] (2.46) . Summing up the pressure due to the distributed boreholes we have Pg = (mfI4C) (lIr) The spacing of the cubic group will be 2L (2.47) . on edges. Consider a point P(x,y,z) directly out from the center of one of the faces of the cubic group and at a distance from the center of the cube. Pg can be rewritten as mf Pg = ([[ 3L2-2R 1+ 2 R0 0 L + [1+ ( 3L2+2R L 20 ) ]. (2.48) R0 J Using an expansion for (1+X), JX<1 and neglecting third order and higher terms we obtain 22 Pg rrCR0 2-] [ . (2.49) The pressure at P(x,y,z) due to a single well at the center of the cubic array with flow strength P5 = Mf is then M/4CR (2.50) The difference between the pressure field at P(x,y,z) from substituting a single well at the center of the cube compared with that of the field from the cubic group of wells will be within 10% provided R0 > L(2.34763) where P(x,y,z) is at a distance (2.51) from the center of the cubic group. If the spacing is L=lOO m then R0235 m For a point on the free surface the drawdown from a cubic borehole group will appear nearly the same as that of a single well of equal strength if the distance to the surface is larger than that given by equation 2.51 . In cases in which a group of boreholes are producing from the same vicinity the group can be approximated by a single well which can be examined using the iteration technique to be discussed in the next chapter. We can do a similar analysis for the fluid flow field in a whole space situation. Consider a homogeneous, isotropic, whole space Darcy type porous medium such that the fluid flow field is given by vq5 M f+ (r S ) 4wr The flow field for a single well at the origin is then (2.52) 23 + N r fs q5 where r5 (2.53) 4'rrr is defined by equation 2.44 . The coordinate axis x,y,z are oriented perpendicular to the faces of the cube with the origin at the center of the cubic grouping. Consider a point on the z-axis P(O,O,z) and at a distance R0 from the origin. The fluid flow field along the z-axis from each of the boreholes in the cubic configuration of strength mf is mf (z-z.) (2.54) . 4-:;: The total flow field in the z-direction at P(O,O,R0) from the cubic configuration will be (z_z) 8 m For a cubic spacing of irR equation 2.55 can be rewritten as (R0-L) m = 2L (R0+L) 3L2-2R o [ R ( (2.55) . 3 0 L 2' R0 + 3L2+2R L Ro1l+(_-2 Using a second order Taylor series expansion for (lxy . )J (2.56) 1 J xkl and neglecting third order and higher terms we obtain m _i.2. [ rrR0 4 2+ 78.75(i_) (2.57) 24 The fluid flow field at P(0,0,R0) for a single well of flow strength Mf at the origin will be (2.58) 2 4 R0 Taking the difference between and we find that if the group of wells were replaced by a single well at the origin, then the distance at which the two flow fields differ by no more than 10% is related to the group spacing by R0 > L(4.33876) (2.59) If the error in determining the flow field is at least 10% then for some region of interest at a distance R0434 m from the origin a cubic group of producing wells with a spacing L=lOO m could be replaced by a single well without any significant effect on the flow field results at R0 25 III. THE TIME ITERATION TECHNIQUE Time dependent effects of the free liquid surface can be approximated using an incremental or iterative proceedure. This involves replacing the free liquid surface by a stationary reference surface at z=O and stepwise adjusting the pressure on the reference surface such that the free surface condition is approximated as closely as possible. Technique The proceedure begins by solving for the pressure field due to a point sink (source) placed on the symmetry axis of the reservoir and assuming the initial free surface condition t=O . p=O at z=O and We then obtain a fluid velocity at the surface and use this to determine an incremental displacement of the surface during a sufficiently small time interval. Next a hydrostatic approximation is used to adjust the pressure on the reference surface for the new position of the free surface. These pressure values form a new boundary condition for recalculating the pressure field within the reservoir during an additional small time increment. The process can then be repeated stepwise. Considering the process in more detail, after the pressure field is found for the initial free surface condition we can calculate the fluid flow at the free surface and subsequently the free surface velocity. Since the free surface is sufficiently far from the sink and the displacement sufficiently small then the fluid flow in this region can be approximated as strictly vertical. Thus only the z-component of the mass flow vector need to be considered in order to obtain an expression for the velocity of the free surface. In chapter (2) we obtained a relation for the pore liquid velocity w0 -(C/p) ap/z ; z = 0 (3.1) . If we assume that the calculated velocity does not change signifi- cantly during the selected time increment then multiplication of by the incremental time gives the displacement h w0 of the liquid surface in the z-direction. Due to the fact that we have defined h as positive up = (C/p)(p/z)t . (3.2) In order to complete the time step procedure, the boundary values for the pressure of the reference surface at z=0 must be calculated. As discussed in chapter (2) we can take that if h is small in comparison to the scale of the undulation of the liquid surface, the difference in the total pressure for the reference surface and the free liquid surface is essentially due to the hydrostatic pressure of the fluid column between them. Thus we can approximate the flow pressure on the reference surface by the hydrostatic pressure of a fluid column of height p = pgh = h t (3.3) Using this relation a new set of boundary values is generated for the reference surface, and the pressure field within the 27 reservoir can then be calculated during the following time step. Repeating this process allows us to derive an approximation of the pressure field as a function of time. The schematic cartoon of figure 1 illustrates several such time steps showing the relative positions of the reference surface c E and the free liquid surface from both an analytical and a numerical point of view. The Analytic Time Step Approximation The analytic solution can be used to examine the criteria under which the time step technique approximation is a valid representation for the solution. We begin with a developement that is analogous to the developement of the computer technique given above with the analytic pressure field at t=0+ Upon completing a derivation of the . first time step flow pressure for a point on the reference surface we show how this result is related to a first order Taylor series expansion of equation 2.37 at (0,0). From the Taylor series expansion we gain some insight as to the restrictions which must be placed on the iteration technique. Equation 2.35 for t=0+ is - fo p(P,0+) [ l/r -. l/rpQI ] . (3.4) Taking the gradient with respect to z f az4 - o r (z+d) 3 rpQI (z-d) 3 J (35) rpQ the vertical flow of liquid can be obtained from equation 2.8 . A relation for the initial vertical pore liquid velocity (eq. 2.16) is h+ 2+ point source at depth Analytical Situation d Numerical Situation p=O - z=O p=O F(1,1) d :::: F(1,15) Initial Conditions Sclve for pressure field numerically then increment the time to obtain fluid displacement. h [Begin Time Step 1 z=O E h1(r) = ] h1(r) \4p1ogh1 og(0) + p1 Approximate flow pressure on z=O (z) as the hydrostatic pressure of the p=O overlying water. This gives new ( boundary values for the reference surface (z). Substitute in p1pgh1 r(1,15) : Solve for pressure field numerically [End Time Step 1 Then increment the time to obtain fluid displacement. [Begin Time Step 2 ] --- Z= d h2(r)=h1(r) + p2=pgh2 \ h2(r) N 1=g(0) + p2 Approximate flow pressure on z=O (z) as the hydrostatic pressure of the overlying water. We get a new boundary condition for . Substitute in p145) ::: Solve for pressure field numerically Continue incremental displacement in time. Figure 1. 1$ with new boundary condition of time step 2 [End Time Step 2 Schematic cartoon of time step process. 3 then = 4 r (z+d) I. 3 (z-d) ] 3 rpQ rpQI , t=O . (3.6) Assuming that the velocity is approximately constant over some small time interval by a distance Ah . t the free surface will be displaced vertically Consider a point (0,0) on the reference surface directly above the point sink, the displacement will be = w0(0,0)t1 which is analogous to equation 3.2 . (3.7) Substituting in gives at f (3.8) for t1 = t and r = 0 . The iterative flow pressure at (0,0) is obtained using a hydrostatic approximation on the reference surface as p1 = pgh =- f 0,' at ) (3.9) . From the complete analytic solution the vertical amplitude of the free surface c relative to the reference surface z is given by equations 2.37 and 2.38 as h(S,t) = -(f0/2rrCpg) [ lirSQ lircQlt ] . (3.10) For the point (0,0) on the reference surface we have h(S,t) = -(f0/2TrCpg) [lid which can be rewritten as - l/(atd) ] (3.11) 30 h(0,t) = -(f0/27rCpgd)[ 1 !) - 11(1+ The first order Taylor series expansion for 11(1+ -) - 1 II << 1 provided that 11(1 + -) is at (3.13) (3.14) . Then substituting into equation 3.12 for the time t = t1 we get at f h(0,t1) (3.12) ] 2pgC ) (3.15) and using the hydrostatic approximation we obtain the flow pressure on the surface at (0,0) at f p C _-.1- , =1 (3.16) which is identical to equation 3.9 that we obtained using the iteration technique. In making the Taylor series approximation we found that it is necessary to have the restriction stated in equation 3.14 to obtain a solution equivalent to equation 3.9 . Equation 3.14 gives a measure of the magnitude of the time step that can be allowed. 31 Computer Programs The iteration technique described here is implimented by a main program supplemented by a group of subroutines. The basic iterative subroutines are VELOC, DIFTBL, and the subroutine package PWSCYL along with the function DERVZO. These subroutines with the assistance of the calling program POSGO perform the iteration technique under the direction of the user. Additional subroutines RADF, QUADR, and RZDIFT along with the function DERVR assist the user in obtaining information about the iterative solutions calculated. Before getting into a more detailed discussion of the time step technique used. it will be helpful for later reference to briefly explain the notation and subroutines which are directly involved with the iteration technique. A more thourough discussion is supplied in Appendix B along with program documentation. The main program and all subroutines except the subroutine group PWSCYL were written specifically for use in studying the time iterative technique. PWSCYL is a group of subroutines which was obtained through Dr. Jonathan Hanson from Lawrence Livermore Laboratory as part of their mathematical software library. Its original authors are Paul Swarztrauber and Roland Sweet (Technical note TN/IA-109 Research , July 1975) of the National Center for Atmospheric Boulder Colorado 80307 Initially, the subroutine PWSCYL calculates the pressure field solution for the case of zero pressure on the free surface z0 32 PWSCYL solves a finite difference approximation to the Poisson equation in cylindrical coordinates. Solution values are then stored in a matrix array set up by the main program. Once this is accomplished the user then prompts the program to calculate a new set of boundary conditions using the subroutines VELOC and DIFTBL along with the function DERVZO VELOC sets up the conditions whereby DIFTBL and DERVZO can calculate a fourth order polynomial derivative at each point along the free surface. VELOC then calculates a new pressure boundary value by equation 3.3 , and stores the value in the corresponding matrix locations. The main program then resets the input matrix array with the new free surface boundary values. A prompt from the user calls PWSCYL again to recalculate the pressure field solution values using the new boundary conditions. This process may be repeated until the job is completed. Other features within the main program allow the user to output or view solution values at any stage in the procedure. Some additional features also allow the user to output a comparison of solution values at any stage of the process with the analytic solution given by equations 2.35 and 2.36 . The user is also able to obtain information on both the radial and z-derivative values for points along the free surface. In the next chapter we will be discussing some equations which use and relate the notation of both the programs discussed here and the analytic solution derived in chapter (2) . Table 2 is set up to 33 relate these two notational schemes and briefly explain specific parameters utilized in the iteration process. Table 2. Brief discussion of numerical parameters used in the time iterative technique. Parameters Numerical Analytic B r - The radial range of the reservoir 0< r <B [A=0 always] M - - Number of radial subdivisions for the interval [A,B] D z - The range of z (depth.) for the reservoir 0< z <0 N - - Number of vertical subdivisions for the interval [C,D] - Specified values for the normal derivative on the boundaries A,B,C,D respectively BDA,BDB BDC,BDD * F - Input - matrix which specifies the source! sink information along with specified boundary data Output - matrix of pressure solution value - - Specifies the boundary condition (see Appendix B ) ELMBDA - - Specifies the calculation of the Poisson equation by PWSCYL (ELMBDA = 0 always) TINC t - Time step increment TIM t - Time (sum of time step increments plus initial time) COND C - Fluid conductivity of medium - Porosity of medium - Density of liquid PHI RHO * p Relationship between F and f0 given later in chapter (4). 34 IV. COMPARISON BETWEEN ANALYTIC AND NUMERICAL MODELS Basically the analytic model and the time step reference model (RM1) are very similar. Both use a linearized form of the free surface condition, and both approximate the flow pressure on the reference surface z by the hydrostatic approximation in the space between z and c . The major differences between them are due to the inherent problems of the finite difference computer techniques. Some of these problems, like the infinite reservoir in the analytic case can only be approximated by putting the sides and bottom boundaries very far from the region of interest. Also the analytic point source has to be approximated by a small source region in the numerical situation. Yet the similarity of the calculated solutions for each case indicates that the approximation techniques are quite adequate. Relationship Between the Analytic and Numerical iodels The source (sink) term of the analytic model (f0) can be related to the source term of the numerical model (F) by integrating over the space surrounding the point source in the analytic case and suming over all of the grid points for the numerical case. Analytic : -v2p = (-f0/27rrC) (r) (d-z) Jv2p dv = J[(foI2rC) ç(r) 5(d-z) ] dv dv = Jv2p dv = (4.1) (4.2) rdodrdz (4.3) f0/C (4.4) 35 Numerical v2p = : F(r,z) (4.5) 10< r) [ constant = F0 )< z <(d+ (d- ) I F(r,z) Jv2p dv = (4.6) ; Otherwise 0 1 JF(rz) dv (47) Id4 B p dv = -F0rrr 2t (4.8) z J Jv2 d- '0 Equating equations 4.4 and 4.8 we obtain a relationship between f0 and F0 - )2 D (4.9) ) 2M which allows us to determine an input value F0 for the numerical model that corresponds to some selected mass flow rate f0 . The minus sign in equation 4.9 results from an interchange of sources and sinks. One other peculiarity of the computer technique is that we have expressed the input reservoir dimensions in kilometers (km) rather than meters (m) of the parameters . This is done so as to reduce the magnitude B (radius) and D (depth) . It has been suggested that the finite difference technique used to calculate the solution for Poisson's equation will give better results if the magnitude of these parameters is small (Dr. F.T. Lindstrom, personal communi- cation,1980). However, this implies an unusual set of units where 36 all length dimensions are in km (mass in kg and time in sec remain the same). F0 used as an input then has dimensions of and the output values of pressure have dimensions kg/km3sec2, kg/kmsec2 Translating the pressure values into the standard MKS system is fortunately a simple task. Simply by dividing p by l0 we obtain the equivalent MKS value. Comparison of the Models Comparison between the numerical and analytic solutions can be made using several techniques. The most obvious and quite satisfactory procedure is to plot the position of the free surface (or some surface of interest) for both models in the same scale directly over one another. Another way to compare the two situations would be to consider the ratio of the pressure values. On this procedure we operate with the Ratio (R) R Numerical Solution Analytic Solution (4.10) at selected locations within the reservoir. In most of our comparisons we consider specific profiles which are comon to both situations. Particuarly three specific profiles are chosen to illustrate essential changes within the reservoir. One of these is obviously along the reference surface (or slightly below the surface for the t=O case) starting at the borehole and extending radially out. This profile will be of special interest because the boundary conditions along this surface define 37 the pressure values in the reservoir during the succeeding iteration. Another profile of interest is along the central axis extending from the reference surface down. A third profile can be located below the reference surface and extend radially out. In general we have chosen to look at a profile beginning somewhere near the point sink. These three areas give a fairly good coverage of the changes taking place in the reservoir. In the particular case below we have extended these profiles out to a radius or depth of about 3 km for a reservoir with an outer radius of over 14 km . At this distance from the numerical boundaries any boundary effects will clearly be negligible, and yet a good understanding of the significant characteristics of the pressure field can be obtained. The Homogeneous Boundary Value Solution Initially we begin our iteration procedure by setting the pressure on the free surface to zero. The solution to this situation corresponds to the half space homogeneous boundary value case p=O at t0 and z0 as we discussed in chapter (2) for the analytic solution. However with the side and bottom boundaries having a no-flow condition, derivative normal to boundary equal zero, the numerical solution represents a deviation from the half space case. The homogeneous boundary value solution is a simple case and will provide a good situation to obtain a measure of how well the numerical solution matches the analytic solution. One thing to consider is the effect of the lower reservoir boundary on the solution values. By keeping the grid spacing constant and varying the number of grid points between the sink point and the boundaries we can examine the effect of the no-flow condition on solution values. This changes the ratio to the boundary distance L a reasonable value would be d/L (ratio of point sink depth d ) for which we concluded in chapter (2) 1/10 or less. Looking at the plots generated in figures 2, 3, and 4 the most apparent effect of fewer grid points is a poorer fit between the two models. In particular, the R value increases at a greater rate for larger radii. For M=N=144 or 100 the similarity of the R curve shapes and their closeness to unity indicate that the boundary effects are minor for these values. Considering that using M=N=lOO rather than 144 requires about 30% less computational time it is reasonable to consider the lower value as an adequate choice for many cases. However, the choice of the M,N values should depend on the specific requirements of the situation. One other feature which we should point out is the way in which the numerical and analytic solutions close to the borehole sink match. Since the analytic point sink is of infinite density we really can't compare the two situations at the sink position, but the solution values are finite elsewhere. Within about two grid spacings of the borehole sink, the two models become strikingly different. However, beyond this distance the solution values compare much better. This effect is observed in each of the graphs in figures 2 and 3 regardless of the M and N values. In the graphs shown we do not compare the two models out past 3 km (30 grid points) although they compare relatively well at 39 A 1.080 rr.i. L020 1.1.1.] 0.1 0.5 2.1 1.3 r ' Z Figure 2. Profile of R 2.9 1.4 values for the homogeneous boundary value solution for three different boundary distances relative to a constant point sink location. Ei] tE'IsI 1.0200 r Sink at (0,1.4) IA 0.4 2.4 1.2 2.8 z-., r=O 60 , B=D= B - M=N= 100 , B=D= 10.0 - M=N= 144 , B=D= 14.4 A - M=N= C Figure 3. Profile of R 6.0 values for the homogeneous boundary value solution along the radial axis for three different boundary distances relative to a constant point sink location. 41 Jill JóI:1 I.I 1.04 I.02 0 0.4 .2 r b 2.0 2.8 Z=O.2 A - M=N= 60, B=D= 6.0 B - M=N= 100, B=D= 10.0 C - M=N= 144, B=D= 14.4 ) Figure 4. Profile of R values for the homogeneous boundary value solution radially just below the free surface for three different boundary distances relative to a constant point sink location. 42 larger distances up to the vicinity of the boundaries where the fit becomes poorer again. From an examination of R values at constant depth radially out from the point sink we find that the pressure values of the two models are within 10% of each other as far out as 5.1 km Because of linearity these results are independent of the sink strength. When the strength is multiplied by some constant, the solution values are uniformly also multiplied by some constant. The analytic solution most clearly exemplifies this situation because the strength of the sink is a simple multiple in the pressure solution (see eq. 2.35), and any multiple of this value then merely multiplies the solution values likewise. However, the validity of the linearization depends on the drawdown amplitude. Approximation of dp/dz by a Polynomial In order to find the liquid velocity at the free surface in the iteration technique we have to calculate the vertical pressure gradient at the reference surface. An analytic expression for the pressure as a function of depth at z=O is obtained by fitting a polynomial curve to points there. The positions used consist of a point on the reference surface and adjacent points along the zdirection. By taking the derivative of this polynomial at the z=O position we obtain an expression which approximates dp/dz at z=O. Appendix A describes the developement of the fourth order polynomial derivative using Newton's Divided-Difference Method. A brief discussion is also included on the subroutines used to calculate 43 the polynomial derivative. The selection of a fourth order polynomial was based mainly on a trial and error procedure in which a higher order polynomial was found to offer no significant improvements. For example, in a particular situation we calculated the incremental reference surface pressure to be p -9.9822Xl06at z=O using a fourth order polynomial and p= -9.9949Xl06at z=O using a fifth order polynomial. The change in the two surface values for an increase in polynomial order is less than one percent. The Validity of the Linearized Free Surface Approximation There are at least two major factors to consider in deciding on the validity of the time step technique. First we need to know how well the linearization approximates the true situation, and second, how well the time step technique approximates the analytic form of the linearization. The second factor can be evaluated relatively easily by simply selecting the model parameters such that they fit the analytic model. Then by calculating some values and comparing them we obtain a measure of how closely the two models match. However, no analytic solution is known which satisfies the complete non-linear free surface condition in equation 2.5 . Thus we really have no good analytical procedure at our disposal to test how well the linearization would fit an exact solution. Nevertheless by explicitly calculating the quadratic and linear boundary terms in given cases it is possible to obtain a measure of their relative magnitudes. 44 A convienient way to compare these two terms is by taking the ratio which we call Quadratie QR Quadratic Term Linear Term QR (4.11) where the quadratic and linear terms are give by equations 2.19 and 2.20 respectively. QR is convieniently expressed as a percentage value. If this value does not exceed 10% then we consider that a valid justification for excluding the quadratic term since its contribution to the overall free surface condition is small. The 10% limitation is based on common experience with perturbation techniques. Testing out this technique with the reference model RM1 discussed in chapter (2), we find that, in fact, the quadratic terms are small in comparison to the linear term provided that the sink strength and the total time of drawdown are within reasonable bounds. Table 3 gives some selected examples that have been calculated using this model with a time step of 4XlO7sec (463 days). We find that QR tends to limit the admissible sink strength (f0) in this particular model. In addition, if we know QR for some specific f0 value and some specified model parameters, then within the present approximation the QR' for some other f value with the same model parameters is simply fi QR' ) QR ( . (4.12) It is also of interest that the surface point having the highest QR value tends to change with time and approaches in the case of RM1 a stable position near (r,z)=(l.0,0) . Calculation of QR for the 45 analytic solution also indicates a similar change of position for the maximum QR with time. The position it migrates to depends on the depth of the point sink. Table 3. Selected examples of the maximum QR for different times using a time step of 4XlO7sec with model RM1. Time X107 sec Position (r,z) km QR (f0=50) QR (f0=l000) 0 (0.0,0) 0.00416 0.0832 4 (0.0,0) 0.00299 0.0598 12 (0.7,0) 0.00221 0.0442 20 (0.9,0) 0.00244 0.0488 40 (1.0,0) 0.00405 0.0810 60 (1.0,0) 0.00634 0.1268 80 (1.0,0) 0.00902 0.1804 The Time-Iterative Solution The time-iterative solution is the next step beyond the homogeneous boundary value case since it begins with a zero pressure on the free surface boundary then perturbs the situation and recalculates a new solution. We still must consider the fact that the time step procedure depends on a pressure field solution which contains boundaries at distance. However, comparing this to the analytic solution through many time steps will be a good test of the iteration method. Figure 5 shows a profile of the free liquid surface for RM1 as set up in chapter (2) over a time period of 8OXIO7sec . Here we have selected a time step of 4XlO7sec as an example. The surface drawdown is in a conical shape around the borehole with the maximum at the (Km) r-' [I] 0.2 0.4 I 0.6 I 0.8 I 1.0 I OXIO7sec 1.2 I 1.4 I 16 1.8 2.0 2.2 4 2.6 _I 0.5 (m) Z=h 20X 101 sec 2°H 40 X 3.5 60 X IO7sec 4.0 8OXIO7sec 4.5-F Figure 5. Profile of the free liquid surface radially outward from the central axis for several different times of the model RM1 with At= 4XlO7sec . 2.8 47 central axis and smoothly becomes smaller radially outward. The initial drawdown rate is large, but rapidly slows down with increasing time as indicated by the time lines being closer together for large t The profiles shown here are scaled with a rather large vertical exaggeration of 1000 to emphasize the drawdown features. As noted earlier for the homogeneous boundary value case, the magnitude of the pressure field within the reservoir is directly proportional to the value of the sink strength (f0) . This effect holds also through the time step procedure. Consequently if a larger withdrawal (e.g. 500 kg/sec) were considered the curves would still be the same only the scale on the z-axis would be multiplied by a constant factor (equivalent to a vertical exaggeration of 100). The next problem is to find out how well figure 5 represents the analytic situation which RM1 is designed to approximate. Figures 6 and 7 show the ratio R for two of the selected profiles (radially out from the sink and along the reference surface, respectively) over the time interval of the drawdown. After the first time step (time = 4XlO7sec) the free surface has significantly overshot the drawdown of the analytic solution near the borehole. However, it quickly settles down and achieves a fairly close approximation to the analytic solution after several time steps. Farther out from the borehole the R values indicate that the difference between the analytic and numerical solution becomes notably larger, and in addition the trend over time is for this situation to become worse. Yet figures 6 and 7 indicate that the divergence of the analytic Time III.'.'.] A - 8(lO7sec B - 6OXlO7sec C - 4OXlO7sec D - 2OXlO7sec 1.0800 E - 4XlO7sec 11 t.j R11L.I.] C n 1.0200 E 'SI.'.'.] [.WI;I.II 0.1 0.5 13 r ' 2.1 Z=I.4 Figure 6. R values plotted radially out from the point sink at several different times for RM1 with it= 4XlO7sec. 49 I. I. I. I.0 R I.0 1.0 I.0 I.0( o 0.4 1.2 r ' 2.0 2.8 z=o Figure 7. values plotted radially out along the reference surface at several different times for RM1 with t=4XlO7. R 50 and numerical models with time is not very rapid. We also are interested in how well the polynomial derivatives of the numerical solutions compare with the analytically derived derivatives. To illustrate the similarity over time for several surface points Table 4 list some calculated values for a particular case (it= 4XlO7sec). Comparison indicates that the numerical polynomial derivative values are fairly good approximations to the analytic solutions. Table 4. Comparison between analytic and RM1 polynomial derivative values for t= 4XlO7sec at two selected points on the reference surface. dp/dr Time Analytic Numerical (r,z)=(0.4,0) %Diff Analytic dp/dz Numerical %Diff 0 0 0 -36.09X106 -36.19X106 <1 20Xl07 8.05X106 8.60Xl06 7 -13.47X106 -l2.27X106 9 40X107 9.49X106 9.76Xl06 3 -6.90Xl06 -6.38X106 8 60X107 9.93Xl06 l0.11XlO6 2 -4.l7XlO6 -3.99X106 4 0 (r,z)=(2.4,0) 0 0 0 0 -5.l9Xl06 -5.26X106 1 20X107 3.96Xl06 4.l5X106 5 -4.90X106 -5.08X106 4 40Xl07 6.l9Xl06 6.41X106 4 -3.80Xl06 -3.89X106 2 60Xl07 7.34Xl06 7.49X106 2 -2.83X106 -2.92Xl06 3 In Chapter (2) we established that a drawdown of 1/5 the borehole depth would be an upper bound for the applicability of the linearized free surface approximation. Calculating out the maximum drawdown at the borehole for RM1 after a time of 8OXlO7sec 51 (t= 4XlO'7sec) we get 4.42 m for a flow strength f0=50 kg/sec . This compares well with the analytically determined value of 4.27 m for the same time, and it is well within the established limit. Another way to view this situation is to use the maximum drawdown limit for this model and calculate the maximum flow strength required to produce that drawdown over the time interval. Since the pressure values calculated for a particular flow strength f0 can be used to determine the pressure values for any other flow strength f (as a simple multiple f/f0 ), this task becomes an easy problem. We find that a flow rate of 3168 kg/sec would produce the drawdown limit for RM1 (t= 4X1O7sec) after 80X1O7sec However, the maximum drawdown is not the only limiting factor for the flow rate. The Quadratio (QR) also changes as approximately a simple multiple (f/f0) of the flow rate. Taking the maximum QR value calculated along the reference surface of the numerical model, we use this to set up a proportionality and find the limiting f0 value. Table 5 list the maximum f0 values allowed based on the QR=O.l limit defined earlier. The limitations placed on the quadratic term specify an upper limit to the flow rate of 554 kg/sec for this model. Thus the QR value becomes the limiting factor at least in this case. The iterative technique we have discussed works adequately for most physical models. It is however limited by an inherent complication which may arrise in certain cases. Generally these computational artifacts are easily distinquished. In the cases we have dealt with, a sudden reversal in the pressure gradient caused anomalous values to occur at the point (0,0) (or nearby points on 52 Table 5. The maximum flow rate kg/sec) possible for RM1 to f maintain the established limits on QR through successive time iterations. Based on the largest QR value for each iteration ( Time in Sec. X107 ). = Itera.# 4X107 Time Time om Time lOXlO7 9X107 8X107 5X107 om Time om Time om 1 4 1672 5 1849 8 2108 9 2060 10 1960 2 8 2116 10 2234 16 2048 18 1905 20 1735 3 12 2267 15 2204 24 1735 27 1600 30 1501 4 16 2202 20 2009 32 1345 36 1132 5 20 2048 25 1778 40 1112 45 949 6 24 1863 30 1563 48 946 7 28 1684 35 1368 56 712 8 32 1516 40 1204 64 62 9 36 1365 45 1067 10 40 1233 50 951 11 44 1118 55 855 12 48 1018 60 771 13 52 931 65 702 14 56 855 15 60 788 16 64 729 17 68 677 18 72 632 19 76 591 20 80 554 53 the reference surface) after several time steps. Continuing the time step procedure resulted in similar discrepancies at other points along the surface. A possible cause for this condition may be that the numerical polynomial derivative values become small after some given number of time steps and the calculated value then becomes subjected to irregularities of the polynomial approximation. Consequently when the polynomial derivative becomes small it may begin taking on incorrect negative values which result in the observed pressure gradient reversals. Thea priori predicting of such gradient reversals would require a rather involved analysis. The parameter b (4.13) b = has been found to be related to the maximum number of time steps taken before an anomalous pressure gradient reversal occurs. It is a factor which appears in the calculation of the free surface pressure values for a time step (see eq. 3.3), and we have called it the characteristic interval. Its name is chosen because Cg/q is refered to as the characteristic fluid velocity (Bodvarsson,1977). Figure 8 shows how this is related to the number of time steps taken for a point sink. The values of porosity, conductivity, and the time increment can be varied for convenience without affecting the program operation provided that b remains the same. We can also change the magnitude of the point sink (source) strength f0 without affecting the number of time steps taken before the pressure gradient reversal occurs. 54 2( Cl) cI E a) 0 C 5 U.1 U. Q. 0.4 0.5 0.6 0.7 0.8 0.9 1.0 b= 2-9-t 0 Figure 8. Maximum time steps before reversal of pressure gradient as a function of the characteristic interval for RM1 4 BIBLIOGRAPHY Bodvarsson, G.,1970, Confined Fluids as Strain Meters; J. Geophys. Res., 75(14), 2711-2718 Bodvarsson, G.,l977, Unconfined Aquifer FLow with a Linearized Free Surface Condition; Jku1l, 27 Carnahan, B., H.A. Luther, and J.O. Wilkes. 1969. Applied Numerical Methods. John Wiley and Sons, New York, 604 pp. Carslaw, H.S. and J.C. Jaeger. 1959. Conduction of Heat in Solids. 2nd ed., Oxford University Press, London. Duff, G.F.D. and D. Naylor. 1966. Differential Equations of Applied Mathematics. John Wiley and Sons, New York, 423 pp. Swarztrauber P. and R. Sweet, 1975, Efficient Fortran Subroutines for the Solution of Elliptic Partial Differential Equations. NCAR, Tech. Note , TN/IA-109 , Boulder Colorado. Zais, E.J. and G. Bodvarsson, 1980, Analysis of Production Decline in Geothermal Reservoirs, LBL-112l5, GREMP-lO. APPENDICES 56 APPENDIX A Development of a Fourth Order Polynomial Derivative Development of an interpolating polynomial using Newton's Divided-Difference Method is given by Carnahan, etal. (1969). Adapting a similar notation we can write out a fourth order interpolating polynomial without the remainder term as: y(x) = a4x4 + a3x3 + a2x2 a1x + a0 (A.l) where, a4 = y[x4,x3,x2,x1,x0] a3 = y[x3,x2,x1,x0] - (A.2) (x0+x1+x2+x3)y[x4,x3,x2,x1,x0J (A.3) a2 = [(x0x1+x0x2+x0x3+x1x2+x1x3x2x3)y[x4x3x2x1x0] (x0+x1+x2)y[x3,x2,x1 ,x0] + a1 = (A.4) [(x0x1+x0x2+x1x2)y[x3x2x1x0] - (x0x1x2+x0x1x3+x0x2x3+ x1x2x3)y[x4,x3,x2,x1,x0] - (x0+x1)y[x2,x1,x0] + y[x1 x0]J a0 = - (A.5) {(x0x1x2x3)y[x4x3x2x1x0] - (x0x1x2)y[x3,x2,x1,x0] + (x0x1)y[x2,x1,x03 - (x0)y[x1,x0] + y[xx1 ...,x0]= . Xl] Y[Xn1Xn_2 xn - xO (A.6) X0] (A.7) Taking the derivative we have, y'(x) = 4a4x3 + 3a3x2 + 2a2x + a1 (A.8) 57 for the sample values y4, y3, y2, y,, y0 corresponding to the positions x4, x3, x2, x1, x0 y . In this situation the spacing of the values determines the denominator of the difference thus only relative magnitudes of the x positions are significant. We need to know the derivative at the reference surface. Consequently, for y0 at the surface z=O we choose x0=O for convenience such that y1,y2,y3,y4 and x1,x2,x3,x4 are successive points below the surface. The derivative is then taken at x=O which helps simplify the form of equation A.8 to y'(0) = a1 (A.9) To calculate the derivative values on the reference surface with the time step technique a subroutine called DIFTBL is used to set up the Newton's divided-difference table for the selected values. Input parameters are listed in Table 6 Table 6. Input for subroutines DIFTBL and DERVZO to calculate the polynomial derivative of the free surface. Parameter X - Array containing position values x0,x1,x2,x3,x4 with x0x(1) F - Matrix array of solution values for the reservoir IC - Radial position F(IC,l) of first polynomial point x0 TABLE - (x1,x2,x3,x4 are along the z-axis from x0) Matrix array of the divided difference table values (output) MP - Polynomial order NP - Number of points used K - Dimension of arrays OK - Check for polynomial order errors X and TABLE Arrays F and X must be set up prior to use of the subroutine. Output values in matrix array TABLE are used with Function to calculate equation A.9 for the point fit to points F(IC,J) J=i,5 F(IC,l) DERVZO using a polynomial APPENDIX B Program Listings The interactive calling program for the iteration technique is POSGO . Using a set of command prompts from a terminal the user directs the computational actions and checks progress or results. The program documentation contains a complete list of these commands with explanation. In addition, all parameters required are explained in the program documentation for each section or subroutine used. Some commands require additional information from the user before the job can be completed. In this case, the program prompts the user with appropriate questions or format required for input. The program operation of POSGO begins by a prompt for a command. Entering a command from the terminal results in the program operation being shifted to the specific command section. If additional information is required (e.g. input of a parameter value, profile position, etc.) a prompt will appear on the screen indicating the type of information required and/or the format specification expected on input. When sufficient information is obtained the appropriate subroutines are called and jobs performed. After completion of the calculations or task for a command section the program returns to the command selection and prompts for another request. POSGO and associated subroutines are written in single precision FORTRAN IV and designed to be used on a CYBER computer. To use on some other computer the array allocations and input/output sections must be checked for compatability. ?ROGRAP4 POSGO(tNPUT,OtJTpUT,TAeQ,TApEj2,TApEjj5,T4pEj,54,J) C C C C C C C CC CCCCC CCCCCCCCCCCCCCCC CCCCCCCC CCCCC CCCCCCCCCC C 0000CCCCC coco cc c CCCC CCCC POSGO IS AM INTERACTIVE CALLING PROGRAM FOR THE SUBROUTINES PWSCYL,... IT GIVES THE USER A WAY OF CHANGING PARAMETERS AND RECALULATtNG THE SOLUTION FOR THE 2-OIM P0155CM EQ. (OR THE MORE GENERAL MEL PHOLTZ EQ.) C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C WRITTEN BY S VERSION * WILLrAM E. IVERA TIME ITERATIVE DROCEEDU DEVISED BY * DR. GUNNAR BOOVARSSCN C 3 MARCH 191 1 INPUT I CUTPUT SPECIFICATIONS TAPEINTIAL PARAMETERS INPUT TO P05CC TAPEI1=OUTPUT FILE USED TO MAKE A SECOND RUM CR IS REALLY JUST A COPY OF (I,J) AS ALLEO ON INPUT IC PWSCYL. TAPE12OUI°UT FILE CONTAINING SOME PARAMETERS USED ALONG WITH THE OUTPUT VALUES (AS FOLLOWS) PARAMETERS LINE 1 A,B,M,IBOCNO,CONOIFLG1,IFLG2 (ZX,2F15.4,2110,E15.8,jx,2Ij) LINE 2 C,O,N,HBOCNO,ONI,FLG3,IFLG4 (2X,2F15.'4,2110,E15.8,1X,211) (2X,L.Fj5.) LINE 3 ELMBDA,RHO,TINC,T!M LINE . THROUGH LIME (M+1)+3 OR LINE (M+j)+3 WHICHEVER LARGEST BDA(t) 908(1), 30C(I), 300(I) (2X,'.F15.4) FROM THIS POINT TILL END OF FILE OUTPUT FQOM PWSCYL CF(11J)] (2X,E15.8,I1X,Ej5.8,11X,Ej5.8,I1X,E15.8,lj.X,E15.8,jjX) TAPE1(.CCPY OF THE 4PAMETERS WHICH CAN BE USED LATER AS A PARAMETER INPUT FILE OUTPUT FILES PRSENTLY TAPEj. AND 10IHF155 ALWAYS TAPEL2 (THE INCLUDE LINE PRINTER CARRAGE CONTROL DIMENSION CF THE F ARRAY) I 15 IN THE RADIAL DIRECTION. N IS IN THE Z DIRECTION (USING CYLINDRICAL CURD.) P P Q N MUST BE OF THE FORM (2) (3) (5) , P,Q,P ARE MON-NEGATIVE INTEGERS LIMITS ON N AND P4 ARE SET At 150 H CUTPUT TO TERMINAL MAY BE OBTAINED FOR AMY SIZE BLOCK OF THE MATRIX BY SPECIFYING THE BEGINNING AND ENCING AND (1)5 (J)5. (I3,4X,13, 1X,I3,'.X,I3) F(I,J) OUTPUT TO TAPEI2 AND TAPE1 IS IN 5 COLUMNS WHERE THE (I) DIMENSION OF THE BLOCK REQUESTED HAS BEEN BROKEN UP INTO A MULTIPLE OF 5 INPUT INFORMATION FROM THE TERMINAL IS GENERALLY PROMPTED BY A GROUP CF LETTERS ABOVE THE INPUT LINE tHAT INDICATE THE FCRMAT,POSITION, AND TYPE OF INFORMATION REQUESTED. C NOTE 3 CAUTION IS PEQUTED WHEN INPUTTING VALUES TO PROGRAM INTEGERS MUST BE RIGHT SHIFTED AND NON-INTEGERS MUST INCLUDE A PERIOD. FLG3 - FLAG TO ALLOW THE USER TO DECIDE IF THE DERIVATIVE VALUES 30A,BOB,BDC,900 WILL BE OUTPUT WITH THE SOLUTICH VALUES(POSLST) OUTPUT OF THESE VALUES IS SURPRESSED UNLESS SPECIFIED EACH TIME P COMMAND IS USED. FLG3 = 0 DERIVATIVE OUTPUT SUPPRESSED FROM POSLST FLG3 DERIVATIVE VALUES OUTPUT WITH POSLST 1 C MOTE 3 EXPLANATION OF THE MEANING AND USAGE OF PARAMETERS IS GIVEN IN THE PWSCYL DOCUMENTATION. A PCLYNCMIAL FIT TO THE FIRST FIVE POINTS ALONG THE DIRECTION Z OF EACH COLUMN FOP CI,J) IS USED TO CALCULATE THE DERIVATIVE CF THE PRESSURE FIELD AT !0. A TIME INCREMENT IS THEM USED TO DETERMINE THE MOVEMENT OF THE LUIO SURFACE. USING A HYDROSTATIC P°ESSUE WE THEN CALCULATE A MEW PRESSURE VALUE FOR Z0 AN ITERATIVE PROCEDURE ALLOWS THIS TO BE CONE FOR AS LONG AS NECCESARY. PARAMETERS WITH SPECIFIC USAGES ( NOT FOUND IN °WSCYL DOCUMENTATION 61 TINC - TIME INCEMEHT /ALJE USED TO EVALUATE THE INCREMENTAL PRESSURE CHANGE OP THE FREE SURFACE ( F(I,j) 11,M+tl DURING ONE TIME STE. UNITS SECCNOS RHO - DENSITY OF FLUID IN cYLINDRICAL RESERVOIR UNITS MASS/VOLUME - EFFECTIVE OROSITY OF °ESERVO!R MATERIAL - TIME OF WHICH THE CURRENT SOLUTICNS HAVE BEEN INCREMENTED 10. TIw SUM OF TIME INCREMENTS USED UNITS SECONDS CONO - FLUID CONDUCTIVITY OF RESERVOIR CONG PERMEABILITY / KINEMATIC VISCOSITY UNITS SECONDS PH! TIM ( EXPLANATION OF COMMANDS R - (RUN) CAUSES EXECUTION CF SUBROUTINE GROUP PWSCY!.. TO CALCULATE THE NUMERICAL SOLUTION 8ASEC ON THE INPUT VALUES F IN ARRAY ALOPIG WITH THE BOUNDARY CONDITIONS (A,3,C,3,MBDCNO, NeDCND,9O4,BQ8,BOC,3DO), AND PARAMETERS (M,N,ELMBOA) I - (INCREMENT) DIRECTS THE SYSTEM 3 INCREMENT 'RESSURE VALUES ALCMG THE UPPE° SURFACE (REFERENCE SURFACE) OF THE CYLINDRICAL It,M+t I. PRESSURE INCREMENTS ARE OBTAINED EGION (I.E. F(I,1) BY TAKING THE SOLUTION VALUES OF A COLUMN IN THE pMATRIX (J1,5) AND CALCULATING A FOURTH ORDER POLYNOMIAL APPROXIMATION 10 THE GRADIENT (DERIVATIVE) AT TIE REFERENCE SURFACE (Jt). USING THIS A VERTICAL VELOCITY IS CALCULATED FOR THE FREE SURFACE AT EACH CF THE COLUMNS BY COND'(PRESSURE GADIENT) / (RHO PHI) UNITS LENGTH / TIME VEL IT HAS BEEN SUGGESTED THAT REDUCING THE MAGNITUDE OF A,B,C.D PARAMETERS WILL PRODUCE A MORE ACCURATE THE SOLUTION. FOR THIS REASON WE HAVE CHOOSEN TO REPRESENT A,B.C,O IN <ILOMETERS RATHER THAN METERS. THIS RESULTS IN SOMEWHAT STQANGE UNITS FOR PRESSURE OF KG./t(.3)(SECZ)1 SINCE ALL LENGTH DIMENSIONS M. ARE THEM INPUT AS INSTEAD OF METERS. LIKE4ISE THE VELOCITY IS THEN KM./SEC WE HAVE ALSO CHOOSEM A CYLINDRICAL COORDINATE SYSTEM WITH OROGIN (1,O) AT F(t.1) THE VELOCITY IS MtJLTIPLIED BY THE TIME INCREMENT TO OBTAIN AN INCREMENTAL LOWERING DELTA (H) OF THE FREE SURFACE. NOTE I OELTA(H) VEL TINC A NEW PRESSURE VALUE IS THEN CALCULATED FOP EACH POINT ON THE SURFACE AT F(I,1) It,M+1 USING THE HYDROSTATIC ELATION NEW PRESSURE = (OLD DRESSURE) s OELTA(H)GRAVRHO GRAy = 9.8OS5E-3 KM/SEC THE REMAINING FCI,J) I1,1+1 , J=a,N+I. ARE RESET TO ZERO FOR THE NEXT ITERATION. NOTE I FOP TWE SPECIFIC URPOSE OF DEALING WITH DCTNT SOURCE(SINK) SOLUTIONS THE LAST Ftt,J) CHANGED WITH THE CHANGE COMMAND IS INSERTED INTO THE SAME (!,J) LOCATION WITH THIS COMMAND TO PRESERVE THE SOURCE VALUE DURING AN ITERATICN. L - (LIST) ALLOWS THE USER 10 VIEW ANY PORTION CF THE F(I,.J) MATRIX DESIRED Al' THE TERMINAL BY SIMPLY RESPONDING TO A OROMPT WITH THE BEGINNING I VALUE FOLLOWED BY THE ENDING I VALUE FOLLCWEO BY THE BEGINNING AND ENDING J VALUES. USE FORMAT (I3,'.X,I3,1X,I3,.X,I3). TAPEI2 CF SOME ARAMETERS P - (PRINT SOLUTION) CREATES * FILE THROU(H VALUES USED AND THE SOLUTION VALUES F(I,J) CREATED BY PWSCYL. ANY CRTION OF THE F(I,J) MATRIX MAY BE OUTPUT AS SPECIFIED BY A QESPONC! TO A PROMPT 4ITH THE BEGINNING AND ENCI.'IG I AND ALSO AS SPECIFIED BY THE SETTING OF FLG3 VALUES. J T - (TIEORETICAL VALUES) CDPUTES THE ANALYTICAL SOLUTTCN TO OISSONS EQUATION FOR A P)INT SOtJRCE(SINK) IN AN INFINITE HALF SPACE BOUNDED BY A FREE SURFACE ALONG A SELECTED FROFILE. THE PROFILE VALUES (F(I,J)] U IS SELECTED BY SUPPLYING THE BEGINNING I AND SUBSCRIPT FOLLOWED BY I FOLLOWED BY A VALUE TO INCREMENT THE A VALUE TO INCREMENT THE U SU8CRIPT FOLLOWED BY THE TOTAL NUMBER OF POINTS (INCREMENTS) TO BE USED IN THE PROFILE 1.55 3. U3,IX I3,LX 13,1x,13,1X,13) (THIS CAN NOT EXCEED TAPi2 THE PROFILE VALUES ARE THEN OUTPUT T A RATIO OF THE NUMERICAL RESULTS WITH THE THEORETICAL VALUES IS OUTPUT FOR COMPARISON PURPOSES. RATIO = NUMERICAL / THEORETICAL Q - (QUADRATIC RATIO COMPUTES THE FCURTH ORDER POLYNOMIAL DERIVATIVES DP/OZ 3, AMO ALCULATES BOTH THE LINEAR AND QUADRATIC OP/DR t TERMS. THEN FORMS THE RATIC C C C C C C C C C C C C C C C QR = QUADRATIC / LINEAR ALCNG THE REFERENCE SURFACE ARE COMPUTATIONAL POINTS F(I,i) SELECTED BY INPUT OF BEGINNING I FOLLOWED BY ENDING I FOLLOWED BY INTERVAL SPACING OF CALCULATEC F(I,1) POINTS. (13,LX,13,1X,13) WHICH CAN BE lAPEL'. 0 - (DATA FILE) OUTPUTS A PARAMETER FILE TO USED AS AN INPUT FILE. THE PWSCYL INPUT F-MATRIX MUST HAVE TAPELL) IN ORDER (TO CREATE FILE BEEN SAVED WITH COMMAND SF FOR THE ARAMETER FILE TO BE OUTPUT. USE OF THIS COMMAND DOES NOT ALTER THE CONTENTS OF THE F-MATRIX. C C C C C C C C C C C E - (END) ALLOWS THE USER TO EXIT THE PROGRAM OPERATIONS WHEN WORK IS COMPLETED. PLACED BEFORE ANY OF THE PARAMETER NAMES C - (CHANGE) A I C C F,M,N,A,8,C.O, TINC,COMO,TIM,PHI,RHO,BOA,80B,BDC,800, ALLOWS THE USER TO CHANGE THE MBQCNO,NBDCNO,ELMBOA,FLG3 (EXAMPLE I CTINC VALUE OF THAT PARAMETER. THE USER IS PROMPTED FOR THE INPUT WITH AN INTEGER OR NON-INTEGER DESIGNATING THE LOCATION OF INPUT FIELD. OF THE CURRENT F-MATRIX CREATES A FILE (TAPEIL) SF - (SAVE F (USUALLY USED TO SAVE THE F-MATRIX INPUT TO WSCYL BEFORE A PASS THROUGH PWSCYL 14 THE EVENT THAT THOSE PARAMETER VALUES WOULD NEED TO BE USED LATER) UTILIZES THE FILE OF INPUT F VALUES CREATED RF - (RESET WITH THE SF COMMAND TO RELOAD THE F-MATRIX WITH THESE VALUES EW VALUES ARE CHANGED IN THE INPUT F-MATRIX (USEFUL IF ONLY A FOR SUCCESSIVE RUNS WITH PWSCYL) C C C I C C I C C C C C 3 C C C C C C 3 C C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCC C C DIMENSION BOA(155),BDB(t55),9DC(155) ,800(155) DIMENSION F(155,155),W(21?0),RATIO(155) DIMENSION ORVR(155),)RVZtL55) INTLO ZERO ALL ARRAYS EXCEPT 00 21 I1,t55 BOA(I)=0. 908(1)20. 9DC( 1)213. 800(1)20. RATIO(I)20.IE-19 00 22 J1,.31 JC1=J+31 JC2J+62 JC3J+ 93 JC.,J+t24 F (I,J)2O. F(I,JCI) 0. F(I,JC2) =0. F(I,JC3)20. F(I,JCk) 213 22 CONTINUE 21 CONTINUE C C C C FSAVEQ. IFLG1O 1F1G2 0 IFLG3O IFLG'.0 IFLGO SET 101MF155 10IMF155 W 63 C READ IN THE INITIAL PARAMETER LIST READ(9,103) A,B,M,M9DCNO.CONO1IFLGItIFLG2 READ(9,133J C,O,N,N8DCNOtPHI,LFLG3,LFLG4 READ(9,109) ELM9D,RH0,TLNC,TIM MIPi+j M1N+t C C C DETERMINE THE OPTIMUM F(I,J) LIST LENGTH RRMM1 RRM(RRMI5.1 +0.9 0.9 ADDED TO ROUND-OFF TO NEXT INTEGER MRR RRPf MRR22MRR MR23 3MRR MRRI. 4MRR C CONTINUE READING PARAMETERS IF(M1.GE.N1) 11M1 IF(N1.GZ.M1) ITN1 00 23 11,IT REAO(9,109) BDA(I),808(I),8DC(I).800(I) 23 CONTINUE 00 2. Il,MRR 1C1 I+MRR IC2I+MRR2 1C31+PIRR3 IC41+NRR'. 00 25 J1,Nt REAO(9,126) F(I,J),F(ICI,J),F(1C2,J),F(IC3,,J),FtIC4,J) 25 CONTINUE 2'. CONTINUE C C C C C EFCEFCEFCEFCEFCEFCEFCEFCEFCEFCE FCEFCEFCEFCE FCEFCEFCEFCEFCEFCEFCEFCE FCEF EFC COMMAND 4N0 EDITOR FUNCTIOMS (THE ORDER OF COMMAND CMECS IS BASED ON EXPECTED MOST USED COMMANDS FIRST) 26 WRITE tOl C C C C READ 10?,RESPI. ICHNG1 IF(RESP1.EQ.THR ) IF(RESPI.EQ.7H1 ) IF(RESPI.EQ.7H1 ) ) IF(RESP1.EQ.?HP P IF(RESPI.EQ.THT IF(RESPt.EQ.THQ ) IF(RESPI.EQ.7H0 IF(RESPt.EQ.7HE P IF(RESPI.EQ.7HCTINC ) ) IF(RESP1.EQ.7HCF IF(RESPI.EO.?HCM IF(RESPt.EO.7HCN P IF(RESP1.EQ.7HCCONO ) IF(RESP1.EQ.7HCA IF(RESP1.EQ.7HCB ) IF(RESPI.EQ.7HCC IF(RESP1.EQ.7HCD P IF(RESP1.EQ.THCPHI P IF(RESP1.EQ.7HCTIM P IF(RESP1.EQ.THCRHO ) IF(RESPI.EQ.THC8OA P IFCRESPI.EO.7HCBDB P P IF(RESPI.EQ.?HCBOC IF(RESPI.EQ.7HCBOO ) IF(RESP1.EQ.7HCMBDCNO) IF(RESPI.EQ.THCNBOCIO) IF(RESPI.EQ.7HCELMBOA) IF(RESPI.EQ.?HSF P IF(RESP1.EQ.7HRF P IF(RESPt.EQ.7HCFLG3 P WRITE 115,RESP1 P P P P C C C GO GO GO GO GO GO GO GO GD GO CD GD GO GD GO 53 CD GO 50 GD GO G0 CD CO GO GO GO CD GO GD TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO TO 53 83 66 62 C C C C C C 9'. C 80 C C C 98 60 '.4 32 30 31 '.6 38 39 '.0 kt '.7 45 '.8 33 3'. 35 36 42 43 37 50 TO 75 TO '.9 501026 C C C C C C C C C C C C C C C C C C C C C C C C C CEFCEFCFECEFCEFCEFCEFCEFCEFCEFCEFCEFCEFCEFCEFCEFCEFCEFCEFCEFCEFCEFCEFCEFCEFC C C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC COMMAND S CHANGE = C C * C 64 ARAMETER EDITOR SECTION (EACH GRCUP OF STATEMENTS RE C C E3ENTS THE REFERENCING CHANGE COMMAND) 30 WRITE 103 READ 105,XN M XM Ml V4+ 1. R R M Nj RM=(RRM/5.)+0.q MQRRRP MQR22MRR 4RQ3=3MQR MR P RR GO TO 26 31 WRITE 106 READ j05,XN NXN NIN+1 GO TO 26 32 WRITE 110 READ lj1,ICHNG 00 27 1t,ICHNG WRITE 112 EAD 113,IVALF,JVALF WRITE 108 READ 105,F(IVALF,JVALF) 27 CONTINUE tcHN1 C C C C FOR SPECIAL ITERATIVE USES THE LAST F(I,J) VALUE CHANGED IS SAVED FSAVEF(IVALF,JVALF) IFLGkI GO TO 25 33 WRITE 110 READ 111.ICHP4G 00 23 It,ICHNG WRITE 11' READ 111,IVAL WRITE 108 READ 105,8D4(IVAL) 28 CONTINUE ICHNGI 3 GO TO 26 WRITE 110 READ 111,ICI4NG DO 29 Il.ICHNG WRITE 11. READ t11,IVAL WRITE 108 READ 105,8D8(IVAL) 29 CONTINUE ICHNGI GO TO 26 35 WRITE 110 READ j11,ICHNG DO 92 I,IcHNG WRITE 11+ READ ill,IVAL WRITE 108 READ 105,30C(IVAL) 92 CONTINUE I)4NG1 GO TO 25 36 WRITE 110 READ 111,ICM'4G DO 93 11,ICHMG WRITE 11e READ 111,IVAL WRITE 108 READ 105,300CIVAL) 93 CONTINUE ICNNG1 GO TO 26 37 WRITE 108 READ 105,ELMBDA GO TO 26 38 WRITE 108 READ 105,A GO TO 26 39 WRITE 103 65 A9 10 .8 '0 wRtT C 108 C A0 i05,C C C C C C GO TO 2 1 WRITE 108 READ 105,0 GOTO2S 2 WRITE 108 READ 105,XMBCD C C C IBOCNDXMBCO 0OT026 C C L3 WRITE 108 READ 105,XN8CO M9DCNO=XNBCC C C INTLO t. G0T026 C C WRITE 108 REAO 105,TINC C C C G0T026 5 WRITE 108 READ j05,TIM C 001026 C .6 WRITE 108 EAO 105,CONO C e7 WRITE 108 READ i05,PHI C 8 WRtTE 108 READ 105,RHO C C 001026 C c G01026 C c 001026 C C .9 WRITE 108 READ 105,FLG3 C C C 1FL03F103 C 001026 C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C CSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSS C SF SAVE F CCMMANO I C S * C C C C C C CREATE FILE OF CURRENT F(I,J) FOR LATER USE S S 5 S 50 REWIND it IFLG2I 00 51 11,MPR 1C11+MRR IC2I+P'R2 1C31+MRR3 IC=I+MRR 00 52 .J=1,N1 WRITE(11,12) Fr,J),F(IC1,J),F(IC2,.J),FUC3,J),F(IC,J) 52 CONTINUE St CONTINUE C S 001026 S S S S S S S S S CSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFSFS C CRPRRRRRRPRRPRQRRRRRRRRRRRRRRRRRRRRRRRPQRRRRRRRRRRRRRRRRRRRRRRRPRRRRRR C C C C C C C C C C C C C RUN = P 1 COMMAND I HE CURENT PARAMETERS TO O9TAIN A SOLUTION USING 53 CONTINUE CALL PWSC'fL(INTL,a,9,M,NBDCNO,804,8C8,C,0,N,N8OCNO,BDC,800, I ELP'80A,F,ICIMF,PERTR8,IERROR,W) RESETTING INTL FOP MOPE RUMS WITH NEW PARAMETERS INTL1 TERROR AND PERTR8 NCW WRITING OUT RRp INFORMATION OF MATRIX (GRID) POINTS ALONG WITH INFORMATION ON THE AND THE TIME INCREMENT WRITE 116, TERROR, PERTRB,Mt,Nt,TIMC,TIM IFLGIQ G0T026 R P R p P P P p C RRRRRRRPRRRRRRRRRRRRRRRRRRRRORRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR CLLLLLLLLLLLLLLLLLLLLLL.LLLLLLLLLLLLLLLL. LLLLLLLLLLLLLLLLLLLLLL LLLLLLLLLLLLLLL C L C CCMMANO I LIST = I I L C C C C C C C C c C L OUTPUTTING SOLUTION VALUES TO TERMINAL OUTPUT MAY BE OBTAINED IN BLOCKS OF SIZE DEPENDING ON THE INPUT GIVEN AS FOLLOWS: BEGINNING (I) VALUE FOLLOWED BY THE E'OING (I) VALUE FOLLOWED BY THE BEGINNING U) VALUE AND ENDING (U) L L L L VALUE. L FURTHER BLOCKS MAY THEN BE INSPECTED (THE PROCESS MAY THEN BE REPEATED) 66 WRITE 127 READ 12,I8,IE,.Ja,JE 00 63 IIB.IE 00 6'. JJB,JE WRITE 122,F(t,J),I,J 6'. CONTINUE 63 CONTINUE WRITE 129 READ t02,RESP6 tF(RESP6.EO.IHY) GO TO 6 I L 1 I I I L L L 1 L I I I G01026 CLLLLLLLLLLLLLLLLLL LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL C CPPPPOPPPPPPPPPPPPPP°PPPPPPPP°PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP C C C C C C C C C COMMAND PRINT SOLUTIONS = P PRODUCING A LISTING OF SOLUTION VALUES AND SOME PARAMETERS USED OUTPUT OF FUI,.j) IS IN BLOCKS WHICH APE ARRANGED IN 5 COLUMNS WHERE THE (I) DIMENSION HAS BEEN BROKEN UP INTO THE 5 DIVISIONS 62 WRITE(12,123) A,8,M,MBDCNO,00NO,IFLGI,IFLG2 WRITEt12.iO3) C,O,N,NBOCNO,PHI,IFLG3,IFLGt. WRITE(12,109) ELMBOA,RHO,TINC,TIM CJJJJJ.JJ.JJJJJJJJJUJ.JJJJJJJJJJJJJJJJJJJJJJJJJJJ C C STATEMENT INSERTED TO JUMP CURRENTLY UNNECESSARY C P RIE(RIE/5.)+O.9 IIE1RIE IIEIIEttB-t t1E22'IIEl tIE3=3IIE1 11E4k11E1 00 71 119,IIE 1C11+IIEI 1C2I+11E2 1C3214I1E3 tCkt+IIEL. WRITE(127122) FU,J),I,J,F(ICI.,J),ICi,J.,F(IC2,J),ICZ,J, 1 F(IC3,J,,IC3,J,F(IC'.,J),t'.,J 72 CONTINUE 71 CONTINUE WRITE 129 READ t02,RESP7 IF(RESP7.EO.IIIY) GO TO 73 C G0T026 P P OUTPUT WRITE(12,iOB) BDA(I),BOR(I) ,80C(I) ,BOOUI) 70 CONTINUE IFLGIO P P P CJJJJJJJ.JJJJJJJJ JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ C 73 WRITE 127 READ IZA,1B,IE,JB,JE RIE=IE-!8+1 C p P tF(IFLG3.NE.1) GO TO 73 00 72 JJB.JE P P IF(M1.GE.N1) ITMI IF(N1.GE..M1) ITNI 30 70 1t,IT C p P * p o P p p P P P P 9 p 9 p P P P P P P P P P P P P p P P p [*A CIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII C CCMMANO C C C C C C C C C C t INCREMENT (TIME) = I I I I I I THIS SECTION FITS DATA TO A °OLYMCMIAL,CALCULATES THE DERIVATIVE AND THE FLOW VELOCITY. THEM IT ASSIGNS NEW PRESSURE VALUES AT Z) (F(I,j)] BASED ON THE TIME INCREMENT INPUT. F(I,J) J>t IS THEN RESET TO ZERO FOR THE NEXT ITERATION. 83 CALL VELOC(F,M1,O,M,CONO,TINC,TIM,pH1,RHO) RESET I I I I F(t,J) J>1 00 81. J2,t55 00 82 1=1,31 IC1I3t 1C21+62 IC31+93 ICI+126 F(I,J)=0.0 F(1C2,J)0. F(1C3,J)=O. F(IC'.,.J)=O. 82 CONTINUE 81 CONTINUE F(IVALF,JvALF)=SAVE IFLG1I 60T026 I I 1 I I I I I r I I I I I I I I CIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII C C I CTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT I COMMAND : THEORETICAL SOLUTION = I C I C C C C C C C C C C C THIS SECTION POOUCES A PROFILE OF PATiO VALUES BY COMPARING THE NUMERICAL SOLUTION FOR A POINT S0UCE (SINK) TO THAT OF AN ANALYTICAL SOLUTION GIVEN IN (REF. UNCOMFINED AOUIFER FLOW WITH A LINEARIZED FREE SURFACE CONDITION I BY DR. G. BODVARSSON 1 1977 ) (IHOTEJI C C C THE LAST F(I,J) VALUE CHANGED IS TAKEN AS THE VALUE AND LOCATION OF THE O1MT SOURCE. SEE FSAVE COMMAND STATEMENT #32 SELECT PROFILE 90 WRITE 106 READ 117,I3,J8,IINC,JINC,NNP 9'. IF(IFLG'..NE.l) GO TO 95 XM=P$ c C C I 1 I I 1 1 T RSP(3-A)/XM ZSP(D-C)/XN R=XIBRSP ZXJBZSP RINC=PSPIINC ZINC=ZSPJtNC DOVALJVALF-t I DO0QVALZSP I I CALL RACFCCOND1 PHI,FSAVE,RIMC,ZINC,R,Z,NNP,PATIC,OQ,TIM, I IIB'.z1133+IINC JJBJB+((I-t)JIMC) JJ91JJ4JINC JJBZJJBI+JP4C JJ83JJB2+JINC JJ94JJ83.JINC C T T T T 1 B4O,XM,XN,IFL) IF(IFLG.NE.0) GO 10 96 WRITE OUT THEORETICAL SOLUTION VALUES FOR PROFILES 00 91 11,NNP,5 IIB!B,((I-1)IINC) 1191119+IINC 1I92=IIBDIINC 11B31192+IIMC 1. I I I I XNN XI9=I9-1. C T I I WRITE(12,11.3) RATIO(I),tIB,JJ9,RATIO(141) ,II81,.JJBI,RATIO(I+2) ,IIBZ,JJB2,RATIO(T+3),I133,JJ83,RATIO(1+4),IIB'.,JJg'. T I r T T I I 1 T T I T T r I I r r I T I I T I I COMPUTE THE C C RATIO (NUMERICAL/THEORETICAL) I T RATIO(I)F(IIB,JJB)/RTIOtI) RATIO(I+1)=F(It91,JJl/RTtO(I+1) RATIO(I+2 )F(1192,JJ82) /RTIO(I+2) RATIO(I+3)F(1193,JJ831 fRTIO(I+3) I T RATI0(I+'.)F(II9'.,JJB.)/RATIO(I+4.) WRITE(l2,11.9) RAIIO(E),II5.JJB,RATIO(I#1),IIBt,JJB1, 1 RATIO(I+2),tI32,JJ3Z,RATIO(I+3),II83,J.J93,RATtO(I+k), 2 II3,JJBk RATIO(I)=.1E-19 RATIO(I+t),IE-19 RATIO(I+2),IE-19 RATIO(I+3).1E-19 RATIO(I+k),IE-t9 I T T T T I T T I T T 1 91 CONTINUE WRITE 129 READ j02,RESPZ IF(RESP2.E.1HYJ GO TO 9] 001025 G0T025 T 1 95 WRITE 12] I 1 T 96 WRITE 121 IFLGO 001025 C I I I T T CTTITTTTTITTTTTTTTTTITTITTTTTTITTTTITTTTTTITTTTTTTITTTTTTTTTTTTTTTTTTTTTTTTT C C C C C C C C aaQaQGQQQQCCQQQQQQQQQQOQQQQOQQQQQQQQQQOQQQOQQQQQQQQQQQQQQQQQQQQQQQQQQGQQQ a s Q QUA)RATIO = Q COMMAND QUAORATIO IS THE RATIO OF TNE 2UADRIATIC TERN NEGLECTED IN THE 0 To THE LINEAR TERM SEE THEISI5 REFERENCE LINEARIZATION Q OF THE LINEARIZED FREE SURFACE APPROXIMATION. LINEAR TERM I -(CONO'GRAV/PHI) (OPIOZ , Z0 QUADRIATIC TERM * -(0NO(RHOPMt))C(DP/OZ)2. +(3P/OR)2.3 ,Z0 C C POINT 151 = STARTING (tST,1) POINT ISP = STOPPING '(ISP,t) 1510 IINT= INT = INTERVAL SPAING OF CALCULATED POINTS 1ST C C C c C ) ( 9 SELECT WINDOW LENGTH WRITE 125 READ jlT,IST,ISTP,IINT CALL QUAOP(F,Mt,N1 ,8,D,N,W,IST,ISTP, IINT,CCNO,PHI, RHO, 1 DRVR,DRVZ,RATIO) WRITE OUT DERIVATIVE AND QUADRATTO VALUES QUADRATIO VALUES ARE STORED IN ARRAY RATIO INP( (ISTP-IST)/IINT) +1 00 99 11,INP,5 ISTNIST+ C (1-1) IINT) ISTIISTT+IIMT 1ST 2=1ST 1 + TINT IST3 IST2+IINT IST'IST3+IIMT 11=1+1 12=1+2 13=1+3 WRITE(12,130) ORVR(I) ,ISTT,DRVR(I1),IST1,DRVR(12),ISTZ, 1 DRVR(I3),IST3,ORVR(I1.),IST WRITE(12,i31) ORVZ(1) ,ISTT,DRVZ(Ii),IST1,ORVZ(12),IST2, 1 ORVZ(I3),ISI3,ORVZ(I'.),t3Te WRITE(1Z,132) RATIO(I),ISTT,RATIO(I1),ISTI,RATIO(12),15T2, 1 RATIO(t3),1ST3,RATIO(IL.),IST DRVR(I)0.O ORVR(I1O.0 DRVR( 12) = 3. I) OPVR(I3) =0.13 DRVR(I.)0.3 DRVZ(IFO.3 DRy! (11) =0.3 ORVZ (I2)0.3 DPVZ(t3)0.0 DRVZ (I)O.l3 RATIO(I)0.1E-19 0 Q a a 0 a a a a a a a Q RATIOCI1FO.iEt RATIO(I2) 0.LE-t RATIO(13)0.LE-t9 0 0 0 RATIOtI'.) =O.IE-19 99 CONTINUE WRITE 129 READ 102,RESP2 IFCRESP2.EQ.1HY) GD TO 98 0 GOTO26 0000000000 QQQQQQQQQQQQQQQQQQQQQQQQQQ000000000Q00000000000000000000000QQQQQQ QDODOOOODDDOODOOOOOOOODDODDD0DQOOOOOOOD0DO0O0OODODOD0DOO000DDDODODDDDDD000D 0 S DATA FILE 0 COMMAND * C C 0 C C C C WRITE OUT PARAMETER LIST IF NECESSARY (IFLG1 LS USED TO DETECT IF F(I,J) HAS BEEN RENEWED OR NOT) (IFLG2 IS USED TO DETET IF FILE ii HAS BEEN CREATED) 60 REWIND Ii IF(IFLG2.NE.L) GO TO 85 WRITE(14,t2'.) A,3,M,MBDCMD,CONQ,IFLG1,IFLG2 WRITEf1'.,1031 C,01N,NBDCMO2PHI,IFLG3,IFLGZ. WRITE (1'., 109) EL1IuDA,RHO, TNC,TtN IF($1.GE.N1) ITP4I IF(NL.GE.Mt) ITZNL 0 0 a 0 0 D 0 0 0 00 55 I1,IT WRITE(1'..i09) 9oA(I),BDB(I),BOCCI),BOOI) 55 CONTINUE 00 58 131,HRR IC1I+MRR IC2I+MRR2 1C31+MRR3 0 0 0 0 0 0 0 ICt.I+HRR'. 00 59 .J1,Nt REAO(1i,126) FFI,FF2,FF3,FF(.,FF5 WRITE(14,122) FFI,I,J,FFZ,IC1,J,FF3,1C2,J,FF'.,1C3,J, 1 FF5, IC'.,J 59 CONTINUE 58 CONTINUE GOTO2S 0 0 0 0 0 0 0 0 DODDODO0OODDD0DDO0DDOOOODOODD0D0O000ODD0OODOD000ODOOOOD0ODO0OODO0OD000OOOOD C CRFRFRFRF RFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRF RFRFRFRFR C C C C C COMMAND RESET F I RESET VALUES FROM F SAVE F RF R $ FILE FOR MORE RUNS 75 IF(IFLGI.EQ.i) GO TO 26 IF(IFLG2.NE.i.) GO TO 85 REWIND 11 00 76 11,MRR 1C11+MRR IC2t+HRR2 IC3t+MRR3 ICt.1+P4RRI. 00 77 J1,Ni REAO(1i,126). F(t,J),F(ICI,J),F(IC2,J),F(IC3,J),F(IC'.,J) 77 CONTINUE 76 CONTINUE IFLGI1 GOTO2S 601026 85 WRITE 10'. C R R R R R R R R R R R R R R R R R R R R RFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFRFR 101 FORMAT(" QUEST ?") 102 FORMAT(A1) 103 FORMAT(2X,2F15.'.,2110.Et5.8,IX,21i) 10'. FORMAT(M FILE OF F VALUES NOT CREATED") 105 FORMAT(E15.8) 106 FORMAT("PROFtLE",/2X,"II3,JJB,INC,JNC,NNP) 107 FORMAT (A?) S.XXXXXXXXXESYY") 109 FORMAT(2X,'.E15.8) U.0 FORMAT( HOW MANY (I) VALUES DO YOU NEED TO CHANGE",f 1" Ill") 111 FORMAT(13) 112 FORMAT( WHAT F(I,J) VALUE WOULD YOU LIKE TO CHANGE",/ 108 FORMAT(" 70 III .JJJt 113 F0RMATt3,1X,t3) 1i.. FOR?4A1( 1' 111) WHAT (1) VALUE WOULO 115 FOPM4T(" PARAME1R ,A7, HOT OU LIKE TO CHANGE,/ OUNU") E19=,E12.6,/ I "SOLUTIONs IH F(1,1) THROUGH F(,I3,tL.,),f 116 FORMAT(" IERROR,13, TINC 2 TIME= ,F15.Le) ,F15.1., 117 FOPMAT(I3,jX,I3,X,I3,1X1I3,tXI3) 118 FORMAT(2X,E15.5, IC ,I3,i., ) ,E15.81 IC .13,1k, ,ciS.8, T( .13,11., ) ,E15.8,TC i E15.8,TC .13,11., 2 t3,Ik,) )_ ,El5.81 PC ,13,IL., 1I FORMAT(2X,Et5.81 ,E15e8, R( ,13,ik, ) 1 Et5.8, R(,13,i4, ) .13,!'., 2 E15.8, RC ,13,I'., ) HOT ASSIGNED") ) C 120 FORMAT( 1 FCIVALF,.JVALF) 121 FORMAIC" I PHI .EO. ZERO "1 122 FORMAT(2X ,E15.8,FC,I3,1'.,) ,E15.8,"F,13,I'.,) -, 1 ,t3,I'., I ,E15.8, ( ,13,Ik, I ,E15.8, 15.8. F( .13,!'., 2 123 FORMAT ( j,1X,2F15.k,2110,15.8,tX,2It,15X,0OSLST I 121. FOPP4T( I ,1x,Ft5.L.,2I10,t5.8,tX,2It,t5X, PARLST 125 FORMT(UAOR4TIO,/2X,IST,ISP,!4T") t2 FORMAT (2X,E15. 8,LIX,E15.8,IIX,E15.8,iiX,E 15.8,1 1X ,E15 .8) ERROR J C 1 1 127 FORMAT (WHAT FC1,J) VALUES,/ III TO III,JJJ TO JJJ) 1 128 FORMAT (I3,4X,13,tX,I3,kX,1) 12q FORMAT (MORE ? Y OR H") ,E15.8,DR('!3,",1) ,1I I E15.8,"t34(",13,,tI 1Ei5.8, OR(,13,,t) 131 FORMAT C2X1E15.8, OZ( ,13, .1) ,E15.8, DZ( ,13, ,I) , .13, ,1)") 1. E15.8, D( .13, ,1) ,E15.8, ZC .13, .1) ,clS.8, OZ( 132 FOPMAT(2X1t15.8, OR(I3, .1) ,Ei5.8, ORC,13, ,t) , 1 E15.8, OP'C .13, ,1) ,E15.8."OR( .13, ,1) ,15.8, QR( .13, .1) 130 FOPMAT(2X Ei5.8,OP(I3,,1) 1 1 C CEEEEEEEEEEEEEEEEEEEEEEEE!EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE C C C C COMMAND 80 STOP END E E E E E CEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!EEEEEEEEEEEEEEEEEEEEEEEE C END 71 SUeROUTINE VELOCCF,Mt ,O,4,COND,TINC,TIM,PHI,RHO) ccccccccccccccccccccccccccccc: cccccccccccc ccccccccccccccccccccccccccccccccCC C C C C C C )IFTBL. AND FUNCTION OERVZO VELOC UTILIZES SUBROUTINE AHO DISPLACEPENT OF THE FREE SURFACE AT To DETERMINE THE VELOCITY FOR A RESERVOIR. Z=O POSGO TO 1P4 PROGRAM VELOC OPERATES ON THE MATRIX F(I,JI ON THE SOLUTION. RESET VALUES AND ITERATE C C THE ZO SURFACE PRESSURE C C F(I,t) IS CALCULATED WITH P = (RHO)(GR*V) OELT*(H) THE WHERE DELTA (HP IS DETERMINED 8'I' THE TIME STEP CHOOSEN AND CALCULATED VELOCITY. CONO COP4OUCTIVITY RHO DENSITY KM. /(SECSEC) P C q.8QGG5E-03 GRAV GRAVITY PHI POROSITY = TIM TIME TINC TINE INCRMT C C C C C C C C C C C C C C C C C C C C c C C C C C C C C C C CALCULATED ARE OUTPUT WITH SOLUTIONS OF C SURFACE PRESSURE VALUES C VALUES. C NEXT ITERATION AS THE F(I,1.) 11,Mt C CCCCCCCCCCCCC C C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C DIMENSION X(6),VEI.FL(t55),TABLE(6,6),F(155,155) T INS TI NC 'TIN SET UP X SPACING OF F(I,J) J1,5 POINTS X N N SPAC=O/XN X(11 0.Q 00 21 12,5 X (I) X CI-t)+SPAC 21 CONTINUE START POLYNOMIAL FITTING 00 31. ICI,Mt POLYNOMIAL IN Z DETERMINE DIFFERENCE TABLE FOR MP.GE.NP - OK - IS A PARAMETER TO HECK FOR CALL OIFTBL(X,F,IC,TABL!,4,5,6,OK) C C C DIRECTION NOT USEO HERE CJJ.J-JJJ.JJJJJJJJJJJJJJJJJJJJJJJJJJ.,JJJJJJJJ-IJJJJJ,JJJJJJJJJJJ C C C WRITE OUT TABLE FOR FIRST TIME THROUGH TO CHECK IF(IC.NE.1) GO TO 70 00 41 J11.5 WRITE(12,1.Q1) (TABLECIT,JT).1T1,5) 41 CONTINUE CJJJJJJ.JJJ JJJJJJJJJJJJJJJJJJJJJ JJJ JJJJJJJJJ_$JJJJJJJJJJJJJJJ C C C C C C C C C C CALCULATE THE DERIVATIVE EQUATION OF VELFL(IC RHO IS OMITTED FROM THE E2UAT ION FOR PRESSURE SINCE IT CANCELS IN THE F(IC,t) 70 OELTPOERVZO(X,TABLE,6) VELFL (IC) (CONO'OELTP)/PlI DELIHTINC*VELFL (IC) THE FREE SURFACE IS BELOW THE FOR A POINT SINK AT TIMEO Z0. THUS THE LEVEL AND Pso AT SOME POINT ABOVE ZSO PRESSURE AT ZS0 MUST BE IEGATIVE. RHO IS OMITTED FROM THE NEXT EXPRESSION F(IC,1)CGRAV'UELTH)+F(I,t) 31 CONT INUE 101 FORMATC2X,6F15.4) 72 ,1 L03 FCRMATCX,F5.L4, F(,13 F( ,13, ,i) ,F1.k, I Ft5.., 2 F(,13,,1)") RETURN END Fj5.k, ( F(,132,1) ,13,,i) ,Ft.'., , 73 SUBROUTINE DIFTBL(X,F,I, TABLE,MP,MP,K,OiC) C C C C C C C C C CC CCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCC DIFTBL CALCULATES THE DIFFERENCE TA3LZ FOR NEWTONS DIVIDED OIFFERENCE METHOD. (ADAPTED FROM "APPLIED NUMERICAL METHOOS BOCK 8Y CARMAP4AN ET.AL. 19B) NP POLYNOMIAL ORDER NP = NUMBER OF POIHS USED OK DETECTS ERRORS IN POLYHOMIAL ORDER C C C c c C C C C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C C C DIMENSION X(K),F(155,155),TABLE(K,K) 0K1 IF(MP.GE.NP) GO TO 10 CAI..CULATE FIRST ORDER DIFFERENCES N1NP-1 00 21 J=t,Nl TA8LE(1,J)(F(IC,J+1)-F(1,Jfl/(X(J+1)-XLU) 21 CONTINUE IF(MP.LE.1J GO TO 11 NOW CALCULATE HIGHER ORDER DIFFERENCES 00 31 12,MP 00 .1. J1,N1 15J+ i-I TABLE(I,J)(TABLE(I-t,J)-TABLE(I-t,J-1))/(X(J+i)-%(IS)) '.1 CONTINUE 31. CONTINUE 11 0K0 10 RETURN END 74 C FUNCTION DERVZO(X,TABLE,<) cccccccccccccccccccccccccc:cc00000ccc0000ccccccccCCCcCCCcCC ccccccccccccccccc C C C C C c C C C C C C C C C CALCULATIONS ARE COMPLETED USING A SHORT FORM OF THE DERIVATIVE FOR THE FOURTH ORDER POLYNOMIAL. THE DERIVATIVE IS COMSEUENTLY ONLY FOR THE SPECIAL CASE 10 Q( P(Z))/DZ WITH THE FIRST PO(.YNOMIAL FIT POINT X(i) AT Z0 ALSO THE DIVIDED DIFFERENCE TABLE MUST BE SET UP FOR TABLE(i,i) AS THE FIRST DIFFERENCE USED AND ALL NEECED DIFFERENCES ON THE MATRIX DIAGONAL. PZ) ACt) A(2)Z + M3)Z C C OP/DZ = A(2) C C A(2) REDUCES TO 2 + .. ZO C C C C C C C C C C C C C C C C C XCt)0 C WITH C A(2)(X(2)XU))PtX()-(X(2)XC3JX($.))P(X(5)3+PCX(2))-(X(2))PCX(3fl C C C C C C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C DIMENSION X(),TABLE(K,K) X23X (2) X(3) X23ksX23X(i.) DER VZOX2 31* BLE (3 ,.3) t X(2)'TABLE(2,2) RETURN E NO X23 'IA BLEC .,k) +1* 8LE (1. 1) - 75 '. SUBROUTINE RAOF(CONO,°HI,FSAVE,RINC,ZINC,R,Z,NNP,RATIO,DQ,TIM, 8,D,XM,XN,IFLG) CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000CCCCCCCCCCCCCCCCCCCCC C C C C RADF COMPUTES THE THEORETIAL HALF SPACE POINT SOURCE SOLUTION FOR THE PRESSURE FIELD ASS3IATED WITH A LINEARIZED FREE SURFACE. t(IIRPQ) + (1./RPQP) - (2/RPQTP)) FMOT RATIO C RR + (Z-OQ)2 )Q.5 C RPQ C C RPQP = ( RR + (Z-QQ) C C C C C C C C C C C C C C C C C C C C C RR + (Z+(A'TIM)+OQ)'Q.S THIS IS THE SOLUTION TO POISSONS EQUATION WITH A SOURCE TERM - (FZ / COND)DELT(P-Q)I(T) RPQTP C C C C C c C C C C C C C C = CAUSAL UNIT STEP FUNCTION C P C WITH DELT(P-Q) = DIRAC DELTA FUNCTION AT POINT C SOURCE POINT Q C C CONCENTRATE) SINK FZ C (REF.s DR. C. 900VARSSOM' , UNCONFINED AQUIFER FLOW WITH A LINEARIZEOC C FREE SURFACE CONDITION 1 1.977) C C IT TURNS OUT THAT THIS CAN BE RELATED TO F IN LAPLCP) : F C=FSAVE) 1(1) C WHERE C C 50, C )'O.5 C STANOS FOR THE LAPLACIAN OPERATOR. LAPLC C C C C -F3AIE(((RR2/2.)'2)'ZZ3/'.. FNOT C C C C C C------------------------------------ CC c C c C C C C C C C C C C = 9.80665E-03 C KM. ,' SEC'SEC ) = CHARATERISTIC FLU!) VELOCITY CHEC( TO PREVENT DIVISION BY ZERO IFLG DEPTH TO POINT SOURCE DQ ( NOTE ) C C C C C C C C C RATtO MUST 9! DIMENSIONED THE SAME AS IN CALLING PROGRAM C C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C DIMENSION RATIOC155) IF(PHI.EQ.0.'J) GO TO .0 RR8/ CXM4Z.) Z Z 0/ X N RRZZ(RRRRZZ) G9. 8C665E-03 I'.. A(CONOG) /PHI FNOT-(FSAVERRZZ) IFLGO 00 21 I1,NNP XI=I RSQ*RR ZAOZ+(ATIM) +00 ZP4OZ-OQ ZPLD =Z+OQ RP@ (RSQ+(ZMOZMOI)0.5 RPQP C RSQ+CZPLOZPLD) )0. 5 RPQTPCRSQ+CZAOZAO)) IF(RPQ.Et2.0.0 .OR. RPQP.E0.3.0 .OR. RPQTP.EQ.O.13) GO TO 30 RATIO(t,FNOT((1./RPQ),(t./RPQP)(2./RP!TP)) IF(RATIOCI).EO.l3.0) RATIO(I),IE-19 31. CONTINUE R=R+RINC Z=Z+ZINC 21 CONTINUE RETURN 30 WRITE 105 t!21. RATIO(I) GO TO 31 76 '.0 IFLG1 RETURN 105 FORMAT( A SINGULARITY 0ETCTEO, OEN0MINATC I - EQUAL TO ENO .1121 .") OF RATI3 SET,/ 77 SUBROUTINE QUAOR(F,Mt,Nt,3,O,M,N,IST,ISTP,IINT,COND,PHI,RHO, I DRVR,ORVZ,RATIO) cccccccccccccccccccccccccccoc::ccccccccccccccccccccccccccccccccccccccccccccC RZDIFT AND FUNCTIONS DERVR,OERVZO QUADR UTILIZES SUBROUTINE TO DETERMINE THE RATIO OF THE NEGLECTED QUADRATIC TERM TO THE LINEAR TERM IN THE LINEARIZED FREE SURFACE APPROXIMATION., TERN QUADRATIC C C C LINEAR TERM C C _(CONQ/(RHOPHI))((Dp/OZ)*42. + (DP/OR)42.] , 20C QUAORIATIC TERN -(OND'GRAV/PHI) ' (OP/'OZ) = CONO 2 RHO = GRAV 2 PHI , Z0 C C C C C 9.80665E-3 C C C POINT STARTING F(IST,1) POINT ISTP = STOPPING F(ISTP,1) tINT = INTERVAL SPACING OF CALCULATED POINTS 157 X V C C QUAORATIO- ------------ ---- LINEAR TERM CONDUCTIVITY DENSITY GRAVITY POROSITY C CORRESPONDS TO CORRESPONOS TO C C C 1 COORDINATE C R COORDINATE C C CCCCCCCCCCCCCCC000CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCC DIMENSION X(6),Y(6),ORVR(L55),ORVZ(155),TA8LEX(6,6),TABLEY(6,6), 1 F(155,1551,RATIO(155),FRAY(155) GRAVxq.50665EO3 CRPCONO/ (RHOPHt) CGP (CONOGRA VI /PHI SET UP ARRAY FOR RADIAL DERIVATIVE FRAY( 1)F (3,1) FRAY(2)F (2,11 DC 31 1=3,155 11=1-2 FRAY(t)F (11,1) 31 CONTINUE SET UP X , V SPACING FOR F(I,J) POINTS XN=P4 YP!M SPACXO/XN 5 P AC Y 8/ V N X (1)20.0 V (112-2. 'SPACY 00 21 122,5 X (I)=X (I-i)+SPACX V (I)Y (1-1) +SPACY 21 CONTINUE START POLYNOMIAL FITTING I P= 0 DO 41. ICIST,ISTP,IINT DETERMINE DIFFERENCE TABLES CALL RZOIFT(X,Y,F,FRAY,IC,TABLEX,TABLEY,k,5,6,OX) CALCULATE DERIVATIVE VALUES AND QUADRATIC TERMS IP=IP+1 DRVZ(IP) 2OER VZO(X,TABLEX1 5) ORVR(IP)OERVR (V,TA8LEY,) RCUAD-CRP" (ORVZ (IP) DRVZ ( IP) + DRVR(IP)'ORVRCIP)) RLIN-CGPDRVZ ( IF) IF(RLIN.EO.0.0) GO TO 45 RAIl CC IP) RQUAO/RLIN 46 CONTINUE 41 CONTINUE 105 FORMAT( SINGULARITY OET!TEC RETURN 45 WRITE 105 RATIO(IPIO.1E21 GO TO 46 END UUAORATIO SET EQUAL TO 1.0E20) SU8ROUTINE RZOIFT (X,Y,F,FRAY,I: ,TABLEx,TAaLEY,p4p,Hp,K,OK) C C C C C C C C C C C C C C C C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC RZOIFT CALCULATES THE DIFERENCE TABLES FOR NEWTONS DIVIDED DIFFERENCE METHOD. (ADAPTEC FRON APPLIED NUMERICAL METNODS BOOK NAHAN ET.At.. t%) BY C NP POL"NOMIAL ORDER NUMBER OF POINTS USED NP K = 0IMESION F OIT ARRAYS USED R IC PCSITION , F(I,l) , OF SPECIFIED POINT OK X Y DETECTS ERRORS IN POLYNOMIAL ORDER CORRESPONDS T THE Z COORDINATE CORRE$PCP4OS TO THE R COORDINATE DINENSION XfK),Y(',F(j55,j55),TABLEX(K,K),TABLEY(K,K),FRAY(t55) 0K1 IF(M°.GE.NP) GC TO 10 CALCULATE FIRST ORDER DIFFERENCES TABLEyc1,n=(FRAYcIC+J)-cR4Y(tc+.J-1,,/(Y(J.1)-Y(J)) 21 CONTINUE C C C C c C C C C C C C C C C ccccccccccccccccccCccCcCcccCcc:ccccCccccccccCcCcCCcCCcccCcCcCCccCcccCccCccc NINP-1 00 21 J1,M1 TLEX(t,,J)(F(IC,J+1)-F(tC,JH/(X(J+1)X(J)) C C C IFUP.LE.l) GO 10 11 NOW CALCULATE HIGHER ORDER DIFFERENCES 00 31 12,MP 00 1.1 J1,N1 15.J+t-t TABLEX (I,J)(TABLEX t-t,J) -TABLEX (I-1,J-t) ) / tX (J+t)-X (IS)) TA!LY(I,.J)(TACLEY(I-1,J)-T*BLEY(I-1,J-t))/(Y(J+t)-Y(IS)) t CONTNUE 31 CONTINUE 11 OKO 10 RETURN END 79 FUNCTION DERVR(Y,TA8LEY,<) cccccccccccccccccccccccccccccc:cc cccccccc cccccccccccccccccccccccccccccccccc C C C C C C C C C C C C C C C C C C CALCULATIONS ARE COMPLETED JSIN6 A SHORT FORM OF THE DERIVATIVE FOR A FOURTH ORDER POLYNOMIAL AT R=O THE DERIVATIVE IS CONSEQUENTLY ONLY FOR THE SPECIAL CASE OtP(R)]/R AT R = Q C C C c C WHERE THE CENTRAL POINT OF THE FIVE POINTS FITTED IS ASSIGNED R C C THE DIVIDED DIFFERENCE TABLE MUST BE SET UP FOR TABLEY(1,1) AS THE C FIRST DIFFERENCE USED AND ALL NEEDED DIFFERENCES ON THE MATRIX DIAGONALC P(R) = ACt) + A(2)R OP/DR = A(2) R 2 , WITH Y(3)=Q A(2) REDUCES TO A(3)R 2 + .. 3 C A(2)P(Y(2)3(Yfl)+YC2))'tY(3) ]+(Y(1)Y(2))P(Y(e)(YC1)Y(2)Y(k))PCY(5) C C C c C C C C C C CCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCC CCCCCCCCC CCCCCCCC CCCCCCCC CCCCCCCCCCCCCCCCCC C DIMENSION Y(K),TA8LEY(K,() Y12=Y(1)+Y(2) Y2=Y(iJY(2) Y23Y2'Y U'.) DERv=TA9LEYc1,t)Yt2'TA8LEY(2,2)+Y2TA8LEYc3,3)Y23TAaLzY('.,.) RETURN END 1 C ,BOCND BOA BC8,C,C N NBDCND,30C, SUBROUTINE PWSCYL (INTL,4,B PYL3OOO5 PYLQO1 PYL]0015 PYLJOOZO PYL3 3O25 PYL0003O PYL0003S PYL000kO PYL300k5 PYL0005Q PYL60055 PYL0006O 3OO,ELMB,F,IOIM,PETRB,IERO,W) C c C C VERSION OCTOBER 1.9Th 2 C C C C C C C C C C C C C PAUL SWARZTRAUBER CC' CC' CC, CC+ CC, 004 CC' CC' CC, 00+ CC' CC' CC' CC' CC' CC' CC' CC' CC' CC' CC' CC' CC' CC' CC' 004 CC' Cc, CC, CC' CC' C C C C C C C PYL.30080 PYL00085 PYL0009O PYL000B5 O3O7PYLOO1OO PYLOO1C5 PYLOOhj PYLOOi15 3'4'"PYLJ 0 --------- -------------- ----------CLASS TWO ROUTINE QEVISIONI DATE LAST CHANGED) 'CC 'CC ----------+cc +CC +cc 'CC 'CC PWSCYL 0 77-03-1.5 CLASS TWO RCUTIMES ARE MADE AVAILABLE BY NMG AS A SERVICE TO THE LLL COMPUTING CCMMUNITY. SUCH ROUTINES FAIL TO MEET ONE OR MORE OF THE CRITERIA FOR INCLUSIOM IN THE CLASS ONE (CERTIFIED) LI3RARY. IT rs RECCMMENOED THAT A CLASS TWO ROUTINE BE USED ONLY WHEN THERE IS NO 4POPRIATE CLASS ONE ROUTINE. NG WILL ATTEMPT TO OVtDE CONSULTATION SERVICES FOR CLASS TWO ROUTINES, BUT SUPORT IS NOT GJARANTEEQ. 4 -------------------------------------- --------------------- NOTICE + 12 'CC 'CC LAWRENCE LIVERMORE LABORATORY NUMERICAL MATHEMATICS GROUP -- MATHEMATICAL SOFTWARE LIBRARY CC,- c C C C C PYL300T5 --------- - CC' CC, CC' Cc, C PYLE3007Q AND NATICNAL CENTER FOP ATMOSPHERIC RESEARCH BOULDE.R,COLCRAOO WHICH IS SPONSORED BY THE NATIONAL SCIENCE FOUNDATION CC' C C C C C PYLOO65 ROLAND SWEET TECHNICAL NOTE TNFIA-tO9 JULY 1.975 C C OCTOBER 1.976 BY C C INCLUDING ERRATA DOCUMENTATION FOR THIS PROSRAM IS GIVEN pi EFFICIENT FORTRAN SUBPROGRAMS FOR THE SOLUTICN OF ELLIPTIC PARTIAL DIFFERENTIAL EQUATIONS C 4 + THIS REPORT WAS PREPARED AS AM ACCOUNT OF WORK SPONSORED BY THE UNITED STATES COVERNWENT. NEITHER THE UNITED STATES NOR THE + UNITED STATES ENERGY RESEARCH AND DEVELOPMENT ADMINISTRATION, + NOR ANY CF THEIR EMPLOYEES, NOR ANY OF THEIR CONTRACTORS, SUB- ' + CONTRACTORS, OP THEIR EMPLOYEES, MAKES ANY WARRENTY, EXPRESS OR + + IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY FOP # 4 THE ACCURACY, COMPLETENESS OR USEFULSS OF ANY INFORMATION, + + APPARATUS, PRODUCT OR PROCESS OISCLOSEC, OR REPRESENTS THAT ITS ' USE WOULO NOT INFRINGE RIVATELT-OWNED RIGHTS. # + 4 + '---------- ------ - ------------ - --------- - ------------ -------+ + ' + I 'CC 'CC +cc fCC 'CC +cC 'CC +CC 'CC 4C 'CC 'CC #CC 'CC 'CC +CC 'CC 'CC +CC + 'CC +CC 'CC PLEASE REPORT ANY SUSPECTED ERRORS IN THIS ROUTINE IMMEDIATELY TO NMG. CC 'CC ------------- - --------- - -------- ---------- ----------- ---'CC PYLJO1Z5 PYLOOI3D PYLOO135 SUBROUTINE PWSCYL SOLVES A FINITE DIFFERENCE APPROXIMATION TO THE PYLOO1kO MODIFIED 4ELMHOLTZ EQUATION IN CYLINORICAL COCROINATES PYLOO145 PYLJO15O (1/R)(D/DR)(R(OfOR)U) + (D/OIZ)(O/OZ)U PYL30155 PYLOQ16O 4 (LAMBOA/R21U F(R,2) PYLDOI55 RCM THIS TWO DIMENSIONAL MODIFIED 4ELMHOLTZ EQUATION RESULTS THE FOURIER TRANSFORM OF THE THREE DIMENSIONAL POISSON EQUATION INTL ' ' $ ON INPUT PYL30175 PYLODI8O PYL0185 PYL0O 190 THE ARGUMENTS ARE DEFINED ASO ' PVLOO1.7O ' PYLQOI95 PYLOO200 PYLGO2O5 PYL3O21O PYLO215 PYL30220 EI CM INITIAL ENTRY TO PWSCYL OR IF P4 AND NBOCNO ARE CHANGED PYLOCZ25 PYLOQ23O FROM PREVIOUS CALL. IF P4 AND NBOCND APE UNCHANGED FROM PREVIOUS CALL TO PWSCYL.PYL00235 PYLOO24O PYL002.5 NOTED A CALL WITH INTL = 1 IS ABOUT 1 PERCENT FASTER THAN A PYL30253 CALL WITH INTL = 0 = 0 = 1 A,8 THE RANGE OF P. I.E. PYLU 0255 A .LE. R .LE. S. AND A MUST BE NON-NEATIVE. M THE NUMBER OF PANELS INTO SUBDIVIDED. HENCE, THERE R-OIRECTION GIVEN BY RU) WHERE DR = (9-4)/N IS THE A MUST BE LESS THAN B PYLO 0275 WHICH THE INTERVAL (A,B) IS WILL BE 1+1 GRID POINTS IN THE = A+(I-1)OR, FOR I = 1,2,...,M+1, PANEL WIDTH. MBDCND INDICATES THE TYPE OF BOUNDARY CONDITIONS AT R = t = 2 = 3 2 4 = B 2 6 PYLUO26O PYLGO2S5 YLO327O A AND R 2 B. PYLOO28O PYL30285 PYLOO29O PYL00295 PYL00300 PYLO 0305 PYL003I.3 PYL00315 PYL130320 IF THE SOLUTION IS SPECIFIED AT P = A AND P. = B. PYL003!5 IF THE SOLUTION IS SPECIFIED AT P = A AND THE DERIVATIVE OFPYL0033O THE SOLUTION WITH RESPECT TO R IS SPECIFIED AT P = B. PYL00335 PYL0034O IF THE DERIVATIVE CF THE SOLUTION WITH RESPECT TO P IS = A SPECIFIED AT (SEE NOTE BELOW) AND R = 3. PYL003'.5 IF THE DERIVATIVE CF THE SOLUTION WITH RESPECT TO R IS PYL00350 4 PYL00355 SPECIFIED AT P (SEE NOTE BELOW) AND THE SOLUTION I PYL0036O SPECIFIED AT P 3. IF THE SOLUTION 13 UNSPECIFIEC AT P = A 2 0 AND THE PYL30365 SOLUTION IS SPECIFIED AT P = B. PYL003TO PYL30375 IF THE SOLUTION IS UNSPECIFIED AT P = A = 0 AND THE DERIVATIVE OF THE SOLUTION WITH RESPECT TO P IS SPECIFIED PYL0038O AT R = 8. PYL0O35 IF A = 0, 00 NOT USE NBQCNO = 3 OR 4, BUT INSTEAO USE MBOCND = 1,2,5, OR S PYLO 0390 PYL00395 PYLOO400 PYLO 0405 PYLOO4LO 30A A ONE-DIMENSIONAL ARRAY OF LENGTH P4+1 THAT SPECIFIES THE VALUES PYLOO415 OF THE DERIVATIVE OF TIE SOLUTION WITH RESPECT TO P AT R A. PYLOD42O PYLOO425 WHEN MBOCND ' 3 OR , NOTED BDA(J) ' (D/OR)U(A,Z(J)), J WHEN 1,2,...,N+1 BDC4O HAS AMY OTHER VALUE, BOA IS A DUMMY VARIABLE. PYL 30430 PYLOOL.35 PYL 30440 PYL0O.5 PYLOOL.50 PYL03455 A ONE-DIMENSIONAL ARRAY OF LENGTH P4+1. THAT SPECIFIES THE VALUES PYLOO46O OF THE DERIVATIVE OF THE SOLUTION WITH RESPECT TO P AT R = 6. PYLOO4S5 PYLOO47O WHEN KBDCNO = 2,3, OR , PYLO 0475 PYLOO48O 908(J) = (O/QR)U(3,Z(J)), J = 1,2,...,N+1. PYL0045 PYLOO49O WHEN MBDCP4D HAS ANY OTHER VALUE, BOB IS A DUMMY VARIABLE. 908 PYL 00495 C,O THE RANGE OF Z. I.E., C .LE. 1 .LE. 0. N C MUST BE LESS THAN C. THE NUMBER OF PANELS INTO WHICH THE INTERVAL (C,D) IS SUBDIVIDED. HENCE, THERE WILL BE P4+1 GRID POINTS IN THE C+(J-tJDZ, FOR 3 = i,2,...,N+1, Z-OIRECIIOP4 GIVEN BY 1(3) N MUST BE CF THE FORM WHERE OZ 2 (0-0)/N IS THE PANEL WIDTH. (2'P)(3'O)(5) WHERE P, 0, AND R ARE ANY MON-NEGATIVE N MUST 3E GREATER THAN 2 INTEGERS. 3 1. 2 3 = 4 PYLO 051.0 PYLOO5I5 PYLQO52O PYLOO525 PYLOQ53O PYLOOS3S PYLDO54Q PYL005I#5 PYLO 0550 PYLOO5B5 PYL0O5SO PYLO 0565 IF THE SOLUTION IS PERIODIC IN 1, I.E., U(I,L) = U(I,N+L). PYLOO57O IF THE SOLUTION IS SPECIFIED AT 1 = C AND Z = 0. PYLQQ575 IF THE SOLUTION IS SPECIFIED AT Z = C AND THE DERIVATIVE CFP'fLOO5dO THE SOLUTION WITH RESPECT TO 1 IS SPECIFIED AT Z 0. PYLOOSB5 IF THE DERIVATIVE OF THE SOLUTION WITH RESPECT TO Z IS PYLOOS9O 0. SPECIFIED AT 1 = C AND Z PYL00595 IF THE DERIVATIVE OF THE SOLUTION WITH RESPECT TO Z IS PYL3O600 SPECIFIED AT Z = AND THE SOLUTION IS SPECIFIED AT Z 0. PYLOO6O5 NBDCNO INDICATES THE TYPE OF BOUNDARY CONDITIONS AT 1 = 2 PYLOO500 PYLQQ5O5 C AND Z = 0. PYLO 0610 PYL30615 A ONE-DIMENSIONAL ARRAY OF LENGTH M+1 THAT SPECIFIES THE VALUES PYLOO62C OF THE DERIVATIVE OF TN! SOLUTION WITH RESPECT TO Z AT Z C. PYL30625 WHEN NBDD4O = 3 OR 4, PYLOOÔ3O PYLO 0635 = 1,2,...,M+t PYLGO64O BOC(I) = (0/DZ)U(P(I) ,C), BDC WHEN NBOCND HAS ANY OTHER VALUE, 8CC IS A DUMMY VARIABLE. PYR0 P YL 3 0 6 55 900 YL00660 A ONEDIMENSIONAL ARRAY OF LENGTH P4+1 THAT SPECIFIES THE VALUES PYL00665 OF THE DERIVATIVE OF THE SOLUTION WITH RESPECT TO Z AT Z PYLOO67O 0. WHEN N8OCNO 2 OR 3, PYLOO6?5 900(I) = (J/DZ)U(R(I),0) , I = 1,2,...,M+1 WHEN NBDCNO HAS ANY OTHER VALUE, BOO IS A DUMMY VARIABLE. ELMBOA THE CONSTANT LAMBDA IN THE MELMWOLTZ EQUATION. IF LAMBDA .01. 0, A SOLUTION MAY NOT EXIST. HOWEVER, PWSCYL WILL ATTEMPT TO FIND A SOLUTION. LAMBDA MUST 8E ZERO WHEN PYL30685 PYLO 0690 PY1130695 PYLOO 700 PYLOO7O5 PYLQO71O PYL30715 PYLOO72I3 PYL00725 PYLOD 730 PY100735 A TWODIMENSIONAL ARRAY THAT SPECIFIES THE VALUES OF THE RIGHT PY1130713 SIDE OF THE HELNHCLTZ EQUATION ANO BOUNDARY DATA (IF ANY). FOR PYL0O75 S OR 6 MBOCNO F PYLOO 680 I 2,3,...,14 F(I,J) = F(RUE),Z(J)). 2,3,...,M AND U PYLOQ75O PYLt3O 755 ON THE BOUNDARIES F IS DEFINED BY MBDCNO 1. 2 3 5 6 NBDCNO 0 1 2 3 PYL30761) PYLOOTS5 --- F(1,J) F(M+j,) U(A,Z(J)) U(A,Z(J)) F(A,Z(J)) F(A,Z(J)) F(0,Z(J)) F(0,Z(.J)) U(8,Z(J)) F(B,Z(J)) F(8,Z(J)) U(B,Z(J)) U(B,Z(J)) F(8,Z(J)) F(t,N+j) F(P(t),C) U(P(I),C) U(R(t),C) F(P(t),C) F(R(I),C) F(P(I),C) U(R(I),0) F(R(I),D) F(R(I),0) F(I,t) PYLOO77O PYLDO 775 PYLOO7AO U(R(I),O) PYL3Q75 PYLO 0790 U = 1,2,...,N+t PYLJO7B5 PYLOO800 PYt30805 PYLBO8IO PYLOQ81S PYL00820 PYLOOA2S PYLOQ83Q PYLI3 3835 P TI.. 3 0 840 I 1,2,...,M+1 PYL00845 PYLOO85O PYLOO8S5 PYLOO86O F NUST BE DIMENSIONED AT LEAST (M+j)(N+1). PY130865 PYL3O 873 PYL00875 NOTE PYL00865 PYLOD 880 PYLO 0890 IF THE TABLE CALLS FOR 90TH THE SOLUTION U AND THE RIGHT SIDE F PYLOO89S AT PYLOO900 A CORNER THEN THE SOLUTION MUST BE SPECIFIED. PYLDQ9O5 PYLOORIO IOIMF THE ROW (OR FIRST) DIMENSION OF THE ARRAY F AS IT APPEARS IN THEPYL3O9L5 THIS PROGRAM CALLING PWSCYL. APAMETER IS USED TO SPEIFY THE PYL3OB2D VARIABLE DIMENSICN OF F. IOIMF MUST BE AT LEAST M+j pYLOoq2S N PYLOO 933 A ONEDIMENSIONAL ARRAY THAT MUST BE PROVIOEQ BY THE USER FOR WOP 3 F SPACE. THE LENGTH OF W MUST BE AT LEAST 6(N#t)+8(M*1). 3 ON OUTPUT ''' ' CONTAINS THE SOLUTION U1I,J) OF THE FINITE DIFFERENCE APPROXIMATION FOR THE GRID POINT (R(I),2(J)), I = 1,2,...,M+1, U = 1,2,...,N+t PERTRB PYL00935 PYL30940 PYp33945 P TI 3 0 95 0 PYLDO 955 PYLJOB6O PYLQO%5 PYLGUB?0 PYL00975 PYLQO9AO PYL00985 PYLO 0990 PYLDO99S PYLOIOI3O IF ONE SPECIFIES A COMBINATION OF PERIODIC, DERIVATIVE, AND UNSPECIFIED BOUNDARY CONDITIONS FOR A POISSON EQUATION PYLQ1005 0), A SOLUTION MAY NOT EXIST. PERTR8 IS A CONSTANT, PYLO1OIO (LAMBDA CALCULATED AND SUBTRACTED FROM F, WHICH ENSURES THAT A SOLUTION PYLUIOI5 PYL31O2O EXISTS. PWSCYL THEN COMPUTES THIS SOLUTION, WHICH IS A LEAST SOUARES SCLUTION TO THE ORISINAL APPROXIMATION. THIS SOLUTION PYLOIO2S IS NOT UNICUE AND IS UNNORMALIZED. THE VALUE OF PERTRB SHOULD PYLQI.030 PYLO1O35 BE SMALL CCMPARED TO THE RIGHT SIDE F. OTHERWISE , A SOLUTION IS OBTAINED TO AN ESSENTIALLY DIFFERENT PROBLEM. THIS COMPARISONPYLDIO4O SHOULD ALWAYS BE MADE TO INSURE THAT A MEANINGFUL SOLUTION HAS PYLO1O'.5 BEEN CBTAINED IERPOR PYLDIO5O PYLQ 1055 PYLO1O6O AN EPPO FLAG WHICH !NOtCATE !NVALID INUT ARAMETER. F NUMBERS 0 AND 11., A SOLUTION IS NOT ATTEMPTED. = 0 = 2 3 = = = = 1 (. S 6 7 8 = 10 = 11 NO ERROR. A LT. 0 EXCEPT PYL31O65 PYL31OTQ PY101375 PYLO1O8O A .GE. B. 1IBOCNO .11. 1 OR WSDCND .GT. 6 C .GE. 0. N NE. OR N .LE. 2 MBDCMQ .LT. 0 OR NBDCMO .GT. . A = 0, MBUCNO 3 OR A .GT. 0. M'CH .GE. 5 A 0, LAMBDA .ME. 0, M8DCNO .GE. 5 IDtPF .LT. M+1 LAMECA .GT. 0 PYL.01085 PYLO1O95 PYLO1100 PYLO11O5 PYLOI1LO PYLGII15 PYLIJ112O PY131125 PYLO113O PYL31135 PYl11Li1 SINCE THIS IS THE ONLY MEANS OF INDICATING 4 POSSIBLY INCORRECT PYLO11L.5 CALL TO P%4SCYL, THE USER SHOULD TEST TERROR AFTER THE CALL. PY101150 W CONTAINS INTERMEDIATE VALUES THAT MUST NOT BE DESTROYED IF PWCYL WILL BE CALLED AGAIN WITH INTL = 1. PYL3 1155 PYL.31160 PYL]1165 PYLO117O PYLO 1175 PYL3 1180 PYLO 1185