1!
2!     CalculiX - A 3-dimensional finite element program
3!     Copyright (C) 1998-2021 Guido Dhondt
4!
5!     This program is free software; you can redistribute it and/or
6!     modify it under the terms of the GNU General Public License as
7!     published by the Free Software Foundation(version 2);
8!
9!
10!     This program is distributed in the hope that it will be useful,
11!     but WITHOUT ANY WARRANTY; without even the implied warranty of
12!     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13!     GNU General Public License for more details.
14!
15!     You should have received a copy of the GNU General Public License
16!     along with this program; if not, write to the Free Software
17!     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18!
19! cd compressible for class 3 orifices where l/d>0 and r/d>0
20! type d) with 0.5<=l/d<=2 (eq. 27)
21!
22!     author: Yannick Muller
23!
24      subroutine pk_cdc_cl3d(lqd,rqd,reynolds,p2p1,beta,cdc_cl3d)
25!
26      implicit none
27!
28      real*8 lqd,rqd,reynolds,p2p1,beta,cdc_cl3d,cdi_rl,cdc_cl3_choked,
29     &     jpsqpt,zeta
30!
31      cdc_cl3_choked=1.d0-(0.008d0+0.992d0*exp(-5.5d0*rqd
32     &     -3.5d0*rqd**2.d0))*(1.d0-0.838d0)
33!
34      call pk_cdi_rl(lqd,rqd,reynolds,beta,cdi_rl)
35!
36!     help function for eq 26
37      if (p2p1.ge.1d0) then
38         jpsqpt=1.d0
39      elseif(p2p1.ge.0.1d0) then
40         zeta=(1.d0-p2p1)/0.6d0
41         jpsqpt=exp(-4.6d0*zeta**7d0-2.2d0*zeta**1.5d0)
42      else
43         jpsqpt=0.d0
44      endif
45!
46      cdc_cl3d=cdc_cl3_choked-jpsqpt*(cdc_cl3_choked-cdi_rl)
47!
48      return
49!
50      end
51