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