Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_fluLesBLij.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: Compute the scale similarity turbulent stress tensor, which
26 ! is the same as the Leonard stress term in the dynamic LES
27 ! models. SS-tauij uses bar-filter while Leonard stress uses
28 ! test-filter.
29 !
30 ! Description: The turbulent stress tensor follows the SS model and can
31 ! be seen as Leonard tensor if the outer bar filter is replaced
32 ! by test filter. This tensor is defined by
33 ! l_{ij}=bar(bar[rho*ui]bar[rho*uj]/bar[rho])
34 ! -bar(bar[rho*ui])bar(bar[rho*uj])/bar(bar[rho])
35 ! where bar denotes the bar-filter with filter-width defined by
36 ! nDel(DIRI:DIRK). On entry we have the solution components
37 ! at cell faces and perform the filtering from face to face.
38 ! We return the resulting tensor at all cell faces including
39 ! dummies. Also 1/bar(bar[rho]) is available stored ffVar(1,:).
40 !
41 ! Input: region = data of current region
42 ! nDel = three components filter width paramater
43 !
44 ! Output: lij = resulting stress tensor of scale similarity or Leonard term
45 !
46 ! Notes: This routine relevant only for physical boundaries of FLU regions.
47 ! 1. Removed CALL to RFLU_InterpCells2FacesPatches because it no longer exists
48 ! This routine might become broken because of this
49 !
50 !******************************************************************************
51 !
52 ! $Id: TURB_fluLesBLij.F90,v 1.5 2008/12/06 08:44:44 mtcampbe Exp $
53 !
54 ! Copyright: (c) 2001 by the University of Illinois
55 !
56 !******************************************************************************
57 
58 SUBROUTINE turb_flulesblij( region,nDel,lij )
59 
60  USE moddatatypes
61  USE moddatastruct, ONLY : t_region
62  USE modglobal, ONLY : t_global
63  USE modbndpatch, ONLY : t_patch
64  USE moderror
66  IMPLICIT NONE
67 
68 ! ... parameters
69  TYPE(t_region), POINTER :: region
70  INTEGER :: ndel(diri:dirk)
71  REAL(RFREAL), POINTER :: lij(:,:)
72 
73 ! ... loop variables
74  INTEGER :: ijkn, ipatch
75 
76 ! ... local variables
77  CHARACTER(CHRLEN) :: rcsidentstring
78  TYPE(t_global), POINTER :: global
79  TYPE(t_patch), POINTER :: patch
80 
81  INTEGER :: ibn,ien,idbeg,idend,npatches,nbfaces
82  REAL(RFREAL), POINTER :: bfvar(:,:),bffvar(:,:)
83  REAL(RFREAL), POINTER :: tens(:,:),tensbar(:,:)
84  REAL(RFREAL), POINTER :: cv(:,:)
85 
86 !******************************************************************************
87 
88  rcsidentstring = '$RCSfile: TURB_fluLesBLij.F90,v $'
89 
90  global => region%global
91  CALL registerfunction( global,'TURB_FluLesBLij',&
92  'TURB_fluLesBLij.F90' )
93 
94 ! get indices and pointers --------------------------------------------------
95 
96  npatches = region%grid%nPatches
97  nbfaces = 0
98 
99  DO ipatch = 1,npatches
100  patch => region%patches(ipatch)
101  nbfaces = nbfaces + patch%nBTris + patch%nBQuads
102  END DO ! iPatch
103  ibn = 1
104  ien = nbfaces
105 
106  cv => region%mixt%cv
107  bfvar => region%turb%bfVar
108  bffvar => region%turb%bffVar
109 
110 ! allocate temporary arrays
111 
112  ALLOCATE( tens(e11:e33,ibn:ien),tensbar(e11:e33,ibn:ien) )
113 
114 ! ff-filtering bRhoF and bRhoUiF (i=1,3) stored in fVar to get
115 ! bar[bRhoF] and bar[bRhoUiF] stored in fbVar
116 
117  idbeg = cv_turb_dens
118  idend = cv_turb_zmom
119 
120 ! for efficiency we store 1/bRhoF in bRhoF and 1/bbRhoF in bbRhoF;
121 ! next, build components of scale-similarity (Bardina) turbulent stress
122 ! tensor lij-component: store bRhoUi*bRhoUj/bRho in tens
123 
124  DO ijkn = ibn,ien
125  bfvar(cv_turb_dens,ijkn)=1._rfreal/bfvar(cv_turb_dens,ijkn)
126  bffvar(cv_turb_dens,ijkn)=1._rfreal/bffvar(cv_turb_dens,ijkn)
127 
128  tens(e11,ijkn) = bfvar(cv_turb_xmom,ijkn)*bfvar(cv_turb_xmom,ijkn)* &
129  bfvar(cv_turb_dens,ijkn)
130  tens(e12,ijkn) = bfvar(cv_turb_xmom,ijkn)*bfvar(cv_turb_ymom,ijkn)* &
131  bfvar(cv_turb_dens,ijkn)
132  tens(e13,ijkn) = bfvar(cv_turb_xmom,ijkn)*bfvar(cv_turb_zmom,ijkn)* &
133  bfvar(cv_turb_dens,ijkn)
134  tens(e22,ijkn) = bfvar(cv_turb_ymom,ijkn)*bfvar(cv_turb_ymom,ijkn)* &
135  bfvar(cv_turb_dens,ijkn)
136  tens(e23,ijkn) = bfvar(cv_turb_ymom,ijkn)*bfvar(cv_turb_zmom,ijkn)* &
137  bfvar(cv_turb_dens,ijkn)
138  tens(e33,ijkn) = bfvar(cv_turb_zmom,ijkn)*bfvar(cv_turb_zmom,ijkn)* &
139  bfvar(cv_turb_dens,ijkn)
140  ENDDO
141 
142 ! ff-filter bRhoUi*bRhoUj/bRho stored in tens to get
143 ! bar[bRhoUi*bRhoUj/bRho] in tensBar
144 
145  idbeg = e11
146  idend = e33
147 
148 ! CALL RFLU_InterpFaces2FacesPatches( region,tens,tensBar )
149 
150 ! combine and find lij=bar[bRhoUi*bRhoUj/bRho]-bbRhoUi*bbRhoUj/bbRho
151 
152  DO ijkn=ibn,ien
153  lij(e11,ijkn)=tensbar(e11,ijkn)-bffvar(cv_turb_dens,ijkn)* &
154  bffvar(cv_turb_xmom,ijkn)*bffvar(cv_turb_xmom,ijkn)
155 
156  lij(e12,ijkn)=tensbar(e12,ijkn)-bffvar(cv_turb_dens,ijkn)* &
157  bffvar(cv_turb_xmom,ijkn)*bffvar(cv_turb_ymom,ijkn)
158 
159  lij(e13,ijkn)=tensbar(e13,ijkn)-bffvar(cv_turb_dens,ijkn)* &
160  bffvar(cv_turb_xmom,ijkn)*bffvar(cv_turb_zmom,ijkn)
161 
162  lij(e22,ijkn)=tensbar(e22,ijkn)-bffvar(cv_turb_dens,ijkn)* &
163  bffvar(cv_turb_ymom,ijkn)*bffvar(cv_turb_ymom,ijkn)
164 
165  lij(e23,ijkn)=tensbar(e23,ijkn)-bffvar(cv_turb_dens,ijkn)* &
166  bffvar(cv_turb_ymom,ijkn)*bffvar(cv_turb_zmom,ijkn)
167 
168  lij(e33,ijkn)=tensbar(e33,ijkn)-bffvar(cv_turb_dens,ijkn)* &
169  bffvar(cv_turb_zmom,ijkn)*bffvar(cv_turb_zmom,ijkn)
170  ENDDO
171 
172 ! deallocate temporary arrays
173 
174  DEALLOCATE( tens,tensbar )
175 
176 ! finalize --------------------------------------------------------------------
177 
178  CALL deregisterfunction( global )
179 
180 END SUBROUTINE turb_flulesblij
181 
182 !******************************************************************************
183 !
184 ! RCS Revision history:
185 !
186 ! $Log: TURB_fluLesBLij.F90,v $
187 ! Revision 1.5 2008/12/06 08:44:44 mtcampbe
188 ! Updated license.
189 !
190 ! Revision 1.4 2008/11/19 22:17:56 mtcampbe
191 ! Added Illinois Open Source License/Copyright
192 !
193 ! Revision 1.3 2006/08/19 15:41:03 mparmar
194 ! Removed call to RFLU_InterpCells2FacesPatches
195 !
196 ! Revision 1.2 2004/08/07 01:07:18 wasistho
197 ! bugfixed, defined pointer cv
198 !
199 ! Revision 1.1 2004/05/28 02:03:58 wasistho
200 ! update unstructured grid LES
201 !
202 !
203 !
204 !******************************************************************************
205 
206 
207 
208 
209 
210 
211 
subroutine turb_flulesblij(region, nDel, lij)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
Definition: patch.h:74
subroutine deregisterfunction(global)
Definition: ModError.F90:469