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