Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PREP_CheckBcValidity.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 validity of BC input.
26 !
27 ! Description: comparison made between .bc and .top files to check whether
28 ! all bc required in the .top file are defined in the .bc file.
29 !
30 ! Input: regions = data of all regions.
31 !
32 ! Output: error msg for inconsistency.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: PREP_CheckBcValidity.F90,v 1.7 2008/12/06 08:44:50 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE checkbcvalidity( regions )
45 
46  USE moddatatypes
47  USE modglobal, ONLY : t_global
48  USE modbndpatch, ONLY : t_patch
49  USE moddatastruct, ONLY : t_region
50  USE moderror
51  USE modparameters
52  IMPLICIT NONE
53 
54 #include "Indexing.h"
55 
56 ! ... parameters
57  TYPE(t_global), POINTER :: global
58  TYPE(t_region), POINTER :: regions(:)
59  TYPE(t_patch), POINTER :: patch
60 
61 ! ... loop variables
62  INTEGER :: ireg, ipatch
63 
64 ! ... local variables
65  INTEGER :: ilev, bctype
66 
67 !******************************************************************************
68 
69  global => regions(1)%global
70  CALL registerfunction( global,'CheckBcValidity',&
71  'PREP_CheckBcValidity.F90' )
72 
73 ! start -----------------------------------------------------------------------
74 
75  ilev = global%startLevel
76 
77  DO ireg = 1,global%nRegions
78  DO ipatch=1,regions(ireg)%nPatches
79 
80  patch => regions(ireg)%levels(ilev)%patches(ipatch)
81  bctype = patch%bcType
82 
83  SELECT CASE(bctype)
84 
85  CASE (bc_slipwall)
86  IF (.NOT. global%prepBcDefined(bc_slipwall)) &
87  CALL errorstop( global,err_no_bcspecified,__line__, &
88  'BC_SLIPW is used in .top but not defined in .bc file' )
89 
90  CASE (bc_noslipwall)
91  IF (.NOT. global%prepBcDefined(bc_noslipwall)) &
92  CALL errorstop( global,err_no_bcspecified,__line__, &
93  'BC_NOSLIP is used in .top but not defined in .bc file' )
94 
95  CASE (bc_inflow)
96  IF (.NOT. global%prepBcDefined(bc_inflow) .AND. &
97  .NOT. global%prepBcDefined(bc_inflow_totang) .AND. &
98  .NOT. global%prepBcDefined(bc_inflow_veltemp) .AND. &
99  .NOT. global%prepBcDefined(bc_inflow_velpress)) &
100  CALL errorstop( global,err_no_bcspecified,__line__, &
101  'BC_INFLOW_... is used in .top but not defined in .bc file' )
102 
103  CASE (bc_outflow)
104  IF (.NOT. global%prepBcDefined(bc_outflow)) &
105  CALL errorstop( global,err_no_bcspecified,__line__, &
106  'BC_OUTFLOW is used in .top but not defined in .bc file' )
107 
108  CASE (bc_farfield)
109  IF (.NOT. global%prepBcDefined(bc_farfield)) &
110  CALL errorstop( global,err_no_bcspecified,__line__, &
111  'BC_FARF is used in .top but not defined in .bc file' )
112 
113  CASE (bc_injection)
114  IF (.NOT. global%prepBcDefined(bc_injection) .AND. &
115  .NOT. global%prepBcDefined(bc_injection_apn)) &
116  CALL errorstop( global,err_no_bcspecified,__line__, &
117  'BC_INJECT is used in .top but not defined in .bc file' )
118 
119  IF (global%prepBcDefined(bc_injection_apn) .AND. &
120  patch%bcCoupled == bc_external) &
121  CALL errorstop( global,err_external_funct,__line__, &
122  'BC_INJECT_APN used in .bc with interaction flag in .top file' )
123 
124  END SELECT
125 
126  ENDDO ! iReg
127  ENDDO ! iPatch
128 
129 ! finalize --------------------------------------------------------------------
130 
131  CALL deregisterfunction( global )
132 
133 END SUBROUTINE checkbcvalidity
134 
135 !******************************************************************************
136 !
137 ! RCS Revision history:
138 !
139 ! $Log: PREP_CheckBcValidity.F90,v $
140 ! Revision 1.7 2008/12/06 08:44:50 mtcampbe
141 ! Updated license.
142 !
143 ! Revision 1.6 2008/11/19 22:18:00 mtcampbe
144 ! Added Illinois Open Source License/Copyright
145 !
146 ! Revision 1.5 2006/01/30 20:16:47 wasistho
147 ! added safety for using injectionAPN
148 !
149 ! Revision 1.4 2006/01/29 09:35:00 wasistho
150 ! added injection_apn
151 !
152 ! Revision 1.3 2005/04/29 20:20:16 wasistho
153 ! bug fixed, removed second bc_inflow in select case
154 !
155 ! Revision 1.2 2005/04/29 03:31:33 wasistho
156 ! added distribution bc file generator
157 !
158 ! Revision 1.1 2004/12/03 02:20:08 wasistho
159 ! added prefix
160 !
161 ! Revision 1.1 2004/12/03 00:40:49 wasistho
162 ! lower to upper case
163 !
164 ! Revision 1.1 2004/07/27 20:29:47 wasistho
165 ! added readBcInputFile and checkBcValidity
166 !
167 !
168 !******************************************************************************
169 
170 
171 
172 
173 
174 
175 
176 
177 
178 
179 
subroutine checkbcvalidity(regions)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
Definition: patch.h:74
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469