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!     You should have received a copy of the GNU General Public License
15!     along with this program; if not, write to the Free Software
16!     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17!
18!     This subroutines enables to caclulate a correction term linked to with the radius
19!     of the spike as a function of r/s (radius/gap)
20!     the parameter Hst ( height of the step ) enable to select either the table for a
21!     straight labyrinth (Hst=0) or for a stepped labyrinth
22!
23!     H.Zimmermann and K.h. Wolff
24!     "Air system correlations part 1 Labyrinth seals"
25!     asme 98-GT-206
26!
27!     author: Yannick Muller
28!
29      subroutine cd_lab_radius(rad,s,hst,cd_radius)
30!
31      implicit none
32!
33      integer id,i,number,n9
34!
35      real*8 rad,s,cd_radius,rzs_tab(9),cd_sharp(9),rzs,hst
36!
37      real*8 rzs_tab1(9)
38      data rzs_tab1
39     &     /0d0,0.05d0,0.100d0,0.150d0,0.200d0,0.250d0,0.300d0,0.350d0,
40     &      0.400d0/
41!
42      real*8 cd_sharp1(9)
43      data cd_sharp1
44     &     /1d0,1.025d0,1.10d0,1.11d0,1.12d0,1.125d0,1.126d0,1.127d0,
45     &      1.127d0/
46!
47      real*8 rzs_tab2(9)
48      data rzs_tab2
49     &     /0d0,0.05d0,075d0,0.100d0,0.15d0,0.20d0,0.25d0,0.30d0,0.40d0/
50!
51      real*8 cd_sharp2(9)
52      data cd_sharp2
53     &     /1d0,1.10d0,1.15d0,1.20d0,1.26d0,1.31d0,1.34d0,1.36d0,1.37d0/
54!
55      data n9 /9/
56!
57      rzs=rad/s
58!
59!     straight labyrinth
60!
61      if(hst.eq.0d0) then
62         call ident(rzs_tab1,rzs,n9,id)
63         number=9
64         do i=1,9
65            rzs_tab(i)=rzs_tab1(i)
66            cd_sharp(i)=cd_sharp1(i)
67         enddo
68!
69!     stepped labyrinth
70!
71      else
72         call ident(rzs_tab2,rzs,n9,id)
73         number=9
74         do i=1,9
75            rzs_tab(i)=rzs_tab2(i)
76            cd_sharp(i)=cd_sharp2(i)
77         enddo
78      endif
79!
80!     linear interpolation
81!
82!
83            if(id.eq.1) then
84              cd_radius=cd_sharp(1)
85            elseif(id.eq.number) then
86               cd_radius=cd_sharp(number)
87            else
88               cd_radius=cd_sharp(id)+(cd_sharp(id+1)-cd_sharp(id))
89     &              *(rzs-rzs_tab(id))/(rzs_tab(id+1)-rzs_tab(id))
90            endif
91!
92            return
93!
94            end
95