Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_CheckBcInput.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: check BC data specified by the user for all modules.
26 !
27 ! Description: none.
28 !
29 ! Input: regions = input parameters for all grid regions.
30 !
31 ! Output: none.
32 !
33 ! Notes: also allocates TBC arrays.
34 !
35 !******************************************************************************
36 !
37 ! $Id: RFLO_CheckBcInput.F90,v 1.6 2008/12/06 08:44:26 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE rflo_checkbcinput( regions )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
48  USE modmixture, ONLY : t_mixt_input
49  USE modbndpatch, ONLY : t_patch, t_bcvalues
50  USE moderror
51  USE modparameters
52  IMPLICIT NONE
53 
54 ! ... parameters
55  TYPE(t_region), POINTER :: regions(:)
56 
57 ! ... loop variables
58  INTEGER :: ireg, ipatch, ilev, ftype
59 
60 ! ... local variables
61  CHARACTER(CHRLEN) :: msg
62 
63  INTEGER :: errorflag
64 
65  TYPE(t_global), POINTER :: global
66  TYPE(t_mixt_input), POINTER :: input
67  TYPE(t_patch), POINTER :: patch
68  TYPE(t_bcvalues), POINTER :: bc
69 
70 !******************************************************************************
71 
72  global => regions(1)%global
73 
74  CALL registerfunction( global,'RFLO_CheckBcInput',&
75  'RFLO_CheckBcInput.F90' )
76 
77 ! check if all BCs set (for all active modules), and allocate TBCs
78 
79  DO ireg=1,global%nRegions
80  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
81  regions(ireg)%active==active) THEN ! on my processor
82  input => regions(ireg)%mixtInput
83  DO ilev=1,regions(ireg)%nGridLevels
84  DO ipatch=1,regions(ireg)%nPatches
85  patch => regions(ireg)%levels(ilev)%patches(ipatch)
86  DO ftype = 1,ftype_max
87 
88  SELECT CASE(ftype)
89  CASE (ftype_mixt)
90  bc => patch%mixt
91  CASE (ftype_turb)
92  IF (input%turbModel == turb_model_none) cycle
93  bc => patch%turb
94  CASE (ftype_plag)
95  cycle
96  CASE (ftype_peul)
97  IF (global%peulUsed .eqv. .false.) cycle
98  bc => patch%peul
99  CASE (ftype_spec)
100  IF (input%gasModel == gas_model_tcperf) cycle
101  bc => patch%spec
102  CASE (ftype_radi)
103  IF (input%radiUsed .eqv. .false.) cycle
104  bc => patch%valRadi
105  END SELECT
106 
107  IF (bc%bcSet .eqv. .false.) THEN
108  WRITE(msg,1000) ireg,ilev,ipatch,patch%bcType,ftype
109  CALL errorstop( global,err_no_bcspecified,__line__,trim(msg) )
110  ENDIF
111 
112  IF (bc%nData > 0) THEN
113  ALLOCATE( bc%tbcs(bc%nData),stat=errorflag )
114  global%error = errorflag
115  IF (global%error /= 0) &
116  CALL errorstop( global,err_allocate,__line__ )
117  bc%tbcs(:)%tbcType = tbc_none
118  ENDIF
119 
120  ENDDO ! fType
121  ENDDO ! iPatch
122  ENDDO ! iLev
123  ENDIF ! region active and on my processor
124  ENDDO ! iReg
125 
126 ! finalize
127 
128  CALL deregisterfunction( global )
129 
130 1000 FORMAT('Region ',i5,', level ',i1,', patch ',i3,', bcType ',i3, &
131  ', fType ',i3)
132 
133 END SUBROUTINE rflo_checkbcinput
134 
135 !******************************************************************************
136 !
137 ! RCS Revision history:
138 !
139 ! $Log: RFLO_CheckBcInput.F90,v $
140 ! Revision 1.6 2008/12/06 08:44:26 mtcampbe
141 ! Updated license.
142 !
143 ! Revision 1.5 2008/11/19 22:17:37 mtcampbe
144 ! Added Illinois Open Source License/Copyright
145 !
146 ! Revision 1.4 2008/08/13 17:25:33 mtcampbe
147 ! Fixed IF statements for booleans to use .eqv. .false. instead of .NOT.
148 ! (beats me)
149 !
150 ! Revision 1.3 2006/08/19 15:39:30 mparmar
151 ! Renamed patch variables
152 !
153 ! Revision 1.2 2005/10/31 21:09:36 haselbac
154 ! Changed specModel and SPEC_MODEL_NONE
155 !
156 ! Revision 1.1 2004/11/29 20:51:38 wasistho
157 ! lower to upper case
158 !
159 ! Revision 1.4 2004/03/05 22:09:02 jferry
160 ! created global variables for peul, plag, and inrt use
161 !
162 ! Revision 1.3 2003/05/15 02:57:03 jblazek
163 ! Inlined index function.
164 !
165 ! Revision 1.2 2003/02/26 23:19:48 jferry
166 ! Replaced [io]stat=global%error with local errorFlag for Rocflo.
167 !
168 ! Revision 1.1 2003/02/11 22:49:53 jferry
169 ! Re-worked BC and TBC input routines to add multi-physics capability
170 !
171 ! Revision 1.1 2003/02/11 22:30:20 jferry
172 ! Re-worked BC and TBC input routines to add multi-physics capability
173 !
174 !******************************************************************************
175 
176 
177 
178 
179 
180 
181 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
Definition: patch.h:74
subroutine input(X, NNODE, NDC, NCELL, NFCE, NBPTS, NBFACE, ITYP, NPROP, XBNDY, XFAR, YFAR, ZFAR)
subroutine rflo_checkbcinput(regions)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469