Navigation:  Sample Problems > usage > stop+restart >

restart_export

Print this Topic Previous pageReturn to chapter overviewNext page

{  RESTART_EXPORT.PDE

 

  This example demonstrates the restart facilities of FlexPDE.

  The problem is a copy of 2D_LAGRANGIAN_SHOCK.PDE,

  with TRANSFER file output every 0.02 units of problem time.

 

  The associated script RESTART_IMPORT.PDE reads one of these

  TRANSFER files to resume the computation from the time of the

  file output.

 

  Alternatively, the Finish Timestep item on the Stop menu could be

  used with the "Dump for Restart" checkbox set to write the automatic

  TRANSFER file "restart_export.rst".  This file could also be used in

  RESTART_IMPORT.PDE to resume the computation from the point

  of the interrupt.

 

}

 

TITLE "Stop and Restart Test - Export"

SELECT

 ngrid= 100

 regrid=off

 errlim=1e-4

 

VARIABLES

 rho(1)

 u(1)

 P(1)

 xm = move(x)

 

DEFINITIONS

 len = 1

 wid = 0.01

 gamma = 1.4

{ define a damping term to kill unwanted oscillations }

 eps =  0.001  

 

 v = 0

 rho0  = 1.0 - 0.875*uramp(x-0.49, x-0.51)

 p0 = 1.0 - 0.9*uramp(x-0.49, x-0.51)

 

INITIAL VALUES

 rho = rho0

 u = 0

 P = p0

 

EULERIAN EQUATIONS

{ Equations are stated as appropriate to the Eulerian (lab) frame.

   FlexPDE will convert to Lagrangian form for moving mesh.

   Since the equation is really in x only, we add dyy(.) terms with natural(.)=0

   on the sidewalls to impose uniformity across the fictitious y coordinate }

 rho: dt(rho) + u*dx(rho) + rho*dx(u)  = dyy(rho) + eps*dxx(rho)

 u:   dt(u) + u*dx(u) + dx(P)/rho  = dyy(u) + eps*dxx(u)

 P:   dt(P) + u*dx(P) + gamma*P*dx(u)  = dyy(P) + eps*dxx(P)

 xm:  dt(xm) = u

 

BOUNDARIES

  REGION 1

  { we must impose the same equivalence dt(xm)=u on the side boundaries

   as in the body equations: }

  START(0,0)    

      natural(u)=0  

       dt(xm)=u  

  line to (len,0)

      value(xm)=len      

      value(u)=0    

  line to (len,wid)

       dt(xm)=u    

      natural(u)=0        

  line to (0,wid)

      value(xm)=0      

      value(u)=0    

  line to close

 

TIME 0 TO 0.1

 

MONITORS

for cycle=5

  grid(x,10*y)

  elevation(rho) from(0,wid/2) to (len,wid/2) range (0,1)

  elevation(u) from(0,wid/2) to (len,wid/2) range (0,1)

  elevation(P) from(0,wid/2) to (len,wid/2) range (0,1)

 

PLOTS

for t=0 by 0.02 to endtime

  grid(x,10*y)

  elevation(rho) from(0,wid/2) to (len,wid/2) range (0,1)

  elevation(u) from(0,wid/2) to (len,wid/2) range (0,1)

  elevation(P) from(0,wid/2) to (len,wid/2) range (0,1)

  !>>>>> HERE IS THE RESTART DUMP COMMAND:

  transfer(rho,u,p)  

 

END

 


Page url: index.html?usage_stoprestart_restart_export.html