KTH framework for Nek5000 toolboxes; testing version  0.0.1
vprops.f
Go to the documentation of this file.
1  subroutine vprops
2 C-----------------------------------------------------------------------
3 C
4 C Set material properties
5 C
6 C Material type: 0 for default (PARAM and PCOND/PRHOCP)
7 C 1 for constant props;
8 C 2 for fortran function;
9 C
10 C-----------------------------------------------------------------------
11  include 'SIZE'
12  include 'INPUT'
13  include 'SOLN'
14  include 'TSTEP'
15  LOGICAL IFKFLD,IFEFLD
16 C
17  if (nio.eq.0.and.loglevel.gt.2)
18  $ write(6,*) 'vprops', ifield
19 
20  nxyz1 = lx1*ly1*lz1
21  nel = nelfld(ifield)
22  ntot1 = nxyz1*nel
23 C
24  IF (istep.EQ.0) THEN
25 C
26 C First time around, set defaults
27 C
28  ifvarp(ifield) = .false.
29  if (iflomach) ifvarp(ifield) = .true.
30 
31  if (.not.ifvarp(ifield)) then ! check all groups
32  do iel=1,nel
33  igrp = igroup(iel)
34  itype = matype(igrp,ifield)
35  if(itype.ne.0) ifvarp(ifield) = .true.
36  enddo
37  endif
38 
39  itest = 0 ! test against all processors
40  if (ifvarp(ifield)) itest = 1
41  itest = iglmax(itest,1)
42  if (itest.gt.0) ifvarp(ifield) = .true.
43 
44  endif
45 C
46 C Fill up property arrays every time step
47  DO 1000 iel=1,nel
48 C
49  igrp=igroup(iel)
50 
51  if (ifuservp) then
52 C
53 C User specified fortran function (pff 2/13/01)
54  CALL nekuvp (iel)
55  difmin = vlmin(vdiff(1,1,1,iel,ifield),nxyz1)
56  IF (difmin .LE. 0.0) THEN
57  WRITE (6,100) difmin,ifield,igrp
58  CALL exitt
59  endif
60 C
61  ELSE IF(matype(igrp,ifield).EQ.1)THEN
62 C
63 C Constant property within groups of elements
64 C
65  cdiff = cpgrp(igrp,ifield,1)
66  ctrans = cpgrp(igrp,ifield,2)
67  CALL cfill(vdiff(1,1,1,iel,ifield),cdiff,nxyz1)
68  CALL cfill(vtrans(1,1,1,iel,ifield),ctrans,nxyz1)
69  IF (cdiff.LE.0.0) THEN
70  WRITE(6,100) cdiff,ifield,igrp
71  100 FORMAT(2x,'ERROR: Non-positive diffusivity ('
72  $ ,g12.3,') specified for field',i2,', group',i2
73  $ ,' element',i4,'.'
74  $ ,/,'ABORTING in VPROPS',//)
75  CALL exitt
76  endif
77 C
78  ELSE IF(matype(igrp,ifield).EQ.2)THEN
79 C
80 C User specified fortran function
81 C
82  CALL nekuvp (iel)
83 C
84  if(optlevel.le.2) then
85  difmin = vlmin(vdiff(1,1,1,iel,ifield),nxyz1)
86  IF (difmin .LE. 0.0) THEN
87  WRITE (6,100) difmin,ifield,igrp
88  CALL exitt
89  endif
90  endif
91 C
92  ELSE IF(matype(igrp,ifield).EQ.0)THEN
93 C
94 C Default constant property
95 C
96  cdiff = cpfld(ifield,1)
97  ctrans = cpfld(ifield,2)
98 c write(6,*) 'vdiff:',ifield,cdiff,ctrans
99  CALL cfill(vdiff(1,1,1,iel,ifield),cdiff,nxyz1)
100  CALL cfill(vtrans(1,1,1,iel,ifield),ctrans,nxyz1)
101  IF (cdiff.LE.0.0) THEN
102  WRITE(6,200) cdiff,ifield
103  200 FORMAT(2x,'ERROR: Non-positive diffusivity ('
104  $ ,g12.3,') specified for field',i2,'.',/
105  $ ,'ABORTING in VPROPS',//)
106  CALL exitt
107  endif
108  endif
109 C
110  1000 CONTINUE
111 C
112  return
113  end
114 C
void exitt()
Definition: comm_mpi.f:604
function iglmax(a, n)
Definition: math.f:913
subroutine cfill(a, b, n)
Definition: math.f:244
real function vlmin(vec, n)
Definition: math.f:357
subroutine nekuvp(iel)
Definition: subs1.f:1053
subroutine vprops
Definition: vprops.f:2