Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PERI_CheckParamInput.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 PERI parameters either specified by user or set in the code.
26 !
27 ! Description: The checking includes the existency and order of parameters.
28 !
29 ! Input: regions = input parameters contained in periInput of all regions.
30 !
31 ! Output: Error msg.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: PERI_CheckParamInput.F90,v 1.5 2008/12/06 08:44:36 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE peri_checkparaminput( regions )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
48  USE modperiodic, ONLY : t_peri_input
49  USE modbndpatch, ONLY : t_patch
50  USE moderror
51  USE modmpi
52  USE modparameters
54  IMPLICIT NONE
55 
56 ! ... parameters
57  TYPE(t_region), POINTER :: regions(:)
58 
59 ! ... loop variables
60  INTEGER :: ireg
61 
62 ! ... local variables
63  CHARACTER(CHRLEN) :: rcsidentstring
64  TYPE(t_global), POINTER :: global
65  TYPE(t_peri_input), POINTER :: input
66  TYPE(t_patch), POINTER :: patches(:)
67 
68 !******************************************************************************
69 
70  rcsidentstring = '$RCSfile: PERI_CheckParamInput.F90,v $'
71 
72  global => regions(1)%global
73  CALL registerfunction( global,'PERI_CheckParamInput',&
74  'PERI_CheckParamInput.F90' )
75 
76 ! check fixed parameters setting ---------------------------------------------
77 
78  IF (cpr_rho /= 1 .OR. &
79  cpr_ruc /= 2 .OR. &
80  cpr_rvc /= 3 .OR. &
81  cpr_uve /= 4 .OR. &
82  cpr_vve /= 5 .OR. &
83  cpr_tmp /= 6 .OR. &
84  cpr_prs /= 7) THEN
85  CALL errorstop( global,err_peri_fixparam,__line__,'cprVar id inconsistent' )
86  ENDIF
87 
88  IF (global%nProcAlloc /= global%nRegions) THEN
89  CALL errorstop( global,err_peri_mpi,__line__, &
90  'nProcAlloc should be = nRegions due to PERI_pgradUpdate procedure' )
91  ENDIF
92 
93 ! check PERI parameter selection regionwise
94 
95 #ifdef RFLO
96  DO ireg=1,global%nRegions
97  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
98  regions(ireg)%active==active) THEN ! on my processor
99 
100  patches => regions(ireg)%levels(1)%patches(:)
101 #endif
102 #ifdef RFLU
103  DO ireg = lbound(regions,1),ubound(regions,1)
104 
105  patches => regions(ireg)%patches(:)
106 #endif
107 
108 ! --- check if injection (cpr) or noslip wall (channel) bc on correct patch
109 
110  IF ((patches(1)%bcType >= bc_injection .AND. &
111  patches(1)%bcType <= bc_injection+bc_range) .OR. &
112  (patches(2)%bcType >= bc_injection .AND. &
113  patches(2)%bcType <= bc_injection+bc_range) .OR. &
114  (patches(5)%bcType >= bc_injection .AND. &
115  patches(5)%bcType <= bc_injection+bc_range) .OR. &
116  (patches(6)%bcType >= bc_injection .AND. &
117  patches(6)%bcType <= bc_injection+bc_range)) THEN
118  CALL errorstop( regions(ireg)%global,err_peri_cprbc,__line__, &
119  'cpr injection bc should be on patch 3 and 4' )
120  ENDIF
121 
122  IF ((patches(1)%bcType >= bc_noslipwall .AND. &
123  patches(1)%bcType <= bc_noslipwall+bc_range) .OR. &
124  (patches(2)%bcType >= bc_noslipwall .AND. &
125  patches(2)%bcType <= bc_noslipwall+bc_range) .OR. &
126  (patches(5)%bcType >= bc_noslipwall .AND. &
127  patches(5)%bcType <= bc_noslipwall+bc_range) .OR. &
128  (patches(6)%bcType >= bc_noslipwall .AND. &
129  patches(6)%bcType <= bc_noslipwall+bc_range)) THEN
130  CALL errorstop( regions(ireg)%global,err_peri_input,__line__, &
131  'channel noslip wall bc should be on patch 3 and 4' )
132  ENDIF
133 
134 ! --- peri input check
135 
136  input => regions(ireg)%periInput
137 
138  IF ((input%flowKind < peri_flow_none).AND. &
139  (input%flowKind > peri_flow_channel)) THEN
140  CALL errorstop( global,err_peri_input,__line__, &
141  'flowkind out of range' )
142  ENDIF
143 
144  IF (input%flowKind == peri_flow_bola) THEN
145  CALL errorstop( global,err_peri_input,__line__, &
146  'boundary layer flow is not ready yet' )
147  ENDIF
148 
149 #ifdef RFLO
150  IF (input%split(jcoord) /= off) THEN
151  IF (input%split(icoord)/=off .OR. input%split(kcoord)/=off) THEN
152  CALL errorstop( global,err_peri_input,__line__, &
153  'cannot combine splitting domain in wall normal with other directions' )
154  ENDIF
155  ENDIF
156 #endif
157 
158  IF (input%flowKind == peri_flow_cpr) THEN
159  IF (input%nVar /= cpr_nvar) THEN
160  CALL errorstop( global,err_peri_input,__line__,'cpr nVar /= 7' )
161  ENDIF
162  IF (input%minjRate /= &
163  patches(3)%mixt%vals(bcdat_inject_mfrate,0)) THEN
164  CALL errorstop( global,err_peri_cprbc,__line__, &
165  'mass injection rate in inj. patches different' )
166  ENDIF
167  IF (input%bulkmFlux < 0._rfreal) THEN
168  CALL errorstop( global,err_peri_input,__line__,'cpr bulk mflux < 0' )
169  ENDIF
170  IF (input%cprEpsilon < 0._rfreal) THEN
171  CALL errorstop( global,err_peri_input,__line__,'cpr epsilon < 0' )
172  ENDIF
173  IF (input%headPres < 0._rfreal) THEN
174  CALL errorstop( global,err_peri_input,__line__,'cpr head pres. < 0' )
175  ENDIF
176  IF (input%headTemp < 0._rfreal) THEN
177  CALL errorstop( global,err_peri_input,__line__,'cpr head temp. < 0' )
178  ENDIF
179  ELSEIF (input%flowKind == peri_flow_channel) THEN
180  IF ((input%pgradType < 0) .OR. (input%pgradType > 1)) THEN
181  CALL errorstop( global,err_peri_input,__line__, &
182  'PGRADTYPE should be 0 or 1' )
183  ENDIF
184  ENDIF
185 
186 #ifdef RFLO
187  ENDIF ! region active
188 #endif
189  ENDDO ! iReg
190 
191 ! finalize ---------------------------------------------------------------
192 
193  CALL deregisterfunction( global )
194 
195 END SUBROUTINE peri_checkparaminput
196 
197 !******************************************************************************
198 !
199 ! RCS Revision history:
200 !
201 ! $Log: PERI_CheckParamInput.F90,v $
202 ! Revision 1.5 2008/12/06 08:44:36 mtcampbe
203 ! Updated license.
204 !
205 ! Revision 1.4 2008/11/19 22:17:49 mtcampbe
206 ! Added Illinois Open Source License/Copyright
207 !
208 ! Revision 1.3 2006/08/19 15:40:08 mparmar
209 ! Renamed patch variables
210 !
211 ! Revision 1.2 2004/06/11 21:49:40 wasistho
212 ! prepared for RFLU
213 !
214 ! Revision 1.1 2004/06/08 23:56:56 wasistho
215 ! changed nomenclature
216 !
217 ! Revision 1.4 2003/10/17 20:25:39 wasistho
218 ! generalize check of nregions = nprocs
219 !
220 ! Revision 1.3 2003/09/18 01:56:17 wasistho
221 ! added ijksplit and pgradType in PERI_PgradUpdate
222 !
223 ! Revision 1.2 2003/04/03 00:31:07 wasistho
224 ! enable channel flow
225 !
226 ! Revision 1.1.1.1 2003/03/29 03:36:30 wasistho
227 ! install ROCPERI
228 !
229 !
230 !
231 !******************************************************************************
232 
233 
234 
235 
236 
237 
238 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine input(X, NNODE, NDC, NCELL, NFCE, NBPTS, NBFACE, ITYP, NPROP, XBNDY, XFAR, YFAR, ZFAR)
subroutine peri_checkparaminput(regions)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469