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

Go to the source code of this file.

Functions/Subroutines

subroutine networkmpc_rhs (i, ipompc, nodempc, coefmpc, labmpc, v, bc, j, mi)
 

Function/Subroutine Documentation

◆ networkmpc_rhs()

subroutine networkmpc_rhs ( integer, intent(in)  i,
integer, dimension(*), intent(in)  ipompc,
integer, dimension(3,*), intent(in)  nodempc,
real*8, dimension(*), intent(in)  coefmpc,
character*20, dimension(*), intent(in)  labmpc,
real*8, dimension(0:mi(2),*), intent(in)  v,
real*8, dimension(*), intent(inout)  bc,
integer, intent(in)  j,
integer, dimension(*), intent(in)  mi 
)
23 !
24 ! user defined network mpc: calculation of the right hand
25 ! side
26 !
27 ! INPUT:
28 !
29 ! i MPC number
30 ! ipompc(1..nmpc)) ipompc(i) points to the first term of
31 ! MPC i in field nodempc
32 ! nodempc(1,*) node number of a MPC term
33 ! nodempc(2,*) coordinate direction of a MPC term
34 ! nodempc(3,*) if not 0: points towards the next term
35 ! of the MPC in field nodempc
36 ! if 0: MPC definition is finished
37 ! coefmpc(*) coefficient of a MPC term
38 ! labmpc(*) label of the MPC. For user-defined
39 ! network MPC's it starts with NETWORK;
40 ! the remaining 13 characters can be used
41 ! to distinguish between different kinds of
42 ! network user MPC's
43 ! vold(0..mi(2),1..nk) solution field in all nodes
44 ! 0: total temperature
45 ! 1: mass flow
46 ! 2: total pressure
47 ! j network equation corresponding to the
48 ! present MPC (i.e. MPC i)
49 ! mi(*) field with global information; mi(2) is the
50 ! highest variable number
51 !
52 ! OUTPUT:
53 !
54 ! bc(*) right hand side of the system of network
55 ! equations; this routine should return bc(j)
56 !
57  implicit none
58 !
59  character*20 labmpc(*)
60 !
61  integer mi(*),i,ipompc(*),nodempc(3,*),j,index,node,idir
62 !
63  real*8 coefmpc(*),v(0:mi(2),*),bc(*)
64 !
65  intent(in) i,ipompc,nodempc,coefmpc,
66  & labmpc,v,j,mi
67 !
68  intent(inout) bc
69 !
70  if(labmpc(i)(8:16).eq.'QUADRATIC') then
71 !
72 ! example equation of the form
73 ! f:=a*v(idir1,node1)+b*v(idir2,node2)**2=0
74 !
75 ! a,idir1,node1,b,idir2,node2 are given in the input deck
76 ! using the *NETWORK MPC keyword
77 ! to be calculated: bc(j):=-f
78 !
79  index=ipompc(i)
80  node=nodempc(1,index)
81  idir=nodempc(2,index)
82  bc(j)=coefmpc(index)*v(idir,node)
83 !
84  index=nodempc(3,index)
85  node=nodempc(1,index)
86  idir=nodempc(2,index)
87  bc(j)=bc(j)+coefmpc(index)*v(idir,node)**2
88 !
89  bc(j)=-bc(j)
90  else
91  write(*,*) '*ERROR in networkmpc_rhs:'
92  write(*,*) ' unknown MPC: ',labmpc(i)
93  endif
94 !
95  return
Hosted by OpenAircraft.com, (Michigan UAV, LLC)