Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_floLesGenFiltCCI.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: Perform cell to cell non-uniform filtering in I-direction.
26 !
27 ! Description: The filtering is performed using the filter coefficients stored
28 ! in turb%ccCofi1,2,4. If filterwidth is zero in this direction
29 ! the cell-variable is simply copied to the filtered cell-variable.
30 !
31 ! Input: region = data of current region
32 ! nDum = number of dummy cells
33 ! i,j,kbeg, i,j,kend = cell index boundaries
34 ! iCOff, ijCOff = cell Offset
35 ! nDel = three components filter width parameter
36 ! idBeg = begin variable index to be filtered
37 ! idEnd = end variable index to be filtered
38 ! fVar = cell variable to be filtered
39 !
40 ! Output: filtVar = filtered cell variable
41 !
42 ! Notes: Mother routine = LesGenFiltCC.
43 !
44 !******************************************************************************
45 !
46 ! $Id: TURB_floLesGenFiltCCI.F90,v 1.5 2008/12/06 08:44:43 mtcampbe Exp $
47 !
48 ! Copyright: (c) 2001 by the University of Illinois
49 !
50 !******************************************************************************
51 
52 SUBROUTINE turb_flolesgenfiltcci( region,nDum,ibeg,iend,jbeg,jend,kbeg,kend, &
53  icoff,ijcoff,ndel,idbeg,idend,fvar,filtvar )
54 
55  USE moddatatypes
56  USE moddatastruct, ONLY : t_region
57  USE modglobal, ONLY : t_global
58  USE modturbulence, ONLY : t_turb
59  USE moderror
61  IMPLICIT NONE
62 
63 #include "Indexing.h"
64 
65 ! ... parameters
66  TYPE(t_region), TARGET :: region
67  INTEGER :: ndum,ibeg,iend,jbeg,jend,kbeg,kend,icoff,ijcoff
68  INTEGER :: ndel(diri:dirk),idbeg,idend
69  REAL(RFREAL), POINTER :: fvar(:,:),filtvar(:,:)
70 
71 ! ... loop variables
72  INTEGER :: i, j, k, l, ijkc, ijkcb, ijkce, ijkcb1, ijkce1
73 
74 ! ... local variables
75  CHARACTER(CHRLEN) :: rcsidentstring
76  TYPE(t_global), POINTER :: global
77  TYPE(t_turb) , POINTER :: turb
78 
79  INTEGER :: ilev
80  REAL(RFREAL) :: tmpb(idbeg:idend,2),tmpe(idbeg:idend,2)
81  REAL(RFREAL), POINTER :: cccof(:,:)
82 
83 !******************************************************************************
84 
85  rcsidentstring = '$RCSfile: TURB_floLesGenFiltCCI.F90,v $'
86 
87  global => region%global
88  CALL registerfunction( global,'TURB_FloLesGenFiltCCI',&
89  'TURB_floLesGenFiltCCI.F90' )
90 
91 ! get parameters and pointers ------------------------------------------------
92 
93  ilev = region%currLevel
94  turb => region%levels(ilev)%turb
95 
96 ! integration over I-direction
97 
98  IF (ndel(diri)==filwidth_zero) THEN
99 
100 ! - no filtering in I-direction is needed and we copy fVar into filtVar
101 
102  filtvar(idbeg:idend,:)=fvar(idbeg:idend,:) ! no simple copy filtvar=fvar
103  ! array sizes can be different
104 
105  ELSEIF ((ndel(diri)==filwidth_one) .OR. &
106  (ndel(diri)==filwidth_two)) THEN
107 
108  IF (ndel(diri)==filwidth_one) THEN
109  cccof => turb%ccCofi1
110  ELSEIF (ndel(diri)==filwidth_two) THEN
111  cccof => turb%ccCofi2
112  ENDIF
113 
114  DO k=kbeg,kend
115  DO j=jbeg,jend
116 
117 ! ----- perform integration
118 
119  DO i=ibeg+1,iend-1
120  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
121  DO l=idbeg,idend
122  filtvar(l,ijkc)=cccof(1,ijkc)*fvar(l,ijkc-1) + &
123  cccof(2,ijkc)*fvar(l,ijkc) + &
124  cccof(3,ijkc)*fvar(l,ijkc+1)
125  END DO ! l
126  ENDDO ! i
127 
128 ! ----- perform integration at the edges
129 
130  ijkcb = indijk(ibeg ,j ,k ,icoff,ijcoff)
131  ijkce = indijk(iend ,j ,k ,icoff,ijcoff)
132 
133  DO l=idbeg,idend
134  tmpb(l,1)=2._rfreal*fvar(l,ijkcb)-fvar(l,ijkcb+1)
135  tmpe(l,1)=2._rfreal*fvar(l,ijkce)-fvar(l,ijkce-1)
136  filtvar(l,ijkcb)=cccof(1,ijkcb)*tmpb(l,1) + &
137  cccof(2,ijkcb)*fvar(l,ijkcb) + &
138  cccof(3,ijkcb)*fvar(l,ijkcb+1)
139  filtvar(l,ijkce)=cccof(1,ijkce)*fvar(l,ijkce-1) + &
140  cccof(2,ijkce)*fvar(l,ijkce) + &
141  cccof(3,ijkce)*tmpe(l,1)
142  ENDDO ! l
143  ENDDO ! j
144  ENDDO ! k
145 
146  ELSEIF (ndel(diri)==filwidth_four) THEN
147 
148  cccof => turb%ccCofi4
149 
150  DO k=kbeg,kend
151  DO j=jbeg,jend
152 
153 ! ----- perform integration
154 
155  DO i=ibeg+2,iend-2
156  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
157  DO l=idbeg,idend
158  filtvar(l,ijkc)=cccof(1,ijkc)*fvar(l,ijkc-2) + &
159  cccof(2,ijkc)*fvar(l,ijkc-1) + &
160  cccof(3,ijkc)*fvar(l,ijkc) + &
161  cccof(4,ijkc)*fvar(l,ijkc+1) + &
162  cccof(5,ijkc)*fvar(l,ijkc+2)
163  ENDDO ! l
164  ENDDO ! i
165 
166 ! ----- perform integration at the edges
167 
168  ijkcb = indijk(ibeg ,j ,k ,icoff,ijcoff)
169  ijkce = indijk(iend ,j ,k ,icoff,ijcoff)
170  ijkcb1= indijk(ibeg+1 ,j ,k ,icoff,ijcoff)
171  ijkce1= indijk(iend-1 ,j ,k ,icoff,ijcoff)
172 
173  DO l=idbeg,idend
174  tmpb(l,1)=2._rfreal*fvar(l,ijkcb)-fvar(l,ijkcb+1)
175  tmpe(l,1)=2._rfreal*fvar(l,ijkce)-fvar(l,ijkce-1)
176  filtvar(l,ijkcb1)=cccof(1,ijkcb1)*tmpb(l,1) + &
177  cccof(2,ijkcb1)*fvar(l,ijkcb1-1) + &
178  cccof(3,ijkcb1)*fvar(l,ijkcb1) + &
179  cccof(4,ijkcb1)*fvar(l,ijkcb1+1) + &
180  cccof(5,ijkcb1)*fvar(l,ijkcb1+2)
181  filtvar(l,ijkce1)=cccof(1,ijkce1)*fvar(l,ijkce1-2) + &
182  cccof(2,ijkce1)*fvar(l,ijkce1-1) + &
183  cccof(3,ijkce1)*fvar(l,ijkce1) + &
184  cccof(4,ijkce1)*fvar(l,ijkce1+1) + &
185  cccof(5,ijkce1)*tmpe(l,1)
186  ENDDO ! l
187 
188  DO l=idbeg,idend
189  tmpb(l,2)=2._rfreal*fvar(l,ijkcb)-fvar(l,ijkcb+2)
190  tmpe(l,2)=2._rfreal*fvar(l,ijkce)-fvar(l,ijkce-2)
191  filtvar(l,ijkcb)=cccof(1,ijkcb)*tmpb(l,2) + &
192  cccof(2,ijkcb)*tmpb(l,1) + &
193  cccof(3,ijkcb)*fvar(l,ijkcb) + &
194  cccof(4,ijkcb)*fvar(l,ijkcb+1) + &
195  cccof(5,ijkcb)*fvar(l,ijkcb+2)
196  filtvar(l,ijkce)=cccof(1,ijkce)*fvar(l,ijkce-2) + &
197  cccof(2,ijkce)*fvar(l,ijkce-1) + &
198  cccof(3,ijkce)*fvar(l,ijkce) + &
199  cccof(4,ijkce)*tmpe(l,1) + &
200  cccof(5,ijkce)*tmpe(l,2)
201  ENDDO ! l
202  ENDDO ! j
203  ENDDO ! k
204  ENDIF ! nDel
205 
206 ! finalize --------------------------------------------------------------------
207 
208  CALL deregisterfunction( global )
209 
210 END SUBROUTINE turb_flolesgenfiltcci
211 
212 !******************************************************************************
213 !
214 ! RCS Revision history:
215 !
216 ! $Log: TURB_floLesGenFiltCCI.F90,v $
217 ! Revision 1.5 2008/12/06 08:44:43 mtcampbe
218 ! Updated license.
219 !
220 ! Revision 1.4 2008/11/19 22:17:55 mtcampbe
221 ! Added Illinois Open Source License/Copyright
222 !
223 ! Revision 1.3 2004/06/03 02:13:17 wasistho
224 ! expand CC-filtering to all dummy layers
225 !
226 ! Revision 1.2 2004/03/12 02:55:36 wasistho
227 ! changed rocturb routine names
228 !
229 ! Revision 1.1 2004/03/08 23:35:45 wasistho
230 ! changed turb nomenclature
231 !
232 ! Revision 1.4 2003/08/29 01:41:39 wasistho
233 ! Added TARGET attribute to region variable, since pointers are cached into it
234 !
235 ! Revision 1.3 2003/05/16 05:44:43 wasistho
236 ! modified array range of CC-filtered
237 !
238 ! Revision 1.2 2003/05/15 02:57:06 jblazek
239 ! Inlined index function.
240 !
241 ! Revision 1.1 2002/10/14 23:55:30 wasistho
242 ! Install Rocturb
243 !
244 !******************************************************************************
245 
246 
247 
248 
249 
250 
251 
**********************************************************************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
**********************************************************************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
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
subroutine turb_flolesgenfiltcci(region, nDum, ibeg, iend, jbeg, jend, kbeg, kend, iCOff, ijCOff, nDel, idBeg, idEnd, fVar, filtVar)