Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_Update.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 step for PLAG module.
26 !
27 ! Description: none.
28 !
29 ! Input: region = current region
30 ! iReg = current region number
31 ! iStage = current RK stage.
32 !
33 ! Output: region%plag = plag variables
34 !
35 ! Notes: This corresponds to Part IV Steps 10d and Part V
36 ! in RocfluidMP framework.
37 !
38 !******************************************************************************
39 !
40 ! $Id: PLAG_Update.F90,v 1.4 2009/10/26 00:19:32 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2002 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE plag_update( region, iReg, iStage )
47 
48  USE moddatatypes
49  USE moddatastruct, ONLY : t_region
50  USE modglobal, ONLY : t_global
51  USE modmixture, ONLY : t_mixt_input
52  USE modpartlag, ONLY : t_plag
53  USE moderror
54  USE modparameters
56 
58 
65  plag_updatedatastruct, &
67 
68  IMPLICIT NONE
69 
70 ! ... parameters
71  TYPE(t_region), INTENT(INOUT), TARGET :: region
72 
73  INTEGER, INTENT(IN) :: ireg, istage
74 
75 ! ... loop variables
76 
77 ! ... local variables
78  CHARACTER(CHRLEN) :: rcsidentstring
79 
80  INTEGER :: ilev
81 
82  TYPE(t_plag), POINTER :: pplag
83  TYPE(t_global), POINTER :: global
84 
85 !******************************************************************************
86 
87  rcsidentstring = '$RCSfile: PLAG_Update.F90,v $ $Revision: 1.4 $'
88 
89  global => region%global
90 
91  CALL registerfunction( global, 'PLAG_Update',&
92  'PLAG_Update.F90' )
93 
94 ! get dimensions and set pointer ----------------------------------------------
95 
96  ilev = region%currLevel
97  pplag => region%levels(ilev)%plag
98 
99 ! Main algorithm for discrete particle evolution ------------------------------
100 ! Active for non-zero number of particles in region --------------------------
101 
102  IF ( pplag%nPcls > 0 ) THEN
103 
104 ! - Calculate RHS for position vector -----------------------------------------
105 
106 ! WRITE(STDOUT,'(A)') ' Entering PLAG_CalcRhsPosition', iReg, iStage
107  CALL plag_calcrhsposition( region )
108 
109 ! - Invoke RK Update ----------------------------------------------------------
110 
111 ! WRITE(STDOUT,'(A)') ' Entering PLAG_RKUpdate', iReg, iStage
112  CALL rkupdategeneric(region,var_type_point,istage,1,pplag%nPcls,1, &
113  pplag%nCv,pplag%cv,pplag%cvOld,pplag%rhs,pplag%rhsSum)
114 
115 ! - Apply wall bouncing algorithm ---------------------------------------------
116 
117 ! WRITE(STDOUT,'(A)') ' Entering PLAG_WallBounce'
118  CALL plag_wallbounce( region )
119 
120 ! - Invoke particle location search for outflow -------------------------------
121 
122 ! WRITE(STDOUT,'(A)') ' Entering PLAG_GetCellIndicesOutflow'
123  CALL plag_getcellindicesoutflow( region )
124 
125 ! - Remove exiting particle from datastructure --------------------------------
126 
127 ! WRITE(STDOUT,'(A)') ' Entering PLAG_PatchRemoveDataOutflow'
128  CALL plag_patchremovedataoutflow( region, ireg )
129 
130 ! - Invoke particle location search -------------------------------------------
131 
132 ! WRITE(STDOUT,'(A)') ' Entering PLAG_GetCellIndices'
133  CALL plag_getcellindices( region, ireg )
134 
135 ! - Remove particle with a delete status from datastructure -------------------
136  CALL plag_updatedatastruct( region,ireg )
137 
138  END IF ! nPcls
139 
140 ! Invoke injection algorithm at last RK stage ----------------------------------
141 
142  IF ( istage == global%nrkSteps ) THEN
143 
144 ! WRITE(STDOUT,'(A)') ' Entering PLAG_InjcEjectParticle'
145  CALL plag_injcejectparticle( region, ireg )
146 
147 ! WRITE(STDOUT,'(A,I4,I8)') ' iReg: nPcls = ',iReg, pPlag%nPcls
148 
149  END IF ! iStage
150 
151 ! Invoke breakup algorithm at last RK stage -----------------------------------
152 
153  IF ( region%plagInput%breakupModel > plag_breakup_nomodel .AND. &
154  istage == global%nrkSteps ) THEN
155  CALL plag_calcbreakup( region, ireg )
156  END IF ! iStage
157 
158 ! finalize --------------------------------------------------------------------
159 
160  CALL deregisterfunction( global )
161 
162 END SUBROUTINE plag_update
163 
164 !******************************************************************************
165 !
166 ! RCS Revision history:
167 !
168 ! $Log: PLAG_Update.F90,v $
169 ! Revision 1.4 2009/10/26 00:19:32 mtcampbe
170 ! Updates for completion of NATIVE_MP_IO
171 !
172 ! Revision 1.3 2008/12/06 08:44:36 mtcampbe
173 ! Updated license.
174 !
175 ! Revision 1.2 2008/11/19 22:17:48 mtcampbe
176 ! Added Illinois Open Source License/Copyright
177 !
178 ! Revision 1.1 2004/12/01 20:58:18 fnajjar
179 ! Initial revision after changing case
180 !
181 ! Revision 1.20 2004/11/17 16:44:11 haselbac
182 ! Replaced RKUpdate call with call to RkUpdateGeneric
183 !
184 ! Revision 1.19 2004/08/05 20:09:54 fnajjar
185 ! Reactivate PLAG_UpdateDataStruct
186 !
187 ! Revision 1.18 2004/04/09 23:16:36 fnajjar
188 ! Added call to PLAG_UpdateDataStruct for appropriate deletion kernel
189 !
190 ! Revision 1.17 2004/03/26 21:30:54 fnajjar
191 ! Removed RFLU-specific calls since PLAG_RFLU_Update is created
192 !
193 ! Revision 1.16 2004/03/22 23:48:30 fnajjar
194 ! Activated RFLU-aware trajectory-based search algorithm
195 !
196 ! Revision 1.15 2004/03/15 21:09:04 haselbac
197 ! Changed name of particle location routine
198 !
199 ! Revision 1.14 2004/03/08 22:34:36 fnajjar
200 ! Moved pRegion section and added PLAG_RFLU_InjectionDriver
201 !
202 ! Revision 1.13 2004/03/05 23:21:00 haselbac
203 ! Added (as yet commented-out) call to PLAG_RFLU_FindParticleCellsTraj
204 !
205 ! Revision 1.12 2004/02/26 21:02:23 haselbac
206 ! Added initial RFLU support
207 !
208 ! Revision 1.11 2004/02/06 21:18:20 fnajjar
209 ! Initial Integration of Rocpart with Rocflu
210 !
211 ! Revision 1.10 2003/09/13 20:14:22 fnajjar
212 ! Added infrastructure for Breakup model
213 !
214 ! Revision 1.9 2003/05/28 15:16:11 fnajjar
215 ! Removed obsolete PLAG_mixt calls as embedded in Rocinteract
216 !
217 ! Revision 1.8 2003/05/07 00:02:07 fnajjar
218 ! Included I/O for nPcls
219 !
220 ! Revision 1.7 2003/04/15 23:02:38 fnajjar
221 ! Removed dead code section
222 !
223 ! Revision 1.6 2003/03/04 22:12:35 jferry
224 ! Initial import of Rocinteract
225 !
226 ! Revision 1.5 2003/02/04 19:07:33 f-najjar
227 ! Aligned calls in routine with RocfluidMP framework
228 !
229 ! Revision 1.4 2003/01/17 19:31:15 f-najjar
230 ! Included iReg in calling sequence for PLAG_PatchRemoveDataOutflow
231 !
232 ! Revision 1.3 2003/01/16 20:44:21 f-najjar
233 ! Include iReg in calling sequence of PLAG_getCellIndices
234 !
235 ! Revision 1.2 2003/01/10 19:09:10 f-najjar
236 ! Included iReg in calling sequence
237 !
238 ! Revision 1.1 2002/10/25 14:20:32 f-najjar
239 ! Initial Import of Rocpart
240 !
241 !
242 !******************************************************************************
243 
244 
245 
246 
247 
248 
249 
subroutine plag_wallbounce(region)
subroutine plag_injcejectparticle(region, iReg)
subroutine plag_getcellindicesoutflow(region)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rkupdategeneric(region, varType, iStage, icBeg, icEnd, ivBeg, ivEnd, cv, cvOld, rhs, rhsSum)
subroutine plag_calcbreakup(region, iReg)
subroutine plag_patchremovedataoutflow(region, iReg)
subroutine plag_calcrhsposition(region)
subroutine plag_getcellindices(region, iReg)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine plag_update(region, iReg, iStage)
Definition: PLAG_Update.F90:46