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