Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_USER_EnforcePatchCoords.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: Impose patch coordinates.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! pRegion Pointer to region data
31 !
32 ! Output: None.
33 !
34 ! Notes:
35 ! 1. This routine is of interest if the grid is known not to satisfy exactly
36 ! certain coordinate values, which may affect mass conservation tests
37 ! because the volume is not conserved.
38 ! 2. This routine will have to be hard-coded for each case.
39 ! 3. Routine coded for flexibility, not efficiency...
40 !
41 !******************************************************************************
42 !
43 ! $Id: RFLU_USER_EnforcePatchCoords.F90,v 1.3 2008/12/06 08:45:03 mtcampbe Exp $
44 !
45 ! Copyright: (c) 2003 by the University of Illinois
46 !
47 !******************************************************************************
48 
49 SUBROUTINE rflu_user_enforcepatchcoords(pRegion)
50 
51  USE moddatatypes
52  USE moddatastruct, ONLY: t_region
53  USE modgrid, ONLY: t_grid
54  USE modbndpatch, ONLY: t_patch
55  USE modglobal, ONLY: t_global
56  USE moderror
57  USE modparameters
58 
59  IMPLICIT NONE
60 
61 ! *****************************************************************************
62 ! Declarations and definitions
63 ! *****************************************************************************
64 
65 ! =============================================================================
66 ! Arguments
67 ! =============================================================================
68 
69  TYPE(t_region), POINTER :: pregion
70 
71 ! =============================================================================
72 ! Locals
73 ! =============================================================================
74 
75  CHARACTER(CHRLEN) :: rcsidentstring
76  INTEGER :: ibv,ipatch,ivg
77  TYPE(t_global), POINTER :: global
78  TYPE(t_grid), POINTER :: pgrid
79  TYPE(t_patch), POINTER :: ppatch
80 
81 ! *****************************************************************************
82 ! Start
83 ! *****************************************************************************
84 
85  rcsidentstring = '$RCSfile: RFLU_USER_EnforcePatchCoords.F90,v $ $Revision: 1.3 $'
86 
87  global => pregion%global
88 
89  CALL registerfunction(global,'RFLU_USER_EnforcePatchCoords', &
90  'RFLU_USER_EnforcePatchCoords.F90')
91 
92  IF ( global%verbLevel > verbose_none ) THEN
93  WRITE(stdout,'(A,1X,A)') solver_name,'Enforcing patch coordinates...'
94  END IF ! global%myProcid
95 
96 ! *****************************************************************************
97 ! Set pointers
98 ! *****************************************************************************
99 
100  pgrid => pregion%grid
101 
102 ! *****************************************************************************
103 ! Select case-dependent boundary patch deformation
104 ! *****************************************************************************
105 
106  SELECT CASE ( trim(global%casename) )
107 
108 ! -----------------------------------------------------------------------------
109 ! Endburner problem (old, edge length 0.1)
110 ! -----------------------------------------------------------------------------
111 
112  CASE ( "endburner3pt","endburner5pt","endburner9pt" )
113  DO ipatch=1,pgrid%nPatches
114  ppatch => pregion%patches(ipatch)
115 
116  IF ( global%verbLevel > verbose_low ) THEN
117  WRITE(stdout,'(A,3X,A,1X,I3)') solver_name,'Patch:',ipatch
118  END IF ! global%myProcid
119 
120  DO ibv = 1,ppatch%nBVert
121  ivg = ppatch%bv(ibv)
122 
123  IF ( ipatch == 1 ) THEN
124  pgrid%xyz(zcoord,ivg) = 0.0_rfreal
125  ELSE IF ( ipatch == 2 ) THEN
126  pgrid%xyz(xcoord,ivg) = 0.0_rfreal
127  ELSE IF ( ipatch == 3 ) THEN
128  pgrid%xyz(ycoord,ivg) = 0.0_rfreal
129  ELSE IF ( ipatch == 4 ) THEN
130  pgrid%xyz(ycoord,ivg) = 0.1_rfreal
131  ELSE IF ( ipatch == 5 ) THEN
132  pgrid%xyz(zcoord,ivg) = 0.1_rfreal
133  ELSE IF ( ipatch == 6 ) THEN
134  pgrid%xyz(xcoord,ivg) = 0.1_rfreal
135  ELSE
136  CALL errorstop(global,err_reached_default,__line__)
137  END IF ! iPatch
138  END DO ! ibv
139  END DO ! iPatch
140 
141 ! -----------------------------------------------------------------------------
142 ! Endburner problem (new, edge length 1.0)
143 ! -----------------------------------------------------------------------------
144 
145  CASE ( "endburner3ptnew" )
146  DO ipatch=1,pgrid%nPatches
147  ppatch => pregion%patches(ipatch)
148 
149  IF ( global%verbLevel > verbose_low ) THEN
150  WRITE(stdout,'(A,3X,A,1X,I3)') solver_name,'Patch:',ipatch
151  END IF ! global%myProcid
152 
153  DO ibv = 1,ppatch%nBVert
154  ivg = ppatch%bv(ibv)
155 
156  IF ( ipatch == 1 ) THEN
157  pgrid%xyz(zcoord,ivg) = 1.0_rfreal
158  ELSE IF ( ipatch == 2 ) THEN
159  pgrid%xyz(ycoord,ivg) = 0.0_rfreal
160  ELSE IF ( ipatch == 3 ) THEN
161  pgrid%xyz(xcoord,ivg) = 1.0_rfreal
162  ELSE IF ( ipatch == 4 ) THEN
163  pgrid%xyz(xcoord,ivg) = 0.0_rfreal
164  ELSE IF ( ipatch == 5 ) THEN
165  pgrid%xyz(ycoord,ivg) = 1.0_rfreal
166  ELSE IF ( ipatch == 6 ) THEN
167  pgrid%xyz(zcoord,ivg) = 0.0_rfreal
168  ELSE
169  CALL errorstop(global,err_reached_default,__line__)
170  END IF ! iPatch
171  END DO ! ibv
172  END DO ! iPatch
173 
174 ! -----------------------------------------------------------------------------
175 ! Endburner problem (angled, edge length 0.1)
176 ! -----------------------------------------------------------------------------
177 
178  CASE ( "endburner3pt_angled" )
179  DO ipatch=1,pgrid%nPatches
180  ppatch => pregion%patches(ipatch)
181 
182  IF ( global%verbLevel > verbose_low ) THEN
183  WRITE(stdout,'(A,3X,A,1X,I3)') solver_name,'Patch:',ipatch
184  END IF ! global%myProcid
185 
186  DO ibv = 1,ppatch%nBVert
187  ivg = ppatch%bv(ibv)
188 
189  IF ( ipatch == 1 ) THEN
190  pgrid%xyz(zcoord,ivg) = 0.0_rfreal
191  ELSE IF ( ipatch == 2 ) THEN
192  pgrid%xyz(xcoord,ivg) = 0.0_rfreal
193  ELSE IF ( ipatch == 3 ) THEN
194  pgrid%xyz(ycoord,ivg) = 0.0_rfreal
195  ELSE IF ( ipatch == 4 ) THEN
196  pgrid%xyz(ycoord,ivg) = 0.1_rfreal
197  ELSE IF ( ipatch == 5 ) THEN
198  pgrid%xyz(zcoord,ivg) = 0.1_rfreal
199  ELSE IF ( ipatch == 6 ) THEN
200  pgrid%xyz(xcoord,ivg) = 0.1_rfreal
201  ELSE
202  CALL errorstop(global,err_reached_default,__line__)
203  END IF ! iPatch
204  END DO ! ibv
205  END DO ! iPatch
206 
207 ! ----------------------------------------------------------------------------
208 ! Default - reaching this here is no error
209 ! ----------------------------------------------------------------------------
210 
211  CASE default
212  IF ( global%verbLevel > verbose_low ) THEN
213  WRITE(stdout,'(A,3X,A)') solver_name,'Nothing to be done.'
214  END IF ! global%myProcid
215  END SELECT ! global%casename
216 
217  IF ( global%verbLevel > verbose_none ) THEN
218  WRITE(stdout,'(A,1X,A,1X,A)') solver_name,'Enforcing patch coordinates', &
219  'done.'
220  END IF ! global%myProcid
221 
222 ! *****************************************************************************
223 ! End
224 ! *****************************************************************************
225 
226  CALL deregisterfunction(global)
227 
228 END SUBROUTINE rflu_user_enforcepatchcoords
229 
230 !******************************************************************************
231 !
232 ! RCS Revision history:
233 !
234 ! $Log: RFLU_USER_EnforcePatchCoords.F90,v $
235 ! Revision 1.3 2008/12/06 08:45:03 mtcampbe
236 ! Updated license.
237 !
238 ! Revision 1.2 2008/11/19 22:18:14 mtcampbe
239 ! Added Illinois Open Source License/Copyright
240 !
241 ! Revision 1.1 2005/04/15 15:09:19 haselbac
242 ! Initial revision
243 !
244 ! Revision 1.3 2003/03/31 16:22:20 haselbac
245 ! Added CASE for endburner3pt_angled
246 !
247 ! Revision 1.2 2003/03/20 20:02:32 haselbac
248 ! Modified RegFun call to avoid probs with
249 ! long 'RFLU_USER_EnforcePatchCoords.F90' names
250 !
251 ! Revision 1.1 2003/02/01 01:14:42 haselbac
252 ! Initial revision
253 !
254 !******************************************************************************
255 
256 
257 
258 
259 
260 
261 
262 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflu_user_enforcepatchcoords(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469