Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SPEC_ReadSpecTypeSection.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 user input, store it in the data structure and check.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! regions Data associated with regions
31 ! iSpecType Species type
32 !
33 ! Output: None.
34 !
35 ! Notes: None.
36 !
37 ! ******************************************************************************
38 !
39 ! $Id: SPEC_ReadSpecTypeSection.F90,v 1.10 2008/12/06 08:44:41 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2003-2005 by the University of Illinois
42 !
43 ! ******************************************************************************
44 
45 SUBROUTINE spec_readspectypesection(regions,iSpecType)
46 
47  USE modglobal, ONLY: t_global
48  USE moddatatypes
49  USE moddatastruct, ONLY: t_region
50  USE moderror
51  USE modparameters
52  USE modspecies, ONLY: t_spec_type
53 
54 #ifdef RFLU
55  USE modinterfaces, ONLY: readbothsection, &
58 #endif
59 
60  IMPLICIT NONE
61 
62 ! ******************************************************************************
63 ! Definitions and declarations
64 ! ******************************************************************************
65 
66 ! ==============================================================================
67 ! Arguments
68 ! ==============================================================================
69 
70  INTEGER, INTENT(IN) :: ispectype
71  TYPE(t_region), DIMENSION(:), POINTER :: regions
72 
73 ! ==============================================================================
74 ! Locals
75 ! ==============================================================================
76 
77  INTEGER, PARAMETER :: nkeys = 8, nstrkeys = 1
78 
79  CHARACTER(CHRLEN) :: keys(nkeys),strkeys(nstrkeys),strvals(nstrkeys)
80  CHARACTER(CHRLEN) :: rcsidentstring
81  LOGICAL :: defined(nkeys),strdefined(nstrkeys)
82  REAL(RFREAL) :: vals(nkeys)
83  TYPE(t_global), POINTER :: global
84  TYPE(t_spec_type), POINTER :: pspectype
85 
86 #ifdef RFLU
87  INTEGER :: ireg
88 #endif
89 
90 ! ******************************************************************************
91 ! Start
92 ! ******************************************************************************
93 
94  rcsidentstring = '$RCSfile: SPEC_ReadSpecTypeSection.F90,v $ $Revision: 1.10 $'
95 
96  global => regions(1)%global
97 
98  CALL registerfunction(global,'SPEC_ReadSpecTypeSection',&
99  'SPEC_ReadSpecTypeSection.F90')
100 
101 ! ******************************************************************************
102 ! Read user input for species
103 ! ******************************************************************************
104 
105  keys(1) = 'FROZENFLAG'
106  keys(2) = 'INITVAL'
107  keys(3) = 'SOURCETYPE'
108  keys(4) = 'SCHMIDTNO'
109  keys(5) = 'DIAMETER'
110  keys(6) = 'PUFFFACTOR'
111  keys(7) = 'VELOCITYMETHOD'
112  keys(8) = 'SETTLINGFLAG'
113 
114  strkeys(1) = 'MATERIAL'
115 
116 #ifdef RFLU
117 ! ==============================================================================
118 ! Read SPEC_TYPE section
119 ! ==============================================================================
120 
121  CALL readbothsection(global,if_input,nkeys,nstrkeys,keys,strkeys,vals, &
122  strvals,defined,strdefined)
123 
124 
125 ! ==============================================================================
126 ! Set variables
127 ! ==============================================================================
128 
129 ! ------------------------------------------------------------------------------
130 ! Frozen flag
131 ! ------------------------------------------------------------------------------
132 
133  IF ( defined(1) .EQV. .true. ) THEN
134  DO ireg = lbound(regions,1),ubound(regions,1)
135  IF ( ispectype <= regions(ireg)%specInput%nSpecies ) THEN
136  IF ( nint(vals(1)) == 0 ) THEN
137  regions(ireg)%specInput%specType(ispectype)%frozenFlag = .false.
138  ELSE
139  regions(ireg)%specInput%specType(ispectype)%frozenFlag = .true.
140  END IF ! NINT
141  END IF ! iSpecType
142  END DO ! iReg
143  END IF ! defined
144 
145 ! ------------------------------------------------------------------------------
146 ! Initial value
147 ! ------------------------------------------------------------------------------
148 
149  IF ( defined(2) .EQV. .true. ) THEN
150  DO ireg = lbound(regions,1),ubound(regions,1)
151  IF ( ispectype <= regions(ireg)%specInput%nSpecies ) THEN
152  regions(ireg)%specInput%specType(ispectype)%initVal = vals(2)
153  END IF ! iSpecType
154  END DO ! iReg
155  END IF ! defined
156 
157 ! ------------------------------------------------------------------------------
158 ! Source type
159 ! ------------------------------------------------------------------------------
160 
161  IF ( defined(3) .EQV. .true. ) THEN
162  DO ireg = lbound(regions,1),ubound(regions,1)
163  IF ( ispectype <= regions(ireg)%specInput%nSpecies ) THEN
164  regions(ireg)%specInput%specType(ispectype)%sourceType = nint(vals(3))
165  END IF ! iSpecType
166  END DO ! iReg
167  END IF ! defined
168 
169 ! ------------------------------------------------------------------------------
170 ! Schmidt number
171 ! ------------------------------------------------------------------------------
172 
173  IF ( defined(4) .EQV. .true. ) THEN
174  DO ireg = lbound(regions,1),ubound(regions,1)
175  IF ( ispectype <= regions(ireg)%specInput%nSpecies ) THEN
176  regions(ireg)%specInput%specType(ispectype)%schmidtNumber = vals(4)
177  END IF ! iSpecType
178  END DO ! iReg
179  END IF ! defined
180 
181 ! ------------------------------------------------------------------------------
182 ! Diameter
183 ! ------------------------------------------------------------------------------
184 
185  IF ( defined(5) .EQV. .true. ) THEN
186  DO ireg = lbound(regions,1),ubound(regions,1)
187  IF ( ispectype <= regions(ireg)%specInput%nSpecies ) THEN
188  regions(ireg)%specInput%specType(ispectype)%diameter = vals(5)
189  END IF ! iSpecType
190  END DO ! iReg
191  END IF ! defined
192 
193 ! ------------------------------------------------------------------------------
194 ! Puff factor
195 ! ------------------------------------------------------------------------------
196 
197  IF ( defined(6) .EQV. .true. ) THEN
198  DO ireg = lbound(regions,1),ubound(regions,1)
199  IF ( ispectype <= regions(ireg)%specInput%nSpecies ) THEN
200  regions(ireg)%specInput%specType(ispectype)%puffFactor = vals(6)
201  END IF ! iSpecType
202  END DO ! iReg
203  END IF ! defined
204 
205 ! ------------------------------------------------------------------------------
206 ! Velocity method
207 ! ------------------------------------------------------------------------------
208 
209  IF ( defined(7) .EQV. .true. ) THEN
210  DO ireg = lbound(regions,1),ubound(regions,1)
211  IF ( ispectype <= regions(ireg)%specInput%nSpecies ) THEN
212  regions(ireg)%specInput%specType(ispectype)%velocityMethod = &
213  nint(vals(7))
214  END IF ! iSpecType
215  END DO ! iReg
216  END IF ! defined
217 
218 ! ------------------------------------------------------------------------------
219 ! Settling flag
220 ! ------------------------------------------------------------------------------
221 
222  IF ( defined(8) .EQV. .true. ) THEN
223  DO ireg = lbound(regions,1),ubound(regions,1)
224  IF ( ispectype <= regions(ireg)%specInput%nSpecies ) THEN
225  IF ( nint(vals(8)) == 0 ) THEN
226  regions(ireg)%specInput%specType(ispectype)%settlingFlag = .false.
227  ELSE
228  regions(ireg)%specInput%specType(ispectype)%settlingFlag = .true.
229  END IF ! NINT
230  END IF ! iSpecType
231  END DO ! iReg
232  END IF ! defined
233 
234 ! ------------------------------------------------------------------------------
235 ! Set material
236 ! ------------------------------------------------------------------------------
237 
238  IF ( strdefined(1) .EQV. .true. ) THEN
239  DO ireg = lbound(regions,1),ubound(regions,1)
240  IF ( ispectype <= regions(ireg)%specInput%nSpecies ) THEN
241  pspectype => regions(ireg)%specInput%specType(ispectype)
242 
243  CALL inrt_setmaterial(global,pspectype%pMaterial,strvals(1))
244  END IF ! iSpecType
245  END DO ! iReg
246  END IF ! strDefined
247 #endif
248 
249 ! ******************************************************************************
250 ! End
251 ! ******************************************************************************
252 
253  CALL deregisterfunction(global)
254 
255 END SUBROUTINE spec_readspectypesection
256 
257 ! ******************************************************************************
258 !
259 ! RCS Revision history:
260 !
261 ! $Log: SPEC_ReadSpecTypeSection.F90,v $
262 ! Revision 1.10 2008/12/06 08:44:41 mtcampbe
263 ! Updated license.
264 !
265 ! Revision 1.9 2008/11/19 22:17:53 mtcampbe
266 ! Added Illinois Open Source License/Copyright
267 !
268 ! Revision 1.8 2005/11/10 02:39:01 haselbac
269 ! Added support for settling flag
270 !
271 ! Revision 1.7 2004/07/30 22:47:37 jferry
272 ! Implemented Equilibrium Eulerian method for Rocflu
273 !
274 ! Revision 1.6 2004/07/28 15:31:34 jferry
275 ! added USED field to SPECIES input section
276 !
277 ! Revision 1.5 2004/07/23 22:43:17 jferry
278 ! Integrated rocspecies into rocinteract
279 !
280 ! Revision 1.4 2004/04/19 20:21:54 haselbac
281 ! Added code to read source type
282 !
283 ! Revision 1.3 2004/02/02 22:42:27 haselbac
284 ! Added reading of material name and setting of material pointer
285 !
286 ! Revision 1.2 2004/01/29 23:00:44 haselbac
287 ! Added reading of Schmidt number
288 !
289 ! Revision 1.1 2003/11/25 21:08:37 haselbac
290 ! Initial revision
291 !
292 ! ******************************************************************************
293 
294 
295 
296 
297 
298 
299 
subroutine readbothsection(global, fileID, nvals, nStrVals, keys, strKeys, vals, strVals, defined, strDefined)
subroutine spec_readspectypesection(regions, iSpecType)
subroutine inrt_setmaterial(global, material, name)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine readsection(global, fileID, nvals, keys, vals, defined)
subroutine deregisterfunction(global)
Definition: ModError.F90:469