CG  Version 25
initLineSolveParameters.h
Go to the documentation of this file.
1 c Here are the statements we use to initialize the main subroutines below
2 #beginMacro INITIALIZE(SOLVER)
3  pc =ipar(0)
4  uc =ipar(1)
5  vc =ipar(2)
6  wc =ipar(3)
7  grid =ipar(4)
8  orderOfAccuracy =ipar(5)
9  gridIsMoving =ipar(6)
10  useWhereMask =ipar(7)
11  gridIsImplicit =ipar(8)
12  implicitMethod =ipar(9)
13  implicitOption =ipar(10)
14  isAxisymmetric =ipar(11)
15  use2ndOrderAD =ipar(12)
16  use4thOrderAD =ipar(13)
17  gridType =ipar(14)
18 
19  computeMatrix =ipar(15)
20  computeRHS =ipar(16)
21  computeMatrixBC =ipar(17)
22  fc =ipar(18)
23  fcu=fc
24  fcv=fc+1
25  fcw=fc+2
26  fcn=fc+nd
27  fct=fc+nd
28  orderOfExtrapolation=ipar(19)
29  ibc = ipar(20)
30 
31  option = ipar(21)
32  nc = ipar(22)
33  turbulenceModel = ipar(23)
34  twilightZoneFlow = ipar(24)
35 
36  useSelfAdjointDiffusion=ipar(25)
37  fourthOrder = ipar(26)
38  pdeModel = ipar(27)
39  tc = ipar(28)
40  numberOfComponents= ipar(29)
41  systemComponent = ipar(30) ! form the tridiagonal system for this component
42 
43  gid(0,0) = ipar(31)
44  gid(1,0) = ipar(32)
45  gid(0,1) = ipar(33)
46  gid(1,1) = ipar(34)
47  gid(0,2) = ipar(35)
48  gid(1,2) = ipar(36)
49 
50  vsc = ipar(37)
51 
52  dx(0) =rpar(0)
53  dx(1) =rpar(1)
54  dx(2) =rpar(2)
55  nu =rpar(3)
56  ad21 =rpar(4)
57  ad22 =rpar(5)
58  ad41 =rpar(6)
59  ad42 =rpar(7)
60 
61  dr(0) =rpar(8)
62  dr(1) =rpar(9)
63  dr(2) =rpar(10)
64  cfl =rpar(11)
65  ad21n =rpar(12)
66  ad22n =rpar(13)
67  ad41n =rpar(14)
68  ad42n =rpar(15)
69  kThermal =rpar(16)
70 
71  thermalExpansivity=rpar(17)
72  gravity(0) =rpar(18)
73  gravity(1) =rpar(19)
74  gravity(2) =rpar(20)
75 
76 
77 #If #SOLVER == "INSVP"
78 
79 !* nuViscoPlastic =rpar(21)
80 !* etaViscoPlastic =rpar(22)
81 !* yieldStressViscoPlastic=rpar(23)
82 !* exponentViscoPlastic =rpar(24)
83 !* epsViscoPlastic =rpar(25) ! small parameter used to offset the effective strain rate
84 
85  ! here are the names used by the getViscoPlasticViscosity macro -- what should we do about this ?
86 !* etaVP=etaViscoPlastic
87 !* yieldStressVP=yieldStressViscoPlastic
88 !* exponentVP=exponentViscoPlastic
89 !* epsVP=epsViscoPlastic
90 
91 !* write(*,'("lineSolveNewINSVP: nuViscoPlastic=",e10.3)') nuViscoPlastic
92 !* write(*,'("lineSolveNewINSVP: etaViscoPlastic=",e10.3)') etaViscoPlastic
93 !* write(*,'("lineSolveNewINSVP: yieldStressViscoPlastic=",e10.3)') yieldStressViscoPlastic
94 !* write(*,'("lineSolveNewINSVP: exponentViscoPlastic=",e10.3)') exponentViscoPlastic
95 !* write(*,'("lineSolveNewINSVP: epsViscoPlastic=",e10.3)') epsViscoPlastic
96 
97 !* -- new way:
98 !* double precision pdb
99 !* character *50 name
100 !* integer ok,getInt,getReal
101 !* ! get visco-plastic parameters
102 !* nuViscoPlastic=1. ! default value
103 !* etaViscoPlastic=1.
104 !* yieldStressViscoPlastic=10.
105 !* exponentViscoPlastic=10.
106 !* epsViscoPlastic=1.e-10 ! small parameter used to offset the effective strain rate
107 !*
108 !* name ='nuViscoPlastic'
109 !* ok = getReal(pdb,name,nuViscoPlastic)
110 !*
111 !* if( ok.eq.1 )then
112 !* write(*,'("*** ut: name=",a10,", num=",e9.3)') name,nuViscoPlastic
113 !* else
114 !* write(*,'("*** ut: name=",a10,", NOT FOUND")') name
115 !* end if
116 
117 #End
118 
120  if( pdeModel.eq.BoussinesqModel .or. pdeModel.eq.viscoPlasticModel )then
122  else
123  tc=uc ! give this default value to tc so we can always add a gravity term, even if there is no T equation
124  thermalExpansivity=0. ! set to zero to turn off the gravity term
125  end if
126 
127  do m=0,2
128  dxv2i(m)=1./(2.*dx(m))
129  dxvsqi(m)=1./(dx(m)**2)
130  drv2i(m)=1./(2.*dr(m))
131  drvsqi(m)=1./(dr(m)**2)
132  end do
133 
134  dx0=dx(0)
135  dy=dx(1)
136  dz=dx(2)
137  dx2i=1./(2.*dx0)
138  dy2i=1./(2.*dy)
139  dz2i=1./(2.*dz)
140  dxsqi=1./(dx0*dx0)
141  dysqi=1./(dy*dy)
142  dzsqi=1./(dz*dz)
143 
144  dr2i=1./(2.*dr(0))
145  ds2i=1./(2.*dr(1))
146  dt2i=1./(2.*dr(2))
147  drsqi=1./(dr(0)**2)
148  dssqi=1./(dr(1)**2)
149  dtsqi=1./(dr(2)**2)
150 
151  dxi=1./dx0
152  dyi=1./dy
153  dzi=1./dz
154  dri=1./dr(0)
155  dsi=1./dr(1)
156  dti=1./dr(2)
157 
158  if( orderOfAccuracy.eq.4 )then
159  dx12i=1./(12.*dx0)
160  dy12i=1./(12.*dy)
161  dz12i=1./(12.*dz)
162  dxsq12i=1./(12.*dx0**2)
163  dysq12i=1./(12.*dy**2)
164  dzsq12i=1./(12.*dz**2)
165  end if
166 
167  cd22=ad22/(nd**2)
168  cd42=ad42/(nd**2)
169 
170  cd22n=ad22n/nd ! for the SA TM model
171  cd42n=ad42n/nd
172 
174 c & use2ndOrderAD,ad21,cd22
175 
176  dtScale=1./cfl
177 
178  if( fourthOrder.eq.1 .and. turbulenceModel.ne.noTurbulenceModel )then
179  write(*,'("insLineSolve: ERROR: fourth-order only available for INS")')
180  ! " '
181  stop 6543
182  end if
183 
184  if( turbulenceModel.eq.spalartAllmaras )then
185  call getSpalartAllmarasParameters(cb1, cb2, cv1, sigma, sigmai, kappa, cw1, cw2, cw3, cw3e6, \
186  cv1e3, cd0, cr0)
187  else if( turbulenceModel.eq.kEpsilon )then
188 
189 c** call getKEpsilonParameters( cMu,cEps1,cEps2,sigmaEpsI,sigmaKI )
190 
191  else if( turbulenceModel.ne.noTurbulenceModel )then
192  stop 88
193  end if
194 
195 
196  if( turbulenceModel.eq.baldwinLomax )then
197  ! assign constants for baldwin-lomax
198  kbl=.4
199  alpha=.0168
200  a0p=26.
201 c ccp=1.6
202  ccp=2.6619
203  ckleb=0.3
204  cwk=.25
205 c cwk=1
206  end if
207 
208  itrip = ipar(50)
209  jtrip = ipar(51)
210  ktrip = ipar(52)
211 
212 
213 #endMacro
214