Navigation:  Sample Problems > usage > moving_mesh >

1d_stretchx

Print this Topic Previous pageReturn to chapter overviewNext page

{ 1D_STRETCHX

 

 This example demonstrates moving meshes in 1D.

 A Gaussian distribution is defined on a 1D mesh.

 The mesh is  then stretched to twice its initial size,

 while the Gaussian remains fixed in space.

 Mesh motion is imposed by explicit positions of the endpoints.

}

TITLE "stretching line"

 

COORDINATES

 cartesian1

VARIABLES

 u

 vx

 xm = move(x)

 

DEFINITIONS

 Hl = 1/2

 gwid = 0.15

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

 lmove = Hl + t

 

INITIAL VALUES

 u= u0

 vx=x/Hl

 

EULERIAN EQUATIONS

 U:   dt(u)=0

 Vx:  div(grad(vx))=0

 Xm:  dt(xm) = vx

 

BOUNDARIES

REGION 1

  { In 1D, "point" boundary conditions must FOLLOW the point at which

       they are to be applied: }

  START(-Hl)   point value(u)=0 point value(vx)=-1 point value(xm)= -lmove

  Line to (Hl) point value(u)=0 point value(vx)=1 point value(xm)= lmove

 

TIME 0 TO 0.5 by 0.01

 

MONITORS

for cycle=1

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

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

 

PLOTS

for time=0.1 by 0.1 to endtime

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

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

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

END

 


Page url: index.html?usage_moving_mesh_1d_stretchx.html