Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_floRansBcondInjection.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 RaNS variables in dummy cells at injection patch
26 !
27 ! Description: none.
28 !
29 ! Input: region = region dimensions, user input
30 ! patch = current patch.
31 !
32 ! Output: region%levels%turb%cv = RaNS variables in dummy cells.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: TURB_floRansBcondInjection.F90,v 1.6 2008/12/06 08:44:44 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE turb_floransbcondinjection( region,patch )
45 
46  USE moddatatypes
47  USE modbndpatch, ONLY : t_patch
48  USE moddatastruct, ONLY : t_region
51  USE moderror
52  USE modparameters
54  IMPLICIT NONE
55 
56 #include "Indexing.h"
57 
58 ! ... parameters
59  TYPE(t_region) :: region
60  TYPE(t_patch) :: patch
61 
62 ! ... loop variables
63  INTEGER :: idum, i, j, k, l
64 
65 ! ... local variables
66  INTEGER :: ibeg, iend, jbeg, jend, kbeg, kend, idir, jdir, kdir
67  INTEGER :: ilev, lbound, n1, n2, i2d, distrib, noff
68  INTEGER :: icoff, ijcoff, ijkc, ijkc1, ijkc2, ijkd, ncv
69 
70  REAL(RFREAL) :: mrate
71  REAL(RFREAL), POINTER :: tcv(:,:), vals(:,:)
72 
73 !******************************************************************************
74 
75  CALL registerfunction( region%global,'TURB_FloRansBcondInjection',&
76  'TURB_floRansBcondInjection.F90' )
77 
78 ! get dimensions and pointers
79 
80  ilev = region%currLevel
81  lbound = patch%lbound
82 
83  CALL rflo_getpatchindices( region,patch,ilev, &
84  ibeg,iend,jbeg,jend,kbeg,kend )
86  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
87 
88  noff = abs(patch%l1end-patch%l1beg) + 1
89  distrib = patch%mixt%distrib
90  ncv = region%turbInput%nCv
91  tcv => region%levels(ilev)%turb%cv
92  vals => patch%mixt%vals
93 
94 ! loop over all cells of a patch
95 
96  IF ((region%mixtInput%turbModel == turb_model_sa) .OR. &
97  (region%mixtInput%turbModel == turb_model_dessa) .OR. &
98  (region%mixtInput%turbModel == turb_model_hdessa)) THEN
99 
100  DO idum=1,region%nDumCells
101  DO k=kbeg,kend
102  DO j=jbeg,jend
103  DO i=ibeg,iend
104  ijkd = indijk(i-idum*idir,j-idum*jdir,k-idum*kdir,icoff,ijcoff)
105  ijkc = &
106  indijk(i-(idum-1)*idir,j-(idum-1)*jdir,k-(idum-1)*kdir,icoff,ijcoff)
107  ijkc1 = &
108  indijk(i-(idum-2)*idir,j-(idum-2)*jdir,k-(idum-2)*kdir,icoff,ijcoff)
109  ijkc2 = &
110  indijk(i+(idum-1)*idir,j+(idum-1)*jdir,k+(idum-1)*kdir,icoff,ijcoff)
111 
112  IF (lbound==1 .OR. lbound==2) THEN
113  n1 = j - jbeg
114  n2 = k - kbeg
115  ELSE IF (lbound==3 .OR. lbound==4) THEN
116  n1 = k - kbeg
117  n2 = i - ibeg
118  ELSE IF (lbound==5 .OR. lbound==6) THEN
119  n1 = i - ibeg
120  n2 = j - jbeg
121  ENDIF
122  i2d = distrib * indij(n1,n2,noff)
123  mrate = vals(bcdat_inject_mfrate,i2d)
124 
125  IF (mrate > 0._rfreal) THEN ! burning surface
126  IF (idum == 1) THEN
127  DO l=1,ncv
128  tcv(l,ijkd) = tcv(l,ijkc)
129  ENDDO
130  ELSE
131  DO l=1,ncv
132  tcv(l,ijkd) = 2._rfreal*tcv(l,ijkc) - tcv(l,ijkc1)
133  ENDDO
134  ENDIF
135  ELSE ! non burning surface, as ns-wall
136  DO l=1,ncv
137  tcv(l,ijkd) = - tcv(l,ijkc2)
138  ENDDO
139  ENDIF
140  ENDDO ! i
141  ENDDO ! j
142  ENDDO ! k
143  ENDDO ! idum
144 
145  ELSE
146 
147  CALL errorstop( region%global,err_turb_ransinput,__line__, &
148  'injection bc is not ready yet for RaNS model selected' )
149  ENDIF
150 
151 ! finalize
152 
153  CALL deregisterfunction( region%global )
154 
155 END SUBROUTINE turb_floransbcondinjection
156 
157 !******************************************************************************
158 !
159 ! RCS Revision history:
160 !
161 ! $Log: TURB_floRansBcondInjection.F90,v $
162 ! Revision 1.6 2008/12/06 08:44:44 mtcampbe
163 ! Updated license.
164 !
165 ! Revision 1.5 2008/11/19 22:17:56 mtcampbe
166 ! Added Illinois Open Source License/Copyright
167 !
168 ! Revision 1.4 2006/08/19 15:40:44 mparmar
169 ! Renamed patch variables
170 !
171 ! Revision 1.3 2005/03/09 06:36:53 wasistho
172 ! incorporated HDESSA
173 !
174 ! Revision 1.2 2004/03/12 02:55:36 wasistho
175 ! changed rocturb routine names
176 !
177 ! Revision 1.1 2004/03/08 23:35:45 wasistho
178 ! changed turb nomenclature
179 !
180 ! Revision 1.2 2004/01/21 03:44:04 wasistho
181 ! fixed distrib and ijkC, C1, C2, D
182 !
183 ! Revision 1.1 2003/10/07 02:17:02 wasistho
184 ! initial installation of RaNS-SA and DES
185 !
186 !
187 !******************************************************************************
188 
189 
190 
191 
192 
193 
194 
**********************************************************************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 turb_floransbcondinjection(region, patch)
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
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