<< Click to Display Table of Contents >> restart_export |
{ RESTART_EXPORT.PDE
This example demonstrates the RESTART facilities of FlexPDE.
The problem is a copy of BUOYANT+TIME.PDE, with restart
transfer file output every 10 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 preference setting to automatically save a final
transfer file. 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"
VARIABLES
temp(100)
psi(0.001)
w(1)
DEFINITIONS
Lx = 1 Ly = 0.5
Rad = 0.5*(Lx^2+Ly^2)/Ly
Gy = 980
sigma_top = 0.01 { surface heat loss coefficient }
sigma_bowl = 1 { bowl heat loss coefficient }
k = 0.0004 { thermal conductivity }
alpha = 0.001 { thermal expansion coefficient }
visc = 1
heatin = min(10,t)
t0 = 50
rho0 = 1
rho = rho0*(1 - alpha*temp)
cp = 1
u = dy(psi)
v = -dx(psi)
penalty = 5000
EQUATIONS
temp: div(k*grad(temp)) = rho0*cp*(dt(temp) + u*dx(temp) + v*dy(temp))
psi: div(grad(psi)) + w = 0
w: dt(w) + u*dx(w) + v*dy(w) = visc*div(grad(w)) - Gy*dx(rho)
BOUNDARIES
region 1
{ on the arc of the bowl, set Psi=0, apply conduction loss to T,
and apply penalty function to w to enforce no-slip condition. }
start(0,0)
natural(temp) = -sigma_bowl*temp
value(psi) = 0
natural(w)=penalty*tangential(u,v)
arc (center=0,Rad) to (Lx,Ly)
{ on the top, continue the prior BC for Psi,
but apply a heat input and loss to T.
Apply natural=0 BC (no vorticity transport) for w }
load(temp) = heatin*exp(-(10*x/Lx)^2) - sigma_top*temp
natural(w)=0
line to (0,Ly)
{ in the symmetry plane assert w=0, with a reflective BC for T }
value(w)=0
load(temp) = 0
line to close
TIME 0 to 10
MONITORS
for cycle=5 { watch what's happening }
contour(temp) as "Temperature"
contour(psi) as "Stream Function"
contour(w) as "Vorticity"
vector(curl(psi)) as "Flow Velocity" norm
PLOTS
for t = 1 by 1 to 10 by 10 to endtime
grid(x,y)
contour(temp) as "Temperature" painted
contour(psi) as "Stream Function"
contour(w) as "Vorticity" painted
vector(curl(psi)) as "Flow Velocity" norm
contour(rho) as "Density" painted
!>>>>> HERE IS THE RESTART TRANSFER COMMAND:
for t=5 by 5 to endtime
export restart
HISTORIES
history(temp) at (0.1*Lx,Ly) (0.2*Lx,Ly) (0.5*Lx,Ly) (0.8*Lx,Ly)
(0.7*Lx,0.5*Ly) (0.04*Lx,0.1*ly) as "Temperature"
history(u) at (0.1*Lx,Ly) (0.2*Lx,Ly) (0.5*Lx,Ly) (0.8*Lx,Ly)
(0.7*Lx,0.5*Ly) (0.04*Lx,0.2*Ly) as "X-velocity"
history(v) at (0.04*Lx,0.1*ly) as "Y-velocity"
history(v) at (0.04*Lx,0.1*ly) vs sqrt(t) as "Y-velocity"
END