Gaus3D

Top  Previous  Next

title '3D Accuracy Test - Gaussian'

 

coordinates

   cartesian3

 

select

    stages = 3

    errlim = staged(1e-2, 1e-3, 1e-4)

 

variables

   u,v

 

definitions

   long = 1

   wide = 1

   z1 = -1

   z2 = 1

   w = 0.25  ! gaussian width

  uex = exp(-(x^2+y^2+z^2)/w^2)

   s = -[dxx(uex)+dyy(uex)+dzz(uex)]

initial values

   u = 0.

 

equations

U:    div[grad(u)] + s = 0

V:    div[grad(v)] + 6*v/w^2 + 2*(x*dx(v)+y*dy(v)+z*dz(v))/w^2 = 0

 

extrusion z = z1,z2

 

boundaries

   surface 1 value(u)=uex   value(v)=uex       { fix bottom surface temp }

   surface 2 value(u)=uex   value(v)=uex       { fix top surface temp }

 

   Region 1            { define full domain boundary in base plane }

      start(-wide,-wide)

        value(u) = uex    value(v)=uex        { fix all side temps }

        line to (wide,-wide)   { walk outer boundary in base plane }

          to (wide,wide)

          to (-wide,wide)

          to close

 

monitors

     grid(x,z) on y=0

 

plots

     grid(x,z) on y=0

     contour(uex) on y=0

     contour(u) on y=0

     contour(v) on y=0

     contour(u-uex) on y=0

     contour(v-uex) on y=0

summary

report(errlim)

report(sqrt(integral((u-uex)^2)/integral(1)))

report(sqrt(integral((v-uex)^2)/integral(1)))

 

histories

   history(sqrt(integral((u-uex)^2)/integral(1)), errlim)

 

end