Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_FindThrustPatches.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: search for all patches of a region to be used
26 ! for computing the thrust.
27 !
28 ! Description: none.
29 !
30 ! Input: region%levels%grid = dimensions, grid data, face vectors.
31 !
32 ! Output: patch%thrustCalc = patch marked for thruct calculation (T/F).
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: RFLO_FindThrustPatches.F90,v 1.4 2008/12/06 08:44:27 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE rflo_findthrustpatches( region,iReg )
45 
46  USE moddatatypes
47  USE modbndpatch, ONLY : t_patch
48  USE moddatastruct, ONLY : t_region
49  USE modglobal, ONLY : t_global
52  USE moderror
53  USE modparameters
54  IMPLICIT NONE
55 
56 #include "Indexing.h"
57 
58 ! ... parameters
59  INTEGER :: ireg
60 
61  TYPE(t_region) :: region
62 
63 ! ... loop variables
64  INTEGER :: ipatch, i, j, k
65 
66 ! ... local variables
67  INTEGER :: ilev, lbound, ibeg, iend, jbeg, jend, kbeg, kend, idir, jdir, kdir
68  INTEGER :: plane, bctype, inoff, ijnoff, ijkn0, ijkn1
69 
70  LOGICAL :: found
71 
72  REAL(RFREAL), POINTER :: xyz(:,:)
73  REAL(RFREAL) :: tol=1.0e-6
74 
75  TYPE(t_global), POINTER :: global
76  TYPE(t_patch), POINTER :: patch
77 
78 !******************************************************************************
79 
80  global => region%global
81 
82  CALL registerfunction( global,'RFLO_FindThrustPatches',&
83  'RFLO_FindThrustPatches.F90' )
84 
85 ! get dimensions and pointers -------------------------------------------------
86 
87  ilev = region%currLevel
88 
89  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
90 
91  xyz => region%levels(ilev)%grid%xyz
92  plane = global%thrustPlane
93 
94 ! thrust plane within region? use tolerance since plane will be at boundary ---
95 
96 ! IF (global%thrustCoord<MINVAL(xyz(plane,:)) .OR. &
97 ! global%thrustCoord>MAXVAL(xyz(plane,:))) THEN
98  IF (global%thrustCoord-minval(xyz(plane,:)) < -tol .OR. &
99  global%thrustCoord-maxval(xyz(plane,:)) > tol) THEN
100  DO ipatch=1,region%nPatches
101  region%levels(ilev)%patches(ipatch)%thrustCalc = .false.
102  ENDDO
103  goto 999
104  ENDIF
105 
106 ! loop over patches -----------------------------------------------------------
107 
108  DO ipatch=1,region%nPatches
109 
110  patch => region%levels(ilev)%patches(ipatch)
111  bctype = patch%bcType
112 
113  patch%thrustCalc = .false.
114 
115  IF ((bctype>=bc_outflow .AND. bctype<=bc_outflow+ bc_range) .OR. &
116  (bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
117  (bctype>=bc_regionint .AND. bctype<=bc_regionint+ bc_range) .OR. &
118  (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range)) THEN
119 
120 ! --- get dimensions of the patch
121 
122  lbound = patch%lbound
123 
124  CALL rflo_getpatchindicesnodes( region,patch,ilev,ibeg,iend, &
125  jbeg,jend,kbeg,kend )
127 
128 ! --- loop over all nodes of the patch
129 
130  found = .true.
131  DO k=kbeg,kend
132  DO j=jbeg,jend
133  DO i=ibeg,iend
134  ijkn0 = indijk(i ,j ,k ,inoff,ijnoff)
135  ijkn1 = indijk(i+idir,j+jdir,k+kdir,inoff,ijnoff)
136 ! IF (MIN(xyz(plane,ijkN0),xyz(plane,ijkN1))>global%thrustCoord .OR.&
137 ! MAX(xyz(plane,ijkN0),xyz(plane,ijkN1))<global%thrustCoord) &
138  IF (global%thrustCoord-min(xyz(plane,ijkn0),xyz(plane,ijkn1)) < -tol .OR.&
139  global%thrustCoord-max(xyz(plane,ijkn0),xyz(plane,ijkn1)) > tol) &
140  found = .false.
141  ENDDO
142  ENDDO
143  ENDDO
144  IF (found) patch%thrustCalc = .true.
145 
146  ENDIF ! bcType
147  IF (global%verbLevel>=verbose_high .AND. patch%thrustCalc) &
148  WRITE(stdout,'(A,I5,A,I3)') ' - region ',ireg,', patch ',ipatch
149 
150  ENDDO ! iPatch
151 
152 ! finalize --------------------------------------------------------------------
153 
154 999 CONTINUE
155 
156  CALL deregisterfunction( global )
157 
158 END SUBROUTINE rflo_findthrustpatches
159 
160 !******************************************************************************
161 !
162 ! RCS Revision history:
163 !
164 ! $Log: RFLO_FindThrustPatches.F90,v $
165 ! Revision 1.4 2008/12/06 08:44:27 mtcampbe
166 ! Updated license.
167 !
168 ! Revision 1.3 2008/11/19 22:17:38 mtcampbe
169 ! Added Illinois Open Source License/Copyright
170 !
171 ! Revision 1.2 2007/11/15 09:46:38 rfiedler
172 ! Use a tolerance when checking whether nodes are on thrust plane.
173 !
174 ! Revision 1.1 2004/11/29 20:51:39 wasistho
175 ! lower to upper case
176 !
177 ! Revision 1.5 2003/11/20 16:40:39 mdbrandy
178 ! Backing out RocfluidMP changes from 11-17-03
179 !
180 ! Revision 1.1 2003/06/02 17:12:00 jblazek
181 ! Added computation of thrust.
182 !
183 !******************************************************************************
184 
185 
186 
187 
188 
189 
190 
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE ibeg
subroutine rflo_getpatchdirection(patch, idir, jdir, kdir)
j indices k indices k
Definition: Indexing.h:6
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_getpatchindices(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jdir
Definition: patch.h:74
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode iend
subroutine rflo_getpatchindicesnodes(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
blockLoc i
Definition: read.cpp:79
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE idir
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
subroutine rflo_findthrustpatches(region, iReg)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
j indices j
Definition: Indexing.h:6
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode jend
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE kdir
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode jbeg
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode kbeg
subroutine deregisterfunction(global)
Definition: ModError.F90:469