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      subroutine materialdata_cfd(nef,vel,shcon,nshcon,ielmatf,
20     &  ntmat_,mi,cvel,vfa,cocon,ncocon,physcon,cvfa,ithermal,nface,
21     &  umel,umfa,ielfa,hcfa,rhcon,nrhcon)
22!
23!     calculation of material properties at elements centers and
24!     face centers (incompressible fluids)
25!
26      implicit none
27!
28      integer nef,i,imat,ntmat_,mi(*),ielmatf(mi(3),*),ithermal(*),
29     &  nshcon(2,*),nface,ncocon(2,*),ielfa(4,*),nrhcon(*)
30!
31      real*8 t1l,vel(nef,0:7),shcon(0:3,ntmat_,*),cvel(*),vfa(0:7,*),
32     &  cocon(0:6,ntmat_,*),physcon(*),cvfa(*),umel(*),umfa(*),
33     &  hcfa(*),rhcon(0:1,ntmat_,*)
34!
35!
36!
37!     element (cell) values
38!
39      do i=1,nef
40         t1l=vel(i,0)
41         imat=ielmatf(1,i)
42!
43!        density
44!
45         call materialdata_rho(rhcon,nrhcon,imat,vel(i,5),t1l,ntmat_,
46     &            ithermal)
47!
48!        heat capacity at constant volume
49!        (for liquids: =heat capacity at constant pressure)
50!
51         call materialdata_cp_sec(imat,ntmat_,t1l,shcon,nshcon,cvel(i),
52     &       physcon)
53!
54!        dynamic viscosity
55!
56         call materialdata_dvi(shcon,nshcon,imat,umel(i),t1l,ntmat_,
57     &            ithermal)
58      enddo
59!
60!     facial values
61!
62      do i=1,nface
63         t1l=vfa(0,i)
64!
65!        take the material of the first adjacent element
66!
67         imat=ielmatf(1,ielfa(1,i))
68!
69!        density
70!
71         call materialdata_rho(rhcon,nrhcon,imat,vfa(5,i),t1l,ntmat_,
72     &            ithermal)
73!
74!        heat capacity at constant volume
75!
76         call materialdata_cp_sec(imat,ntmat_,t1l,shcon,nshcon,cvfa(i),
77     &       physcon)
78!
79!        dynamic viscosity
80!
81         call materialdata_dvi(shcon,nshcon,imat,umfa(i),t1l,ntmat_,
82     &            ithermal)
83!
84!        heat conduction
85!
86         call materialdata_cond(imat,ntmat_,t1l,cocon,ncocon,hcfa(i))
87      enddo
88!
89      return
90      end
91