Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PEUL_SourceEqEul.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: compute source terms associated with Equilibrium Eulerian method
26 !
27 ! Description: none.
28 !
29 ! Input: region = data of current region.
30 !
31 ! Output: region%levels%peul%rhs = source terms.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: PEUL_SourceEqEul.F90,v 1.3 2008/12/06 08:44:39 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2004 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE peul_sourceeqeul( region,ipt )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
48  USE modparteul, ONLY : t_peul_ptype
49  USE moderror
50  USE modparameters
52 
53  IMPLICIT NONE
54 
55 #include "Indexing.h"
56 
57 ! ... parameters
58  TYPE(t_region), INTENT(INOUT) :: region
59  INTEGER, INTENT(IN) :: ipt
60 
61 ! ... loop variables
62  INTEGER :: ijkn,i,j,k
63 
64 ! ... local variables
65  CHARACTER(CHRLEN) :: rcsidentstring
66 
67  INTEGER :: ilev,ibn,ien,errorflag,ic,ijknpi,ijknpj,ijknpk
68  INTEGER :: ipcbeg,ipcend,jpcbeg,jpcend,kpcbeg,kpcend,icoff,ijcoff
69  INTEGER :: idnbeg,idnend,jdnbeg,jdnend,kdnbeg,kdnend,inoff,ijnoff
70 
71  REAL(RFREAL) :: ux,uy,uz,vx,vy,vz,wx,wy,wz,taufac,mass,tau,trg2av
72 
73  REAL(RFREAL), POINTER, DIMENSION(:,:) :: gtv,gradi,gradj,gradk,scv,srhs
74  REAL(RFREAL), POINTER, DIMENSION(:) :: vol
75  REAL(RFREAL), ALLOCATABLE, DIMENSION(:) :: trg2i,trg2j,trg2k
76 
77  TYPE(t_peul_ptype), POINTER :: ptype
78  TYPE(t_global), POINTER :: global
79 
80 !******************************************************************************
81 
82  rcsidentstring = '$RCSfile: PEUL_SourceEqEul.F90,v $ $Revision: 1.3 $'
83 
84  global => region%global
85 
86  CALL registerfunction( global,'PEUL_SourceEqEul',&
87  'PEUL_SourceEqEul.F90' )
88 
89 ! begin -----------------------------------------------------------------------
90 
91  ilev = region%currLevel
92 
93  CALL rflo_getdimensphys( region,ilev,ipcbeg,ipcend, &
94  jpcbeg,jpcend,kpcbeg,kpcend )
95  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
96 
97  CALL rflo_getdimensdummynodes( region,ilev,idnbeg,idnend, &
98  jdnbeg,jdnend,kdnbeg,kdnend )
99  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
100  ibn = indijk(idnbeg,jdnbeg,kdnbeg,inoff,ijnoff)
101  ien = indijk(idnend,jdnend,kdnend,inoff,ijnoff)
102 
103  vol => region%levels(ilev)%grid%vol
104 
105  gtv => region%levels(ilev)%mixt%tv
106 
107  gradi => region%levels(ilev)%mixt%gradi
108  gradj => region%levels(ilev)%mixt%gradj
109  gradk => region%levels(ilev)%mixt%gradk
110 
111  scv => region%levels(ilev)%peul%cv
112  srhs => region%levels(ilev)%peul%rhs
113 
114  ptype => region%peulInput%ptypes(ipt)
115 
116 ! allocate temporary arrays ---------------------------------------------------
117 
118  ALLOCATE( trg2i(ibn:ien),stat=errorflag )
119  errorflag = global%error
120  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
121 
122  ALLOCATE( trg2j(ibn:ien),stat=errorflag )
123  errorflag = global%error
124  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
125 
126  ALLOCATE( trg2k(ibn:ien),stat=errorflag )
127  errorflag = global%error
128  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
129 
130  DO ijkn = ibn,ien
131 
132  ux = gradi(gr_mixt_ux,ijkn)
133  uy = gradi(gr_mixt_uy,ijkn)
134  uz = gradi(gr_mixt_uz,ijkn)
135  vx = gradi(gr_mixt_vx,ijkn)
136  vy = gradi(gr_mixt_vy,ijkn)
137  vz = gradi(gr_mixt_vz,ijkn)
138  wx = gradi(gr_mixt_wx,ijkn)
139  wy = gradi(gr_mixt_wy,ijkn)
140  wz = gradi(gr_mixt_wz,ijkn)
141 
142  trg2i(ijkn) = ux**2 + vy**2 + wz**2 + 2._rfreal*(uy*vx + vz*wy + wx*uz)
143 
144  ux = gradj(gr_mixt_ux,ijkn)
145  uy = gradj(gr_mixt_uy,ijkn)
146  uz = gradj(gr_mixt_uz,ijkn)
147  vx = gradj(gr_mixt_vx,ijkn)
148  vy = gradj(gr_mixt_vy,ijkn)
149  vz = gradj(gr_mixt_vz,ijkn)
150  wx = gradj(gr_mixt_wx,ijkn)
151  wy = gradj(gr_mixt_wy,ijkn)
152  wz = gradj(gr_mixt_wz,ijkn)
153 
154  trg2j(ijkn) = ux**2 + vy**2 + wz**2 + 2._rfreal*(uy*vx + vz*wy + wx*uz)
155 
156  ux = gradk(gr_mixt_ux,ijkn)
157  uy = gradk(gr_mixt_uy,ijkn)
158  uz = gradk(gr_mixt_uz,ijkn)
159  vx = gradk(gr_mixt_vx,ijkn)
160  vy = gradk(gr_mixt_vy,ijkn)
161  vz = gradk(gr_mixt_vz,ijkn)
162  wx = gradk(gr_mixt_wx,ijkn)
163  wy = gradk(gr_mixt_wy,ijkn)
164  wz = gradk(gr_mixt_wz,ijkn)
165 
166  trg2k(ijkn) = ux**2 + vy**2 + wz**2 + 2._rfreal*(uy*vx + vz*wy + wx*uz)
167 
168  END DO ! ijkN
169 
170  taufac = ptype%tauVcoef
171 
172  DO k=kpcbeg,kpcend
173  DO j=jpcbeg,jpcend
174  DO i=ipcbeg,ipcend
175 
176  ic = indijk(i,j,k,icoff,ijcoff)
177  mass = scv(ipt,ic)*vol(ic)
178 
179  IF (mass > 0._rfreal) THEN ! only effects positive masses
180 
181  tau = taufac / gtv(tv_mixt_muel,ic)
182 
183  ijkn = indijk(i ,j ,k ,inoff,ijnoff)
184  ijknpi = indijk(i+1,j ,k ,inoff,ijnoff)
185  ijknpj = indijk(i ,j+1,k ,inoff,ijnoff)
186  ijknpk = indijk(i ,j ,k+1,inoff,ijnoff)
187 
188  trg2av = (trg2i(ijkn) + trg2i(ijknpi) + &
189  trg2j(ijkn) + trg2j(ijknpj) + &
190  trg2k(ijkn) + trg2k(ijknpk)) / 6._rfreal
191 
192  srhs(ipt,ic) = srhs(ipt,ic) - mass * tau * trg2av
193 
194  END IF ! mass
195 
196  END DO ! i
197  END DO ! j
198  END DO ! k
199 
200 ! Deallocate temporary array --------------------------------------------------
201 
202  DEALLOCATE( trg2i,stat=errorflag )
203  global%error = errorflag
204  IF (global%error /= 0) CALL errorstop( global,err_deallocate,__line__ )
205 
206  DEALLOCATE( trg2j,stat=errorflag )
207  global%error = errorflag
208  IF (global%error /= 0) CALL errorstop( global,err_deallocate,__line__ )
209 
210  DEALLOCATE( trg2k,stat=errorflag )
211  global%error = errorflag
212  IF (global%error /= 0) CALL errorstop( global,err_deallocate,__line__ )
213 
214 ! finalize --------------------------------------------------------------------
215 
216  CALL deregisterfunction( global )
217 
218 END SUBROUTINE peul_sourceeqeul
219 
220 !******************************************************************************
221 !
222 ! RCS Revision history:
223 !
224 ! $Log: PEUL_SourceEqEul.F90,v $
225 ! Revision 1.3 2008/12/06 08:44:39 mtcampbe
226 ! Updated license.
227 !
228 ! Revision 1.2 2008/11/19 22:17:52 mtcampbe
229 ! Added Illinois Open Source License/Copyright
230 !
231 ! Revision 1.1 2004/12/01 21:09:59 haselbac
232 ! Initial revision after changing case
233 !
234 ! Revision 1.1 2004/05/04 20:27:37 jferry
235 ! Implemented equilibrium Eulerian method
236 !
237 !******************************************************************************
238 
239 
240 
241 
242 
243 
244 
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
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
**********************************************************************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 jdnbeg
**********************************************************************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 idnend
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
**********************************************************************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 jdnend
**********************************************************************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 idnbeg
**********************************************************************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)
**********************************************************************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 iEndG gradi(:,:)
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 rflo_getdimensdummynodes(region, iLev, idnbeg, idnend, jdnbeg, jdnend, kdnbeg, kdnend)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine peul_sourceeqeul(region, ipt)
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)
**********************************************************************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 kdnbeg
**********************************************************************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 iEndG gradj(:,:)