Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_rFLO_RansResSmoothingCoeff.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: calculate coefficients for the implicit residual smoothing for
26 ! RaNS class of turbulence
27 !
28 ! Description: none.
29 !
30 ! Input: region%levels%turb%srad = convective spectral radii for smoke.
31 !
32 ! Output: region%levels%turb%epsIrs = smoothing coefficients.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: TURB_rFLO_RansResSmoothingCoeff.F90,v 1.3 2008/12/06 08:44:45 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2002 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE turb_rflo_ransressmoothingcoeff( region ) ! PUBLIC
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
50  USE moderror
51  USE modparameters
53  IMPLICIT NONE
54 
55 #include "Indexing.h"
56 
57 ! ... parameters
58  TYPE(t_region), INTENT(INOUT) :: region
59 
60 ! ... loop variables
61  INTEGER :: i, j, k
62 
63 ! ... local variables
64  CHARACTER(CHRLEN) :: rcsidentstring
65 
66  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
67  INTEGER :: ilev, icoff, ijcoff, ijkc
68 
69  REAL(RFREAL) :: cflrat, smoocf, radij, radjk, radik, radji, radkj, radki
70  REAL(RFREAL) :: psi, ex, ey, ez
71  REAL(RFREAL), POINTER :: srad(:,:), epsirs(:,:)
72 
73  TYPE(t_global), POINTER :: global
74 
75 !******************************************************************************
76 
77  global => region%global
78 
79  CALL registerfunction( global,'TURB_RFLO_RansResSmoothingCoeff',&
80  'TURB_rFLO_RansResSmoothingCoeff.F90' )
81 
82  IF (region%turbInput%modelClass /= model_rans) goto 999
83 
84 ! begin -----------------------------------------------------------------------
85 
86 ! get dimensions and pointers
87 
88  ilev = region%currLevel
89 
90  CALL rflo_getdimensphys( region,ilev,ipcbeg,ipcend,jpcbeg,jpcend, &
91  kpcbeg,kpcend )
92  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
93 
94  srad => region%levels(ilev)%turb%srad
95  epsirs => region%levels(ilev)%turb%epsIrs
96 
97  smoocf = region%turbInput%smoocf
98 
99 ! loop over physical cells
100 
101  cflrat = sqrt(1._rfreal+4._rfreal*smoocf)
102  psi = 0.0625_rfreal
103 
104  DO k=kpcbeg,kpcend
105  DO j=jpcbeg,jpcend
106  DO i=ipcbeg,ipcend
107  ijkc = indijk(i,j,k,icoff,ijcoff)
108  radij = srad(icoord,ijkc)/srad(jcoord,ijkc)
109  radjk = srad(jcoord,ijkc)/srad(kcoord,ijkc)
110  radik = srad(icoord,ijkc)/srad(kcoord,ijkc)
111  radji = 1._rfreal/radij
112  radkj = 1._rfreal/radjk
113  radki = 1._rfreal/radik
114 
115  ex = 0.25_rfreal*((cflrat/(1._rfreal+psi*(radji+radki)))**2-1._rfreal)
116  ey = 0.25_rfreal*((cflrat/(1._rfreal+psi*(radij+radkj)))**2-1._rfreal)
117  ez = 0.25_rfreal*((cflrat/(1._rfreal+psi*(radik+radjk)))**2-1._rfreal)
118  ex = min(smoocf,ex)
119  ey = min(smoocf,ey)
120  ez = min(smoocf,ez)
121 
122  epsirs(icoord,ijkc) = max(0._rfreal,ex)
123  epsirs(jcoord,ijkc) = max(0._rfreal,ey)
124  epsirs(kcoord,ijkc) = max(0._rfreal,ez)
125  ENDDO ! i
126  ENDDO ! j
127  ENDDO ! k
128 
129 ! finalize --------------------------------------------------------------------
130 
131 999 CONTINUE
132 
133  CALL deregisterfunction( global )
134 
135 END SUBROUTINE turb_rflo_ransressmoothingcoeff
136 
137 !******************************************************************************
138 !
139 ! RCS Revision history:
140 !
141 ! $Log: TURB_rFLO_RansResSmoothingCoeff.F90,v $
142 ! Revision 1.3 2008/12/06 08:44:45 mtcampbe
143 ! Updated license.
144 !
145 ! Revision 1.2 2008/11/19 22:17:56 mtcampbe
146 ! Added Illinois Open Source License/Copyright
147 !
148 ! Revision 1.1 2004/03/11 03:26:33 wasistho
149 ! changed rocturb nomenclature
150 !
151 ! Revision 1.1 2004/03/08 23:35:46 wasistho
152 ! changed turb nomenclature
153 !
154 ! Revision 1.2 2003/10/20 00:37:06 wasistho
155 ! goto 999 before register function
156 !
157 ! Revision 1.1 2003/10/07 02:17:03 wasistho
158 ! initial installation of RaNS-SA and DES
159 !
160 !
161 !******************************************************************************
162 
163 
164 
165 
166 
167 
168 
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
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
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 ipcbeg
blockLoc i
Definition: read.cpp:79
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
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
subroutine turb_rflo_ransressmoothingcoeff(region)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)