• No results found

One dimensional adaptive grid generation

N/A
N/A
Protected

Academic year: 2020

Share "One dimensional adaptive grid generation"

Copied!
8
0
0

Loading.... (view fulltext now)

Full text

(1)

ONE-DIMENSIONAL ADAPTIVE

GRID

GENERATION

AHMEDM. M. KHODIERandADELY. HASSAN

Department

of

Mathematics

Faculty

of

Education AinShamsUniversity

Roxy,

Cairo,

Egyp

(Received November I, 1995 and in revised form May 8, 1996)

ABSTRACT. Inthiswork,wegiveanadaptive grid generation method whichallowsasingle pointtobe

added in the regions oflarge variation. Thismethoduses aquadrature ruleas aweightfunction. Our Weightfimction measuresthe variationofthesolution function on each subintervalofthe solution domain. The method is appliedtoobtainthenumerical solutionsofsome differentialequations. Acomparison of

the numerical solution obtainedbythis method andother methodsisgiven.

KEY WORDS ANDPHRASES Finitedifferences, errorestimation, weightfunction, adaptivegrid generation.

1991AMS SUBJECT CLASSIFICATIONCODES 65L50.

1. INTRODUCTION

It is well known thatthechoiceofthe mesh pointsplaysanimportantrole in theaccuracy ofthe numerical solutionofdifferentialequations. For example,when thesolutionhas largevariations likelarge gradients, peaks, or boundary layers in some partsofthesolutiondomain,weneedmoregrid pointsin

such regions thaninregions where thesolutionchangessmoothly. This type

omesh

generationisknown asadaptivegridgeneration.

During the lasttwodecades,asignificantinterest ingeneratingandapplying adaptive gridstothe numerical solutions of differentialequationsissurfaced(seeforexampleDennyand Landis ];Eiseman

[2];LentiniandPereyra [3];Matsuno andDwyer [4];andThompson[5]). The common property ofmost

adaptive grid methods is that they dividethesolution domain into subintervalssuchthat somepositive weight function has roughly equal valueover eachsubinterval. Mostadaptive grid generationmethods

differ from each otherin the choiceoftheweightfimctionand agreeincalculating thevalueofthegiven weightfunction at asingle point. Mostforms ofthe weightfunctionsusedin literaturedependonthe first

derivative,orthe second derivative,orthetnmcationerror ofthe solution.

Equidistdbution schemes in literature usually use a cm4tinear coordinate transformation to

(2)

w

x

+

x

0

w

where w is the given weight function. In the nxt section,weshow that theuseof such techniques

introduces a numericaldiffusionto the solutionofthe problem underconsideration.

Inthis paper, we give anadaptive grid generation method basedonusingaquadraturerule as a

weight function If the variation ofthe solution islargeon asubinterval, then thequadraturewillbe

large. The advantage ofour weight function is that it is calculated on a subintervalofthe solution

domain, not atasingle point ofthatdomain.Toavoidthenumericaldiffusionintroduced inmostadaptive

methods, we use finite differences on irregular gridtosolvethegivenproblemsinthephysicaldomain withoutthe useof anytransformations.

2. FINITE DIFFERENCES AND TRUNCATION ERRORS

Adaptive methodsin literatureusuallyuse acurvilinearcoordinatetransformationtotransformthe

physical domain into a computational domain where the mesh points are equally spaced. A one

dimensionaltransformationcanbewritten as

