Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
INRT_ReadDrag.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: Reads in information related to the interaction Drag
26 !
27 ! Description: none.
28 !
29 ! Input: regions = data of all regions
30 !
31 ! Output: fills user data into region%inrtInput%inrts
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: INRT_ReadDrag.F90,v 1.4 2008/12/06 08:44:32 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2003 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE inrt_readdrag( regions )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
49  USE moderror
50  USE modparameters
52 
53 #ifdef RFLO
55 #endif
56 #ifdef RFLU
57  USE modinterfaces, ONLY : readsection
58 #endif
61  IMPLICIT NONE
62 
63 ! ... parameters
64  TYPE(t_region), POINTER :: regions(:)
65 
66 ! ... loop variables
67  INTEGER :: ireg,iplag
68 
69 ! ... local variables
70  INTEGER, PARAMETER :: nkeys_max = 20
71 
72  CHARACTER(CHRLEN) :: rcsidentstring
73  CHARACTER(CHRLEN) :: keys(nkeys_max)
74 
75  INTEGER :: brbeg,brend,nedges
76  INTEGER :: nplag
77  INTEGER :: nimplkeys,nnodekeys,nkeys
78  INTEGER :: ind,indmixt,indplag0
79  INTEGER :: ikeyused,ikeymodel,ikeynode0
80  INTEGER :: ikeymixtactv,ikeyplagactv,ikeymixtperm,ikeyplagperm
81 
82  LOGICAL :: defined(nkeys_max)
83 
84  REAL(RFREAL) :: vals(nkeys_max)
85 
86  TYPE(t_inrt_input), POINTER :: input
87  TYPE(t_inrt_interact), POINTER :: inrt
88  TYPE(t_global), POINTER :: global
89 
90 !******************************************************************************
91 
92  rcsidentstring = '$RCSfile: INRT_ReadDrag.F90,v $ $Revision: 1.4 $'
93 
94  global => regions(1)%global
95 
96  CALL registerfunction( global,'INRT_ReadDrag',&
97  'INRT_ReadDrag.F90' )
98 
99 ! begin -----------------------------------------------------------------------
100 
101 ! define implementation-dependent keys
102 
103  ikeyused = 1
104  ikeymodel = 2
105  nimplkeys = 2
106 
107  keys(ikeyused) = 'USED'
108  keys(ikeymodel) = 'MODEL'
109 
110 ! define Node keys
111 
112  ikeynode0 = nimplkeys
113  ikeymixtactv = ikeynode0 + 1
114  ikeyplagactv = ikeynode0 + 2
115  ikeymixtperm = ikeynode0 + 3
116  ikeyplagperm = ikeynode0 + 4
117  nnodekeys = 4
118 
119  keys(ikeymixtactv) = 'MIXT_ACTV'
120  keys(ikeyplagactv) = 'PLAG_ACTV'
121  keys(ikeymixtperm) = 'MIXT_PERM'
122  keys(ikeyplagperm) = 'PLAG_PERM'
123 
124  nkeys = ikeynode0 + nnodekeys
125 
126  IF (nkeys > nkeys_max) CALL errorstop( global,err_exceeds_decl_mem,__line__ )
127 
128 ! Read interaction section from input file
129 
130 #ifdef RFLO
131  CALL readregionsection( global,if_input,nkeys,keys,vals,brbeg,brend,defined )
132 #endif
133 #ifdef RFLU
134  CALL readsection( global,if_input,nkeys,keys,vals,defined )
135  brbeg = lbound(regions,1)
136  brend = ubound(regions,1)
137 #endif
138 
139  DO ireg=brbeg,brend
140 
141  input => regions(ireg)%inrtInput
142  inrt => input%inrts(inrt_type_drag)
143 
144 ! - Check that INRT_DEFAULT section has been read, and that interaction has not
145 
146  IF (.NOT. input%defaultRead) &
147  CALL errorstop( global,err_inrt_defunread,__line__ )
148 
149  IF (inrt%used) CALL errorstop( global,err_inrt_read,__line__ )
150 
151 ! - Use local variables for some useful quantities
152 
153  nplag = input%nPlag
154 
155  indmixt = input%indMixt
156  indplag0 = input%indPlag0
157 
158 ! - Check if interaction is used
159 
160  inrt%used = .true. ! used by default when its section appears
161 
162  IF (defined(ikeyused)) THEN
163  IF (nint(vals(ikeyused)) == 0) inrt%used = .false.
164  END IF ! defined(iKeyUsed)
165 
166  IF (nplag < 1) inrt%used = .false. ! cannot occur without particles
167 
168  IF (.NOT. inrt%used) cycle ! do not bother with unused interactions
169 
170 ! - Define interaction (using any relevant information from input deck)
171 
172  CALL inrt_definedrag(regions(ireg))
173 
174 ! - Check for switches
175 
176  inrt%switches(inrt_swi_drag_model) = inrt_drag_model_default
177 
178  IF (defined(ikeymodel)) THEN
179 
180  SELECT CASE (nint(vals(ikeymodel)))
181 
182  CASE (1)
183  inrt%switches(inrt_swi_drag_model) = inrt_drag_model_stokes
184 
185  CASE (2)
186  inrt%switches(inrt_swi_drag_model) = inrt_drag_model_sn
187 
188  CASE (3)
189  inrt%switches(inrt_swi_drag_model) = inrt_drag_model_smrfld
190 
191  CASE default
192  CALL errorstop( global,err_inrt_badswitch,__line__ )
193 
194  END SELECT ! vals(iKeyModel)
195 
196  END IF ! defined(iKeyModel)
197 
198 ! - Check for Mixture controls
199 
200  IF (defined(ikeymixtactv)) &
201  CALL inrt_setactiveness(global,vals(ikeymixtactv), &
202  inrt%activeness(indmixt))
203 
204  IF (defined(ikeymixtperm)) &
205  CALL inrt_setpermission(global,vals(ikeymixtperm), &
206  inrt%permission(indmixt))
207 
208 ! - Check for Lagrangian particle controls
209 
210  DO iplag=1,nplag+1
211 
212  ind = indplag0 + iplag
213 
214  IF (defined(ikeyplagactv)) &
215  CALL inrt_setactiveness(global,vals(ikeyplagactv), &
216  inrt%activeness(ind))
217 
218  IF (defined(ikeyplagperm)) &
219  CALL inrt_setpermission(global,vals(ikeyplagperm), &
220  inrt%permission(ind))
221 
222  END DO ! iPlag
223 
224 ! - Determine permission Tokens
225 
226  CALL inrt_determinetokens(regions(ireg),inrt)
227 
228  END DO ! iReg
229 
230 ! finalize --------------------------------------------------------------------
231 
232  CALL deregisterfunction( global )
233 
234 END SUBROUTINE inrt_readdrag
235 
236 !******************************************************************************
237 !
238 ! RCS Revision history:
239 !
240 ! $Log: INRT_ReadDrag.F90,v $
241 ! Revision 1.4 2008/12/06 08:44:32 mtcampbe
242 ! Updated license.
243 !
244 ! Revision 1.3 2008/11/19 22:17:44 mtcampbe
245 ! Added Illinois Open Source License/Copyright
246 !
247 ! Revision 1.2 2007/03/07 22:18:05 fnajjar
248 ! Included Sommerfeld drag law
249 !
250 ! Revision 1.1 2004/12/01 21:56:35 fnajjar
251 ! Initial revision after changing case
252 !
253 ! Revision 1.7 2004/07/23 22:43:16 jferry
254 ! Integrated rocspecies into rocinteract
255 !
256 ! Revision 1.6 2004/03/05 22:09:03 jferry
257 ! created global variables for peul, plag, and inrt use
258 !
259 ! Revision 1.5 2004/03/02 21:49:23 jferry
260 ! Added inrtUsed flag to mixture data structure
261 !
262 ! Revision 1.4 2003/04/02 22:32:04 jferry
263 ! codified Activeness and Permission structures for rocinteract
264 !
265 ! Revision 1.3 2003/03/24 23:30:52 jferry
266 ! overhauled rocinteract to allow interaction design to use user input
267 !
268 ! Revision 1.2 2003/03/11 16:09:39 jferry
269 ! Added comments
270 !
271 ! Revision 1.1 2003/03/04 22:12:35 jferry
272 ! Initial import of Rocinteract
273 !
274 !******************************************************************************
275 
276 
277 
278 
279 
280 
281 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine inrt_definedrag(region)
subroutine inrt_determinetokens(region, inrt)
IndexType nedges() const
Definition: Mesh.H:564
**********************************************************************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 input(X, NNODE, NDC, NCELL, NFCE, NBPTS, NBFACE, ITYP, NPROP, XBNDY, XFAR, YFAR, ZFAR)
subroutine inrt_setactiveness(global, val, actv)
subroutine readsection(global, fileID, nvals, keys, vals, defined)
subroutine readregionsection(global, fileID, nvals, keys, vals, brbeg, brend, defined)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine inrt_setpermission(global, val, perm)
subroutine inrt_readdrag(regions)