Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RVAV_ComputeAnalyticalSolution.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 analytical data stream (S2) for various flow fields.
26 !
27 ! Description: currently supported formats are:
28 ! - ASCII
29 ! - Binary
30 !
31 ! Input: case name from the list of arguments
32 !
33 ! Output: File for Analytical solution
34 !
35 ! Notes:
36 !
37 !******************************************************************************
38 !
39 ! $Id: RVAV_ComputeAnalyticalSolution.F90,v 1.3 2008/12/06 08:45:08 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2002 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE rvav_computeanalyticalsolution( similarityType,regionsS1 )
46 
47  USE moddatatypes
48  USE moderror
49  USE moddatastruct, ONLY : t_region
50  USE modglobal, ONLY : t_global
51  USE modgrid, ONLY : t_grid
52  USE modmixture, ONLY : t_mixt
55  USE modmpi
56  USE modparameters
57  USE rvav_modglobal
61  IMPLICIT NONE
62 
63 #include "Indexing.h"
64 
65 ! ... parameters
66  INTEGER :: similaritytype
67  TYPE (t_region), POINTER :: regionss1(:)
68 
69 ! ... loop variables
70  INTEGER :: i, j, k
71 
72 ! ... local variables
73  CHARACTER(CHRLEN) :: msg
74  CHARACTER(CHRLEN+23) :: fname
75 
76  TYPE(t_grid) , POINTER :: grid
77  TYPE(t_mixt) , POINTER :: mixt
78  TYPE(t_global) , POINTER :: global
79 
80  INTEGER :: ireg, ilev
81  INTEGER :: ipc, jpc, kpc, ibc, iec
82  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
83  INTEGER :: icoff, ijcoff
84  INTEGER :: icelloffset, ijcelloffset
85  INTEGER :: ibpc,iepc
86  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
87  INTEGER :: ivars, inodes, jnodes, knodes, nvari, nvars, errorflag
88 
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_ComputeAnalyticalSolution',&
97  'RVAV_ComputeAnalyticalSolution.F90' )
98 
99 ! open file in which stream2 is stored
100 
101  WRITE(fname,'(A,A)') trim(globalrvav%casename)//'_s2.anl'
102  OPEN (if_rvav_file_s2,file=fname,form='formatted',status='unknown',&
103  iostat=errorflag)
104 
105  global%error = errorflag
106  IF (global%error /= 0) &
107  CALL errorstop( global, err_file_open,__line__,'File: '//trim(fname) )
108 
109 ! write number of regions
110 
111  WRITE(if_rvav_file_s2,*,err=10) global%nRegions
112 
113 ! calculate cell centroids ----------------------------------------------------
114 
115  IF (global%verbLevel /= verbose_none) &
116  WRITE(stdout,'(/,A)') 'Compute Cell Centroids...'
117 
118  DO ireg=1, global%nRegions
119 
120  ilev = regionss1(ireg)%currLevel
121  grid => regionss1(ireg)%levels(ilev)%grid
122  mixt => regionss1(ireg)%levels(ilev)%mixt
123 
124 ! - get cell and node dimensions
125 
126  CALL rflo_getdimensdummy( regionss1(ireg),ilev,idcbeg,idcend, &
127  jdcbeg,jdcend,kdcbeg,kdcend )
128  CALL rflo_getcelloffset( regionss1(ireg),ilev,icelloffset,ijcelloffset )
129  ibc = indijk(idcbeg,jdcbeg,kdcbeg,icelloffset,ijcelloffset)
130  iec = indijk(idcend,jdcend,kdcend,icelloffset,ijcelloffset)
131 
132  CALL rflo_getdimensphys( regionss1(ireg),ilev,ipcbeg,ipcend, &
133  jpcbeg,jpcend,kpcbeg,kpcend )
134  CALL rflo_getcelloffset( regionss1(ireg),ilev,icoff,ijcoff )
135 
136  ibpc = indijk(ipcbeg,jpcbeg,kpcbeg,icoff,ijcoff)
137  iepc = indijk(ipcend,jdcend,kpcend,icoff,ijcoff)
138 
139  ALLOCATE( grid%cofg(3,ibc:iec),stat=errorflag )
140  global%error = errorflag
141  IF (global%error /= 0) CALL errorstop( global, err_allocate,__line__ )
142 
143  IF (global%verbLevel /= verbose_none) &
144  WRITE(stdout,'(/,A,2X,I5)') ' nGridLevels = ',regionss1(ireg)%nGridLevels
145 
146  CALL rflo_copygeometrydummy( regionss1(ireg) )
147  CALL rflo_calccellcentroids( regionss1(ireg) )
148 
149  ENDDO ! iReg
150 
151 ! start case selection for analytical solutions -------------------------------
152 
153  SELECT CASE (similaritytype)
154 
155 ! generates Input DataStream for C0
156 
157  CASE (rvav_culick)
158 
159  IF (global%verbLevel /= verbose_none) &
160  WRITE(stdout,'(/,A)') 'Generates Input Deck for C0 ...'
161 
162  CALL rvav_proudmanculicksolution( fname,regionss1 )
163 
164 ! generates Input DataStream for GAMM Bump
165 
166  CASE (rvav_gammbump)
167 
168  IF (global%verbLevel /= verbose_none) &
169  WRITE(stdout,'(/,A)') 'Generates Input Deck for GAMM Bump ...'
170 
171  CALL rvav_gammbumpsolution( fname,regionss1 )
172 
173 ! generates Input DataStream for Laminar Blasius
174 
175  CASE (rvav_blasius)
176 
177  IF (global%verbLevel /= verbose_none) &
178  WRITE(stdout,'(/,A)') 'Generates Input Deck for Laminar Blasius ...'
179 
180  CALL rvav_blasiussolution( fname,regionss1 )
181 
182  END SELECT ! similarityType
183 
184 ! close file ------------------------------------------------------------------
185 
186  CLOSE(if_rvav_file_s2,iostat=errorflag)
187  global%error = errorflag
188  IF (global%error /= 0) &
189  CALL errorstop( global, err_file_close,__line__,'File: '//trim(fname) )
190 
191  goto 999
192 
193 10 CONTINUE
194  CALL errorstop( global, err_file_read,__line__,'File: '//trim(fname) )
195 
196 ! finalize --------------------------------------------------------------------
197 
198 999 CONTINUE
199 
200  CALL deregisterfunction( global )
201 
202 1000 FORMAT('Region ',i5,', grid level= ',i2,'.')
203 
204 END SUBROUTINE rvav_computeanalyticalsolution
205 
206 !******************************************************************************
207 !
208 ! RCS Revision history:
209 !
210 ! $Log: RVAV_ComputeAnalyticalSolution.F90,v $
211 ! Revision 1.3 2008/12/06 08:45:08 mtcampbe
212 ! Updated license.
213 !
214 ! Revision 1.2 2008/11/19 22:18:18 mtcampbe
215 ! Added Illinois Open Source License/Copyright
216 !
217 ! Revision 1.1 2004/12/01 22:46:35 fnajjar
218 ! Initial revision after changing case
219 !
220 ! Revision 1.15 2003/11/20 16:40:41 mdbrandy
221 ! Backing out RocfluidMP changes from 11-17-03
222 !
223 ! Revision 1.11 2003/05/15 02:57:07 jblazek
224 ! Inlined index function.
225 !
226 ! Revision 1.10 2002/10/12 03:20:51 jblazek
227 ! Replaced [io]stat=global%error with local errorFlag for Rocflo.
228 !
229 ! Revision 1.9 2002/09/10 00:01:45 f-najjar
230 ! Variable global moved into regions()
231 !
232 ! Revision 1.8 2002/08/15 19:48:06 jblazek
233 ! Implemented grid deformation capability.
234 !
235 ! Revision 1.7 2002/07/31 02:34:57 f-najjar
236 ! Split Analytical Solutions into individual routines
237 !
238 ! Revision 1.6 2002/06/24 16:05:05 f-najjar
239 ! Cleanup for file writing
240 !
241 ! Revision 1.5 2002/06/24 15:48:09 f-najjar
242 ! Included Blasius Profile Computation
243 !
244 ! Revision 1.4 2002/06/21 14:11:15 f-najjar
245 ! Clean up for Consistency
246 !
247 ! Revision 1.3 2002/06/19 20:29:02 f-najjar
248 ! Included GAMM Bump Computation
249 !
250 ! Revision 1.2 2002/06/19 14:40:14 f-najjar
251 ! Included verbLevel calls for cleanup
252 !
253 ! Revision 1.1 2002/06/18 03:19:15 f-najjar
254 ! Initial Import
255 !
256 !******************************************************************************
257 
258 
259 
260 
261 
262 
263 
subroutine rvav_proudmanculicksolution(fname, regionsS1)
subroutine rflo_copygeometrydummy(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 idcend
subroutine rflo_calccellcentroids(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
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
**********************************************************************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
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
subroutine rvav_computeanalyticalsolution(similarityType, 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 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
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 form
**********************************************************************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
subroutine rvav_gammbumpsolution(fname, regionsS1)
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)
subroutine rvav_blasiussolution(fname, regionsS1)