Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_LesEsgModel4.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 fourth energy subgrid contribution, alpha_4.
26 !
27 ! Description: The contribution of the energy subgrid alpha_4 is added to
28 ! the viscous flux residual.
29 ! Alpha_1 is the energy transfer term from resolved to sgs,
30 ! has been added in VisFluxEddy of VFluxHybrid.
31 ! Alpha_4 is the present turbulence dissipation rate term.
32 ! Alpha_4 = C_eps.bar[rho].k^(3/2)/delta, with
33 ! k = 1/2.tau_ii and
34 ! C_eps = int{alpha_1}dx/int{bar[rho].k^(3/2)/delta)}dx
35 ! Alpha_2 (effect on the heat conductivity) and
36 ! Alpha_3 (pressure dilatation term) have been modeled together
37 ! in the above viscous flux routines using the
38 ! eddy-diffusivity model (turb. heat flux).
39 !
40 ! Input: region = data of current region
41 !
42 ! Output: mixt%diss, containing the alpha_4 contribution
43 !
44 ! Notes: alpha_1,2,3 has been added to mixt%diss in a previous treatment.
45 !
46 !******************************************************************************
47 !
48 ! $Id: TURB_LesEsgModel4.F90,v 1.7 2008/12/06 08:44:41 mtcampbe Exp $
49 !
50 ! Copyright: (c) 2001 by the University of Illinois
51 !
52 !******************************************************************************
53 
54 SUBROUTINE turb_lesesgmodel4( region )
55 
56  USE moddatatypes
57  USE moddatastruct, ONLY : t_region
58  USE modglobal, ONLY : t_global
59 #ifdef RFLO
61 
62 #include "Indexing.h"
63 #endif
65  USE moderror
66  USE modparameters
68  IMPLICIT NONE
69 
70 ! ... parameters
71  TYPE(t_region) :: region
72 
73 ! ... loop variables
74  INTEGER :: i, j, k, ijkc
75 
76 ! ... local variables
77  CHARACTER(CHRLEN) :: rcsidentstring
78  TYPE(t_global), POINTER :: global
79 
80  REAL(RFREAL) :: oo3,oo12,beta,delfac,delta
81  REAL(RFREAL) :: esg1glo,esg4glo,cepsilon,esg4
82  REAL(RFREAL), POINTER :: cv(:,:),diss(:,:),trace(:),vol(:)
83  REAL(RFREAL), POINTER :: colvar(:,:)
84 
85  INTEGER :: ibn,ien
86 #ifdef RFLO
87  INTEGER :: ibeg,iend,jbeg,jend,kbeg,kend
88  INTEGER :: ipcbeg,ipcend,jpcbeg,jpcend,kpcbeg,kpcend
89  INTEGER :: ilev,icoff,ijcoff
90 #endif
91 
92 !******************************************************************************
93 
94  rcsidentstring = '$RCSfile: TURB_LesEsgModel4.F90,v $'
95 
96  global => region%global
97  CALL registerfunction( global,'TURB_LesEsgModel4',&
98  'TURB_LesEsgModel4.F90' )
99 
100 ! get constants, indices and pointers -----------------------------------------
101 
102  oo3 = 1.0_rfreal/3.0_rfreal
103  oo12 = 1.0_rfreal/12.0_rfreal
104  beta = region%mixtInput%betrk(region%irkStep)
105  delfac = sqrt(region%turbInput%delFac2)
106 
107 #ifdef RFLO
108  ilev = region%currLevel
109  cv => region%levels(ilev)%mixt%cv
110  diss => region%levels(ilev)%mixt%diss
111  trace => region%levels(ilev)%turb%trace
112  vol => region%levels(ilev)%grid%vol
113 
114  CALL rflo_getdimensphys( region,ilev,ipcbeg,ipcend, &
115  jpcbeg,jpcend,kpcbeg,kpcend )
116  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
117 
118  ibeg = ipcbeg
119  iend = ipcend
120  jbeg = jpcbeg
121  jend = jpcend
122  kbeg = kpcbeg
123  kend = kpcend
124 
125 ! global sum of rho*k^(3/2)/delta contribution (global%esg4Sum) has been
126 ! initialized in TURB_LesRkInit
127 
128 ! proceed computation of the model constant C_epsilon
129  DO k=kbeg,kend
130  DO j=jbeg,jend
131  DO i=ibeg,iend
132  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
133 #endif
134 #ifdef RFLU
135  cv => region%mixt%cv
136  diss => region%mixt%diss
137  trace => region%turb%trace
138  vol => region%grid%vol
139 
140  DO ijkc = 1,region%grid%nCells
141 #endif
142 
143 ! ----- obtain the subgrid kinetic energy k == 0.5*rho*tau_ii in trace at cell
144 ! centers; rho*tau_ii is the trace of rho*tau_ij tensor; note that in
145 ! the formal formulation k == 0.5*tau_ii.
146 
147  trace(ijkc) = oo12*trace(ijkc)
148 
149 ! ----- get global weighted sum of alpha_4; store rho*k^(3/2)/delta in trace
150  delta = delfac*vol(ijkc)**oo3
151  trace(ijkc) = sqrt(trace(ijkc)**3/cv(cv_mixt_dens,ijkc))/delta
152  global%esg4Sum = global%esg4Sum + trace(ijkc)*vol(ijkc)
153 
154 #ifdef RFLO
155  ENDDO ! i
156  ENDDO ! j
157  ENDDO ! k
158 #endif
159 #ifdef RFLU
160  ENDDO ! ijkC
161 #endif
162 
163  esg1glo = global%esg1Psum
164  esg4glo = global%esg4Psum
165 
166  cepsilon = esg1glo/(esg4glo+1.e-16_rfreal)
167 
168 ! add contribution of the 4th ESG model into diss
169 
170 #ifdef RFLO
171  DO k=kbeg,kend
172  DO j=jbeg,jend
173  DO i=ibeg,iend
174  ijkc = indijk(i ,j ,k ,icoff,ijcoff)
175 #endif
176 #ifdef RFLU
177  DO ijkc = 1,region%grid%nCells
178 #endif
179  esg4 = cepsilon*trace(ijkc)
180  diss(cv_mixt_ener,ijkc) = diss(cv_mixt_ener,ijkc) + esg4*beta
181 #ifdef RFLO
182  ENDDO ! i
183  ENDDO ! j
184  ENDDO ! k
185 #endif
186 #ifdef RFLU
187  ENDDO ! ijkC
188 #endif
189 
190 #ifdef STATS
191 ! if desired, collect quantities of interest at cell centers for statistics
192 
193  IF (region%turbInput%nSt > 0) THEN
194  ibn = lbound( trace,1 )
195  ien = ubound( trace,1 )
196  ALLOCATE( colvar(1,ibn:ien) )
197  colvar(1,:) = cepsilon*trace(:)
198  CALL turb_statccollector( region,3,3,colvar )
199  DEALLOCATE( colvar)
200  ENDIF
201 #endif
202 
203 ! finalize --------------------------------------------------------------------
204 
205  CALL deregisterfunction( global )
206 
207 END SUBROUTINE turb_lesesgmodel4
208 
209 !******************************************************************************
210 !
211 ! RCS Revision history:
212 !
213 ! $Log: TURB_LesEsgModel4.F90,v $
214 ! Revision 1.7 2008/12/06 08:44:41 mtcampbe
215 ! Updated license.
216 !
217 ! Revision 1.6 2008/11/19 22:17:54 mtcampbe
218 ! Added Illinois Open Source License/Copyright
219 !
220 ! Revision 1.5 2004/10/22 23:17:46 wasistho
221 ! collect esg4 into statistics
222 !
223 ! Revision 1.4 2004/04/08 20:22:02 wasistho
224 ! replaced REAL_SMALL by actual value
225 !
226 ! Revision 1.3 2004/03/27 02:16:42 wasistho
227 ! compiled with Rocflu
228 !
229 ! Revision 1.2 2004/03/19 02:49:45 wasistho
230 ! prepared for RFLU
231 !
232 ! Revision 1.1 2004/03/05 04:37:00 wasistho
233 ! changed nomenclature
234 !
235 ! Revision 1.6 2004/02/26 21:23:16 wasistho
236 ! changed turb%esg.. to global%esg..
237 !
238 ! Revision 1.5 2004/02/24 21:03:39 wasistho
239 ! used local (region) production-dissipation balance for non-uniform MPI load
240 !
241 ! Revision 1.4 2003/05/15 02:57:06 jblazek
242 ! Inlined index function.
243 !
244 ! Revision 1.3 2003/04/04 22:38:00 wasistho
245 ! remove warning to inactivate energy model
246 !
247 ! Revision 1.2 2002/12/12 03:28:09 wasistho
248 ! Change mpi_comm_world to global%mpiComm
249 !
250 ! Revision 1.1 2002/10/14 23:55:29 wasistho
251 ! Install Rocturb
252 !
253 !
254 !******************************************************************************
255 
256 
257 
258 
259 
260 
261 
**********************************************************************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
**********************************************************************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 kpcbeg
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
double sqrt(double d)
Definition: double.h:73
**********************************************************************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 jpcbeg
**********************************************************************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 ipcend
**********************************************************************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
**********************************************************************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 ipcbeg
blockLoc i
Definition: read.cpp:79
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
subroutine turb_statccollector(region, iBegSt, iEndSt, colVar)
RT delta(int i) const
Definition: Direction_2.h:159
subroutine turb_lesesgmodel4(region)
Tfloat trace() const
Return the trace of the image, viewed as a matrix.
Definition: CImg.h:13217
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 jpcend
**********************************************************************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
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)