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