Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_SendBoundaryValuesAlpha.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: store outgoing data into GenX buffers before updating boundary
26 ! conditions (for now, the routine only sends the density at
27 ! the interface).
28 !
29 ! Description: none.
30 !
31 ! Input: region = dimensions of patches, types of BC`s, flow variables
32 !
33 ! Output: regions%levels%patches = data in buffers for GenX.
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: RFLO_SendBoundaryValuesAlpha.F90,v 1.7 2008/12/06 08:44:01 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2002 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE rflo_sendboundaryvaluesalpha( region )
46 
47  USE moddatatypes
48  USE modglobal, ONLY : t_global
49  USE modbndpatch, ONLY : t_patch
50  USE moddatastruct, ONLY : t_region
53  USE moderror
54  USE modparameters
55  IMPLICIT NONE
56 
57 #include "Indexing.h"
58 
59 ! ... parameters
60  TYPE(t_region) :: region
61 
62 ! ... loop variables
63  INTEGER :: ipatch, i, j, k, ijkc, i2d, n1, n2, ng1, ng2
64 
65 ! ... local variables
66  INTEGER :: ilev, bctype, lbound, icoff, ijcoff, noff
67  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, distrib, indmol
68 
69  REAL(RFREAL) :: tburn, rgas
70  REAL(RFREAL), POINTER :: cv(:,:), dv(:,:), gv(:,:), vals(:,:)
71 
72  TYPE(t_global), POINTER :: global
73  TYPE(t_patch) , POINTER :: patch
74 
75 !******************************************************************************
76 
77  global => region%global
78 
79  CALL registerfunction( global,'RFLO_SendBoundaryValuesAlpha',&
80  'RFLO_SendBoundaryValuesAlpha.F90' )
81 
82 ! store pointers to variables -------------------------------------------------
83 
84  ilev = region%currLevel
85 
86  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
87 
88  indmol = region%levels(ilev)%mixt%indMol
89 
90  cv => region%levels(ilev)%mixt%cv
91  dv => region%levels(ilev)%mixt%dv
92  gv => region%levels(ilev)%mixt%gv
93 
94 ! loop over all cells of the patch (if an interface)
95 
96  DO ipatch=1,region%nPatches
97 
98  patch => region%levels(ilev)%patches(ipatch)
99  bctype = patch%bcType
100  lbound = patch%lbound
101  distrib = patch%mixt%distrib
102  noff = abs(patch%l1end-patch%l1beg) + 1
103  vals => patch%mixt%vals
104 
105  IF ( patch%bcCoupled == bc_external .OR. & ! data from outside
106  (patch%bcCoupled == bc_internal .AND. & ! data from internal APN
107  bctype == bc_injection_apn)) THEN
108 
109  CALL rflo_getpatchindices( region,patch,ilev, &
110  ibeg,iend,jbeg,jend,kbeg,kend )
111 
112 ! --- outgoing data
113 
114  DO k=kbeg,kend
115  DO j=jbeg,jend
116  DO i=ibeg,iend
117  ijkc = indijk(i,j,k,icoff,ijcoff)
118  IF (lbound==1 .OR. lbound==2) THEN
119  n1 = j - jbeg
120  n2 = k - kbeg
121  IF (lbound == 2) THEN
122  ng1 = j - jbeg + 1
123  ELSE
124  ng1 = jend - j + 1
125  ENDIF
126  ng2 = k - kbeg + 1
127  ELSE IF (lbound==3 .OR. lbound==4) THEN
128  n1 = k - kbeg
129  n2 = i - ibeg
130  IF (lbound == 4) THEN
131  ng2 = i - ibeg + 1
132  ELSE
133  ng2 = iend - i + 1
134  ENDIF
135  ng1 = k - kbeg + 1
136  ELSE IF (lbound==5 .OR. lbound==6) THEN
137  n1 = i - ibeg
138  n2 = j - jbeg
139  IF (lbound == 6) THEN
140  ng1 = i - ibeg + 1
141  ELSE
142  ng1 = iend - i + 1
143  ENDIF
144  ng2 = j - jbeg + 1
145  ENDIF
146  IF (bctype>=bc_injection .AND. bctype<=bc_injection+bc_range) THEN
147  i2d = distrib * indij(n1,n2,noff)
148  tburn = vals(bcdat_inject_temp,i2d)
149 
150  IF (bctype==bc_injection_apn) THEN
151  patch%mdotAlp( ng1,ng2) = vals(bcdat_inject_mfrate,i2d)
152  patch%tflmAlp( ng1,ng2) = vals(bcdat_inject_temp ,i2d)
153  patch%rhofvfAlp(1,ng1,ng2) = vals(bcdat_inject_rfvfu ,i2d)
154  patch%rhofvfAlp(2,ng1,ng2) = vals(bcdat_inject_rfvfv ,i2d)
155  patch%rhofvfAlp(3,ng1,ng2) = vals(bcdat_inject_rfvfw ,i2d)
156  ENDIF
157  IF (patch%bFlag(ng1,ng2) == 1) THEN ! burning
158  rgas = mixtperf_r_m( gv(gv_mixt_mol,ijkc*indmol) )
159  patch%rhofAlp(ng1,ng2) = mixtperf_d_prt( dv(dv_mixt_pres,ijkc), &
160  rgas,tburn )
161  ELSE ! not burning
162  patch%rhofAlp(ng1,ng2) = cv(cv_mixt_dens,ijkc)
163  ENDIF
164  ELSE ! not an injection boundary
165  patch%rhofAlp(ng1,ng2) = cv(cv_mixt_dens,ijkc)
166  ENDIF
167  ENDDO ! i
168  ENDDO ! j
169  ENDDO ! k
170 
171  ENDIF ! external BC
172  ENDDO ! iPatch
173 
174 ! finalize --------------------------------------------------------------------
175 
176  CALL deregisterfunction( global )
177 
178 END SUBROUTINE rflo_sendboundaryvaluesalpha
179 
180 !******************************************************************************
181 !
182 ! RCS Revision history:
183 !
184 ! $Log: RFLO_SendBoundaryValuesAlpha.F90,v $
185 ! Revision 1.7 2008/12/06 08:44:01 mtcampbe
186 ! Updated license.
187 !
188 ! Revision 1.6 2008/11/19 22:17:15 mtcampbe
189 ! Added Illinois Open Source License/Copyright
190 !
191 ! Revision 1.5 2006/08/19 15:37:52 mparmar
192 ! Renamed patch variables
193 !
194 ! Revision 1.4 2006/01/25 04:31:33 wasistho
195 ! bug fixed allow injectionAPN to send
196 !
197 ! Revision 1.3 2006/01/25 01:37:04 wasistho
198 ! output tflame_alp and rhofVf_alp to Genx
199 !
200 ! Revision 1.2 2006/01/24 07:05:07 wasistho
201 ! send mdotAlp for InjectionAPN case
202 !
203 ! Revision 1.1 2004/12/01 21:23:53 haselbac
204 ! Initial revision after changing case
205 !
206 ! Revision 1.7 2004/11/13 22:37:50 wasistho
207 ! invert orientation of genx-surface-variables
208 !
209 ! Revision 1.6 2003/11/20 16:40:34 mdbrandy
210 ! Backing out RocfluidMP changes from 11-17-03
211 !
212 ! Revision 1.3 2003/05/15 02:57:00 jblazek
213 ! Inlined index function.
214 !
215 ! Revision 1.2 2002/10/15 00:49:29 jblazek
216 ! Got rid of second nOff ...
217 !
218 ! Revision 1.1 2002/10/15 00:38:18 jblazek
219 ! Added routine to send newest fluids density to GenX.
220 !
221 !******************************************************************************
222 
223 
224 
225 
226 
227 
228 
**********************************************************************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
real(rfreal) function mixtperf_r_m(M)
Definition: MixtPerf_R.F90:54
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)
real(rfreal) function mixtperf_d_prt(P, R, T)
Definition: MixtPerf_D.F90:71
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_sendboundaryvaluesalpha(region)
blockLoc i
Definition: read.cpp:79
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
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