Skip to content

Commit

Permalink
added streamfunction/vorticity example
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.mcs.anl.gov/repos/nek5/examples@1004 24248562-e74d-0410-ab4b-d4d80c744c73
  • Loading branch information
fischer1 committed Feb 12, 2014
1 parent 99a783a commit 0ccfd00
Show file tree
Hide file tree
Showing 6 changed files with 2,727 additions and 0 deletions.
66 changes: 66 additions & 0 deletions eddy_psi_omega/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
c
c This case demonstrates how to use the Nek5000 convection-diffusion
c solver as a 2D Navier-Stoke solver using the streamfunction-vorticity
c (psi-omega) formulation.
c
c Basically, vorticity is advected and the streamfunction is derived by
c solving a Poisson equation. (The Poisson equation is not solved
c efficiently here, this is just a demonstration of some of the capabilities
c that users can develop with the userchk routine.)
c
c Details (below) of the particular example are from the "eddy" example.
c
c
c This case monitors the error for an exact 2D solution
c to the Navier-Stokes equations based on the paper of Walsh [1],
c with an additional translational velocity (u0,v0).
c
c The computational domain is [0,2pi]^2 with doubly-periodic
c boundary conditions.
c
c Walsh's solution consists of an array of vortices determined
c as a linear combinations of eigenfunctions of having form:
c
c cos(pi m x)cos(pi n y), cos(pi m x)sin(pi n y)
c sin(pi m x)cos(pi n y), sin(pi m x)sin(pi n y)
c
c and
c
c cos(pi k x)cos(pi l y), cos(pi k x)sin(pi l y)
c sin(pi k x)cos(pi l y), sin(pi k x)sin(pi l y)
c
c While there are constraints on admissible (m,n),(k,l)
c pairings, Walsh shows that there is a large class of
c possible pairings that give rise to very complex vortex
c patterns.
c
c Walsh's solution applies either to unsteady Stokes or
c unsteady Navier-Stokes. The solution is a non-translating
c decaying array of vortices that decays at the rate
c
c exp ( -4 pi^2 (m^2+n^2) visc time ),
c
c with (m^2+n^2) = (k^2+l^2). A nearly stationary state may
c be obtained by taking the viscosity to be extremely small,
c so the effective decay is negligible. This limit, however,
c leads to an unstable state, thus diminsishing the value of
c Walsh's solution as a high-Reynolds number test case.
c
c It is possible to extend Walsh's solution to a stable convectively-
c dominated case by simulating an array of vortices that translate
c at arbitrary speed by adding a constant to the initial velocity field.
c This approach provides a good test for convection-diffusion dynamics.
c In the current file set the translational velocity is specified as:
c
c U0 =[u0,v0] := [param(96),param(97)] ( in the .rea file )
c
c
c The approach can also be extended to incompressible MHD with non-unit
c magnetic Prandtl number Pm.
c
c [1] Owen Walsh, "Eddy Solutions of the Navier-Stokes Equations,"
c in The Navier-Stokes Equations II - Theory and Numerical Methods,
c Proceedings, Oberwolfach 1991, J.G. Heywood, K. Masuda,
c R. Rautmann, S.A. Solonnikov, Eds., Springer-Verlag, pp. 306--309
c (1992).
c
97 changes: 97 additions & 0 deletions eddy_psi_omega/SIZE
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
C Dimension file to be included
C
C HCUBE array dimensions
C
parameter (ldim=2)
parameter (lx1=16,ly1=lx1,lz1=1,lelt=300,lelv=lelt)
parameter (lxd=3*lx1/2,lyd=lxd,lzd=1)
parameter (lelx=20,lely=20,lelz=1)
c
parameter (lzl=3 + 2*(ldim-3))
c
parameter (lx2=lx1-2)
parameter (ly2=ly1-2)
parameter (lz2=lz1 )
parameter (lx3=lx1)
parameter (ly3=ly1)
parameter (lz3=lz1)
c
c parameter (lpelv=lelv,lpelt=lelt,lpert=3) ! perturbation
c parameter (lpx1=lx1,lpy1=ly1,lpz1=lz1) ! array sizes
c parameter (lpx2=lx2,lpy2=ly2,lpz2=lz2)
c
parameter (lpelv=1,lpelt=1,lpert=1) ! perturbation
parameter (lpx1=1,lpy1=1,lpz1=1) ! array sizes
parameter (lpx2=1,lpy2=1,lpz2=1)
c
c
c parameter (lbelv=lelv,lbelt=lelt) ! MHD
c parameter (lbx1=lx1,lby1=ly1,lbz1=lz1) ! array sizes
c parameter (lbx2=lx2,lby2=ly2,lbz2=lz2)
c
parameter (lbelv=1,lbelt=1) ! MHD
parameter (lbx1=1,lby1=1,lbz1=1) ! array sizes
parameter (lbx2=1,lby2=1,lbz2=1)
c
C LX1M=LX1 when there are moving meshes; =1 otherwise
parameter (lx1m=1,ly1m=1,lz1m=1)
parameter (ldimt= 2) ! 2 passive scalars + T
parameter (ldimt1=ldimt+1)
parameter (ldimt3=ldimt+3)
parameter (lp = 512)
parameter (lelg = 4100)
c
c Note: In the new code, LELGEC should be about sqrt(LELG)
c
PARAMETER (LELGEC = 1)
PARAMETER (LXYZ2 = 1)
PARAMETER (LXZ21 = 1)
c
PARAMETER (LMAXV=LX1*LY1*LZ1*LELV)
PARAMETER (LMAXT=LX1*LY1*LZ1*LELT)
PARAMETER (LMAXP=LX2*LY2*LZ2*LELV)
PARAMETER (LXZ=LX1*LZ1)
PARAMETER (LORDER=3)
PARAMETER (MAXOBJ=4,MAXMBR=LELT*6,lhis=100)
C
C Common Block Dimensions
C
PARAMETER (LCTMP0 =2*LX1*LY1*LZ1*LELT)
PARAMETER (LCTMP1 =4*LX1*LY1*LZ1*LELT)
C
C The parameter LVEC controls whether an additional 42 field arrays
C are required for Steady State Solutions. If you are not using
C Steady State, it is recommended that LVEC=1.
C
PARAMETER (LVEC=1)
C
C Uzawa projection array dimensions
C
parameter (mxprev = 20)
parameter (lgmres = 30)
C
C Split projection array dimensions
C
parameter(lmvec = 1)
parameter(lsvec = 1)
parameter(lstore=lmvec*lsvec)
c
c NONCONFORMING STUFF
c
parameter (maxmor = lelt)
C
C Array dimensions
C
COMMON/DIMN/NELV,NELT,NX1,NY1,NZ1,NX2,NY2,NZ2
$,NX3,NY3,NZ3,NDIM,NFIELD,NPERT,NID
$,NXD,NYD,NZD

c automatically added by makenek
parameter(lxo = lx1) ! max output grid size (lxo>=lx1)

c automatically added by makenek
parameter(lpart = 1 ) ! max number of particles

c automatically added by makenek
integer ax1,ay1,az1,ax2,ay2,az2
parameter (ax1=lx1,ay1=ly1,az1=lz1,ax2=lx2,ay2=ly2,az2=lz2) ! running averages
14 changes: 14 additions & 0 deletions eddy_psi_omega/psi_omega.box
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
base.rea
2 spatial dimension
1 number of fields
#
# comments Lee Ho Thesis, p. 76, p.128
#
#
#========================================================
#
Box
-16 -16 nelx,nely,nelz for Box
0 1. 1. x0 x1 ratio
0 1. 1. y0 y1 ratio
P ,P ,P ,P , bc's ! NOTE sigma given in usrdat2
Loading

0 comments on commit 0ccfd00

Please sign in to comment.