CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
cross_split.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine cross_split (node1, node2, nodem, nelem, lakon, kon, ipkon, nactdog, identity, ielprop, prop, iflag, v, xflow, f, nodef, idirf, df, cp, r, physcon, numf, set, mi, ider, ttime, time, iaxial)
 

Function/Subroutine Documentation

◆ cross_split()

subroutine cross_split ( integer  node1,
integer  node2,
integer  nodem,
integer  nelem,
character*8, dimension(*)  lakon,
integer, dimension(*)  kon,
integer, dimension(*)  ipkon,
integer, dimension(0:3,*)  nactdog,
logical  identity,
integer, dimension(*)  ielprop,
real*8, dimension(*)  prop,
integer  iflag,
real*8, dimension(0:mi(2),*)  v,
real*8  xflow,
real*8  f,
integer, dimension(*)  nodef,
integer, dimension(*)  idirf,
real*8, dimension(*)  df,
real*8  cp,
real*8  r,
real*8, dimension(*)  physcon,
integer  numf,
character*81, dimension(*)  set,
integer, dimension(2)  mi,
integer  ider,
real*8  ttime,
real*8  time,
integer  iaxial 
)
23 !
24 ! A cross split element(zeta calculation according to Idel'chik)
25 ! Written by Yavor Dobrev
26 ! For an explanation of the parameters see tee.f
27 !
28  implicit none
29 !
30  logical identity
31 !
32  character*8 lakon(*)
33  character*81 set(*)
34 !
35  integer
36  &nelem,nactdog(0:3,*),node1,node2,nodem,numf,kon(*),ipkon(*),
37  &ielprop(*),nodef(*),idirf(*),iflag,inv,mi(2),nodem1,nelem1,
38  &ichan_num,ider,icase,iaxial,index
39 !
40  real*8 prop(*),v(0:mi(2),*),xflow,f,df(*),kappa,r,tt1,tt2,pt1,
41  &pt2,cp,physcon(*),km1,kp1,kdkm1,pt2pt1,pt1pt2,pt2pt1_crit,
42  &tdkp1,a,a1,a2,calc_residual_cross_split,dh1,dh2,alpha,xflow1,
43  &xflow2,zeta_fac,a_s,ts0,pspt0,pspt2,m1,m2,ts2,ttime,time
44 !
45  index=ielprop(nelem)
46 !
47  if(iflag.eq.0) then
48  identity=.true.
49  if(nactdog(2,node1).ne.0)then
50  identity=.false.
51  elseif(nactdog(2,node2).ne.0)then
52  identity=.false.
53  elseif(nactdog(1,nodem).ne.0)then
54  identity=.false.
55  endif
56 !
57  elseif(iflag.eq.1)then
58 !
59  kappa=(cp/(cp-r))
60  kp1=kappa+1d0
61  km1=kappa-1d0
62  kdkm1=kappa/km1
63  tdkp1=2.d0/kp1
64 !
65  if(nelem.eq.nint(prop(index+2))) then
66  a=prop(index+5)
67  elseif(nelem.eq.nint(prop(index+3)))then
68  a=prop(index+6)
69  elseif(nelem.eq.nint(prop(index+4)))then
70  a=prop(index+6)
71  endif
72 !
73  pt1=v(2,node1)
74  pt2=v(2,node2)
75 !
76  if(pt1.ge.pt2) then
77  inv=1
78  tt1=v(0,node1)-physcon(1)
79  tt2=v(0,node2)-physcon(1)
80  else
81  inv=-1
82  pt1=v(2,node2)
83  pt2=v(2,node1)
84  tt1=v(0,node2)-physcon(1)
85  tt2=v(0,node1)-physcon(1)
86  endif
87 !
88  pt1pt2=pt1/pt2
89  pt2pt1=1/pt1pt2
90 !
91  pt2pt1_crit=tdkp1**kdkm1
92 !
93  if(pt2pt1.gt.pt2pt1_crit) then
94  xflow=inv*pt1*a*dsqrt(2.d0*kdkm1*pt2pt1**(2.d0/kappa)
95  & *(1.d0-pt2pt1**(1.d0/kdkm1))/r)/dsqrt(tt1)
96  else
97  xflow=inv*pt1*a*dsqrt(kappa/r)*tdkp1**(kp1/(2.d0*km1))/
98  & dsqrt(tt1)
99  endif
100 !
101  elseif(iflag.eq.2)then
102 !
103  numf=6
104 !
105  kappa=(cp/(cp-r))
106 !
107 ! setting icase (always adiabatic)
108 !
109  icase=0;
110 !
111 ! Inlet conditions are the same for both branches
112 !
113 ! Determining the previous element as
114 ! the incoming mass flow is defined there
115  nelem1=nint(prop(index+1))
116  nodem1=kon(ipkon(nelem1)+2)
117 !
118 ! Inlet conditions
119  pt1=v(2,node1)
120  tt1=v(0,node1)-physcon(1)
121  xflow1=v(1,nodem1)*iaxial
122  a1=prop(index+5)
123  dh1=prop(index+9)
124 !
125 ! Set the node numbers for the degrees of freedom
126  nodef(1)=node1
127  nodef(2)=node1
128  nodef(3)=nodem1
129  nodef(4)=nodem
130  nodef(5)=node2
131  nodef(6)=node2
132 !
133  idirf(1)=2
134  idirf(2)=0
135  idirf(3)=1
136  idirf(4)=1
137  idirf(5)=2
138  idirf(6)=0
139 !
140  if(nelem.eq.nint(prop(index+2))) then
141  ichan_num=1
142 !
143  tt2=v(0,node2)
144  xflow2=v(1,nodem)*iaxial
145  pt2=v(2,node2)
146  a2=a1
147  a_s=prop(index+6)
148  dh2=dh1
149  alpha=0
150  zeta_fac=prop(index+11)
151 !
152  elseif(nelem.eq.nint(prop(index+3))) then
153  ichan_num=2
154 !
155  tt2=v(0,node2)
156  xflow2=v(1,nodem)*iaxial
157  pt2=v(2,node2)
158  a2=prop(index+6)
159  dh2=prop(index+10)
160  alpha=prop(index+7)
161  zeta_fac=prop(index+12)
162 !
163  elseif(nelem.eq.nint(prop(index+4))) then
164  ichan_num=3
165 !
166  tt2=v(0,node2)
167  xflow2=v(1,nodem)*iaxial
168  pt2=v(2,node2)
169  a1=prop(index+5)
170  a2=prop(index+6)
171  dh2=prop(index+10)
172  alpha=prop(index+8)
173  zeta_fac=prop(index+12)
174 !
175  endif
176 !
177  if(ider.eq.0)then
178 ! Residual
179  f=calc_residual_cross_split(pt1,tt1,xflow1,xflow2,pt2,
180  & tt2,ichan_num,a1,a2,a_s,dh1,dh2,alpha,zeta_fac,
181  & kappa,r,ider,iflag)
182  else
183 ! Derivatives
184  call calc_ider_cross_split(df,pt1,tt1,xflow1,xflow2,pt2,
185  & tt2,ichan_num,a1,a2,a_s,dh1,dh2,alpha,zeta_fac,
186  & kappa,r,ider,iflag)
187  endif
188 !
189  elseif(iflag.eq.3) then
190 !
191  kappa=(cp/(cp-r))
192 !
193 ! setting icase (always adiabatic)
194 !
195  icase=0;
196 !
197 ! Inlet conditions are the same for both branches
198 !
199 ! Determining the previous element as
200 ! the incoming mass flow is defined there
201 !
202  nelem1=nint(prop(index+1))
203  nodem1=kon(ipkon(nelem1)+2)
204 !
205 ! Inlet conditions
206 !
207  pt1=v(2,node1)
208  tt1=v(0,node1)-physcon(1)
209  xflow1=v(1,nodem1)*iaxial
210  a1=prop(index+5)
211  dh1=prop(index+9)
212 !
213  if(nelem.eq.nint(prop(index+2))) then
214  ichan_num=1
215 !
216  tt2=v(0,node2)
217  xflow2=v(1,nodem)*iaxial
218  pt2=v(2,node2)
219  a2=a1
220  a_s=prop(index+6)
221  dh2=dh1
222  alpha=0
223  zeta_fac=prop(index+11)
224 !
225  elseif(nelem.eq.nint(prop(index+3))) then
226  ichan_num=2
227 !
228  tt2=v(0,node2)
229  xflow2=v(1,nodem)*iaxial
230  pt2=v(2,node2)
231  a2=prop(index+6)
232  dh2=prop(index+10)
233  alpha=prop(index+7)
234  zeta_fac=prop(index+12)
235 !
236  elseif(nelem.eq.nint(prop(index+4))) then
237  ichan_num=3
238 !
239  tt2=v(0,node2)
240  xflow2=v(1,nodem)*iaxial
241  pt2=v(2,node2)
242  a1=prop(index+5)
243  a2=prop(index+6)
244  dh2=prop(index+10)
245  alpha=prop(index+8)
246  zeta_fac=prop(index+12)
247 !
248  endif
249 !
250 ! Write the main information about the element
251 !
252 ! Flow velocity at inlet
253  call ts_calc(xflow1,tt1,pt1,kappa,r,a1,ts0,icase)
254  pspt0=(ts0/tt1)**(kappa/(kappa-1))
255 ! Calculate Mach numbers
256  call machpi(m1,pspt0,kappa,r)
257  call ts_calc(xflow2,tt2,pt2,kappa,r,a2,ts2,icase)
258 ! Pressure ratio
259  pspt2=(ts2/tt2)**(kappa/(kappa-1))
260  call machpi(m2,pspt2,kappa,r)
261 !
262  write(1,*) ''
263  write(1,55) ' from node ',node1,
264  & ' to node ', node2,': air massflow rate= ',xflow
265 !
266  write(1,56)' Inlet node ',node1,': Tt1= ',tt1,
267  & ', Ts1= ',ts0,', Pt1= ',pt1,
268  & ', M1= ',m1
269  write(1,*)' Element ',nelem,lakon(nelem)
270  & ,', Branch ',ichan_num
271 !
272  55 format(1x,a,i6,a,i6,a,e11.4,a)
273  56 format(1x,a,i6,a,e11.4,a,e11.4,a,e11.4,a,e11.4)
274 !
275 ! Set ider to calculate the residual
276  ider=0
277 !
278 ! Calculate the element one last time with enabled output
279  f=calc_residual_cross_split(pt1,tt1,xflow1,xflow2,pt2,
280  & tt2,ichan_num,a1,a2,a_s,dh1,dh2,alpha,zeta_fac,
281  & kappa,r,ider,iflag)
282 !
283  write(1,56)' Outlet node ',node2,': Tt2= ',tt2,
284  & ' , Ts2= ',ts2,' , Pt2= ',pt2,
285  & ', M2= ',m2
286 !
287  endif
288 !
289  xflow=xflow/iaxial
290  df(3)=df(3)*iaxial
291  df(4)=df(4)*iaxial
292 !
293  return
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
subroutine ts_calc(xflow, Tt, Pt, kappa, r, A, Ts, icase)
Definition: ts_calc.f:20
subroutine calc_ider_cross_split(df, pt1, Tt1, xflow1, xflow2, pt2, Tt2, ichan_num, A1, A2, A_s, dh1, dh2, alpha, zeta_fac, kappa, R, ider, iflag)
Definition: calc_ider_cross_split.f:24
real *8 function calc_residual_cross_split(pt1, Tt1, xflow1, xflow2, pt2, Tt2, ichan_num, A1, A2, A_s, dh1, dh2, alpha, zeta_fac, kappa, R, ider, iflag)
Definition: calc_residual_cross_split.f:24
subroutine machpi(MACH, PI, kappa, rgas)
Definition: machpi.f:23
static double * e11
Definition: radflowload.c:42
Hosted by OpenAircraft.com, (Michigan UAV, LLC)