Navigation:  Sample Problems > usage > moving_mesh >

2D_movepoint

Print this Topic Previous pageReturn to chapter overviewNext page

{  2D_MOVEPOINT.PDE

 

 This example is a variation  of 2D_STRETCH_XY.PDE demonstrating the use of

 moving and non-moving point declarations.

 

 A point defined by name and used in the construction of the domain will move

 when the mesh moves.  The "NODE POINT" declaration will also create a movable

 point.

 Points declared explicitly or not used in the mesh construction will remain fixed.

 

}

TITLE "stretching brick"

SELECT

 regrid=off

coordinates

 cartesian2('x','y')

VARIABLES

 u

 vx

 xm = move(x)

 vy

 ym = move(y)

DEFINITIONS

 Hl = 1/2

 gwid = 0.15

 u0= exp(-(x^2+y^2)/gwid^2)

 lmove = Hl + t

 ms = gwid^2/u0

 P = point(Hl,Hl)   ! a point that IS used in domain construction

 Q = point(0.1,0)   ! a point that is used in "node point"

 R = point(-0.2,-0.2)   ! a point that is NOT used in domain construction

INITIAL VALUES

 u= u0

 vx = x/Hl

 vy = y/Hl

EQUATIONS

 U:   dt(u)=0

 vx:  div(grad(vx))=0

 Xm:  dt(xm) = vx

 vy:  div(grad(vy))=0

 Ym:  dt(ym) = vy

BOUNDARIES

REGION 1

  mesh_spacing = ms

  START(-Hl,-Hl)

  value(u) = 0 nobc(vx) nobc(xm) value(vy)=-1 value(ym)=-lmove

  Line to (Hl,-Hl)

  value(u)=0 value(vx) = 1 value(xm)=lmove nobc(vy) nobc(ym)

  line to P

  value(u)=0 nobc(vx) nobc(xm) value(vy)=1 value(ym) = lmove  

  line to (-Hl,Hl)

  value(u)=0 value(vx)=-1 value(xm)=-lmove nobc(vy) nobc(ym)

  line to close

NODE POINT q

TIME 0 TO 0.5 by 0.01! 10

MONITORS

for cycle=1

  grid(x,y) zoom(-Hl-1/2,-Hl-1/2, 2*Hl+1,2*Hl+1)

grid(x,y) zoom(-0.6,0.4, 0.2,0.2)

contour(vx) zoom(-0.6,0.4, 0.2,0.2)

contour(vy) zoom(-0.6,0.4, 0.2,0.2)

  contour(u)

  elevation(u,u0) from(-10*Hl,0) to (10*Hl,0) range (0,1)

  elevation(u,u0) from(0,-10*Hl) to (0,10*Hl) range (0,1)

PLOTS

for time=0.1 by 0.1 to endtime

  grid(x,y) zoom(-Hl-1/2,-Hl-1/2, 2*Hl+1,2*Hl+1)

  contour(u)

  contour(u-u0) as "True Total Error"

  contour(error) as "Estimated Step Error" painted

  elevation(u,u0)   from(-10*Hl,0) to (10*Hl,0) range (0,1)

  elevation(dt(xm)) from(-10*Hl,0) to (10*Hl,0) range (0,1)

  elevation(u,u0)   from(0,-10*Hl) to (0,10*Hl) range (0,1)

  elevation(dt(ym)) from(0,-10*Hl) to (0,10*Hl) range (0,1)

History(u) at P,Q, (0.2,0) as "Points a and b move, c does not"

History(u) at R,(-0.2,-0.2) as "neither point moves"

END

 


Page url: index.html?usage_moving_mesh_2d_movepoint.html