x(=

p(-

0_<<N (2.1)

where N is thenumber ofsubintervals inthesolutiondomain, i.e., h l/N, his thestepsize intheuniform

mesh. The first andsecondderivativesofthesolution inphysicaldomaintake theform

and

u

u,,

(2.2)

xg

ugg

ugxg

(2.3)

xx

x

x

in the computational domain. Hoffman[6] comparedthetnmcation errorsofthefirst derivativesof the solution function in the physical and computational domains. Thompsonetal.

[7]

provedthat if u is

x

approximated in thephysicaldomainby usingacentral difference for

u

and theexactvalueof

x,

then the truncationerror inequation(2.2)isgivenby

T -1

oo -1 oo

g(D-

XDx)2n

+1

u

Y

+ u (2.4)

(2n+1)!

2n+1

(2n+1)

x

Xn_l

Xn=l

Thedominantpart ofT is x

h2p

u

h2pu

h2pUxxx

(2.5)

T1

=-6---

x--

xx

-g

The first term of T containsanumericalviscosity

UxWhich

usuallycausestroubles and may distroy the

solution. Thistermcanbe eliminatedifwe use central differenceapproximation for

x.

Inthiscase,we have

U

U(’+I

U(’-I

+T.

(2.6)

u

(3)

The dominantpart of is x

l(X

i+l

xi)3

-(xi_

_xi)3

T

2=--(xi+l-2x

i+x

)u

xx 6 o

+l-Xi_l

u (2.7)

In the physical domain,thefirstderivative u x

asfollows(seefig.2.1)

can beapproximated by using the centraldifference

u(x )-u(x

u +1 -1 T

x

hl

+

h2

x

where thedominant partofthe mmcation error isgiven by

x

(2.8)

-(h12-h

+h22)u

(2.9)

T3

-(h2

hl)Uxx

lh2

xxx

The dominant part of the tnmcation error inequation

(2.9)

isthesame asthat giveninequation(2.7). Hence, the central difference approximation of the first derivative u has thesame truncation errorin

x

both physical and computationaldomain.

Now,

we compare the truncation errorsfor thecentral differenceapproximation ofthe second derivative u in thephysical andcomputational domains. Inthe physical domain,wehave

2[hlU(X

+h

2

)+h2u(xi_l

)]

uxx +1

-(hl

)u(xi

+T (2.10)

hlh2

(h +

h2

x

(2.11)

The main partofthe mmcationerror

T

is

T

4

=-(h

2

-hl)Uxx

x

-’2

(h12-

hlh2

+h)Uxxxx

Inthecomputational domain,wehave

u

u(i+l)-2u(i)+u(_

1)

(u(i+l)-U(i_l)XX

+l-2Xi

+xt_

1)

Xi+l-Xl-1

2

x/+l-Xi-2 2

wherethedominant partof thetruncation error

T

isgiven by
(4)

(h2

-h)

2 (h 2

-h)

2

T5

(h

+h2)2

Uxx

--(h2

-hl)[1

)2 ]Uxxx

(2.13)

(h +h

2

The first term in equation (2.13) istroublesomesinceitdependsonthe derivative u which isbeing

approximated. Tiffstermvanishesonlywhenh h

2 Thisleadstouniformmesh inthe physicaldomain which isnotour interest in thiswork.

Hence,

the use of central differencesfor thederivatives ofthetransformationwhich eliminate the

term u in the tnmcation error ofthe first derivative now introduces an errorthat dependon u This

x xx

error introduces a numerical diffusion.

From the above discussion, it isclearthat thetruncation errorsofthe firstderivative u and the x

second derivative u (asshown in equations(2.7)and(2.13))contain a numerical diffusionterm inthe computational domain while in the physical domain, there is a numerical diffusion term onlyin the

truncation error of the first derivative (see equation (2.9)). De Rivas [8] suggested thefollowing approximation

x

hlh2

(h

+h2)

whichhas themain

pan

ofthetruncation error

T

6

hlh2Uxx

x

Therefore, it is preferabletsolveaproblemin thephysical dthantsolveitinthe cmpttil

domain. A compariso f the maximum error between theexactsotutiand theuerical soluti btained inphysicalandcompmatialdmains isgiven in

exale

4.1.

Manteffel and

WNte [9]

showed that the differenceschemeobtainedbyusing equations(2.10)

ad (2.14) yields a second order accate solutio

deite

thefct that thetrcatierrorisflwer

rder.

3. CONSTRUCTION OF ADAPTIVE MESH

In this section, we describe ourprocedureforconstructing the adaptivemesh. Toillustratethis, letusconsiderthe differential equation

au +bu

+cu=g

0<x_<l

(3.1)

xx x

where a,b,c, g are,ingeneral,functionsofx and the boundary values

u(0)

andu(1)aregiven.

Let u(x)

eC4[0,1]

be anapproximatesolutionof equation(3.1)obtainedbysomeinterpolation of the discrete numerical solution obtained oncrudeuniformmesh.

For

example,the functionu(x)canbe approximatedby using splineorany piecewise polynomialapproximations. Inthiswork,weusequadratic spline polynomial to approximate thesolution. Then by consideringthemidpoint

Xm=(Xi

+

xi

+1)

2. the errorof Sknpson’s rule appliedtothesubinterval

[xi,

x

+ isgiven by -1

(5)

%vhere

x.<

i

<

x.+l

If we consider the two points

xg=(3x

i+x

i+l)/4

and

x

r=(x

+3xi+

1)/4,

thentheerrorbecomes

EZ,

(u)

I"

u(x)dx+

f.,,.

....

u(x)dx-

--(x,+,l

x,)[u(x,)+4u(xt)+2u(x,,)+4u(x,.)+u(x,/i)

..1 where x <

’i

<x

-(c,)]

(3.3)

92160

(xi+

xi)5[Uxxxx

()

+

Uxxxx

m and xm<

’i’2

<

xi+

1. Bysubtracting equation(3.2)from equation(3.3),we get

-(x,/

x,

lu(x,

)-4u(xe)

+ 6u(x

m)- 4u(xr +

u(x,

+

1)

_-19216__

xi

+

xi)5[

Uxxxx

(;)

+uxxxx

(;)-32u

xxxx

(;i)[

(3.4)

Hence

El,U)

< 17

4i080

(xi

+

xi

)5

u

()

of Equation(3.4)

rret

e

e=or of

Sn

e

on

e

btewal[x

i,x

+

1].

ffe fo dae

u

has a

ge

vue

on a

btaL

wehavea

ge

v

ofeor

tion

(3.4). h

s

ca,

we add

e

dpot x to

e

m

pots

d

reat

e

proceded me

goppg

cdteis

m

fisfied.R

w o

at

e

nmedcalrets

dd

on

e

propeRies ofe

d.

ffe

me

ratio is

ge, e

convergofe kae lufion mod y belog. h work,we

ratio

Mn

to be 4 S

Mn

4.

s

worL

e

procedeof

cong

adape

m

wasto

op

wh

e n

ofadapte

me

pots

is

e

e as

e

o m.

procedec be

ehed

e

foflogalgo

ALGOM

approte

fion u of equation (3.1) obtmed on a

o

me

pots

{x },

i=0,1,2 N.

e ape me

{z

be COheredas

e

foRog

,s

1.Stm

e

o me

pots

z x i=0,1,2,...,N.

2.

Co,me

e

e=orE. eqfion(3.4)oneachbtewal[z

zi

3.De

e

btal of eor, ym

4.Update

e me

pots

{zi}

toclude

e

dpotof

[Zm_

1,Zm].

5.geat

gs

2-4tfl

e

oppg

cdt tfied.

4. NUMERICAL RESULTS

(6)

d2u

EXAMPLE 4.1. --+4u 20x +4x 0_<x <

dx

In

thisexample,wecomparethe numerical resultsobtained inthe physical and computationaldomain.The

boundary conditions are obtained fi’om the exactsolutionu(x)=x

5.

The resultsaregivenintable4.1.

Also, a comparison of thenumericalresultsobtainedbyourmethod andsomeother methodsisgivenin table 4.2. Theadaptive meshisshowninfig.4.1.

d2u

du

0 0_<x_<l

EXAMPLE

4.2.

dx qdx

with the boundary conditions u(0) 0 and u(1)=1. Thisexampleis consideredbyLickand Gaskins [10]. It has a boundary layer ofthickness 1/qnear the fight boundary. Numerical results for q=20are

givenintable 4.3, and the adaptive meshisshowninfigure4.2.

rx

d2u

du

EXAMPLE

4.3. +-- 0 0 _< x _< r- dx dx

where the boundary conditions are u(0) 0 andu(1) 1. Thefirstandhigherorder derivatives ofthe

solution function havesinguhdfiesat x=0forr>1. The numericalreadtsobtainedfor 1.25 aregiven

intable4.4,andthe adaptive mesh distributionisshowninfigure4.3.

d2u

du

EXAMPLE 4.4 --+re+m=0 0<x<l t>l/4

dx dx

withboundary conditionsu(0) 0andu(1)

sm(x/-

1). Numericalresults givenintable4.5 aredue

to t=l 0. Theadaptive meshisshowninfigure4.4.

REMARK. In all tables, adaptive

,

adaptive

2,

andadaptiverepresentthenumericalresultson

adaptive grid obtained by using the first derivative, second derivative,and ourquadraturerule(equation

(3.4))as aweightfunction.

Transformation

x()

(e

1)/(e-1)

x()=’

No.of Subintervals Abs.Max.Errorin Phys.Domain

32 23x10-5

64 59x10

-

50x 10-5

32 18x

10-6

30x 10-5

64 4x10-6 75x10-6

Table 4.1. NumericalResults of Example4.1 in Physical and Computational domain

Mesh

Type AbsoluteMaximumError

Abs.Max.Errorin

Comp.

Domain 20x10-4

80 Subintervals 160 Subintervals 320Subintervals

uniform 48x10-6

25x10-6

14x10-6

adaptive 29x10-6

16x

10-6

7x10

adaptive 13x10 8x

10-6

3x10-6

adaptive 67 10-7 39x10-7 12x10

MeshType

Table 4.2. Numerical Results ofExample4.1 AbsoluteMaximumError

80 Subintervals 160 Subintervals 320 Subintervals

umform 20x10

-

49 x10-5

15x10

-adaptive 14x10 42x10-5

13x10-5

adaptive 72x10-5 30x10-5

48x10

-adaptive 10x10-5 29x10-.6

(7)

MeshType

bsolute

MaximunnError

80 Subintervals 160 Subintervals 320Subintervals uniform 30)<10.4

18 10-4

x10

adaptive 26

10.4

13 10 97 0

-adaptive 21

10.4

98 0

-

73 0

-adaptive 14 x

10.4

53x10

-

24x10

-MeshType

uniform

adaptive’

adaptive

adaptive

Table4.4. Numerical Results ofExample4.3

Ab"s’o’iute Mai’mm

Error

80 Subintervals 160 Subintervals

17x10-J 72x10

40x

10.4

18x I0

-23x

10.4

6 x

10-4

6 x

10.4

20x10

-Table4.5.NumericalResultsof Example4.4

320 Subintervals llx

10-4

71xI0

-16xI0

-6xlO

-Fig.4.1.Adaptive Mesh for Example4.1 with80Subintervals

Fig.4.3. Adaptive Mesln for

Examifle

4.3

with80Subinten,ais

Fig.4.2.Adaptive Mesh forExample4.2 with 80 Subintervals

Fig.4.4. Adaptive Mesh frExample4.4

(8)

5. CONCLUSIONS

In this work,wehaveanalyzedthe numerical solution of differentialequationsin thephysicaland

computational domains. The difference approximations ofthe first derivatives have thesametruncation errors in both domains whilethe difference approximations ofthe secondderivatives introduceartificial

viscosity in the computational domain. Theartificialviscosity can beavoidedby solving thedifferential

equationsinthe physicaldomain.

The adaptive grid generation methods generates a well suited mesh for the problemsunder

consideration speciallyifthe solution oftheseproblems hasalargevariation in some partsofthesolution domain. Also the use of adaptive methods doesnotrequireany priori knowledge aboutthe solution or eventhe locationsof kslargevariations.

The numerical results presented in thispapershow that theerror obtainedby usingouradaptive

method isof almost 50% ofthe error obtainedby usingothermethods.

[]]

[2]

[31

[4]

[1

[6]

[7]

[8]

[9]

[10]

REFERENCES

DENNY, V. E. and LANDIS, It.

B., "A

NewMethod for Solving TwoPointBoundaryValue Problems Using Optimal Node Distnoution

",

J.ofComp.Phys.9(1972), 120-137.

EISEMAN, P. K "Adaptive Grid Generation",

Computer

MethodsinAppliedMechanicsand

Eng.

64(1987),321-376.

LENTINI, M. and

PEREYRA,

V.

"An

AdaptiveFiniteDifference Solver forNonlinearTwo Point Boundary Value Problems with Mild Boundary

Layers",

SiamJ.Numer.Anal. 14,No. (1977),91-111.

MATSUNO, K. and

DWYER,

H.

A.,

"Adaptive Methods for Elliptic Grid Generation",J.of

Comp.

Phys.77(1988),40-52.

THOMPSON, J.

F.,

"A Surveyof Dynamically Adaptive Gridinthe NumericalSolutionofPartial

Differential Equations",Appl. Numer.Math. (1985),3-27.

HOFFMAN, J.

D.,

"Rehtionship between the Truncation ErrorsofCenteredFinite Difference Approximationon Uniform andNommiformMeshes", J.of

Comp.

’Phys.

46(1982), 469-474.

THOMPSON, J. F.

WARSI,

Z.U.

A.,

and

MASTIN,

C.

W.,

"Order of Difference Expression

onCurvilinearCoordinateSystems",Advancesin GridGeneration,ASME (1983), 17-28.

DE RWAS, E. K. "On the Use ofNonuniform Grids inFinite DifferenceEquations",J.of

Comp.

Phys. 10(1972),202-210.

MANTEUFFEL, T.A.and

WHITE,

A.B.,"TheNumerical Solutionof Second-Order Boundary ValueProblemsonNonuniformMeshes", Math. of Computation, 47,No. 176(1986),511-535.

LICK,

W. and

GASKINS,

T.

"A

Consistent andAccurateProcedure for ObtainingDifference

References

Related documents

Three-point bend tests showed that the alkali treatments of Alfa fibers have also a significant effect on flexural modulus. From the histogram in Fig.2b, It is clearly seen that

National Conference on Technical Vocational Education, Training and Skills Development: A Roadmap for Empowerment (Dec. 2008): Ministry of Human Resource Development, Department

Another important JUJUTSU (柔術) school that is called YOSHIN RYU (楊心流), but not related to HONTAI YOSHIN RYU (本體楊心流), had a great influence on the

Three in one his glory sharing, earth and heav’n his praise declaring, Praise the high majestic Father, praise the everlasting LORD!. Worshiping Our God, The One and

Proprietary Schools are referred to as those classified nonpublic, which sell or offer for sale mostly post- secondary instruction which leads to an occupation..

During the critical Encoding/Maintenance period, activity on trials with the highest level of accuracy (3 or 4 correct) is higher than trials with lower levels of accuracy.

This result is partially a consequence of lower confidence when rating the friend and canonical individual as well as smaller mean absolute distances between those two individuals

Acknowledging the lack of empirical research on design rights, our paper wishes to investigate the risk of piracy and the perceptions of the registered and unregistered design