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

Go to the source code of this file.

Functions/Subroutines

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

Function/Subroutine Documentation

◆ absolute_relative()

subroutine absolute_relative ( 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(*)  mi,
real*8  ttime,
real*8  time,
integer  iaxial 
)
23 !
24 ! orifice element
25 !
26 ! author: Yannick Muller
27 !
28  implicit none
29 !
30  logical identity
31  character*8 lakon(*)
32  character*81 set(*)
33 !
34  integer nelem,nactdog(0:3,*),node1,node2,nodem,numf,
35  & ielprop(*),nodef(*),idirf(*),index,iflag,
36  & ipkon(*),kon(*),nelemswirl,mi(*),iaxial
37 !
38  real*8 prop(*),v(0:mi(2),*),xflow,f,df(*),kappa,r,
39  & p1,p2,t1,t2,cp,physcon(*),km1,kp1,kdkm1,
40  & kdkp1,u,pi,qred_crit,pt1,pt2,tt1,tt2,ct,fact,
41  & cp_cor,ttime,time
42 !
43  if(iflag.eq.0) then
44  identity=.true.
45 !
46  if(nactdog(2,node1).ne.0)then
47  identity=.false.
48  elseif(nactdog(2,node2).ne.0)then
49  identity=.false.
50  elseif(nactdog(1,nodem).ne.0)then
51  identity=.false.
52  endif
53 !
54  elseif(iflag.eq.1)then
55  xflow=0.d0
56 !
57  elseif(iflag.eq.2) then
58 !
59  numf=4
60  kappa=(cp/(cp-r))
61  km1=kappa-1.d0
62  kp1=kappa+1.d0
63  kdkm1=kappa/km1
64  kdkp1=kappa/kp1
65 !
66  index=ielprop(nelem)
67 !
68  u=prop(index+1)
69  ct=prop(index+2)
70  nelemswirl=nint(prop(index+3))
71 !
72  if(nelemswirl.ne.0) then
73 !
74 ! previous element is a preswirl nozzle
75 !
76  if(lakon(nelemswirl)(2:5).eq.'ORPN') then
77  ct=prop(ielprop(nelemswirl)+5)
78 !
79 ! previous element is a forced vortex
80 !
81  elseif(lakon(nelemswirl)(2:5).eq.'VOFO') then
82  ct=prop(ielprop(nelemswirl)+7)
83 !
84 ! previous element is a free vortex
85 !
86  elseif(lakon(nelemswirl)(2:5).eq.'VOFR') then
87  ct=prop(ielprop(nelemswirl)+9)
88  endif
89  endif
90 !
91  pt1=v(2,node1)
92  pt2=v(2,node2)
93 !
94  if(lakon(nelem)(2:4).eq.'ATR') then
95 !
96  xflow=v(1,nodem)*iaxial
97  tt1=v(0,node1)-physcon(1)
98  tt2=v(0,node2)-physcon(1)
99 !
100  nodef(1)=node1
101  nodef(2)=node1
102  nodef(3)=nodem
103  nodef(4)=node2
104 !
105 ! in the case of a negative flow direction
106 !
107  if(xflow.le.0d0) then
108  write(*,*)''
109  write(*,*)'*WARNING:'
110  write(*,*)'in element',nelem
111  write(*,*)'TYPE=ABSOLUTE TO RELATIVE'
112  write(*,*)'mass flow negative!'
113  write(*,*)'check results and element definition'
114  endif
115 !
116  elseif(lakon(nelem)(2:4).eq.'RTA') then
117 !
118  xflow=v(1,nodem)*iaxial
119  tt1=v(0,node1)-physcon(1)
120  tt2=v(0,node2)-physcon(1)
121 !
122  nodef(1)=node1
123  nodef(2)=node1
124  nodef(3)=nodem
125  nodef(4)=node2
126 !
127  if(xflow.le.0d0) then
128  write(*,*)''
129  write(*,*)'*WARNING:'
130  write(*,*)'in element',nelem
131  write(*,*)'TYPE=RELATIVE TO ABSOLUTE'
132  write(*,*)'mass flow negative!'
133  write(*,*)'check results and element definition'
134  endif
135  endif
136 !
137  idirf(1)=2
138  idirf(2)=0
139  idirf(3)=1
140  idirf(4)=2
141 !
142 ! computing temperature corrected Cp=Cp(T) coefficient
143  call cp_corrected(cp,tt1,tt2,cp_cor)
144 !
145  if(tt1.lt.273) then
146  tt1= tt2
147  endif
148 !
149  if(cp_cor.eq.0.d0) then
150  cp_cor=cp
151  endif
152 !
153 ! transformation from absolute system to relative system
154 !
155  if(lakon(nelem)(2:4).eq.'ATR') then
156 !
157  fact=1+(u**2-2*u*ct)/(2*cp_cor*tt1)
158 !
159  f=pt2-pt1*(fact)**kdkm1
160 !
161 ! pressure node 1
162 !
163  df(1)=-fact**kdkm1
164 !
165 ! temperature node1
166 !
167  df(2)=-pt1*kdkm1*(-(u**2-2*u*ct)/(2*cp_cor*tt1**2))
168  & *fact**(kdkm1-1)
169 !
170 ! mass flow node m
171 !
172  df(3)=0
173 !
174 ! pressure node 2
175 !
176  df(4)=1
177 !
178 ! transformation from relative system to absolute system
179 !
180  elseif(lakon(nelem)(2:4).eq.'RTA') then
181 !
182  fact=1-(u**2-2*u*ct)/(2*cp*tt1)
183 !
184  f=pt2-pt1*(fact)**kdkm1
185 !
186  df(1)=-fact**kdkm1
187 !
188  df(2)=-pt1*kdkm1*((u**2-2*u*ct)/(2*cp*tt1**2))
189  & *fact**(kdkm1-1)
190 !
191  df(3)=0
192 !
193  df(4)=1
194 !
195  endif
196 
197  elseif(iflag.eq.3) then
198 
199  kappa=(cp/(cp-r))
200  km1=kappa-1.d0
201  kp1=kappa+1.d0
202  kdkm1=kappa/km1
203  kdkp1=kappa/kp1
204 !
205  index=ielprop(nelem)
206 !
207  u=prop(index+1)
208  ct=prop(index+2)
209  nelemswirl=nint(prop(index+3))
210 !
211  if(nelemswirl.ne.0) then
212 !
213 ! previous element is a preswirl nozzle
214 !
215  if(lakon(nelemswirl)(2:5).eq.'ORPN') then
216  ct=prop(ielprop(nelemswirl)+5)
217 !
218 ! previous element is a forced vortex
219 !
220  elseif(lakon(nelemswirl)(2:5).eq.'VOFO') then
221  ct=prop(ielprop(nelemswirl)+7)
222 !
223 ! previous element is a free vortex
224 !
225  elseif(lakon(nelemswirl)(2:5).eq.'VOFR') then
226  ct=prop(ielprop(nelemswirl)+9)
227  endif
228  endif
229 !
230  pt1=v(2,node1)
231  pt2=v(2,node2)
232 !
233  if(lakon(nelem)(2:4).eq.'ATR') then
234 !
235  xflow=v(1,nodem)*iaxial
236  tt1=v(0,node1)-physcon(1)
237  tt2=v(0,node2)-physcon(1)
238 !
239  nodef(1)=node1
240  nodef(2)=node1
241  nodef(3)=nodem
242  nodef(4)=node2
243 !
244 ! in the case of a negative flow direction
245 !
246  if(xflow.le.0d0) then
247  write(*,*)''
248  write(*,*)'*WARNING:'
249  write(*,*)'in element',nelem
250  write(*,*)'TYPE=ABSOLUTE TO RELATIVE'
251  write(*,*)'mass flow negative!'
252  write(*,*)'check results and element definition'
253  endif
254 !
255  elseif(lakon(nelem)(2:4).eq.'RTA') then
256 !
257  xflow=v(1,nodem)*iaxial
258  tt1=v(0,node1)-physcon(1)
259  tt2=v(0,node2)-physcon(1)
260 !
261  nodef(1)=node1
262  nodef(2)=node1
263  nodef(3)=nodem
264  nodef(4)=node2
265 !
266  if(xflow.le.0d0) then
267  write(*,*)''
268  write(*,*)'*WARNING:'
269  write(*,*)'in element',nelem
270  write(*,*)'TYPE=RELATIVE TO ABSOLUTE'
271  write(*,*)'mass flow negative!'
272  write(*,*)'check results and element definition'
273  endif
274  endif
275 !
276  idirf(1)=2
277  idirf(2)=0
278  idirf(3)=1
279  idirf(4)=2
280 !
281 ! computing temperature corrected Cp=Cp(T) coefficient
282  call cp_corrected(cp,tt1,tt2,cp_cor)
283 !
284  if(tt1.lt.273) then
285  tt1= tt2
286  endif
287 !
288  if(cp_cor.eq.0.d0) then
289  cp_cor=cp
290  endif
291 
292  write(1,*) ''
293  write(1,55) ' from node',node1,
294  &' to node', node2,': air massflow rate=',xflow,''
295  55 FORMAT(1x,a,i6,a,i6,a,e11.4,a,a,e11.4,a)
296 
297  write(1,56)' Inlet node ',node1,': Tt1= ',tt1,
298  & ', Ts1= ',tt1,', Pt1= ',pt1
299  write(1,*)' Element ',nelem,lakon(nelem)
300  write(1,57)' u= ',u,' ,Ct= ',ct,''
301  write(1,56)' Outlet node ',node2,': Tt2= ',tt2,
302  & ', Ts2= ',tt2,', Pt2= ',pt2
303 !
304  56 FORMAT(1x,a,i6,a,e11.4,a,e11.4,a,e11.4,a,e11.4)
305  57 FORMAT(1x,a,e11.4,a,e11.4,a)
306 
307  endif
308 !
309  xflow=xflow/iaxial
310  df(3)=df(3)*iaxial
311 !
312  return
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
subroutine cp_corrected(cp, Tg1, Tg2, cp_cor)
Definition: cp_corrected.f:24
static double * e11
Definition: radflowload.c:42
Hosted by OpenAircraft.com, (Michigan UAV, LLC)