Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_floLesGenFiltFFK.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 face to face filtering in K-direction.
26 !
27 ! Description: The filtering is performed using the filter coefficients stored
28 ! in turb%ffCofk1,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 ! ijk = ijk-face is being treated
33 ! i,j,kbeg, i,j,kend = node index boundaries
34 ! iNOff, ijNOff = node 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 = face variable to be filtered
39 !
40 ! Output: filtVar = filtered face variable
41 !
42 ! Notes: Mother routine = LesGenFiltFF.
43 !
44 !******************************************************************************
45 !
46 ! $Id: TURB_floLesGenFiltFFK.F90,v 1.4 2008/12/06 08:44:43 mtcampbe Exp $
47 !
48 ! Copyright: (c) 2001 by the University of Illinois
49 !
50 !******************************************************************************
51 
52 SUBROUTINE turb_flolesgenfiltffk( region,ijk,ibeg,iend,jbeg,jend,kbeg,kend, &
53  inoff,ijnoff,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 :: ijk,ibeg,iend,jbeg,jend,kbeg,kend,inoff,ijnoff
68  INTEGER :: ndel(diri:dirk),idbeg,idend
69  REAL(RFREAL), POINTER :: fvar(:,:),filtvar(:,:)
70 
71 ! ... loop variables
72  INTEGER :: i, j, k, l, ijkn, ijknb, ijkne
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),tmpe(idbeg:idend)
81  REAL(RFREAL), POINTER :: ffcof(:,:)
82 
83 !******************************************************************************
84 
85  rcsidentstring = '$RCSfile: TURB_floLesGenFiltFFK.F90,v $'
86 
87  global => region%global
88  CALL registerfunction( global,'TURB_FloLesGenFiltFFK',&
89  'TURB_floLesGenFiltFFK.F90' )
90 
91 ! get parameters and pointers ------------------------------------------------
92 
93  ilev = region%currLevel
94  turb => region%levels(ilev)%turb
95 
96 ! integration over K-direction
97 
98  IF (ndel(dirk)==filwidth_zero) THEN
99 
100 ! - no filtering in K-direction is needed and we copy fVar into filtVar
101 
102  filtvar = fvar
103 
104  ELSEIF ((ndel(dirk)==filwidth_one) .OR. &
105  (ndel(dirk)==filwidth_two)) THEN
106 
107  IF (ndel(dirk)==filwidth_one) THEN
108  IF (ijk==diri) THEN
109  ffcof => turb%ffCofk1I
110  ELSEIF (ijk==dirj) THEN
111  ffcof => turb%ffCofk1J
112  ELSEIF (ijk==dirk) THEN
113  ffcof => turb%ffCofk1K
114  ENDIF
115  ELSEIF (ndel(dirk)==filwidth_two) THEN
116  IF (ijk==diri) THEN
117  ffcof => turb%ffCofk2I
118  ELSEIF (ijk==dirj) THEN
119  ffcof => turb%ffCofk2J
120  ELSEIF (ijk==dirk) THEN
121  ffcof => turb%ffCofk2K
122  ENDIF
123  ENDIF
124 
125 ! - perform integration
126 
127  DO k=kbeg,kend
128  DO j=jbeg,jend
129  DO i=ibeg,iend
130  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
131  DO l=idbeg,idend
132  filtvar(l,ijkn)=ffcof(1,ijkn)*fvar(l,ijkn-ijnoff) + &
133  ffcof(2,ijkn)*fvar(l,ijkn) + &
134  ffcof(3,ijkn)*fvar(l,ijkn+ijnoff)
135  END DO ! l
136  ENDDO ! i
137  ENDDO ! j
138  ENDDO ! k
139 
140  ELSEIF (ndel(dirk)==filwidth_four) THEN
141 
142  IF (ijk==diri) THEN
143  ffcof => turb%ffCofk4I
144  ELSEIF (ijk==dirj) THEN
145  ffcof => turb%ffCofk4J
146  ELSEIF (ijk==dirk) THEN
147  ffcof => turb%ffCofk4K
148  ENDIF
149 
150 ! - perform integration
151 
152  DO k=kbeg+1,kend-1
153  DO j=jbeg,jend
154  DO i=ibeg,iend
155  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
156  DO l=idbeg,idend
157  filtvar(l,ijkn)=ffcof(1,ijkn)*fvar(l,ijkn-2*ijnoff) + &
158  ffcof(2,ijkn)*fvar(l,ijkn-ijnoff) + &
159  ffcof(3,ijkn)*fvar(l,ijkn) + &
160  ffcof(4,ijkn)*fvar(l,ijkn+ijnoff) + &
161  ffcof(5,ijkn)*fvar(l,ijkn+2*ijnoff)
162  ENDDO ! l
163  ENDDO ! i
164  ENDDO ! j
165  ENDDO ! k
166 
167 ! - perform integration at the edges
168 
169  DO j=jbeg,jend
170  DO i=ibeg,iend
171  ijknb = indijk(i ,j ,kbeg ,inoff,ijnoff)
172  ijkne = indijk(i ,j ,kend ,inoff,ijnoff)
173  DO l=idbeg,idend
174  tmpb(l) = 2._rfreal*fvar(l,ijknb-ijnoff)-fvar(l,ijknb)
175  tmpe(l) = 2._rfreal*fvar(l,ijkne+ijnoff)-fvar(l,ijkne)
176  filtvar(l,ijknb)=ffcof(1,ijknb)*tmpb(l) + &
177  ffcof(2,ijknb)*fvar(l,ijknb-ijnoff) + &
178  ffcof(3,ijknb)*fvar(l,ijknb) + &
179  ffcof(4,ijknb)*fvar(l,ijknb+ijnoff) + &
180  ffcof(5,ijknb)*fvar(l,ijknb+2*ijnoff)
181  filtvar(l,ijkne)=ffcof(1,ijkne)*fvar(l,ijkne-2*ijnoff)+ &
182  ffcof(2,ijkne)*fvar(l,ijkne-ijnoff) + &
183  ffcof(3,ijkne)*fvar(l,ijkne) + &
184  ffcof(4,ijkne)*fvar(l,ijkne+ijnoff) + &
185  ffcof(5,ijkne)*tmpe(l)
186  ENDDO ! l
187  ENDDO ! i
188  ENDDO ! j
189  ENDIF ! nDel
190 
191 ! finalize --------------------------------------------------------------------
192 
193  CALL deregisterfunction( global )
194 
195 END SUBROUTINE turb_flolesgenfiltffk
196 
197 !******************************************************************************
198 !
199 ! RCS Revision history:
200 !
201 ! $Log: TURB_floLesGenFiltFFK.F90,v $
202 ! Revision 1.4 2008/12/06 08:44:43 mtcampbe
203 ! Updated license.
204 !
205 ! Revision 1.3 2008/11/19 22:17:55 mtcampbe
206 ! Added Illinois Open Source License/Copyright
207 !
208 ! Revision 1.2 2004/03/12 02:55:36 wasistho
209 ! changed rocturb routine names
210 !
211 ! Revision 1.1 2004/03/08 23:35:45 wasistho
212 ! changed turb nomenclature
213 !
214 ! Revision 1.3 2003/08/29 01:42:14 wasistho
215 ! Added TARGET attribute to region variable, since pointers are cached into it
216 !
217 ! Revision 1.2 2003/05/15 02:57:06 jblazek
218 ! Inlined index function.
219 !
220 ! Revision 1.1 2002/10/14 23:55:30 wasistho
221 ! Install Rocturb
222 !
223 !
224 !******************************************************************************
225 
226 
227 
228 
229 
230 
231 
**********************************************************************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_flolesgenfiltffk(region, ijk, ibeg, iend, jbeg, jend, kbeg, kend, iNOff, ijNOff, 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