Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_ExplicitMultiStage.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: Calculate solution at a new time level/iteration.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! regions Region data
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 ! ******************************************************************************
37 !
38 ! $Id: RFLU_ExplicitMultiStage.F90,v 1.7 2008/12/06 08:44:29 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2005-2006 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 SUBROUTINE rflu_explicitmultistage(regions)
45 
46  USE moddatatypes
47  USE modparameters
48  USE modglobal, ONLY: t_global
49  USE moderror
50  USE moddatastruct, ONLY: t_region
51  USE modgrid, ONLY: t_grid
52  USE modmixture, ONLY: t_mixt
53  USE modmpi
54 
56  USE rflu_modmpi
58 
61  rflu_setvars, &
63 
64  IMPLICIT NONE
65 
66 ! ******************************************************************************
67 ! Declarations and definitions
68 ! ******************************************************************************
69 
70 ! ==============================================================================
71 ! Arguments
72 ! ==============================================================================
73 
74  TYPE(t_region), POINTER :: regions(:)
75 
76 ! ==============================================================================
77 ! Locals
78 ! ==============================================================================
79 
80  INTEGER :: ireg,istage
81  TYPE(t_global), POINTER :: global
82  TYPE(t_grid), POINTER :: pgrid
83  TYPE(t_mixt), POINTER :: pmixt
84  TYPE(t_region), POINTER :: pregion
85 
86 ! ******************************************************************************
87 ! Start
88 ! ******************************************************************************
89 
90  global => regions(1)%global
91 
92  CALL registerfunction(global,'RFLU_ExplicitMultiStage',&
93  'RFLU_ExplicitMultiStage.F90')
94 
95 ! ******************************************************************************
96 ! Loop over stages
97 ! ******************************************************************************
98 
99  DO istage = 1,global%nrkSteps
100 
101 ! ==============================================================================
102 ! Loop over regions, update and send variables
103 ! ==============================================================================
104 
105  DO ireg = 1,global%nRegionsLocal
106  pregion => regions(ireg)
107  pgrid => pregion%grid
108  pmixt => pregion%mixt
109 
110  pregion%irkStep = istage
111 
112 ! ------------------------------------------------------------------------------
113 ! Store previous solution
114 ! ------------------------------------------------------------------------------
115 
116  IF ( istage == 1 ) THEN
117  CALL rflu_ems_setcvold(pregion)
118  END IF ! iStage
119 
120 ! ------------------------------------------------------------------------------
121 ! Compute residual and zero residuals in dummy cells
122 ! ------------------------------------------------------------------------------
123 
124  CALL rflu_ems_computeresidual(pregion)
125  CALL rflu_zerovirtualcellvars(pregion,pmixt%rhs)
126 
127 ! ------------------------------------------------------------------------------
128 ! Update conserved variables, check validity and positivity
129 ! ------------------------------------------------------------------------------
130 
131  CALL rflu_ems_updateconservedvars(pregion)
132  CALL rflu_checkvaliditywrapper(pregion)
133  CALL rflu_checkpositivitywrapper(pregion)
134 
135 ! ------------------------------------------------------------------------------
136 ! Send variables to other regions
137 ! ------------------------------------------------------------------------------
138 
139  CALL rflu_mpi_isendwrapper(pregion)
140 
141 ! ------------------------------------------------------------------------------
142 ! Update other variables
143 ! ------------------------------------------------------------------------------
144 
145  CALL rflu_setvars(pregion,1,pgrid%nCells)
146  END DO ! iReg
147 
148 ! ==============================================================================
149 ! Copy variables between regions on same process
150 ! ==============================================================================
151 
152  CALL rflu_mpi_copywrapper(regions)
153 
154 ! ==============================================================================
155 ! Loop over regions, receive variables and update
156 ! ==============================================================================
157 
158  DO ireg = 1,global%nRegionsLocal
159  pregion => regions(ireg)
160  pgrid => pregion%grid
161 
162 ! ------------------------------------------------------------------------------
163 ! Receive variables from other regions
164 ! ------------------------------------------------------------------------------
165 
166  CALL rflu_mpi_recvwrapper(pregion)
167 
168 ! ------------------------------------------------------------------------------
169 ! Update other variables in virtual cells
170 ! ------------------------------------------------------------------------------
171 
172  CALL rflu_setvars(pregion,pgrid%nCells+1,pgrid%nCellsTot)
173 
174 ! ------------------------------------------------------------------------------
175 ! Transform variables in virtual cells associated with related patches
176 ! ------------------------------------------------------------------------------
177 
178  CALL rflu_relp_transformwrapper(pregion)
179  END DO ! iReg
180 
181 ! ==============================================================================
182 ! Loop over regions, clear requests
183 ! ==============================================================================
184 
185  DO ireg = 1,global%nRegionsLocal
186  pregion => regions(ireg)
187  pgrid => pregion%grid
188 
189  CALL rflu_mpi_clearrequestwrapper(pregion)
190  END DO ! iReg
191  END DO ! iStage
192 
193 ! ******************************************************************************
194 ! End
195 ! ******************************************************************************
196 
197  CALL deregisterfunction(global)
198 
199 END SUBROUTINE rflu_explicitmultistage
200 
201 ! ******************************************************************************
202 !
203 ! RCS Revision history:
204 !
205 ! $Log: RFLU_ExplicitMultiStage.F90,v $
206 ! Revision 1.7 2008/12/06 08:44:29 mtcampbe
207 ! Updated license.
208 !
209 ! Revision 1.6 2008/11/19 22:17:42 mtcampbe
210 ! Added Illinois Open Source License/Copyright
211 !
212 ! Revision 1.5 2006/04/07 15:19:22 haselbac
213 ! Removed tabs
214 !
215 ! Revision 1.4 2006/03/26 20:28:43 haselbac
216 ! Changed to wrappers bcos of GL model
217 !
218 ! Revision 1.3 2006/03/25 22:01:35 haselbac
219 ! Added call to transforming data on related patches
220 !
221 ! Revision 1.2 2005/12/03 19:45:20 haselbac
222 ! Apparent bug fix: Separated call to RFLU_MPI_ClearRequestWrapper into separate loop
223 !
224 ! Revision 1.1 2005/05/16 20:36:29 haselbac
225 ! Initial revision
226 !
227 ! ******************************************************************************
228 
229 
230 
231 
232 
233 
234 
subroutine rflu_setvars(pRegion, icgBeg, icgEnd)
subroutine, public rflu_mpi_isendwrapper(pRegion)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflu_zerovirtualcellvars(pRegion, var)
subroutine, public rflu_ems_computeresidual(pRegion)
subroutine, public rflu_mpi_clearrequestwrapper(pRegion)
subroutine, public rflu_ems_setcvold(pRegion)
subroutine rflu_explicitmultistage(regions)
subroutine rflu_checkpositivitywrapper(pRegion)
subroutine, public rflu_mpi_recvwrapper(pRegion)
subroutine, public rflu_relp_transformwrapper(pRegion)
subroutine, public rflu_ems_updateconservedvars(pRegion)
subroutine, public rflu_mpi_copywrapper(regions)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflu_checkvaliditywrapper(pRegion)