Forever
Previous  Top  Next

forever06
{ FOREVER.PDE
This problem displays the behaviour of FlexPDE in time dependent problems.
We posit a field with paraboloidal shape and with amplitude sinusoidal
in time. We then derive the source function necessary to achieve this
solution, and follow the integration for ten cycles, comparing the solution
to the known analytic solution. }

title 'A forever test'

Variables
Temp (threshold=0.1)

definitions
K = 1
eps = 0
shape = (1-x^2-y^2)
Texact = shape*sin(t)
source = shape*cos(t) - div(K*grad(shape))*sin(t)

Initial values
Temp = Texact

equations
div(K*grad(Temp)) + source = dt(Temp)

boundaries
Region 1
start(-1,-1)
value(Temp)=Texact
line to (1,-1) to (1,1) to (-1,1) to close

time 0 to 20*pi by 0.01

monitors
for cycle=5
contour(Temp) { show the Temperature during solution }

plots { write these plots to the .PGX file }
for t = pi/2 by pi to endtime
contour(Temp)
surface(Temp)
contour(Temp-Texact) as "Error"
vector(-dx(Temp),-dy(Temp)) as "Heat Flow"

histories
history(Temp) at (0,0) (0.5,0.5) integrate
history(Temp-Texact) at (0,0) (0.5,0.5)

end