Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_floLesUniFiltCCK.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 uniform filtering in K-direction.
26 !
27 ! Description: The filtering is performed using fixed filter coefficients.
28 ! If filterwidth is zero in this direction the cell-variable is
29 ! simply copied to the filtered cell-variable.
30 !
31 ! Input: global = global data, only used in register function
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 = LesUniFiltCC.
43 !
44 !******************************************************************************
45 !
46 ! $Id: TURB_floLesUniFiltCCK.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_flolesunifiltcck( global,nDum,ibeg,iend,jbeg,jend,kbeg,kend, &
53  icoff,ijcoff,ndel,idbeg,idend,fact1,fact2,fvar, &
54  filtvar )
55 
56  USE moddatatypes
57  USE modglobal, ONLY : t_global
58  USE modturbulence
59  USE moderror
61  IMPLICIT NONE
62 
63 #include "Indexing.h"
64 
65 ! ... parameters
66  TYPE(t_global), POINTER :: global
67  INTEGER :: ndum,ibeg,iend,jbeg,jend,kbeg,kend,icoff,ijcoff
68  INTEGER :: ndel(diri:dirk),idbeg,idend
69  REAL(RFREAL) :: fact1(filwidth_four),fact2(filwidth_four)
70  REAL(RFREAL), POINTER :: fvar(:,:),filtvar(:,:)
71 
72 ! ... loop variables
73  INTEGER :: i, j, k, l, ijkc, ijkcb, ijkce, ijkcb1, ijkce1
74 
75 ! ... local variables
76  CHARACTER(CHRLEN) :: rcsidentstring
77  REAL(RFREAL) :: tmpb(idbeg:idend,2),tmpe(idbeg:idend,2)
78 
79 !******************************************************************************
80 
81  rcsidentstring = '$RCSfile: TURB_floLesUniFiltCCK.F90,v $'
82 
83  CALL registerfunction( global,'TURB_FloLesUniFiltCCK',&
84  'TURB_floLesUniFiltCCK.F90' )
85 
86 ! integration over K-direction -----------------------------------------------
87 
88  IF (ndel(dirk)==filwidth_zero) THEN
89 
90 ! - no filtering in K-direction is needed and we copy fVar into filtVar
91 
92  filtvar(idbeg:idend,:)=fvar(idbeg:idend,:) ! no simple copy filtvar=fvar
93  ! array sizes can be different
94 
95  ELSEIF ((ndel(dirk)==filwidth_one) .OR. &
96  (ndel(dirk)==filwidth_two)) THEN
97 
98  DO j=jbeg,jend
99  DO i=ibeg,iend
100 
101 ! ----- perform integration
102 
103  DO k=kbeg+1,kend-1
104  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
105  DO l=idbeg,idend
106  filtvar(l,ijkc)=fact1(ndel(dirk))*(fvar(l,ijkc-ijcoff) + &
107  fvar(l,ijkc+ijcoff))+ &
108  fact2(ndel(dirk))*fvar(l,ijkc)
109  ENDDO ! l
110  ENDDO ! k
111 
112 ! ----- perform integration at the edges
113 
114  ijkcb = indijk(i ,j ,kbeg ,icoff,ijcoff)
115  ijkce = indijk(i ,j ,kend ,icoff,ijcoff)
116 
117  DO l=idbeg,idend
118  tmpb(l,1)=2._rfreal*fvar(l,ijkcb)-fvar(l,ijkcb+ijcoff)
119  tmpe(l,1)=2._rfreal*fvar(l,ijkce)-fvar(l,ijkce-ijcoff)
120  filtvar(l,ijkcb)=fact1(ndel(dirk))*(tmpb(l,1)+fvar(l,ijkcb+ijcoff))+ &
121  fact2(ndel(dirk))*fvar(l,ijkcb)
122  filtvar(l,ijkce)=fact1(ndel(dirk))*(tmpe(l,1)+fvar(l,ijkce-ijcoff))+ &
123  fact2(ndel(dirk))*fvar(l,ijkce)
124  ENDDO ! l
125  ENDDO ! i
126  ENDDO ! j
127 
128  ELSEIF (ndel(dirk)==filwidth_four) THEN
129 
130  DO j=jbeg,jend
131  DO i=ibeg,iend
132 
133 ! ----- perform integration
134 
135  DO k=kbeg+2,kend-2
136  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
137  DO l=idbeg,idend
138  filtvar(l,ijkc)=fact1(ndel(dirk))*(fvar(l,ijkc-2*ijcoff) + &
139  fvar(l,ijkc+2*ijcoff))+ &
140  fact2(ndel(dirk))*(fvar(l,ijkc+ijcoff) + &
141  fvar(l,ijkc)+fvar(l,ijkc-ijcoff))
142  ENDDO ! l
143  ENDDO ! k
144 
145 ! ----- perform integration at the edges
146 
147  ijkcb = indijk(i ,j ,kbeg ,icoff,ijcoff)
148  ijkce = indijk(i ,j ,kend ,icoff,ijcoff)
149  ijkcb1= indijk(i ,j ,kbeg+1 ,icoff,ijcoff)
150  ijkce1= indijk(i ,j ,kend-1 ,icoff,ijcoff)
151 
152  DO l=idbeg,idend
153  tmpb(l,1)=2._rfreal*fvar(l,ijkcb)-fvar(l,ijkcb+ijcoff)
154  tmpe(l,1)=2._rfreal*fvar(l,ijkce)-fvar(l,ijkce-ijcoff)
155  filtvar(l,ijkcb1)=fact1(ndel(dirk))*(tmpb(l,1)+fvar(l,ijkcb1+2*ijcoff))+ &
156  fact2(ndel(dirk))*(fvar(l,ijkcb1+ijcoff)+fvar(l,ijkcb1)+ &
157  fvar(l,ijkcb1-ijcoff))
158  filtvar(l,ijkce1)=fact1(ndel(dirk))*(tmpe(l,1)+fvar(l,ijkce1-2*ijcoff))+ &
159  fact2(ndel(dirk))*(fvar(l,ijkce1+ijcoff)+fvar(l,ijkce1)+ &
160  fvar(l,ijkce1-ijcoff))
161  ENDDO ! l
162 
163  DO l=idbeg,idend
164  tmpb(l,2)=2._rfreal*fvar(l,ijkcb)-fvar(l,ijkcb+2*ijcoff)
165  tmpe(l,2)=2._rfreal*fvar(l,ijkce)-fvar(l,ijkce-2*ijcoff)
166  filtvar(l,ijkcb)=fact1(ndel(dirk))*(tmpb(l,2)+fvar(l,ijkcb+2*ijcoff))+ &
167  fact2(ndel(dirk))*(fvar(l,ijkcb+ijcoff)+fvar(l,ijkcb)+ &
168  tmpb(l,1))
169  filtvar(l,ijkce)=fact1(ndel(dirk))*(tmpe(l,2)+fvar(l,ijkce-2*ijcoff))+ &
170  fact2(ndel(dirk))*(fvar(l,ijkce-ijcoff)+fvar(l,ijkce)+ &
171  tmpe(l,1))
172  ENDDO ! l
173  ENDDO ! i
174  ENDDO ! j
175  ENDIF ! nDel
176 
177 ! finalize --------------------------------------------------------------------
178 
179  CALL deregisterfunction( global )
180 
181 END SUBROUTINE turb_flolesunifiltcck
182 
183 !******************************************************************************
184 !
185 ! RCS Revision history:
186 !
187 ! $Log: TURB_floLesUniFiltCCK.F90,v $
188 ! Revision 1.5 2008/12/06 08:44:43 mtcampbe
189 ! Updated license.
190 !
191 ! Revision 1.4 2008/11/19 22:17:56 mtcampbe
192 ! Added Illinois Open Source License/Copyright
193 !
194 ! Revision 1.3 2004/06/03 02:12:53 wasistho
195 ! expand CC-filtering to all dummy layers
196 !
197 ! Revision 1.2 2004/03/12 02:55:36 wasistho
198 ! changed rocturb routine names
199 !
200 ! Revision 1.1 2004/03/08 23:35:45 wasistho
201 ! changed turb nomenclature
202 !
203 ! Revision 1.3 2003/05/16 05:44:18 wasistho
204 ! modified array range of CC-filtered
205 !
206 ! Revision 1.2 2003/05/15 02:57:06 jblazek
207 ! Inlined index function.
208 !
209 ! Revision 1.1 2002/10/14 23:55:30 wasistho
210 ! Install Rocturb
211 !
212 !******************************************************************************
213 
214 
215 
216 
217 
218 
219 
**********************************************************************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
subroutine turb_flolesunifiltcck(global, nDum, ibeg, iend, jbeg, jend, kbeg, kend, iCOff, ijCOff, nDel, idBeg, idEnd, fact1, fact2, 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 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