Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RADI_FlimEmsUpdate.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: update FLD radiation solution for steady flow or dual time-stepping
26 ! using explicit multistage scheme
27 !
28 ! Description: none.
29 !
30 ! Input: region = data of current region,
31 !
32 ! Output: region%levels%radi%cv = new solution after each stage.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: RADI_FlimEmsUpdate.F90,v 1.3 2008/12/06 08:44:37 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE radi_flimemsupdate( region )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
49  USE moderror
50  USE modparameters
52 #ifdef RFLO
55 
56 #include "Indexing.h"
57 #endif
58 
59  IMPLICIT NONE
60 
61 ! ... parameters
62  TYPE(t_region) :: region
63 
64 ! ... loop variables
65  INTEGER :: ic, idx
66 
67 ! ... local variables
68  TYPE(t_global), POINTER :: global
69 
70  INTEGER :: istage, ibc, iec, idxb, idxe
71  REAL(RFREAL), POINTER :: cv(:,:), cvold(:,:), rhs(:,:)
72  REAL(RFREAL), POINTER :: vol(:), dt(:)
73  REAL(RFREAL) :: ark(5), fac, adtv, cfl
74 
75 #ifdef RFLO
76  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
77  INTEGER :: ilev, icoff, ijcoff
78 #endif
79 
80 !******************************************************************************
81 
82  global => region%global
83 
84  CALL registerfunction( global,'RADI_FlimEmsUpdate',&
85  'RADI_FlimEmsUpdate.F90' )
86 
87 ! get parameters, dimensions and pointers -------------------------------------
88 
89  istage = region%irkStep
90  ark(:) = region%mixtInput%ark(:)
91  cfl = region%mixtInput%cfl
92 
93  IF (region%radiInput%radiModel == radi_model_fldtran) THEN
94  idxb = cv_radi_ener
95  idxe = cv_radi_ener
96  ENDIF
97 
98 #ifdef RFLO
99  ilev = region%currLevel
100 
101  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
102  jdcbeg,jdcend,kdcbeg,kdcend )
103  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
104  ibc = indijk(idcbeg,jdcbeg,kdcbeg,icoff,ijcoff)
105  iec = indijk(idcend,jdcend,kdcend,icoff,ijcoff)
106 
107  cv => region%levels(ilev)%radi%cv
108  cvold => region%levels(ilev)%radi%cvOld
109  rhs => region%levels(ilev)%radi%rhs
110  vol => region%levels(ilev)%grid%vol
111  dt => region%levels(ilev)%dt
112 #endif
113 
114 #ifdef RFLU
115  ibc = 1
116  iec = region%grid%nCellsTot
117 
118  cv => region%radi%cv
119  cvold => region%radi%cvOld
120  rhs => region%radi%rhs
121  vol => region%grid%vol
122  dt => region%dt
123 #endif
124 
125 ! update FLD radiation solution ------------------------------------------------
126 
127  fac = ark(istage)*cfl
128  DO ic = ibc,iec
129  adtv = fac*dt(ic)/vol(ic)
130  DO idx = idxb,idxe
131  rhs(idx,ic) = adtv*rhs(idx,ic)
132  ENDDO
133  ENDDO
134 
135  IF (global%solverType == solv_implicit) THEN
136  fac = 1.5_rfreal*ark(istage)*cfl/global%dtMin
137  DO ic = ibc,iec
138  adtv = 1._rfreal/(1._rfreal+fac*dt(ic))
139  DO idx = idxb,idxe
140  cv(idx,ic) = cvold(idx,ic) - adtv*rhs(idx,ic)
141  ENDDO
142  ENDDO
143  ELSE
144  DO ic=ibc,iec
145  DO idx = idxb,idxe
146  cv(idx,ic) = cvold(idx,ic) - rhs(idx,ic)
147  ENDDO
148  ENDDO
149  ENDIF
150 
151 ! extrapolate solution to dummy cells
152 
153 #ifdef RFLO
154  CALL rflo_extrapintcellvec( region,idxb,idxe,cv )
155 #endif
156 #ifdef RFLU
157 ! CALL RFLU_ExtrapIntCellVec( region,idxb,idxe,cv )
158 #endif
159 
160 ! finalize --------------------------------------------------------------------
161 
162  CALL deregisterfunction( global )
163 
164 END SUBROUTINE radi_flimemsupdate
165 
166 !******************************************************************************
167 !
168 ! RCS Revision history:
169 !
170 ! $Log: RADI_FlimEmsUpdate.F90,v $
171 ! Revision 1.3 2008/12/06 08:44:37 mtcampbe
172 ! Updated license.
173 !
174 ! Revision 1.2 2008/11/19 22:17:50 mtcampbe
175 ! Added Illinois Open Source License/Copyright
176 !
177 ! Revision 1.1 2004/09/30 17:49:10 wasistho
178 ! prepared for full FLD radiation model
179 !
180 !
181 !
182 !******************************************************************************
183 
184 
185 
186 
187 
188 
189 
190 
**********************************************************************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 idcend
NT rhs
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
**********************************************************************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 ic
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
**********************************************************************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 kdcbeg
subroutine rflo_extrapintcellvec(region, idBeg, idEnd, fVec)
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
**********************************************************************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 idcbeg
subroutine radi_flimemsupdate(region)
**********************************************************************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 jdcend
**********************************************************************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 jdcbeg
subroutine deregisterfunction(global)
Definition: ModError.F90:469