Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RVAV_ProudmanCulickSolution.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: Generate Proudman-Culick Analytical Solution.
26 !
27 ! Description:
28 !
29 ! Input: number of variables and array
30 !
31 ! Output: array for Analytical solution
32 !
33 ! Notes:
34 !
35 !******************************************************************************
36 !
37 ! $Id: RVAV_ProudmanCulickSolution.F90,v 1.3 2008/12/06 08:45:08 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2002 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE rvav_proudmanculicksolution( fname,regionsS1 )
44 
45  USE moddatatypes
46  USE moderror
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
49  USE modgrid, ONLY : t_grid
50  USE modmixture, ONLY : t_mixt
51  USE modmpi
52  USE modparameters
53  USE rvav_modglobal
55  IMPLICIT NONE
56 
57 #include "Indexing.h"
58 
59 ! ... parameter
60  CHARACTER(*) :: fname
61  TYPE (t_region), POINTER :: regionss1(:)
62 
63 ! ... loop variables
64  INTEGER :: i, j, k
65 
66 ! ... local variables
67  CHARACTER(CHRLEN) :: msg
68 
69  REAL(RFREAL), PARAMETER :: massfluxc0 = 2.42_rfreal
70  REAL(RFREAL), PARAMETER :: tempwallc0 = 303.0_rfreal
71  REAL(RFREAL), PARAMETER :: pressureheadend = 1.53451e+05_rfreal
72  REAL(RFREAL), PARAMETER :: heightc0 = 0.02
73 
74  TYPE(t_grid) , POINTER :: grid
75  TYPE(t_mixt) , POINTER :: mixt
76  TYPE(t_global) , POINTER :: global
77 
78  INTEGER :: ireg, ilev
79  INTEGER :: ipc, jpc, kpc, ibc, iec
80  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
81  INTEGER :: icoff, ijcoff
82  INTEGER :: icelloffset, ijcelloffset
83  INTEGER :: ibpc,iepc
84  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
85  INTEGER :: ivars, inodes, jnodes, knodes, nvari, nvars
86  INTEGER :: ijkcell, errorflag
87 
88  REAL(RFREAL) :: pi
89  REAL(RFREAL), POINTER :: cofg(:,:)
90  REAL(RFREAL), DIMENSION(:,:), ALLOCATABLE :: cvsa
91 
92 !******************************************************************************
93 
94  global => regionss1(1)%global
95 
96  CALL registerfunction( global, 'RVAV_ProudmanCulickSolution',&
97  'RVAV_ProudmanCulickSolution.F90' )
98 
99  pi = global%pi
100 
101 ! generate Input DataStream for Proudman Culick
102 
103  DO ireg=1, global%nRegions
104 
105  ilev = regionss1(ireg)%currLevel
106  grid => regionss1(ireg)%levels(ilev)%grid
107  mixt => regionss1(ireg)%levels(ilev)%mixt
108 
109  cofg => grid%cofg
110 
111 ! - get cell dimensions
112 
113  CALL rflo_getdimensdummy( regionss1(ireg),ilev,idcbeg,idcend, &
114  jdcbeg,jdcend,kdcbeg,kdcend )
115  CALL rflo_getcelloffset( regionss1(ireg),ilev,icelloffset,ijcelloffset )
116  ibc = indijk(idcbeg,jdcbeg,kdcbeg,icelloffset,ijcelloffset)
117  iec = indijk(idcend,jdcend,kdcend,icelloffset,ijcelloffset)
118 
119 ! - get physical dimensions
120 
121  CALL rflo_getdimensphys( regionss1(ireg),ilev,ipcbeg,ipcend, &
122  jpcbeg,jpcend,kpcbeg,kpcend )
123  CALL rflo_getcelloffset( regionss1(ireg),ilev,icoff,ijcoff )
124 
125 ! - allocate work array
126 
127  ALLOCATE( cvsa(3,ibc:iec),stat=errorflag )
128  global%error = errorflag
129  IF (global%error /= 0) CALL errorstop( global, err_allocate,__line__ )
130 
131 ! - initialize variables
132 
133  cvsa = 0.0_rfreal
134  ipcbeg = 1
135  ipcend = 1
136  nvari = 3
137 
138  DO k = kpcbeg, kpcend
139  DO j = jpcbeg, jpcend
140  DO i = ipcbeg, ipcend
141  ijkcell = indijk(i,j,k,icoff,ijcoff)
142 
143  cvsa(1,ijkcell) = sin(0.5_rfreal*pi*cofg(ycoord,ijkcell)/heightc0)
144  cvsa(2,ijkcell) = cos(0.5_rfreal*pi*cofg(ycoord,ijkcell)/heightc0)
145  cvsa(3,ijkcell) = pressureheadend
146  END DO ! i
147  END DO ! j
148  END DO ! k
149 
150 ! Write stream2 data
151 
152  inodes = ipcend-ipcbeg+1
153  jnodes = jpcend-jpcbeg+1
154  knodes = kpcend-kpcbeg+1
155  nvars = zcoord+nvari
156 
157  WRITE(if_rvav_file_s2,*,err=10) inodes,jnodes,knodes,nvars
158 
159  WRITE(if_rvav_file_s2,*,err=10) &
160  (((cofg(xcoord,indijk(i,j,k,icoff,ijcoff)), i=ipcbeg,ipcend), &
161  j=jpcbeg,jpcend), &
162  k=kpcbeg,kpcend), &
163  (((cofg(ycoord,indijk(i,j,k,icoff,ijcoff)), i=ipcbeg,ipcend), &
164  j=jpcbeg,jpcend), &
165  k=kpcbeg,kpcend), &
166  (((cofg(zcoord,indijk(i,j,k,icoff,ijcoff)), i=ipcbeg,ipcend), &
167  j=jpcbeg,jpcend), &
168  k=kpcbeg,kpcend), &
169  ((((cvsa(ivars,indijk(i,j,k,icoff,ijcoff)), i=ipcbeg,ipcend), &
170  j=jpcbeg,jpcend), &
171  k=kpcbeg,kpcend), &
172  ivars=1,nvari)
173 
174  DEALLOCATE( cvsa,stat=errorflag )
175  global%error = errorflag
176  IF (global%error /= 0) CALL errorstop( global,err_deallocate,__line__ )
177 
178  END DO ! iReg
179 
180  goto 999
181 
182 10 CONTINUE
183  CALL errorstop( global,err_file_read,__line__,'File: '//trim(fname) )
184 
185 ! finalize --------------------------------------------------------------------
186 
187 999 CONTINUE
188 
189  CALL deregisterfunction( global )
190 
191 END SUBROUTINE rvav_proudmanculicksolution
192 
193 !******************************************************************************
194 !
195 ! RCS Revision history:
196 !
197 ! $Log: RVAV_ProudmanCulickSolution.F90,v $
198 ! Revision 1.3 2008/12/06 08:45:08 mtcampbe
199 ! Updated license.
200 !
201 ! Revision 1.2 2008/11/19 22:18:19 mtcampbe
202 ! Added Illinois Open Source License/Copyright
203 !
204 ! Revision 1.1 2004/12/01 22:46:35 fnajjar
205 ! Initial revision after changing case
206 !
207 ! Revision 1.5 2003/05/15 02:57:08 jblazek
208 ! Inlined index function.
209 !
210 ! Revision 1.4 2002/10/21 18:56:05 f-najjar
211 ! Bug fix for Character Length of fname to be consistent with RVAV_ModInterfaces
212 !
213 ! Revision 1.3 2002/10/12 03:20:51 jblazek
214 ! Replaced [io]stat=global%error with local errorFlag for Rocflo.
215 !
216 ! Revision 1.2 2002/09/10 00:01:45 f-najjar
217 ! Variable global moved into regions()
218 !
219 ! Revision 1.1 2002/07/31 02:36:43 f-najjar
220 ! Initial Import
221 !
222 !
223 !******************************************************************************
224 
225 
226 
227 
228 
229 
230 
subroutine rvav_proudmanculicksolution(fname, regionsS1)
**********************************************************************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
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 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
static const double pi
Definition: smooth_medial.C:43
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
**********************************************************************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
NT & sin
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 idcbeg
**********************************************************************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
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
**********************************************************************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 errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine grid(bp)
Definition: setup_py.f90:257
subroutine deregisterfunction(global)
Definition: ModError.F90:469
NT & cos
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)