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

Go to the source code of this file.

Functions/Subroutines

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

Function/Subroutine Documentation

◆ user_network_element_p1()

subroutine user_network_element_p1 ( integer, intent(in)  node1,
integer, intent(in)  node2,
integer, intent(in)  nodem,
integer, intent(in)  nelem,
character*8, dimension(*), intent(in)  lakon,
integer, dimension(*), intent(in)  kon,
integer, dimension(*), intent(in)  ipkon,
integer, dimension(0:3,*), intent(in)  nactdog,
logical, intent(inout)  identity,
integer, dimension(*), intent(in)  ielprop,
real*8, dimension(*), intent(in)  prop,
integer, intent(in)  iflag,
real*8, dimension(0:mi(2),*), intent(in)  v,
real*8, intent(inout)  xflow,
real*8, intent(inout)  f,
integer, dimension(*), intent(inout)  nodef,
integer, dimension(*), intent(inout)  idirf,
real*8, dimension(*), intent(inout)  df,
real*8, intent(in)  cp,
real*8, intent(in)  R,
real*8, dimension(*), intent(in)  physcon,
real*8, intent(in)  dvi,
integer, intent(inout)  numf,
character*81, dimension(*), intent(in)  set,
real*8, dimension(3,*), intent(in)  co,
real*8, dimension(0:mi(2),*), intent(in)  vold,
integer, dimension(*), intent(in)  mi,
real*8, intent(in)  ttime,
real*8, intent(in)  time,
integer, intent(in)  iaxial 
)
23 !
24 ! UP1 element: mass flow = c * dsqrt(pt2-pt1)
25 !
26 ! f:= c * dsqrt(pt2-pt1) - mass flow
27 !
28 ! for this element it is known that the flow direction
29 ! has to correspond to the pressure drop
30 !
31 ! INPUT:
32 !
33 ! node1 first node in element topology
34 ! node2 third node in element topology
35 ! nodem second node in element topology (middle node)
36 ! nelem element number
37 ! lakon(i) label of element i
38 ! kon connectivity list of all elements; the topology
39 ! of element i starts at kon(ipkon(i))
40 ! ipkon(i) pointer of element i into list kon
41 ! nactdog(j,i) global degree of freedom in the network
42 ! equation system of local dof j (0,1 or 2 for
43 ! networks) of node i. If nactdog(j,i)=0 the
44 ! variable is known
45 ! ielprop(i) pointer for element i into field prop. The
46 ! properties for element i start at
47 ! prop(ielprop(i)+1,...)
48 ! prop field of all properties
49 ! iflag indicates what information should be returned
50 ! by the routine:
51 ! 0: identity
52 ! 1: xflow
53 ! 2: numf, nodef, idirf, f, df
54 ! 3: none
55 ! v(0..mi(2),i) values at node i in the current network
56 ! iteration (0=total temperature,
57 ! 1=mass flow, 2=total pressure for network nodes,
58 ! 0=temperature, 1..3=displacements for structural
59 ! nodes)
60 ! cp specific heat at constant pressure corresponding
61 ! to a mean static temperature across the element
62 ! R specific gas constant
63 ! physcon(1..) physical constants (e.g. physcon(1) is absolute
64 ! zero in the unit systemof the user; cf. the
65 ! user's manual for the other entries)
66 ! dvi dynamical viscosity corresponding
67 ! to a mean static temperature across the element
68 ! set(i) set name corresponding to set i
69 ! co(1..3,i) coordinates of node i in the global system
70 ! vold(0..mi(2),i) values at node i at the start of the current network
71 ! iterations (0=total temperature,
72 ! 1=mass flow, 2=total pressure for network nodes,
73 ! 0=temperature, 1..3=displacements for structural
74 ! nodes)
75 ! mi(2) max degree of freedom per node (max over all
76 ! nodes) in fields like v(0:mi(2))...; the other
77 ! values of mi are not relevant here
78 ! ttime total time at the end of the current
79 ! thermo-mechanical increment. To reach the end
80 ! of this increment several thermo-mechanical
81 ! iterations are performed. For each of these
82 ! iterations a loop of network iterations is
83 ! performed
84 ! time step time a the end of the current thermo-
85 ! mechanical increment
86 ! iaxial number of times the current structure fits into
87 ! 360 degrees
88 !
89 !
90 ! OUTPUT:
91 !
92 ! identity if .true. the user_network_element routine is
93 ! not needed (all variables known)
94 ! xflow mass flow
95 ! f value of the element equation
96 ! nodef nodes corresponding to the variables in the
97 ! element equation
98 ! idirf degrees of freedom corresponding to the variables
99 ! in the element equation
100 ! df derivatives of the element equation w.r.t. its
101 ! variables
102 ! numf number of variables in the element equation
103 !
104  implicit none
105 !
106  logical identity
107  character*8 lakon(*)
108  character*81 set(*)
109 !
110  integer nelem,nactdog(0:3,*),node1,node2,nodem,numf,
111  & ielprop(*),nodef(*),idirf(*),iflag,ipkon(*),kon(*),
112  & iaxial,mi(*),inv,index,icase
113 !
114  real*8 prop(*),v(0:mi(2),*),xflow,f,df(*),r,cp,physcon(*),dvi,
115  & co(3,*),vold(0:mi(2),*),ttime,time,xmach,xflow_oil,tt1,tt2,
116  & reynolds,pt1,pt2,kappa,c,a,d,pi,t1,t2
117 !
118  intent(in) node1,node2,nodem,nelem,lakon,
119  & kon,ipkon,nactdog,ielprop,prop,iflag,v,
120  & cp,r,physcon,dvi,set,co,vold,mi,ttime,
121  & time,iaxial
122 !
123  intent(inout) xflow,f,df,identity,nodef,idirf,numf
124 !
125  pi=4.d0*datan(1.d0)
126  if(iflag.eq.0) then
127 !
128 ! called by envtemp.f:
129 !
130 ! check whether element equation is needed (this is the
131 ! case if identity=.false.
132 !
133  identity=.true.
134 !
135  if(nactdog(2,node1).ne.0)then
136  identity=.false.
137  elseif(nactdog(2,node2).ne.0)then
138  identity=.false.
139  elseif(nactdog(1,nodem).ne.0)then
140  identity=.false.
141  endif
142 !
143  elseif(iflag.eq.1)then
144 !
145 ! called by initialnet.f:
146 !
147 ! calculation of the mass flow if everything else is known
148 !
149  index=ielprop(nelem)
150  c=prop(index+2)
151 !
152  pt1=v(2,node1)
153  pt2=v(2,node2)
154  if(pt1.ge.pt2) then
155  inv=1
156  else
157  inv=-1
158  pt1=v(2,node2)
159  pt2=v(2,node1)
160  endif
161 !
162  xflow=c*dsqrt(pt1-pt2)
163 !
164  elseif(iflag.eq.2)then
165 !
166 ! called by resultnet.f and mafillnet.f
167 !
168  numf=3
169  index=ielprop(nelem)
170 !
171  pt1=v(2,node1)
172  pt2=v(2,node2)
173  if(pt1.ge.pt2) then
174 !
175 ! flow direction corresponds to element orientation
176 !
177  inv=1
178  xflow=v(1,nodem)*iaxial
179  nodef(1)=node1
180  nodef(2)=nodem
181  nodef(3)=node2
182  else
183 !
184 ! flow direction does not correspond to element orientation
185 !
186  inv=-1
187  pt1=v(2,node2)
188  pt2=v(2,node1)
189  xflow=-v(1,nodem)*iaxial
190  nodef(1)=node2
191  nodef(2)=nodem
192  nodef(3)=node1
193  endif
194 !
195  idirf(1)=2
196  idirf(2)=1
197  idirf(3)=2
198 !
199 ! nodef and idirf show that the variables are (if inv=1):
200 ! 1. total pressure in node 1
201 ! 2. mass flow
202 ! 3. total pressure in node 2
203 !
204  c=prop(index+2)
205 !
206  f=c*dsqrt(pt1-pt2)-xflow
207  df(1)=c/(2.d0*dsqrt(pt1-pt2))
208  df(2)=-1.d0*inv
209  df(3)=-df(1)
210 !
211 ! output
212 !
213  elseif(iflag.eq.3) then
214 !
215 ! called by flowoutput.f
216 !
217 ! storage in the .net-file
218 !
219  index=ielprop(nelem)
220  a=prop(index+1)
221  kappa=(cp/(cp-r))
222  icase=1
223 !
224  pt1=v(2,node1)
225  pt2=v(2,node2)
226  if(pt1.ge.pt2) then
227  inv=1
228  xflow=v(1,nodem)*iaxial
229  tt1=v(0,node1)-physcon(1)
230  tt2=v(0,node2)-physcon(1)
231  else
232  inv=-1
233  pt1=v(2,node2)
234  pt2=v(2,node1)
235  xflow=-v(1,nodem)*iaxial
236  tt1=v(0,node2)-physcon(1)
237  tt2=v(0,node1)-physcon(1)
238  endif
239 !
240 ! calculation of the static temperatures
241 !
242  if(lakon(nelem)(3:3).eq.'P') then
243 !
244 ! "pipe"-like element: total and static temperatures
245 ! differ
246 !
247  call ts_calc(xflow,tt1,pt1,kappa,r,a,t1,icase)
248  call ts_calc(xflow,tt2,pt2,kappa,r,a,t2,icase)
249  else
250 !
251 ! "chamber-connecting"-like element: total and static
252 ! temperatures are equal
253 !
254  t1=tt1
255  t2=tt2
256  endif
257 !
258 ! calculation of the dynamic viscosity
259 !
260  if(dabs(dvi).lt.1e-30) then
261  write(*,*) '*ERROR in orifice: '
262  write(*,*) ' no dynamic viscosity defined'
263  write(*,*) ' dvi= ',dvi
264  call exit(201)
265  endif
266 !
267  index=ielprop(nelem)
268  kappa=(cp/(cp-r))
269  a=prop(index+1)
270  d=dsqrt(a*4/pi)
271  reynolds=dabs(xflow)*d/(dvi*a)
272  xmach=dsqrt(((pt1/pt2)**((kappa-1.d0)/kappa)-1.d0)*2.d0/
273  & (kappa-1.d0))
274 !
275  xflow_oil=0.d0
276 !
277  write(1,*) ''
278  write(1,55) ' from node ',node1,
279  & ' to node ', node2,' : air massflow rate = '
280  &,inv*xflow,' ',
281  & ', oil massflow rate = ',xflow_oil,' '
282 !
283  if(inv.eq.1) then
284  write(1,56)' Inlet node ',node1,' : Tt1 = ',tt1,
285  & ' , Ts1 = ',t1,' , Pt1 = ',pt1, ' '
286 !
287  write(1,*)' Element ',nelem,lakon(nelem)
288  write(1,57)' dyn.visc = ',dvi,' , Re = '
289  & ,reynolds,', M = ',xmach
290 !
291  write(1,56)' Outlet node ',node2,' : Tt2 = ',tt2,
292  & ' , Ts2 = ',t2,' , Pt2 = ',pt2,' '
293 !
294  else if(inv.eq.-1) then
295  write(1,56)' Inlet node ',node2,': Tt1 = ',tt1,
296  & ' , Ts1 = ',t1,' , Pt1 = ',pt1, ' '
297  &
298  write(1,*)' element R ',set(numf)(1:30)
299  write(1,57)' dyn.visc. = ',dvi,' , Re ='
300  & ,reynolds,', M = ',xmach
301 !
302  write(1,56)' Outlet node ',node1,': Tt2 = ',tt2,
303  & ' , Ts2 = ',t2,' , Pt2 = ',pt2, ' '
304  endif
305 !
306  endif
307 !
308  55 format(1x,a,i6,a,i6,a,e11.4,a,a,e11.4,a)
309  56 format(1x,a,i6,a,e11.4,a,e11.4,a,e11.4,a)
310  57 format(1x,a,e11.4,a,e11.4,a,e11.4)
311 !
312 ! degree of freedom 2 is the mass flow dof (cf. field idirf)
313 !
314  xflow=xflow/iaxial
315  df(2)=df(2)*iaxial
316 !
317  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
static double * e11
Definition: radflowload.c:42
Hosted by OpenAircraft.com, (Michigan UAV, LLC)