3d_periodic_exchange

<< Click to Display Table of Contents >>

Navigation:  Sample Problems > Usage > Periodicity >

3d_periodic_exchange

Previous pageReturn to chapter overviewNext page

{  3D_PERIODIC_EXCHANGE.PDE

 

 This example shows the use of FlexPDE in a 3D problem with azimuthal periodicity.

 In this problem we create a repeated 45-degree segment of a ring,

 and make the end values of U and V exchange.

 

}

 

title '3D PERIODIC EXCHANGE TEST'

 

coordinates cartesian3

 

Variables

    u,v

   

definitions

    k = 1

    an = pi/4         { this is the angular size of the repeated segment }

    crot = cos(an)     { the sine and cosine needed in the transformation }

    srot = sin(an)

    H = 0

    xc = 1.5

    yc = 0.2

    rc = 0.1

 

    ! construct an array of angles distributed throughout the figure

    arcangle = array (0 by an/30 to an)

    ! construct arrays of U and V at the points on the arc at R=xc, Z=0.5  (to be evaluated at plot time)

    arcu = array for a(0 by an/30 to an)  : eval(u, xc*cos(a), xc*sin(a), 0.5)

    arcv = array for a(0 by an/30 to an)  : eval(v, xc*cos(a), xc*sin(a), 0.5)

   

equations

    u : div(K*grad(u)) + H = 0

    v : div(K*grad(v)) - H = 0

 

extrusion z=0,0.4,0.6,1

 

boundaries

    region 1

 

      { this line forms the remote boundary for the later periodic statement }

      start(1,0) line to (2,0)

 

      value(u) = 0 arc(center=0,0) to (2*crot,2*srot)

 

      { The following line segment is periodic under an angular rotation.

               The mapping expressions take each point on the line into a corresponding

               point in the base line.  Note that although all the mapped y-coordinates

               will be zero, we give the general expression so that the transformation

               will be invertible. }

      periodic(x*crot+y*srot, -x*srot+y*crot)

          { map U to opposite V, and V to opposite U, so that U at 45 degrees is V at zero degrees and vice versa }

          map(u)=v  

          map(v)=u

      line to (crot,srot)

 

      value(u)=0

      arc(center= 0,0) to close

 

    limited region 2

      layer 2 H = 1

      start(xc-rc,0) line to (xc+rc,0) to (xc+rc,rc) to (xc-rc,rc) to close

 

    limited region 3

      layer 2 H = -1

      start((xc-rc)*crot,(xc-rc)*srot)

      line to ((xc+rc)*crot,(xc+rc)*srot)

              to ((xc+rc)*crot+rc*srot,(xc+rc)*srot-rc*crot)

              to ((xc-rc)*crot+rc*srot,(xc-rc)*srot-rc*crot) to close

 

monitors

    grid(x,y,z)

    contour(u) on z=0.1

    contour(u) on z=0.5

    contour(u) on z=0.9

 

plots

    grid(x,y,z)

    contour(u) on z=0.1        painted as "U on Z=0.1"

    contour(v) on z=0.1        painted as "V on Z=0.1"

    ! plot the arrays of U and V along the arc at R=xc, Z=0.5

    elevation(arcu,arcv) vs arcangle as "U and V vs angle at R="+$(xc)+" Z=0.5"

    contour(u) on z=0.5        painted as "U on Z=0.5"

    contour(v) on z=0.5        painted as "V on Z=0.5"

    contour(u) on z=0.9        painted as "U on Z=0.9"

    contour(v) on z=0.9        painted as "V on Z=0.9"

end