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

Go to the source code of this file.

Functions/Subroutines

subroutine pt2zpt1_crit (pt2, pt1, Tt1, lambda, kappa, r, l, d, pt2zpt1_c, Qred1_crit, crit, icase, M1)
 

Function/Subroutine Documentation

◆ pt2zpt1_crit()

subroutine pt2zpt1_crit ( real*8, intent(in)  pt2,
real*8, intent(in)  pt1,
real*8, intent(in)  Tt1,
real*8, intent(in)  lambda,
real*8, intent(in)  kappa,
real*8, intent(in)  r,
real*8, intent(in)  l,
real*8, intent(in)  d,
real*8, intent(inout)  pt2zpt1_c,
real*8, intent(inout)  Qred1_crit,
logical, intent(inout)  crit,
integer, intent(in)  icase,
real*8  M1 
)
35 !
36  implicit none
37 !
38  logical crit
39 !
40  integer icase,i
41 !
42  real*8 pt2,pt1,lambda,kappa,l,d,m1,pt2zpt1,pt2zpt1_c,
43  & km1,kp1,kp1zk,tt1,r,xflow_crit,qred1_crit,fmin,
44  & f,fmax,m1_min,m1_max,lld
45 !
46  intent(in) pt2,pt1,tt1,lambda,kappa,r,l,d,
47  & icase
48 !
49  intent(inout) qred1_crit,crit,pt2zpt1_c
50 !
51  crit=.false.
52 !
53 ! useful variables and constants
54 !
55  km1=kappa-1.d0
56  kp1=kappa+1.d0
57  kp1zk=kp1/kappa
58  lld=lambda*l/d
59 !
60 ! adiabatic case
61 !
62  if(icase.eq.0) then
63 !
64 ! computing M1 using dichotomy method (dividing the interval with the function
65 ! root iteratively by 2)
66 !
67  i=1
68 !
69  m1_min=0.001d0
70  m1_max=1
71 !
72  fmin=(1.d0-m1_min**2)*(kappa*m1_min**2)**(-1)
73  & +0.5d0*kp1zk*log((0.5d0*kp1)*m1_min**2
74  & *(1+0.5d0*km1*m1_min**2)**(-1))-lld
75 !
76  fmax=(1.d0-m1_max**2)*(kappa*m1_max**2)**(-1)
77  & +0.5d0*kp1zk*log((0.5d0*kp1)*m1_max**2
78  & *(1+0.5d0*km1*m1_max**2)**(-1))-lld
79  do
80  i=i+1
81  m1=(m1_min+m1_max)*0.5d0
82 !
83  f=(1.d0-m1**2)*(kappa*m1**2)**(-1)
84  & +0.5d0*kp1zk*log((0.5d0*kp1)*m1**2
85  & *(1+0.5d0*km1*m1**2)**(-1))-lld
86 !
87  if(abs(f).le.1e-6) then
88  exit
89  endif
90  if(i.gt.50) then
91  exit
92  endif
93 !
94  if(fmin*f.le.0.d0) then
95  m1_max=m1
96  fmax=f
97  else
98  m1_min=m1
99  fmin=f
100  endif
101  enddo
102 !
103  pt2zpt1_c=m1*(0.5d0*kp1)**(0.5*kp1/km1)
104  & *(1+0.5d0*km1*m1**2)**(-0.5d0*kp1/km1)
105 !
106 ! isothermal case
107 !
108  elseif (icase.eq.1) then
109 !
110 ! computing M1 using dichotomy method for choked conditions M2=1/dsqrt(kappa)
111 ! (1.d0-kappa*M1**2)/(kappa*M1**2)+log(kappa*M1**2)-lambda*l/d=0
112 !
113  i=1
114 !
115  m1_min=0.001d0
116  m1_max=1/dsqrt(kappa)
117 !
118  fmin=(1.d0-kappa*m1_min**2)/(kappa*m1_min**2)
119  & +log(kappa*m1_min**2)-lambda*l/d
120 !
121  fmax=(1.d0-kappa*m1_max**2)/(kappa*m1_max**2)
122  & +log(kappa*m1_max**2)-lambda*l/d
123 !
124  do
125  i=i+1
126  m1=(m1_min+m1_max)*0.5d0
127 !
128  f=(1.d0-kappa*m1**2)/(kappa*m1**2)
129  & +log(kappa*m1**2)-lambda*l/d
130 !
131  if((abs(f).le.1e-5).or.(i.ge.50)) then
132  exit
133  endif
134 !
135  if(fmin*f.le.0.d0) then
136  m1_max=m1
137  fmax=f
138  else
139  m1_min=m1
140  fmin=f
141  endif
142  enddo
143 !
144 ! computing the critical pressure ratio in the isothermal case
145 ! pt=A*dsqrt(kappa)/(xflow*dsqrt(kappa Tt))*
146 ! M*(1+0.5d0*(kappa-1)M**2)**(-0.5d0*(kappa+1)/(kappa-1))
147 ! and forming the pressure ratio between inlet and outlet(choked)
148 !
149 c Pt2zPt1_c=dsqrt(Tt2/Tt1)*M1*dsqrt(kappa)*((1+0.5d0*km1/kappa)
150 c & /(1+0.5d0*km1*M1**2))**(0.5d0*(kappa+1)/km1)
151  pt2zpt1_c=m1*dsqrt(kappa)*((1+0.5d0*km1/kappa)
152  & /(1+0.5d0*km1*m1**2))**(0.5d0*(kappa+1)/km1+0.5d0)
153 !
154  endif
155 !
156  pt2zpt1=pt2/pt1
157  if(pt2zpt1.le.pt2zpt1_c) then
158  crit=.true.
159  endif
160 !
161  qred1_crit=m1*dsqrt(kappa/r)
162  & *(1+0.5d0*km1*m1**2)**(-0.5d0*kp1/km1)
163 !
164 c write(*,*) 'pt2zpt1_crit ',dsqrt(kappa/r)
165 c & *(1+0.5d0*km1)**(-0.5d0*kp1/km1)
166 !
167  return
Hosted by OpenAircraft.com, (Michigan UAV, LLC)