Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReadViscositySection.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 !******************************************************************************
24 !
25 ! Purpose: read in user input related to viscosity model.
26 !
27 ! Description: none.
28 !
29 ! Input: user input file.
30 !
31 ! Output: regions = flow model, moving grid.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: ReadViscositySection.F90,v 1.4 2008/12/06 08:44:10 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2003 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE readviscositysection( regions )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY: t_region
47 #ifdef RFLO
49 #endif
50 #ifdef RFLU
51  USE modinterfaces, ONLY : readsection
52 #endif
53  USE moderror
54  USE modparameters
55  IMPLICIT NONE
56 
57 ! ... parameters
58  TYPE(t_region), POINTER :: regions(:)
59 
60 ! ... local variables
61  INTEGER, PARAMETER :: nkeys = 4
62  CHARACTER(10) :: keys(nkeys)
63 
64 #ifdef RFLO
65  INTEGER :: brbeg, brend
66 #endif
67 #ifdef RFLU
68  INTEGER :: ireg
69 #endif
70 
71  LOGICAL :: defined(nkeys)
72 
73  REAL(RFREAL) :: vals(nkeys)
74 
75 !******************************************************************************
76 
77  CALL registerfunction( regions(1)%global,'ReadViscositySection',&
78  'ReadViscositySection.F90' )
79 
80 ! specify keywords and search for them
81 
82  keys(1) = 'MODEL'
83  keys(2) = 'VISCOSITY'
84  keys(3) = 'REFTEMP'
85  keys(4) = 'SUTHCOEF'
86 
87 #ifdef RFLO
88  CALL readregionsection( regions(1)%global,if_input,nkeys,keys,vals, &
89  brbeg,brend,defined )
90 
91  IF (defined(1).eqv..true.) &
92  regions(brbeg:brend)%mixtInput%viscModel = nint(vals(1))
93 
94  IF (defined(2).eqv..true.) THEN
95  regions(brbeg:brend)%mixtInput%refVisc = abs(vals(2))
96  ELSE
97  regions(brbeg:brend)%mixtInput%refVisc = -1._rfreal
98  ENDIF
99 
100  IF (defined(3).eqv..true.) &
101  regions(brbeg:brend)%mixtInput%refTemp = abs(vals(3))
102 
103  IF (defined(4).eqv..true.) &
104  regions(brbeg:brend)%mixtInput%suthCoef = abs(vals(4))
105 #endif
106 
107 #ifdef RFLU
108  CALL readsection( regions(1)%global,if_input,nkeys,keys,vals,defined )
109 
110  IF ( defined(1) .EQV. .true. ) THEN
111  DO ireg = lbound(regions,1),ubound(regions,1)
112  regions(ireg)%mixtInput%viscModel = nint(vals(1))
113  END DO ! iReg
114  END IF ! defined
115 
116  IF ( defined(2) .EQV. .true. ) THEN
117  DO ireg = lbound(regions,1),ubound(regions,1)
118  regions(ireg)%mixtInput%refVisc = abs(vals(2))
119  END DO ! iReg
120  ELSE
121  DO ireg = lbound(regions,1),ubound(regions,1)
122  regions(ireg)%mixtInput%refVisc = REAL(crazy_value_int,rfreal)
123  END DO ! iReg
124  END IF ! defined
125 
126  IF ( defined(3) .EQV. .true. ) THEN
127  DO ireg = lbound(regions,1),ubound(regions,1)
128  regions(ireg)%mixtInput%refTemp = abs(vals(3))
129  END DO ! iReg
130  END IF ! defined
131 
132  IF ( defined(4) .EQV. .true. ) THEN
133  DO ireg = lbound(regions,1),ubound(regions,1)
134  regions(ireg)%mixtInput%suthCoef = abs(vals(4))
135  END DO ! iReg
136  END IF ! defined
137 #endif
138 
139 ! finalize
140 
141  CALL deregisterfunction( regions(1)%global )
142 
143 END SUBROUTINE readviscositysection
144 
145 !******************************************************************************
146 !
147 ! RCS Revision history:
148 !
149 ! $Log: ReadViscositySection.F90,v $
150 ! Revision 1.4 2008/12/06 08:44:10 mtcampbe
151 ! Updated license.
152 !
153 ! Revision 1.3 2008/11/19 22:17:23 mtcampbe
154 ! Added Illinois Open Source License/Copyright
155 !
156 ! Revision 1.2 2008/10/23 18:20:55 mtcampbe
157 ! Crazy number of changes to track and fix initialization and
158 ! restart bugs. Many improperly formed logical expressions
159 ! were fixed, and bug in allocation for data associated with
160 ! the BC_INFLOWVELTEMP boundary condition squashed in
161 ! RFLO_ReadBcInflowVelSection.F90.
162 !
163 ! Revision 1.1 2004/12/01 16:50:59 haselbac
164 ! Initial revision after changing case
165 !
166 ! Revision 1.8 2003/12/04 03:23:04 haselbac
167 ! Added parameter, setting of refVisc if undefined, fixed bug
168 !
169 ! Revision 1.7 2003/11/20 16:40:35 mdbrandy
170 ! Backing out RocfluidMP changes from 11-17-03
171 !
172 ! Revision 1.4 2003/05/20 22:16:16 jblazek
173 ! Corrected bug in viscosity model input.
174 !
175 ! Revision 1.3 2003/05/16 02:27:43 haselbac
176 ! Removed KIND=RFREAL from NINT statements
177 !
178 ! Revision 1.2 2003/05/15 02:57:02 jblazek
179 ! Inlined index function.
180 !
181 ! Revision 1.1 2003/04/10 23:28:27 fnajjar
182 ! Initial import for viscosity models
183 !
184 !******************************************************************************
185 
186 
187 
188 
189 
190 
191 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE brbeg
subroutine readsection(global, fileID, nvals, keys, vals, defined)
subroutine readregionsection(global, fileID, nvals, keys, vals, brbeg, brend, defined)
subroutine readviscositysection(regions)
subroutine deregisterfunction(global)
Definition: ModError.F90:469