spacetime2

<< Click to Display Table of Contents >>

Navigation:  Sample Problems > Usage > Misc >

spacetime2

Previous pageReturn to chapter overviewNext page

{ SPACETIME2.PDE  

 

 This example is a modification of SPACETIME1.PDE, showing the solution of

 one-dimensional transient heatflow with differing material properties,

 cast as a boundary-value problem.

 

 The time variable is represented by Y, and the temperature by u(x,y).

 

 We specify two regions of differing conductivity, KX.

 

 The initial Temperature is given as a truncated parabola along y=0.

 

 We specify reflective boundary conditions in X (natural(u)=0) along

 the sides x=0 and x=1.

 

 The value of u is thus assigned everywhere on the boundary except

 along the segment y=1, 0<x<1.  Along that boundary, we use the

 natural boundary condition,  

              natural(u) = 0,  

 since this corresponds to the application of no boundary sources.

 

}  

 

title "1-D Transient Heatflow as a Boundary-Value Problem"  

 

Variables  

  u              { define U as the system variable }  

 

definitions  

  kx              { declare KX as a parameter, but leave the value for later }  

 

Initial values  

    u = 0          { unimportant, since this problem is masquerading

                                 as a linear boundary-value problem }  

 

equations           { define the heatflow equation }  

  U: dy(u)  =  dx(kx*dx(u))

 

boundaries  

  region 1  

      kx = 0.1                { conductivity = 0.1 in region 1 }  

 

      start(0,0)

      value(u)=2.025-10*x^2   { define the temperature at t=0, x<=0.45 }  

      line to (0.45,0)

 

      value(u) = 0           { force zero temperature for t=0, x>0.45 }  

      line to (1,0) to (1,1)  

 

      natural(u) = 0          { no flux across x=1 boundary }  

      line to (1,1)  

 

      natural(u) =  0         { no sources on t=1 boundary }  

      line to (0,1)  

 

      natural(u) = 0        { no flux across x=0 boundary }  

      line to close  

 

  region 2  

       kx = 0.01                { low conductivity in region 2 }  

      start(0.45,0)           { lay region 2 over center strip of region 1 }  

      line to (0.55,0)  

            to (0.55,1)  

            to (0.45,1)  

            to close  

 

monitors  

    contour(u)  

 

plots  

    contour(u)

    surface(u)  

 

end