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

Go to the source code of this file.

Functions/Subroutines

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

Function/Subroutine Documentation

◆ characteristic()

subroutine characteristic ( 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,
real*8  dvi,
integer  numf,
character*81, dimension(*)  set,
integer, dimension(*)  mi,
real*8  ttime,
real*8  time,
integer  iaxial 
)
24 !
25 ! This subroutine is used to enables the processing of empiric
26 ! given under the form
27 ! massflow*dsqrt(T1)/Pt1=f((Pt1-Pt2)/Pt1) and T1=T2
28 ! characteristics the subroutine proceeds using
29 ! linear interpolation to estimate the values for the whole characteristic
30 ! note that the characteristic is implicitely containing the point (0,0)
31 !
32 ! author: Yannick Muller
33 !
34  implicit none
35 !
36  logical identity
37 !
38  character*8 lakon(*)
39  character*81 set(*)
40 !
41  integer nelem,nactdog(0:3,*),node1,node2,nodem,kon(*),ipkon(*),
42  & ielprop(*),nodef(*),idirf(*),index,iflag,
43  & inv,id,numf,npu,i,mi(*),iaxial
44 !
45  real*8 prop(*),v(0:mi(2),*),xflow,f,df(*),cp,r,dvi,
46  & p1,p2,physcon(*),ttime,time,xmach,kappa,
47  & xpu(100),ypu(100),qred,p1mp2zp1,t1,scal,t2
48 !
49  if (iflag.eq.0) then
50  identity=.true.
51 !
52  if(nactdog(2,node1).ne.0)then
53  identity=.false.
54  elseif(nactdog(2,node2).ne.0)then
55  identity=.false.
56  elseif(nactdog(1,nodem).ne.0)then
57  identity=.false.
58  endif
59 !
60  elseif ((iflag.eq.1).or.(iflag.eq.2)) then
61 !
62  index=ielprop(nelem)
63 !
64  npu=nint(prop(index+2))
65  scal=prop(index+1)
66 
67  do i=1, 100
68  xpu(i)=0
69  ypu(i)=0
70  enddo
71 !
72  do i=1,npu
73  xpu(i)=prop(index+2*i+1)
74  ypu(i)=prop(index+2*i+2)
75  enddo
76 !
77  p1=v(2,node1)
78  p2=v(2,node2)
79 !
80  if(p1.ge.p2) then
81  inv=1
82  t1=v(0,node1)-physcon(1)
83  else
84  inv=-1
85  p1=v(2,node2)
86  p2=v(2,node1)
87  t1=v(0,node2)-physcon(1)
88  endif
89 !
90  p1mp2zp1=(p1-p2)/p1
91 !
92  if(iflag.eq.1) then
93 
94  call ident(xpu,p1mp2zp1,npu,id)
95  if(id.eq.0) then
96  qred=scal*ypu(1)
97  xflow=inv*qred*p1/dsqrt(t1)
98  elseif(id.ge.npu) then
99  qred=scal*ypu(npu)
100  xflow=inv*qred*p1/dsqrt(t1)
101  else
102  qred=scal*(ypu(id)+(ypu(id+1)-ypu(id))
103  & *(p1mp2zp1-xpu(id))/(xpu(id+1)-xpu(id)))
104  xflow=inv*qred*p1/dsqrt(t1)
105  endif
106 !
107  elseif (iflag.eq.2) then
108  numf=4
109 !
110  p1=v(2,node1)
111  p2=v(2,node2)
112  xflow=v(1,nodem)*iaxial
113 !
114  if (p1.ge.p2) then
115 !
116  inv=1
117  xflow=v(1,nodem)*iaxial
118  t1=v(0,node1)-physcon(1)
119  nodef(1)=node1
120  nodef(2)=node1
121  nodef(3)=nodem
122  nodef(4)=node2
123 !
124  else
125 !
126  inv=-1
127  p1=v(2,node2)
128  p2=v(2,node1)
129  t1=v(0,node2)-physcon(1)
130  xflow=-v(1,nodem)*iaxial
131  nodef(1)=node2
132  nodef(2)=node2
133  nodef(3)=nodem
134  nodef(4)=node1
135  endif
136 !
137  idirf(1)=2
138  idirf(2)=0
139  idirf(3)=1
140  idirf(4)=2
141 !
142  df(2)=xflow/(2.d0*p1*dsqrt(t1))
143  df(3)=inv*dsqrt(t1)/p1
144 !
145  call ident(xpu,p1mp2zp1,npu,id)
146 !
147  if(id.eq.0) then
148  f=dabs(xflow)/p1*dsqrt(t1)-scal*ypu(1)
149  df(4)=0.01d0
150  df(1)=-xflow*dsqrt(t1)/p1**2
151 !
152  elseif(id.ge.npu) then
153  f=dabs(xflow)/p1*dsqrt(t1)-scal*ypu(npu)
154  df(4)=0.01d0
155  df(1)=-xflow*dsqrt(t1)/p1**2
156 !
157  else
158  f=dabs(xflow)/p1*dsqrt(t1)-(scal*ypu(id)
159  & +scal*(ypu(id+1)-ypu(id))
160  & *(p1mp2zp1-xpu(id))/(xpu(id+1)-xpu(id)))
161 !
162  df(4)=scal*(ypu(id+1)-ypu(id))/(xpu(id+1)-xpu(id))*1/p1
163 !
164  df(1)=-xflow*dsqrt(t1)/p1**2-(p2/p1**2)
165  & *(scal*(ypu(id+1)-ypu(id))/(xpu(id+1)-xpu(id)))
166  endif
167  endif
168 
169  elseif(iflag.eq.3) then
170  p1=v(2,node1)
171  p2=v(2,node2)
172  xflow=v(1,nodem)*iaxial
173  kappa=(cp/(cp-r))
174  xmach=dsqrt(((p1/p2)**((kappa-1.d0)/kappa)-1.d0)*2.d0/
175  & (kappa-1.d0))
176 !
177  if (p1.ge.p2) then
178 !
179  inv=1
180  xflow=v(1,nodem)*iaxial
181  t1=v(0,node1)-physcon(1)
182  t2=v(0,node2)-physcon(1)
183  nodef(1)=node1
184  nodef(2)=node1
185  nodef(3)=nodem
186  nodef(4)=node2
187 !
188  else
189 !
190  inv=-1
191  p1=v(2,node2)
192  p2=v(2,node1)
193  t1=v(0,node2)-physcon(1)
194  t2=v(0,node1)-physcon(1)
195  xflow=-v(1,nodem)*iaxial
196  nodef(1)=node2
197  nodef(2)=node2
198  nodef(3)=nodem
199  nodef(4)=node1
200  endif
201 !
202  write(1,*) ''
203  write(1,55) ' from node',node1,
204  & ' to node', node2,': air massflow rate=',xflow
205 !
206  55 FORMAT(1x,a,i6,a,i6,a,e11.4,a,a,e11.4,a)
207 !
208  if(inv.eq.1) then
209  write(1,56)' Inlet node ',node1,': Tt1=',t1,
210  & ', Ts1=',t1,', Pt1=',p1
211 
212  write(1,*)' Element ',nelem,lakon(nelem)
213  write(1,57) 'M = ',xmach
214 !
215  write(1,56)' Outlet node ',node2,': Tt2=',t2,
216  & ', Ts2=',t2,', Pt2=',p2
217 !
218  else if(inv.eq.-1) then
219  write(1,56)' Inlet node ',node2,': Tt1=',t1,
220  & ', Ts1=',t1,', Pt1=',p1
221  &
222  write(1,*)' Element ',nelem,lakon(nelem)
223  write(1,57) 'M = ',xmach
224 !
225  write(1,56)' Outlet node ',node1,': Tt2=',t2,
226  & ', Ts2=',t2,', Pt2=',p2
227 !
228  endif
229 !
230  56 FORMAT(1x,a,i6,a,e11.4,a,e11.4,a,e11.4,a)
231  57 format(40x,a,e11.4)
232 !
233  endif
234 !
235  xflow=xflow/iaxial
236  df(3)=df(3)*iaxial
237 !
238  return
subroutine ident(x, px, n, id)
Definition: ident.f:26
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
static double * e11
Definition: radflowload.c:42
Hosted by OpenAircraft.com, (Michigan UAV, LLC)