Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_LesTestRhoV.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 test filtered density and velocities at cell centers.
26 !
27 ! Description: We filter mixture cv using cell to cell (test) filtering.
28 ! The cell filtered cv is then processed to get Favre filtered
29 ! velocities.
30 !
31 ! Input: region = data of current region
32 !
33 ! Output: ccVar = cell filtered rho and u_i
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: TURB_LesTestRhoV.F90,v 1.6 2008/12/06 08:44:42 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2001 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE turb_lestestrhov( region,ibc,iec )
46 
47  USE moddatatypes
48  USE moddatastruct, ONLY : t_region
49  USE modglobal, ONLY : t_global
50 #ifdef RFLO
52 
53 #include "Indexing.h"
54 #endif
55  USE modturbulence
56  USE moderror
57  USE modparameters
59  IMPLICIT NONE
60 
61 ! ... parameters
62  TYPE(t_region) :: region
63  INTEGER :: ibc, iec
64 
65 ! ... loop variables
66  INTEGER :: i, j, k, ijkc
67 
68 ! ... local variables
69  CHARACTER(CHRLEN) :: rcsidentstring
70  TYPE(t_global), POINTER :: global
71 
72  INTEGER :: idbeg,idend,tndel(diri:dirk)
73  REAL(RFREAL), POINTER :: cv(:,:), ccvar(:,:)
74 
75 #ifdef RFLO
76  INTEGER :: ilev
77 #endif
78 
79 !******************************************************************************
80 
81  rcsidentstring = '$RCSfile: TURB_LesTestRhoV.F90,v $'
82 
83  global => region%global
84  CALL registerfunction( global,'TURB_LesTestRhoV',&
85  'TURB_LesTestRhoV.F90' )
86 
87 ! get indices and pointers --------------------------------------------------
88 
89 #ifdef RFLO
90  ilev = region%currLevel
91  cv => region%levels(ilev)%mixt%cv
92  ccvar => region%levels(ilev)%turb%ccVar
93 #endif
94 #ifdef RFLU
95  cv => region%mixt%cv
96  ccvar => region%turb%ccVar
97 #endif
98 
99 ! test filter width is twice bar filter width
100 
101  tndel(diri) = 2*region%turbInput%filterWidth(diri)
102 #ifdef RFLO
103  tndel(dirj) = 2*region%turbInput%filterWidth(dirj)
104  tndel(dirk) = 2*region%turbInput%filterWidth(dirk)
105 #endif
106 
107 ! we calculate vi=test[bar(rho*ui)]/test[bar(rho)] from bar(rho) and
108 ! bar(rho*ui) already available as mixt%cv; the filtered conservative
109 ! variables and returned at cell centers including dummies in ccVar
110 
111  idbeg = cv_turb_dens
112  idend = cv_turb_zmom
113 #ifdef RFLO
114  IF (region%turbInput%filterType == filtype_uniform) THEN
115  CALL turb_flolesunifiltcc( region,tndel,idbeg,idend,cv,ccvar )
116  ELSE
117  CALL turb_flolesgenfiltcc( region,tndel,idbeg,idend,cv,ccvar )
118  ENDIF
119 #endif
120 #ifdef RFLU
121 ! CALL TURB_FluLesFiltCC( region,tNDel,idBeg,idEnd,cv,ccVar )
122  ccvar(idbeg:idend,:) = cv(idbeg:idend,:)
123 #endif
124 
125 ! for efficiency we store 1/test(bar[rho]) in ccVar(CV_TURB_DENS,:)
126 
127  DO ijkc=ibc,iec
128  ccvar(cv_turb_dens,ijkc) = 1._rfreal/ccvar(cv_turb_dens,ijkc)
129  ENDDO
130 
131 ! then compute vi and store these in ccVar
132 
133  DO ijkc=ibc,iec
134  ccvar(cv_turb_uvel,ijkc) = ccvar(cv_turb_xmom,ijkc)* &
135  ccvar(cv_turb_dens,ijkc)
136  ccvar(cv_turb_vvel,ijkc) = ccvar(cv_turb_ymom,ijkc)* &
137  ccvar(cv_turb_dens,ijkc)
138  ccvar(cv_turb_wvel,ijkc) = ccvar(cv_turb_zmom,ijkc)* &
139  ccvar(cv_turb_dens,ijkc)
140  ENDDO
141 
142 ! finalize --------------------------------------------------------------------
143 
144  CALL deregisterfunction( global )
145 
146 END SUBROUTINE turb_lestestrhov
147 
148 !******************************************************************************
149 !
150 ! RCS Revision history:
151 !
152 ! $Log: TURB_LesTestRhoV.F90,v $
153 ! Revision 1.6 2008/12/06 08:44:42 mtcampbe
154 ! Updated license.
155 !
156 ! Revision 1.5 2008/11/19 22:17:54 mtcampbe
157 ! Added Illinois Open Source License/Copyright
158 !
159 ! Revision 1.4 2005/12/31 23:28:15 wasistho
160 ! copy cv to ccVar for rocflu temporarily
161 !
162 ! Revision 1.3 2004/03/19 02:51:34 wasistho
163 ! prepared for RFLU
164 !
165 ! Revision 1.2 2004/03/12 02:55:35 wasistho
166 ! changed rocturb routine names
167 !
168 ! Revision 1.1 2004/03/05 04:37:00 wasistho
169 ! changed nomenclature
170 !
171 ! Revision 1.3 2003/05/16 05:43:44 wasistho
172 ! modified array range of CC-filtered
173 !
174 ! Revision 1.2 2003/05/15 02:57:06 jblazek
175 ! Inlined index function.
176 !
177 ! Revision 1.1 2002/10/14 23:55:30 wasistho
178 ! Install Rocturb
179 !
180 !
181 !******************************************************************************
182 
183 
184 
185 
186 
187 
188 
subroutine turb_flolesgenfiltcc(region, nDel, idBeg, idEnd, fVar, fbVar)
j indices k indices k
Definition: Indexing.h:6
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine turb_flolesunifiltcc(region, nDel, idBeg, idEnd, fVar, fbVar)
blockLoc i
Definition: read.cpp:79
subroutine turb_lestestrhov(region, ibc, iec)
j indices j
Definition: Indexing.h:6
subroutine deregisterfunction(global)
Definition: ModError.F90:469