Commit 68df98ba authored by Cody Permann's avatar Cody Permann
Browse files

Adding template example

Additional changes needed to makenek to avoid
clobbering the template example Makefile
parent 006750a1
......@@ -3,7 +3,7 @@
###############################################################################
#
# Optional Environment variables
# MOOSE_DIR - Root directory of the MOOSE project
# MOOSE_DIR - Root directory of the MOOSE project
#
###############################################################################
# Use the MOOSE submodule if it exists and MOOSE_DIR is not set
......@@ -20,13 +20,20 @@ include $(FRAMEWORK_DIR)/build.mk
include $(FRAMEWORK_DIR)/moose.mk
################################## MODULES ####################################
ALL_MODULES := yes
include $(MOOSE_DIR)/modules/modules.mk
SOLID_MECHANICS := yes
CONTACT := yes
HEAT_CONDUCTION := yes
WATER_STEAM_EOS := yes
MISC := yes
PHASE_FIELD := yes
XFEM := yes
include $(MOOSE_DIR)/modules/modules.mk
###############################################################################
# dep apps
APPLICATION_DIR := $(CURDIR)
APPLICATION_NAME := MOON
APPLICATION_NAME := moon
APP_REV_HEADER := $(CURDIR)/include/base/MoonRevision.h
BUILD_EXEC := yes
DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME))
include $(FRAMEWORK_DIR)/app.mk
......
# Assume that NEK_DIR and NEK_CASENAME are defined by parent Makefile
$(NEK_OBJ): run_makenek
#all:: $(NEK_OBJ) $(NEK_LIB) SESSION.NAME
run_makenek:
$(NEK_SOURCE_DIR)/core/makenek $(NEK_CASENAME) $(NEK_SOURCE_DIR)
SESSION.NAME:
echo $(NEK_CASENAME) > SESSION.NAME && echo $(NEK_CASE_DIR) >> SESSION.NAME
.PHONY: run_makenek
$(NEK_LIB): run_makenek
make lib
###############################################################################
################### MOOSE Application Standard Makefile #######################
###############################################################################
#
# Optional Environment variables
# MOOSE_DIR - Root directory of the MOOSE project
# FRAMEWORK_DIR - Location of the MOOSE framework
#
###############################################################################
EXAMPLE_DIR ?= $(shell dirname `pwd`)
MOON_DIR ?= $(shell dirname $(EXAMPLE_DIR))
MOOSE_DIR ?= $(MOON_DIR)/moose
FRAMEWORK_DIR ?= $(MOOSE_DIR)/framework
###############################################################################
# framework
include $(FRAMEWORK_DIR)/build.mk
include $(FRAMEWORK_DIR)/moose.mk
################################## MODULES ####################################
SOLID_MECHANICS := yes
CONTACT := yes
HEAT_CONDUCTION := yes
WATER_STEAM_EOS := yes
MISC := yes
PHASE_FIELD := yes
XFEM := yes
include $(MOOSE_DIR)/modules/modules.mk
###############################################################################
# nek
NEK_SOURCE_DIR := $(MOON_DIR)/Nek5000
NEK_CASE_DIR := $(CURDIR)
NEK_CASENAME := $(shell basename $(NEK_CASE_DIR))
NEK_OBJ := obj/$(NEK_CASENAME).o
NEK_LIB := $(NEK_SOURCE_DIR)/Nek5000.a
# moon
APPLICATION_DIR := $(MOON_DIR)
APPLICATION_NAME := moon
DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME))
include $(FRAMEWORK_DIR)/app.mk
# case
APPLICATION_DIR := $(CURDIR)
APPLICATION_NAME := $(shell basename $(APPLICATION_DIR))
MAIN_DIR := $(MOON_DIR)/src
BUILD_EXEC := yes
ADDITIONAL_LIBS := $(NEK_OBJ) $(NEK_LIB)
DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME))
include $(FRAMEWORK_DIR)/app.mk
###############################################################################
# Additional special case targets should be added here
C Dimension file to be included
C
C HCUBE array dimensions
C
parameter (ldim=2)
parameter (lx1=8,ly1=lx1,lz1=1,lelt=300,lelv=lelt)
parameter (lxd=12,lyd=lxd,lzd=1)
parameter (lelx=20,lely=20,lelz=1)
parameter (lzl=3 + 2*(ldim-3))
parameter (lx2=lx1-2)
parameter (ly2=ly1-2)
parameter (lz2=lz1 )
parameter (lx3=lx1)
parameter (ly3=ly1)
parameter (lz3=lz1)
parameter (lp = 512)
parameter (lelg = 4100)
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 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 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)
c
c Note: In the new code, LELGEC should be about sqrt(LELG)
c
PARAMETER (LELGEC = 1)
PARAMETER (LXYZ2 = 1)
PARAMETER (LXZ21 = 1)
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)
PARAMETER (lhis=100) ! # of pts a proc reads from hpts.in
! Note: lhis*np > npoints in hpts.in
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
c automatically added by makenek
parameter (lxs=1,lys=lxs,lzs=(lxs-1)*(ldim-2)+1) !New Pressure Preconditioner
c automatically added by makenek
parameter (lfdm=0) ! == 1 for fast diagonalization method
c automatically added by makenek
common/IOFLAG/nio ! for logfile verbosity control
c automatically added by makenek
integer toteq
parameter(toteq = 1 ) ! Number of conserved variables
c IFCMT=FALSE then toteq=1
c automatically added by makenek
integer lelcmt
parameter(lelcmt = 1 ) ! # of cmt elements
c IFCMT=FALSE then lelcmt=1
256 256 8 256 1024 256 0
218 256 255 207 173
219 255 254 173 175
222 254 253 175 174
223 253 252 174 181
202 252 251 181 164
203 251 250 164 166
206 250 249 166 165
207 249 248 165 208
250 248 247 208 194
251 247 246 194 196
254 246 245 196 195
255 245 244 195 202
234 244 243 202 185
235 243 242 185 187
238 242 241 187 186
239 241 256 186 207
216 207 173 205 178
217 173 175 178 177
220 175 174 177 176
221 174 181 176 180
200 181 164 180 169
201 164 166 169 168
204 166 165 168 167
205 165 208 167 206
248 208 194 206 199
249 194 196 199 198
252 196 195 198 197
253 195 202 197 201
232 202 185 201 190
233 185 187 190 189
236 187 186 189 188
237 186 207 188 205
210 205 178 203 170
211 178 177 170 172
214 177 176 172 171
215 176 180 171 179
194 180 169 179 161
195 169 168 161 163
198 168 167 163 162
199 167 206 162 204
242 206 199 204 191
243 199 198 191 193
246 198 197 193 192
247 197 201 192 200
226 201 190 200 182
227 190 189 182 184
230 189 188 184 183
231 188 205 183 203
208 203 170 224 223
209 170 172 223 222
212 172 171 222 221
213 171 179 221 220
192 179 161 220 219
193 161 163 219 218
196 163 162 218 217
197 162 204 217 216
240 204 191 216 215
241 191 193 215 214
244 193 192 214 213
245 192 200 213 212
224 200 182 212 211
225 182 184 211 210
228 184 183 210 209
229 183 203 209 224
154 224 223 159 125
155 223 222 125 127
158 222 221 127 126
159 221 220 126 133
138 220 219 133 116
139 219 218 116 118
142 218 217 118 117
143 217 216 117 160
186 216 215 160 146
187 215 214 146 148
190 214 213 148 147
191 213 212 147 154
170 212 211 154 137
171 211 210 137 139
174 210 209 139 138
175 209 224 138 159
152 159 125 157 130
153 125 127 130 129
156 127 126 129 128
157 126 133 128 132
136 133 116 132 121
137 116 118 121 120
140 118 117 120 119
141 117 160 119 158
184 160 146 158 151
185 146 148 151 150
188 148 147 150 149
189 147 154 149 153
168 154 137 153 142
169 137 139 142 141
172 139 138 141 140
173 138 159 140 157
146 157 130 155 122
147 130 129 122 124
150 129 128 124 123
151 128 132 123 131
130 132 121 131 113
131 121 120 113 115
134 120 119 115 114
135 119 158 114 156
178 158 151 156 143
179 151 150 143 145
182 150 149 145 144
183 149 153 144 152
162 153 142 152 134
163 142 141 134 136
166 141 140 136 135
167 140 157 135 155
144 155 122 240 239
145 122 124 239 238
148 124 123 238 237
149 123 131 237 236
128 131 113 236 235
129 113 115 235 234
132 115 114 234 233
133 114 156 233 232
176 156 143 232 231
177 143 145 231 230
180 145 144 230 229
181 144 152 229 228
160 152 134 228 227
161 134 136 227 226
164 136 135 226 225
165 135 155 225 240
90 240 239 95 61
91 239 238 61 63
94 238 237 63 62
95 237 236 62 69
74 236 235 69 52
75 235 234 52 54
78 234 233 54 53
79 233 232 53 96
122 232 231 96 82
123 231 230 82 84
126 230 229 84 83
127 229 228 83 90
106 228 227 90 73
107 227 226 73 75
110 226 225 75 74
111 225 240 74 95
88 95 61 93 66
89 61 63 66 65
92 63 62 65 64
93 62 69 64 68
72 69 52 68 57
73 52 54 57 56
76 54 53 56 55
77 53 96 55 94
120 96 82 94 87
121 82 84 87 86
124 84 83 86 85
125 83 90 85 89
104 90 73 89 78
105 73 75 78 77
108 75 74 77 76
109 74 95 76 93
82 93 66 91 58
83 66 65 58 60
86 65 64 60 59
87 64 68 59 67
66 68 57 67 49
67 57 56 49 51
70 56 55 51 50
71 55 94 50 92
114 94 87 92 79
115 87 86 79 81
118 86 85 81 80
119 85 89 80 88
98 89 78 88 70
99 78 77 70 72
102 77 76 72 71
103 76 93 71 91
80 91 58 112 111
81 58 60 111 110
84 60 59 110 109
85 59 67 109 108
64 67 49 108 107
65 49 51 107 106
68 51 50 106 105
69 50 92 105 104
112 92 79 104 103
113 79 81 103 102
116 81 80 102 101
117 80 88 101 100
96 88 70 100 99
97 70 72 99 98
100 72 71 98 97
101 71 91 97 112
26 112 111 47 13
27 111 110 13 15
30 110 109 15 14
31 109 108 14 21
10 108 107 21 4
11 107 106 4 6
14 106 105 6 5
15 105 104 5 48
58 104 103 48 34
59 103 102 34 36
62 102 101 36 35
63 101 100 35 42
42 100 99 42 25
43 99 98 25 27
46 98 97 27 26
47 97 112 26 47
24 47 13 45 18
25 13 15 18 17
28 15 14 17 16
29 14 21 16 20
8 21 4 20 9
9 4 6 9 8
12 6 5 8 7
13 5 48 7 46
56 48 34 46 39
57 34 36 39 38
60 36 35 38 37
61 35 42 37 41
40 42 25 41 30
41 25 27 30 29
44 27 26 29 28
45 26 47 28 45
18 45 18 43 10
19 18 17 10 12
22 17 16 12 11
23 16 20 11 19
2 20 9 19 1
3 9 8 1 3
6 8 7 3 2
7 7 46 2 44
50 46 39 44 31
51 39 38 31 33
54 38 37 33 32
55 37 41 32 40
34 41 30 40 22
35 30 29 22 24
38 29 28 24 23
39 28 45 23 43
16 43 10 256 255
17 10 12 255 254
20 12 11 254 253
21 11 19 253 252
0 19 1 252 251
1 1 3 251 250
4 3 2 250 249
5 2 44 249 248
48 44 31 248 247
49 31 33 247 246
52 33 32 246 245
53 32 40 245 244
32 40 22 244 243
33 22 24 243 242
36 24 23 242 241
37 23 43 241 256
This diff is collapsed.
c-----------------------------------------------------------------------
subroutine exact(uu,vv,xx,yy,n,time,visc,u0,v0)
c
c This routine creates initial conditions for an exact 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
c The approach can also be extended to incompressible MHD with 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
c 2/23/02; 6/2/09; pff
c
c
include 'SIZE'
include 'INPUT'
c
real uu(n),vv(n),xx(n),yy(n)
c
real cpsi(2,5), a(2,5)
save cpsi , a
c data a / .4,.45 , .4,.2 , -.2,-.1 , .2,.05, -.09,-.1 / ! See eddy.m
c data cpsi / 0,65 , 16,63 , 25,60 , 33,56 , 39,52 / ! See squares.f
c data cpsi / 0,85 , 13,84 , 36,77 , 40,75 , 51,68 /
c This data from Walsh's Figure 1 [1]:
data a / -.2,-.2, .25,0., 0,0 , 0,0 , 0,0 /
data cpsi / 0, 5 , 3, 4 , 0,0 , 0,0 , 0,0 /
one = 1.
pi = 4.*atan(one)
aa = cpsi(2,1)**2
arg = -visc*time*aa ! domain is [0:2pi]
e = exp(arg)
c
c ux = psi_y, uy = -psi_x
c
do i=1,n
x = xx(i) - u0*time
y = yy(i) - v0*time
sx = sin(cpsi(2,1)*x)
cx = cos(cpsi(2,1)*x)
sy = sin(cpsi(2,1)*y)
cy = cos(cpsi(2,1)*y)
u = a(1,1)*cpsi(2,1)*cy
v = a(2,1)*cpsi(2,1)*sx
do k=2,5
s1x = sin(cpsi(1,k)*x)
c1x = cos(cpsi(1,k)*x)
s2x = sin(cpsi(2,k)*x)
c2x = cos(cpsi(2,k)*x)
s1y = sin(cpsi(1,k)*y)
c1y = cos(cpsi(1,k)*y)
s2y = sin(cpsi(2,k)*y)
c2y = cos(cpsi(2,k)*y)
c1 = cpsi(1,k)
c2 = cpsi(2,k)
if (k.eq.2) u = u + a(1,k)*s1x*c2y*c2
if (k.eq.2) v = v - a(1,k)*c1x*s2y*c1
if (k.eq.2) u = u - a(2,k)*s2x*c1y*c1
if (k.eq.2) v = v + a(2,k)*c2x*s1y*c2
if (k.eq.3) u = u - a(1,k)*s1x*c2y*c2
if (k.eq.3) v = v + a(1,k)*c1x*s2y*c1
if (k.eq.3) u = u - a(2,k)*c2x*c1y*c1
if (k.eq.3) v = v - a(2,k)*s2x*s1y*c2
if (k.eq.4) u = u + a(1,k)*c1x*c2y*c2
if (k.eq.4) v = v + a(1,k)*s1x*s2y*c1
if (k.eq.4) u = u + a(2,k)*c2x*c1y*c1
if (k.eq.4) v = v + a(2,k)*s2x*s1y*c2
if (k.eq.5) u = u - a(1,k)*s1x*c2y*c2
if (k.eq.5) v = v + a(1,k)*c1x*s2y*c1
if (k.eq.5) u = u - a(2,k)*s2x*c1y*c1
if (k.eq.5) v = v + a(2,k)*c2x*s1y*c2
enddo
uu(i) = u*e + u0
vv(i) = v*e + v0
enddo
return
end
c-----------------------------------------------------------------------
subroutine uservp (ix,iy,iz,ieg)
include 'SIZE'
include 'TOTAL'
include 'NEKUSE'
C
udiff =0.
utrans=0.
return
end
c-----------------------------------------------------------------------
subroutine userf (ix,iy,iz,ieg)
include 'SIZE'
include 'TOTAL'
include 'NEKUSE'