Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_InjcTileRKUpdate.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: Update solution and sums residuals for tile data infrastructure.
26 !
27 ! Description: none.
28 !
29 ! Input: region = current region.
30 ! iStage = RK stage
31 !
32 ! Output: region%levels%tilePlag%cv
33 ! region%levels%tilePlag%rhsSum
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: PLAG_InjcTileRKUpdate.F90,v 1.5 2009/03/02 00:19:36 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2002 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE plag_injctilerkupdate( region, iStage )
46 
47  USE moddatatypes
49  USE modbndpatch, ONLY : t_patch
50  USE moddatastruct, ONLY : t_region
51  USE modglobal, ONLY : t_global
52  USE modmixture, ONLY : t_mixt_input
53  USE moderror
54  USE modparameters
55 
57 
58  USE modinterfaces, ONLY : rkupdategeneric
59 
60  IMPLICIT NONE
61 
62 ! ... parameters
63  TYPE(t_region) :: region
64 
65  INTEGER :: istage
66 
67 ! ... loop variables
68  INTEGER :: icont, ipatch, itile
69 
70 ! ... local variables
71  CHARACTER(CHRLEN) :: rcsidentstring
72 
73  INTEGER :: bctype, ncont, npatches, ntiles
74  INTEGER :: ivtilebeg, ivtileend
75 #ifdef RFLO
76  INTEGER :: ilev, n1, n2
77 #endif
78 
79  REAL(RFREAL), POINTER, DIMENSION(:,:) :: pcv, pcvold, prhs, prhssum
80 
81  TYPE(t_patch), POINTER :: ppatch
82  TYPE(t_tile_plag), POINTER :: ptileplag
83  TYPE(t_global), POINTER :: global
84 
85 !******************************************************************************
86 
87  rcsidentstring = '$RCSfile: PLAG_InjcTileRKUpdate.F90,v $ $Revision: 1.5 $'
88 
89  global => region%global
90 
91  CALL registerfunction( global, 'PLAG_InjcTileRKUpdate',&
92  'PLAG_InjcTileRKUpdate.F90' )
93 
94 ! Get dimensions --------------------------------------------------------------
95 
96 #ifdef RFLO
97  ilev = region%currLevel
98  npatches = region%nPatches
99 #endif
100 #ifdef RFLU
101  npatches = region%grid%nPatches
102 #endif
103  ncont = region%plagInput%nCont
104 
105 ! Loop over patches -----------------------------------------------------------
106 
107  DO ipatch=1,npatches
108 
109 #ifdef RFLO
110  ppatch => region%levels(ilev)%patches(ipatch)
111 #endif
112 #ifdef RFLU
113  ppatch => region%patches(ipatch)
114 #endif
115 
116  bctype = ppatch%bcType
117 
118 ! - Select injection boundary condition ---------------------------------------
119 
120 #ifdef RFLU
121  IF ( (bctype >= bc_injection .AND. bctype <= bc_injection + bc_range) .OR. &
122  (bctype >= bc_inflow .AND. bctype <= bc_inflow + bc_range) ) THEN
123 #else
124  IF ( (bctype >= bc_injection .AND. bctype <= bc_injection + bc_range) ) THEN
125 #endif
126 ! -- Get tile dimensions and pointers -----------------------------------------
127 
128 #ifdef RFLO
129  n1 = abs(ppatch%l1end -ppatch%l1beg ) + 1
130  n2 = abs(ppatch%l2end -ppatch%l2beg ) + 1
131  ntiles = n1*n2
132 #endif
133 #ifdef RFLU
134  ntiles = ppatch%nBFaces
135 #endif
136 
137  ptileplag => ppatch%tilePlag
138 
139  pcv => ptileplag%cv
140  pcvold => ptileplag%cvOld
141  prhs => ptileplag%rhs
142  prhssum => ptileplag%rhsSum
143 
144 ! -- Use Generic RKUpdate routine ---------------------------------------------
145 
146  ivtilebeg = cv_tile_momnrm
147  ivtileend = cv_tile_last+ncont
148 
149  CALL rkupdategeneric( region,var_type_point,istage,1,ntiles, &
150  ivtilebeg,ivtileend,pcv,pcvold,prhs,prhssum )
151 
152  END IF !bcType
153 
154  END DO ! iPatch
155 
156 ! finalize --------------------------------------------------------------------
157 
158  CALL deregisterfunction( global )
159 
160 END SUBROUTINE plag_injctilerkupdate
161 
162 !******************************************************************************
163 !
164 ! RCS Revision history:
165 !
166 ! $Log: PLAG_InjcTileRKUpdate.F90,v $
167 ! Revision 1.5 2009/03/02 00:19:36 mtcampbe
168 ! Added some ifdefs around Rocflo to disable particle injection on INFLOW
169 ! boundaries and added some checks around MPI tags utilizing a new global
170 ! data item, global%mpiTagMax.
171 !
172 ! Revision 1.4 2008/12/06 08:44:34 mtcampbe
173 ! Updated license.
174 !
175 ! Revision 1.3 2008/11/19 22:17:46 mtcampbe
176 ! Added Illinois Open Source License/Copyright
177 !
178 ! Revision 1.2 2006/09/18 20:30:18 fnajjar
179 ! Activated tile datastructure for inflow bc
180 !
181 ! Revision 1.1 2004/12/01 20:57:47 fnajjar
182 ! Initial revision after changing case
183 !
184 ! Revision 1.5 2004/11/17 16:43:17 haselbac
185 ! Replaced RKUpdate call with call to RkUpdateGeneric
186 !
187 ! Revision 1.4 2004/03/08 22:23:14 fnajjar
188 ! Modified routine to be RFLU-aware and added call to PLAG_rkUpdateGeneric
189 !
190 ! Revision 1.3 2004/02/25 21:56:15 fnajjar
191 ! Moved tile pointers outside do-loop
192 !
193 ! Revision 1.2 2003/01/16 20:15:11 f-najjar
194 ! Removed iRegionGlobal
195 !
196 ! Revision 1.1 2002/10/25 14:16:32 f-najjar
197 ! Initial Import of Rocpart
198 !
199 !
200 !******************************************************************************
201 
202 
203 
204 
205 
206 
207 
subroutine plag_injctilerkupdate(region, iStage)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rkupdategeneric(region, varType, iStage, icBeg, icEnd, ivBeg, ivEnd, cv, cvOld, rhs, rhsSum)
subroutine deregisterfunction(global)
Definition: ModError.F90:469