Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PEUL_BcondInflow.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: update values in dummy cells for smoke at outflow boundary patch.
26 !
27 ! Description: none.
28 !
29 ! Input: region = region dimensions, user input
30 ! patch = current patch.
31 !
32 ! Output: region%levels%peul = smoke variables in dummy cells.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: PEUL_BcondInflow.F90,v 1.4 2008/12/06 08:44:38 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE peul_bcondinflow( region,patch )
45 
46  USE moddatatypes
47  USE modbndpatch, ONLY : t_patch
48  USE moddatastruct, ONLY : t_region
49  USE modglobal, ONLY : t_global
50  USE moderror
51  USE modparameters
53 
56  IMPLICIT NONE
57 
58 #include "Indexing.h"
59 
60 ! ... parameters
61  TYPE(t_region), INTENT(INOUT) :: region
62  TYPE(t_patch), INTENT(IN) :: patch
63 
64 ! ... loop variables
65  INTEGER :: idum, i, j, k
66 
67 ! ... local variables
68  CHARACTER(CHRLEN) :: rcsidentstring
69 
70  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, idir, jdir, kdir
71  INTEGER :: ilev, lobound, icoff, ijcoff, ijkc, ijkc1, ijkd
72  INTEGER :: nptypes, noff, distrib, n1, n2, i2d
73 
74  REAL(RFREAL), POINTER :: cv(:,:), vals(:,:)
75 
76  TYPE(t_global), POINTER :: global
77 
78 !******************************************************************************
79 
80  rcsidentstring = '$RCSfile: PEUL_BcondInflow.F90,v $ $Revision: 1.4 $'
81 
82  global => region%global
83 
84  CALL registerfunction( global,'PEUL_BcondInflow',&
85  'PEUL_BcondInflow.F90' )
86 
87 ! begin -----------------------------------------------------------------------
88 
89 ! get dimensions and pointers
90 
91  ilev = region%currLevel
92  lobound = patch%lbound
93 
94  CALL rflo_getpatchindices( region,patch,ilev, &
95  ibeg,iend,jbeg,jend,kbeg,kend )
97  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
98 
99  noff = abs(patch%l1end-patch%l1beg) + 1
100  distrib = patch%peul%distrib
101 
102  cv => region%levels(ilev)%peul%cv
103  vals => patch%peul%vals
104 
105  nptypes = region%peulInput%nPtypes
106  IF (region%levels(ilev)%peul%nCv /= nptypes) &
107  CALL errorstop( global,err_peul_npmismatch,__line__ )
108  IF (lbound(vals,1) /= 1 .OR. ubound(vals,1) /= nptypes) &
109  CALL errorstop( global,err_peul_npmismatch,__line__ )
110 
111 ! loop over all cells of a patch
112 
113  DO idum=1,region%nDumCells
114  DO k=kbeg,kend
115  DO j=jbeg,jend
116  DO i=ibeg,iend
117 
118  ijkc = indijk(i-(idum-1)*idir,j-(idum-1)*jdir,k-(idum-1)*kdir,icoff,ijcoff)
119  ijkc1 = indijk(i-(idum-2)*idir,j-(idum-2)*jdir,k-(idum-2)*kdir,icoff,ijcoff)
120  ijkd = indijk(i-idum*idir,j-idum*jdir,k-idum*kdir,icoff,ijcoff)
121 
122  IF (idum == 1) THEN
123 
124  SELECT CASE(lobound)
125  CASE (1:2)
126  n1 = j - jbeg
127  n2 = k - kbeg
128  CASE (3:4)
129  n1 = k - kbeg
130  n2 = i - ibeg
131  CASE(5:6)
132  n1 = i - ibeg
133  n2 = j - jbeg
134  END SELECT ! lobound
135 
136  i2d = distrib * indij(n1,n2,noff)
137 
138  cv(:,ijkd) = 2._rfreal*vals(:,i2d) - cv(:,ijkc)
139 
140  ELSE
141 
142  cv(:,ijkd) = 2._rfreal*cv(:,ijkc ) - cv(:,ijkc1)
143 
144  END IF ! idum
145 
146  ENDDO ! i
147  ENDDO ! j
148  ENDDO ! k
149  ENDDO ! idum
150 
151 ! finalize --------------------------------------------------------------------
152 
153  CALL deregisterfunction( global )
154 
155 END SUBROUTINE peul_bcondinflow
156 
157 !******************************************************************************
158 !
159 ! RCS Revision history:
160 !
161 ! $Log: PEUL_BcondInflow.F90,v $
162 ! Revision 1.4 2008/12/06 08:44:38 mtcampbe
163 ! Updated license.
164 !
165 ! Revision 1.3 2008/11/19 22:17:51 mtcampbe
166 ! Added Illinois Open Source License/Copyright
167 !
168 ! Revision 1.2 2006/08/19 15:40:16 mparmar
169 ! Renamed patch variables
170 !
171 ! Revision 1.1 2004/12/01 21:09:14 haselbac
172 ! Initial revision after changing case
173 !
174 ! Revision 1.3 2003/05/15 02:57:05 jblazek
175 ! Inlined index function.
176 !
177 ! Revision 1.2 2003/04/09 15:12:04 jferry
178 ! miscellaneous stylistic changes
179 !
180 ! Revision 1.1 2003/04/07 18:29:01 jferry
181 ! added inflow boundary condition and initialization to a constant
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
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_getpatchindices(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
**********************************************************************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 peul_bcondinflow(region, patch)
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)
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
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
**********************************************************************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