Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_FlowSolver.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: Flow solver of Rocflu, essentially wrapper around time-stepping
26 ! routine.
27 !
28 ! Description: None.
29 !
30 ! Input: None.
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 ! ******************************************************************************
37 !
38 ! $Id: RFLU_FlowSolver.F90,v 1.24 2008/12/06 08:44:30 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2002-2004 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 #ifdef GENX
45 SUBROUTINE rflu_flowsolver(globalGenx,timeSystem,dTimeSystem,genxHandleBc, &
46  genxhandlegm)
47 #else
48 SUBROUTINE rflu_flowsolver(dTimeSystem,dIterSystem,levels)
49 #endif
50 
51  USE moddatatypes
52 #ifdef GENX
53  USE modrocstar, ONLY: t_globalgenx
54 #endif
55  USE moddatastruct, ONLY: t_level,t_region
56  USE modglobal, ONLY: t_global
57  USE moderror
58  USE modmpi
59  USE modparameters
60 
61 #ifdef GENX
64 #endif
65 
66 #ifdef PETSC
68 #endif
69 
71 #ifdef GENX
73 #endif
74 
75  IMPLICIT NONE
76 
77 ! ******************************************************************************
78 ! Arguments
79 ! ******************************************************************************
80 
81 #ifdef GENX
82  INTEGER :: ditersystem
83  INTEGER, INTENT(IN) :: genxhandlebc,genxhandlegm
84  DOUBLE PRECISION, INTENT(IN) :: dtimesystem,timesystem
85  TYPE(t_globalgenx), POINTER :: globalgenx
86 #else
87  INTEGER, INTENT(IN) :: ditersystem
88  REAL(RFREAL), INTENT(IN) :: dtimesystem
89  TYPE(t_level), POINTER :: levels(:)
90 #endif
91 
92 ! ******************************************************************************
93 ! Locals
94 ! ******************************************************************************
95 
96  CHARACTER(CHRLEN) :: rcsidentstring
97 #ifdef GENX
98  INTEGER :: ireg
99  LOGICAL :: corrflag
100 #endif
101  TYPE(t_region), POINTER :: pregion,regions(:)
102  TYPE(t_global), POINTER :: global
103 
104 ! ******************************************************************************
105 ! Start
106 ! ******************************************************************************
107 
108  rcsidentstring = '$RCSfile: RFLU_FlowSolver.F90,v $ $Revision: 1.24 $'
109 
110 #ifdef GENX
111  global => globalgenx%global
112  regions => globalgenx%levels(1)%regions
113 
114  IF ( (global%currentTime-timesystem) > 1.0e-10_rfreal ) THEN
115  corrflag = .true.
116  ELSE
117  corrflag = .false.
118  END IF ! global
119 
120  global%currentTime = timesystem
121  global%timeStamp = timesystem
122 
123  global%genxHandleBc = genxhandlebc
124  global%genxHandleGm = genxhandlegm
125  ditersystem = 0
126 #else
127  global => levels(1)%regions(1)%global
128  regions => levels(1)%regions
129 #endif
130 
131  global%dTimeSystem = dtimesystem
132 
133  CALL registerfunction(global,'RFLU_FlowSolver',&
134  'RFLU_FlowSolver.F90')
135 
136 #ifdef ROCPROF
137  CALL fprofiler_begins("RFLU::FlowSolver")
138 #endif
139 
140 ! ******************************************************************************
141 ! Start time stepping
142 ! ******************************************************************************
143 
144 ! ==============================================================================
145 ! Write header for convergence history
146 ! ==============================================================================
147 
148  IF ( global%myProcid==masterproc .AND. global%verbLevel/=verbose_none ) THEN
149  WRITE(stdout,'(A)') solver_name
150  IF ( global%flowType == flow_steady ) THEN
151  WRITE(stdout,1000) solver_name,solver_name
152  ELSE IF ( global%flowType == flow_unsteady ) THEN
153  WRITE(stdout,1010) solver_name,solver_name
154  END IF ! global%flowType
155  END IF ! global%myProcid
156 
157 #ifdef GENX
158 ! ==============================================================================
159 ! Get current boundary condition values for computing time steps
160 ! ==============================================================================
161 
162  DO ireg = 1,global%nRegionsLocal
163  pregion => regions(ireg)
164  CALL com_call_function(global%genxHandleBc,2,0.0_rfreal,1)
165  CALL rflu_putboundaryvaluesalpha(pregion)
166  CALL com_call_function(global%genxHandleBc,2,0.0_rfreal,2)
167  CALL rflu_genx_initbflag(pregion)
168  CALL rflu_getboundaryvalues(pregion)
169  END DO ! iReg
170 
171 ! ==============================================================================
172 ! Update geometry if starting corrector step
173 ! ==============================================================================
174 
175  IF ( corrflag .EQV. .true. ) THEN
176  IF ( global%myProcid == masterproc .AND. &
177  global%verbLevel > verbose_none ) THEN
178  WRITE(stdout,'(A,1X,A)') solver_name,'Starting corrector step.'
179  END IF ! global
180 
181  DO ireg = 1,global%nRegionsLocal
182  pregion => regions(ireg)
183  CALL rflu_buildgeometry(pregion)
184  END DO ! iReg
185  END IF ! corrFlag
186 #endif
187 
188 ! ******************************************************************************
189 ! Call time-stepping routines
190 ! ******************************************************************************
191 
192  IF (global%solverType == solv_explicit) THEN
193  IF (global%cycleType == mgcycle_no) THEN
194  CALL rflu_timestepping(dtimesystem,ditersystem,regions)
195  ELSE
196  CALL errorstop(global,err_reached_default,__line__)
197  END IF ! global%cycleType
198  ELSE
199 #ifdef PETSC
200  CALL rflu_nk_timestepping(dtimesystem,ditersystem,regions)
201 #endif
202  ENDIF ! global%solverType
203 
204 ! ******************************************************************************
205 ! End
206 ! ******************************************************************************
207 
208 #ifdef ROCPROF
209  CALL fprofiler_ends("RFLU::FlowSolver")
210 #endif
211 
212  CALL deregisterfunction(global)
213 
214 1000 FORMAT(a,2x,' iter',4x,'res-norm',5x,'force-x',6x,'force-y',6x,'force-z', &
215  6x,'mass-in',6x,'mass-out',/,a,1x,84('-'))
216 1010 FORMAT(a,2x,' time',10x,'delta-t',6x,'force-x',6x,'force-y',6x,'force-z', &
217  6x,'mass-in',6x,'mass-out'/,a,1x,90('-'))
218 
219 END SUBROUTINE rflu_flowsolver
220 
221 ! ******************************************************************************
222 !
223 ! RCS Revision history:
224 !
225 ! $Log: RFLU_FlowSolver.F90,v $
226 ! Revision 1.24 2008/12/06 08:44:30 mtcampbe
227 ! Updated license.
228 !
229 ! Revision 1.23 2008/11/19 22:17:42 mtcampbe
230 ! Added Illinois Open Source License/Copyright
231 !
232 ! Revision 1.22 2007/04/20 16:07:49 mtcampbe
233 ! Updating for burnout support function RFLU_GENX_InitBFLAG
234 !
235 ! Revision 1.21 2005/09/14 15:59:33 haselbac
236 ! Minor clean-up
237 !
238 ! Revision 1.20 2005/09/13 20:49:39 mtcampbe
239 ! Added profiling calls
240 !
241 ! Revision 1.19 2005/08/03 18:30:32 hdewey2
242 ! Add IF for solverType
243 !
244 ! Revision 1.18 2005/08/02 18:26:14 hdewey2
245 ! Added NK capability
246 !
247 ! Revision 1.17 2004/10/19 19:29:17 haselbac
248 ! Cosmetics only
249 !
250 ! Revision 1.16 2003/06/20 22:34:58 haselbac
251 ! Cosmetic changes
252 !
253 ! Revision 1.15 2003/05/09 17:01:03 jiao
254 ! Renamed the COM_call_function_handlers to COM_call_function.
255 !
256 ! Revision 1.14 2003/03/05 20:39:31 jiao
257 ! ACH: Added calls to get correct data at every time step inside/outside of PC
258 !
259 ! Revision 1.13 2003/02/24 18:05:38 haselbac
260 ! Bug fix and clean-up
261 !
262 ! Revision 1.12 2003/02/24 17:25:20 haselbac
263 ! Add geometry computation for PC iterations within GENX
264 !
265 ! Revision 1.11 2003/02/24 14:50:33 haselbac
266 ! Bug fix: Added missing initialization of timeStamp
267 !
268 ! Revision 1.10 2002/10/19 22:22:23 haselbac
269 ! Removed RFLU_GetBValues - not needed here with proper calls
270 !
271 ! Revision 1.9 2002/10/19 16:13:19 haselbac
272 ! Removed include for Roccom, cosmetic changes to output
273 !
274 ! Revision 1.8 2002/10/17 20:04:52 haselbac
275 ! Added timeSystem to argument list (GENX)
276 !
277 ! Revision 1.7 2002/10/17 14:12:59 haselbac
278 ! Added RFLU_GetBValues for proper restart (discussion with Jim J.)
279 !
280 ! Revision 1.6 2002/10/05 19:21:30 haselbac
281 ! GENX integration, some cosmetics
282 !
283 ! Revision 1.5 2002/09/09 15:49:58 haselbac
284 ! global now under regions
285 !
286 ! Revision 1.4 2002/06/17 13:34:12 haselbac
287 ! Prefixed SOLVER_NAME to all screen output
288 !
289 ! Revision 1.3 2002/05/04 17:09:00 haselbac
290 ! Uncommented writing of convergence file
291 !
292 ! Revision 1.2 2002/04/11 19:02:21 haselbac
293 ! Cosmetic changes and some preparation work
294 !
295 ! Revision 1.1 2002/03/14 19:12:00 haselbac
296 ! Initial revision
297 !
298 ! ******************************************************************************
299 
300 
301 
302 
303 
304 
305 
subroutine rflu_flowsolver(dTimeSystem, dIterSystem, levels)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine, public rflu_buildgeometry(pRegion, sypeFaceFlag)
subroutine, public rflu_nk_timestepping(dTimeSystem, dIterSystem, regions)
subroutine rflu_putboundaryvaluesalpha(region)
subroutine, public rflu_genx_initbflag(pRegion)
void int int REAL * x
Definition: read.cpp:74
subroutine rflu_timestepping(dTimeSystem, dIterSystem, regions)
subroutine rflu_getboundaryvalues(region)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
RT a() const
Definition: Line_2.h:140