moving_source

<< Click to Display Table of Contents >>

Navigation:  Sample Problems > Usage > Misc >

moving_source

Previous pageReturn to chapter overviewNext page

{ MOVING_SOURCE.PDE

 

  This script uses the EDGE_DISTANCE function to create a moving Gaussian boundary source.

 

}

Title 'Moving Source'

   

Variables u

Global Variables m(1)

   

Select

   initgridlimit=1   ! don't regrid at initial discontinuity

   fixdt = 0.05

  debug(treemods)

 

Definitions

   wide=1

  ! the width of the gaussian is .25

   w = wide/4

  ! move the center of the source from 0.5 at a velocity of 1.0

   d = t+0.5      

  ! the gaussian function

   gaust = exp( -(edge_distance("wall")-d)^2 / w^2 )

  ! integrate the gaussian over the wall distance

   lint = surf_integral(gaust,"wall")

 

Initial Equations

   u:   div(grad(u)) = 0

 

Equations

   u:   div(grad(u)) = 0

   m: dt(m)=1

 

Boundaries

  Region 1

  ! define the "wall" to be the right side and top, and apply the source

  start  (wide,-wide)  

      label "wall" value(u)=gaust

  line to(wide,wide) to(-wide,wide)

      endlabel "wall" natural(u)=0

  ! define a natural bc over the left side and bottom

  line to(-wide,-wide) natural(u)=0

  line to close

 

! run long enough that the source climbs the right wall and crosses the top

Time = 0 to 3

 

Plots

  for cycle=1

  grid(x,y)

  contour(u)

  surface(u)

  elevation(gaust) on "wall" report lint

   

  history(lint, integral(u))

   

End