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

Go to the source code of this file.

Functions/Subroutines

subroutine liquidpump (node1, node2, nodem, nelem, nactdog, identity, ielprop, prop, iflag, v, xflow, f, nodef, idirf, df, rho, g, co, numf, mi, ttime, time, iaxial)
 

Function/Subroutine Documentation

◆ liquidpump()

subroutine liquidpump ( integer  node1,
integer  node2,
integer  nodem,
integer  nelem,
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  rho,
real*8, dimension(3)  g,
real*8, dimension(3,*)  co,
integer  numf,
integer, dimension(*)  mi,
real*8  ttime,
real*8  time,
integer  iaxial 
)
22 !
23 ! pump for incompressible media
24 !
25  implicit none
26 !
27  logical identity
28 !
29  integer nelem,nactdog(0:3,*),node1,node2,nodem,
30  & ielprop(*),nodef(*),idirf(*),index,iflag,
31  & inv,id,numf,npu,i,mi(*),iaxial
32 !
33  real*8 prop(*),v(0:mi(2),*),xflow,f,df(*),ttime,time,
34  & p1,p2,rho,g(3),dg,z1,z2,co(3,*),
35  & xpu(10),ypu(10),xxpu(10),yypu(10),dh
36 !
37  numf=3
38 !
39  if (iflag.eq.0) then
40  identity=.true.
41 !
42  if(nactdog(2,node1).ne.0)then
43  identity=.false.
44  elseif(nactdog(2,node2).ne.0)then
45  identity=.false.
46  elseif(nactdog(1,nodem).ne.0)then
47  identity=.false.
48  endif
49 !
50  elseif((iflag.eq.1).or.(iflag.eq.2))then
51 !
52  index=ielprop(nelem)
53 !
54  npu=nint(prop(index+1))
55  do i=1,npu
56  xpu(i)=prop(index+2*i)
57  ypu(i)=prop(index+2*i+1)
58  enddo
59 !
60  p1=v(2,node1)
61  p2=v(2,node2)
62 !
63  z1=-g(1)*co(1,node1)-g(2)*co(2,node1)-g(3)*co(3,node1)
64  z2=-g(1)*co(1,node2)-g(2)*co(2,node2)-g(3)*co(3,node2)
65 !
66  if(iflag.eq.2) then
67  xflow=v(1,nodem)*iaxial
68  if(xflow.ge.0.d0) then
69  inv=1
70  else
71  inv=-1
72  endif
73  nodef(1)=node1
74  nodef(2)=nodem
75  nodef(3)=node2
76  idirf(1)=2
77  idirf(2)=1
78  idirf(3)=2
79  endif
80 !
81  dg=dsqrt(g(1)*g(1)+g(2)*g(2)+g(3)*g(3))
82 !
83  if(iflag.eq.1) then
84  dh=(z2-z1+(p2-p1)/rho)/dg
85 !
86 ! reverting the order in xpu and ypu and storing the
87 ! result in xxpu and yypu
88 !
89  do i=1,npu
90  xxpu(i)=xpu(npu+1-i)
91  yypu(i)=ypu(npu+1-i)
92  enddo
93  call ident(yypu,dh,npu,id)
94  if(id.eq.0) then
95  xflow=xxpu(1)
96  elseif(id.eq.npu) then
97  xflow=0.d0
98  else
99  xflow=xxpu(id)+(xxpu(id+1)-xxpu(id))*(dh-yypu(id))/
100  & (yypu(id+1)-yypu(id))
101  endif
102  else
103  df(1)=1.d0/rho
104  df(3)=-df(1)
105  xflow=xflow/rho
106  call ident(xpu,xflow,npu,id)
107  if(id.eq.0) then
108  if(xflow.ge.0.d0) then
109  f=z1-z2+(p1-p2)/rho+dg*ypu(1)
110  df(2)=0.d0
111  else
112  df(2)=-1.d10
113  f=z1-z2+(p1-p2)/rho+dg*(ypu(1)+xflow*df(2))
114  df(2)=df(2)*dg/rho
115  endif
116  elseif(id.eq.npu) then
117  df(2)=-1.d10
118  f=z1-z2+(p1-p2)/rho+dg*(ypu(npu)+df(2)*(xflow-xpu(npu)))
119  df(2)=df(2)*dg/rho
120  else
121  df(2)=(ypu(id+1)-ypu(id))/(xpu(id+1)-xpu(id))
122  f=z1-z2+(p1-p2)/rho+dg*(ypu(id)+(xflow-xpu(id))*df(2))
123  df(2)=df(2)*dg/rho
124  endif
125  endif
126 !
127  endif
128 !
129  xflow=xflow/iaxial
130  df(2)=df(2)*iaxial
131 !
132  return
subroutine ident(x, px, n, id)
Definition: ident.f:26
static double * z1
Definition: filtermain.c:48
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
Hosted by OpenAircraft.com, (Michigan UAV, LLC)