Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RADI_rFLO_FlimResSmoothingCoeff.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 ! FLD radiation model.
27 !
28 ! Description: none.
29 !
30 ! Input: region%levels%radi%srad = convective spectral radii for smoke.
31 !
32 ! Output: region%levels%radi%epsIrs = smoothing coefficients.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: RADI_rFLO_FlimResSmoothingCoeff.F90,v 1.3 2008/12/06 08:44:38 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2002 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE radi_rflo_flimressmoothingcoeff( 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,'RADI_RFLO_FlimResSmoothingCoeff',&
80  'RADI_rFLO_FlimResSmoothingCoeff.F90' )
81 
82  IF (region%radiInput%radiModel /= radi_model_fldtran) 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)%radi%srad
95  epsirs => region%levels(ilev)%radi%epsIrs
96 
97  smoocf = region%radiInput%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 radi_rflo_flimressmoothingcoeff
136 
137 !******************************************************************************
138 !
139 ! RCS Revision history:
140 !
141 ! $Log: RADI_rFLO_FlimResSmoothingCoeff.F90,v $
142 ! Revision 1.3 2008/12/06 08:44:38 mtcampbe
143 ! Updated license.
144 !
145 ! Revision 1.2 2008/11/19 22:17:50 mtcampbe
146 ! Added Illinois Open Source License/Copyright
147 !
148 ! Revision 1.1 2004/09/30 17:49:10 wasistho
149 ! prepared for full FLD radiation model
150 !
151 !
152 !
153 !******************************************************************************
154 
155 
156 
157 
158 
159 
160 
subroutine radi_rflo_flimressmoothingcoeff(region)
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_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)