Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_floLesGenFiltCCJ.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-unifrom filtering in J-direction.
26 !
27 ! Description: The filtering is performed using the filter coefficients stored
28 ! in turb%ccCofj1,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_floLesGenFiltCCJ.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_flolesgenfiltccj( 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_floLesGenFiltCCJ.F90,v $'
86 
87  global => region%global
88  CALL registerfunction( global,'TURB_FloLesGenFiltCCJ',&
89  'TURB_floLesGenFiltCCJ.F90' )
90 
91 ! get parameters and pointers ------------------------------------------------
92 
93  ilev = region%currLevel
94  turb => region%levels(ilev)%turb
95 
96 ! integration over J-direction
97 
98  IF (ndel(dirj)==filwidth_zero) THEN
99 
100 ! - no filtering in J-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(dirj)==filwidth_one) .OR. &
106  (ndel(dirj)==filwidth_two)) THEN
107 
108  IF (ndel(dirj)==filwidth_one) THEN
109  cccof => turb%ccCofj1
110  ELSEIF (ndel(dirj)==filwidth_two) THEN
111  cccof => turb%ccCofj2
112  ENDIF
113 
114  DO k=kbeg,kend
115  DO i=ibeg,iend
116 
117 ! ----- perform integration
118 
119  DO j=jbeg+1,jend-1
120  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
121  DO l=idbeg,idend
122  filtvar(l,ijkc)=cccof(1,ijkc)*fvar(l,ijkc-icoff) + &
123  cccof(2,ijkc)*fvar(l,ijkc) + &
124  cccof(3,ijkc)*fvar(l,ijkc+icoff)
125  END DO ! l
126  ENDDO ! j
127 
128 ! ----- perform integration at the edges
129 
130  ijkcb = indijk(i ,jbeg ,k ,icoff,ijcoff)
131  ijkce = indijk(i ,jend ,k ,icoff,ijcoff)
132 
133  DO l=idbeg,idend
134  tmpb(l,1)=2._rfreal*fvar(l,ijkcb)-fvar(l,ijkcb+icoff)
135  tmpe(l,1)=2._rfreal*fvar(l,ijkce)-fvar(l,ijkce-icoff)
136  filtvar(l,ijkcb)=cccof(1,ijkcb)*tmpb(l,1) + &
137  cccof(2,ijkcb)*fvar(l,ijkcb) + &
138  cccof(3,ijkcb)*fvar(l,ijkcb+icoff)
139  filtvar(l,ijkce)=cccof(1,ijkce)*fvar(l,ijkce-icoff) + &
140  cccof(2,ijkce)*fvar(l,ijkce) + &
141  cccof(3,ijkce)*tmpe(l,1)
142  ENDDO ! l
143  ENDDO ! i
144  ENDDO ! k
145 
146  ELSEIF (ndel(dirj)==filwidth_four) THEN
147 
148  cccof => turb%ccCofj4
149 
150  DO k=kbeg,kend
151  DO i=ibeg,iend
152 
153 ! ----- perform integration
154 
155  DO j=jbeg+2,jend-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*icoff) + &
159  cccof(2,ijkc)*fvar(l,ijkc-icoff) + &
160  cccof(3,ijkc)*fvar(l,ijkc) + &
161  cccof(4,ijkc)*fvar(l,ijkc+icoff) + &
162  cccof(5,ijkc)*fvar(l,ijkc+2*icoff)
163  ENDDO ! l
164  ENDDO ! j
165 
166 ! ----- perform integration at the edges
167 
168  ijkcb = indijk(i ,jbeg ,k ,icoff,ijcoff)
169  ijkce = indijk(i ,jend ,k ,icoff,ijcoff)
170  ijkcb1= indijk(i ,jbeg+1 ,k ,icoff,ijcoff)
171  ijkce1= indijk(i ,jend-1 ,k ,icoff,ijcoff)
172 
173  DO l=idbeg,idend
174  tmpb(l,1)=2._rfreal*fvar(l,ijkcb)-fvar(l,ijkcb+icoff)
175  tmpe(l,1)=2._rfreal*fvar(l,ijkce)-fvar(l,ijkce-icoff)
176  filtvar(l,ijkcb1)=cccof(1,ijkcb1)*tmpb(l,1) + &
177  cccof(2,ijkcb1)*fvar(l,ijkcb1-icoff) + &
178  cccof(3,ijkcb1)*fvar(l,ijkcb1) + &
179  cccof(4,ijkcb1)*fvar(l,ijkcb1+icoff) + &
180  cccof(5,ijkcb1)*fvar(l,ijkcb1+2*icoff)
181  filtvar(l,ijkce1)=cccof(1,ijkce1)*fvar(l,ijkce1-2*icoff) + &
182  cccof(2,ijkce1)*fvar(l,ijkce1-icoff) + &
183  cccof(3,ijkce1)*fvar(l,ijkce1) + &
184  cccof(4,ijkce1)*fvar(l,ijkce1+icoff) + &
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*icoff)
190  tmpe(l,2)=2._rfreal*fvar(l,ijkce)-fvar(l,ijkce-2*icoff)
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+icoff) + &
195  cccof(5,ijkcb)*fvar(l,ijkcb+2*icoff)
196  filtvar(l,ijkce)=cccof(1,ijkce)*fvar(l,ijkce-2*icoff) + &
197  cccof(2,ijkce)*fvar(l,ijkce-icoff) + &
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 ! i
203  ENDDO ! k
204  ENDIF ! nDel
205 
206 ! finalize --------------------------------------------------------------------
207 
208  CALL deregisterfunction( global )
209 
210 END SUBROUTINE turb_flolesgenfiltccj
211 
212 !******************************************************************************
213 !
214 ! RCS Revision history:
215 !
216 ! $Log: TURB_floLesGenFiltCCJ.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:22 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:44 wasistho
233 ! Added TARGET attribute to region variable, since pointers are cached into it
234 !
235 ! Revision 1.3 2003/05/16 05:44:51 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
subroutine turb_flolesgenfiltccj(region, nDum, ibeg, iend, jbeg, jend, kbeg, kend, iCOff, ijCOff, nDel, idBeg, idEnd, fVar, filtVar)
**********************************************************************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