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

Go to the source code of this file.

Functions/Subroutines

subroutine hns (b, theta, rho, dg, sqrts0, xflow, h1, h2)
 

Function/Subroutine Documentation

◆ hns()

subroutine hns ( real*8  b,
real*8  theta,
real*8  rho,
real*8  dg,
real*8  sqrts0,
real*8  xflow,
real*8  h1,
real*8  h2 
)
20 !
21 ! determine the flow depth h2 downstream of a hydraulic jump,
22 ! corresponding to a upstream flow depth of h1
23 !
24  implicit none
25 !
26  real*8 b,rho,dg,sqrts0,xflow,h1,h2,c2,f,df,dh2,hk,
27  & xflow2,tth,a1,yg1,a2,yg2,da2dh2,dyg2dh2,theta
28 !
29  call hcrit(xflow,rho,b,theta,dg,sqrts0,hk)
30 !
31  h2=h1*(-1.d0+dsqrt(1.d0+8.d0*(hk/h1)**3))/2.d0
32 !
33  if(dabs(theta).lt.1.d-10) return
34 !
35 ! hns for a trapezoid, non-rectangular cross section
36 !
37  c2=rho*rho*dg*sqrts0
38  xflow2=xflow*xflow
39  tth=dtan(theta)
40  a1=h1*(b+h1*tth)
41  yg1=h1*(3.d0*b+2.d0*h1*tth)/(6.d0*(b+h1*tth))
42 !
43 ! Newton-Raphson iterations
44 !
45  do
46  a2=h2*(b+h2*tth)
47  yg2=h2*(3.d0*b+2.d0*h2*tth)/(6.d0*(b+h2*tth))
48  da2dh2=b+2.d0*h2*tth
49  dyg2dh2=((3.d0*b+4.d0*h2*tth)*(b+tth)
50  & -tth*h2*(3.d0*b+2.d0*h2*tth))/
51  & (6.d0*(b+h2*tth)**2)
52  f=a2*xflow2+c2*(a1*a1*a2*yg1-a1*a2*a2*yg2)-a1*xflow2
53  df=da2dh2*xflow2+c2*(a1*a1*yg1*da2dh2-2.d0*a1*a2*da2dh2*yg2
54  & -a1*a2*a2*dyg2dh2)
55  dh2=f/df
56  if(dabs(dh2)/h2.lt.1.d-3) exit
57  h2=h2-dh2
58  enddo
59 !
60  write(*,*) 'hns ','h1= ',h1,'h2= ',h2,'hk= ',hk
61 !
62  return
subroutine df(x, u, uprime, rpar, nev)
Definition: subspace.f:133
subroutine hcrit(xflow, rho, b, theta, dg, sqrts0, hk)
Definition: hcrit.f:20
Hosted by OpenAircraft.com, (Michigan UAV, LLC)