Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rocstar/RFLO_GetBoundaryValues.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: obtain boundary values from GenX.
26 !
27 ! Description: none.
28 !
29 ! Input: region = dimensions and topology.
30 !
31 ! Output: region%levels%patch = input values for boundary conditions.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: RFLO_GetBoundaryValues.F90,v 1.7 2008/12/06 08:44:00 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE rflo_getboundaryvalues( region )
44 
45  USE moddatatypes
46  USE modglobal, ONLY : t_global
47  USE modbndpatch, ONLY : t_patch
48  USE moddatastruct, ONLY : t_region
50  USE moderror
51  USE modparameters
52  IMPLICIT NONE
53 
54 #include "Indexing.h"
55 
56 ! ... parameters
57  TYPE(t_region) :: region
58 
59 ! ... loop variables
60  INTEGER :: ipatch, i, j, k, ijkc, n1, n2, ng1, ng2
61 
62 ! ... local variables
63  INTEGER :: ilev, bctype, lbound, icoff, ijcoff, i2d, noff
64  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend
65 
66  REAL(RFREAL), POINTER :: vals(:,:)
67 
68  TYPE(t_global), POINTER :: global
69  TYPE(t_patch) , POINTER :: patch
70 
71 !******************************************************************************
72 
73  global => region%global
74 
75  CALL registerfunction( global,'RFLO_GetBoundaryValues',&
76  'RFLO_GetBoundaryValues.F90' )
77 
78 ! get offsets
79 
80  ilev = region%currLevel
81 
82  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
83 
84 ! loop over all cells of the patch (if an interface)
85 
86  DO ipatch=1,region%nPatches
87 
88  patch => region%levels(ilev)%patches(ipatch)
89  vals => patch%mixt%vals
90  bctype = patch%bcType
91  lbound = patch%lbound
92  noff = abs(patch%l1end-patch%l1beg) + 1
93 
94  IF (patch%bcCoupled == bc_external) THEN ! data from outside
95 
96  CALL rflo_getpatchindices( region,patch,ilev, &
97  ibeg,iend,jbeg,jend,kbeg,kend )
98 
99  DO k=kbeg,kend
100  DO j=jbeg,jend
101  DO i=ibeg,iend
102  ijkc = indijk(i,j,k,icoff,ijcoff)
103  IF (lbound==1 .OR. lbound==2) THEN
104  n1 = j - jbeg
105  n2 = k - kbeg
106  IF (lbound == 2) THEN
107  ng1 = j - jbeg + 1
108  ELSE
109  ng1 = jend - j + 1
110  ENDIF
111  ng2 = k - kbeg + 1
112  ELSE IF (lbound==3 .OR. lbound==4) THEN
113  n1 = k - kbeg
114  n2 = i - ibeg
115  IF (lbound == 4) THEN
116  ng2 = i - ibeg + 1
117  ELSE
118  ng2 = iend - i + 1
119  ENDIF
120  ng1 = k - kbeg + 1
121  ELSE IF (lbound==5 .OR. lbound==6) THEN
122  n1 = i - ibeg
123  n2 = j - jbeg
124  IF (lbound == 6) THEN
125  ng1 = i - ibeg + 1
126  ELSE
127  ng1 = iend - i + 1
128  ENDIF
129  ng2 = j - jbeg + 1
130  ENDIF
131  i2d = indij(n1,n2,noff)
132  IF (bctype>=bc_injection .AND. bctype<=bc_injection+bc_range) THEN
133  IF (patch%bFlag(ng1,ng2) == 1) THEN ! burning
134  vals(bcdat_inject_mfrate,i2d) = patch%mdotAlp(ng1,ng2)
135  ELSE ! not ignited
136  vals(bcdat_inject_mfrate,i2d) = -1._rfreal
137  ENDIF
138  vals(bcdat_inject_temp ,i2d) = patch%tflmAlp ( ng1,ng2)
139  vals(bcdat_inject_rfvfu,i2d) = patch%rhofvfAlp(1,ng1,ng2)
140  vals(bcdat_inject_rfvfv,i2d) = patch%rhofvfAlp(2,ng1,ng2)
141  vals(bcdat_inject_rfvfw,i2d) = patch%rhofvfAlp(3,ng1,ng2)
142  ELSE IF (bctype>=bc_noslipwall .AND. &
143  bctype<=bc_noslipwall+bc_range) THEN
144  ! store Tflm as wall temperature ???
145  ! wall movement deduced from grid deformation
146  ! This block reserved for heat conduction later,
147  ! for now set alpha-variables to zero
148  patch%mdotAlp(:,:) = 0._rfreal
149  patch%tflmAlp(:,:) = 0._rfreal
150  patch%rhofvfAlp(:,:,:) = 0._rfreal
151  ELSE
152  patch%mdotAlp(:,:) = 0._rfreal
153  patch%tflmAlp(:,:) = 0._rfreal
154  patch%rhofvfAlp(:,:,:) = 0._rfreal
155  ENDIF
156  ENDDO
157  ENDDO
158  ENDDO
159 
160  ENDIF ! external BC
161  ENDDO ! iPatch
162 
163 ! finalize
164 
165  CALL deregisterfunction( global )
166 
167 END SUBROUTINE rflo_getboundaryvalues
168 
169 !******************************************************************************
170 !
171 ! RCS Revision history:
172 !
173 ! $Log: RFLO_GetBoundaryValues.F90,v $
174 ! Revision 1.7 2008/12/06 08:44:00 mtcampbe
175 ! Updated license.
176 !
177 ! Revision 1.6 2008/11/19 22:17:14 mtcampbe
178 ! Added Illinois Open Source License/Copyright
179 !
180 ! Revision 1.5 2006/08/19 15:37:48 mparmar
181 ! Renamed patch variables
182 !
183 ! Revision 1.4 2006/03/03 07:11:09 wasistho
184 ! zero out incoming varsAlp for non-injection
185 !
186 ! Revision 1.3 2005/02/01 21:18:09 wasistho
187 ! reactivated bflag
188 !
189 ! Revision 1.2 2005/01/21 00:21:26 wasistho
190 ! temporary commented bflag condition
191 !
192 ! Revision 1.1 2004/12/01 21:23:49 haselbac
193 ! Initial revision after changing case
194 !
195 ! Revision 1.9 2004/11/13 22:37:35 wasistho
196 ! invert orientation of genx-surface-variables
197 !
198 ! Revision 1.8 2003/11/20 16:40:33 mdbrandy
199 ! Backing out RocfluidMP changes from 11-17-03
200 !
201 ! Revision 1.5 2003/05/15 02:57:00 jblazek
202 ! Inlined index function.
203 !
204 ! Revision 1.4 2002/10/12 20:14:35 jblazek
205 ! Corrected bug in indices of bFlag.
206 !
207 ! Revision 1.3 2002/10/10 23:49:48 jblazek
208 ! Changed orientation of surface grid.
209 !
210 ! Revision 1.2 2002/09/27 00:57:09 jblazek
211 ! Changed makefiles - no makelinks needed.
212 !
213 ! Revision 1.1 2002/09/20 22:22:34 jblazek
214 ! Finalized integration into GenX.
215 !
216 !******************************************************************************
217 
218 
219 
220 
221 
222 
223 
**********************************************************************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
j indices k indices k
Definition: Indexing.h:6
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_getpatchindices(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
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
blockLoc i
Definition: read.cpp:79
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
subroutine rflo_getboundaryvalues(region)
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 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