Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SPEC_CheckUserInput.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 input values for species.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! regions Data associated with regions
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 ! ******************************************************************************
37 !
38 ! $Id: SPEC_CheckUserInput.F90,v 1.6 2008/12/06 08:44:40 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003-2005 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 SUBROUTINE spec_checkuserinput(regions)
45 
46  USE modglobal, ONLY: t_global
47  USE moddatatypes
48  USE moddatastruct, ONLY: t_region
49  USE moderror
50  USE modparameters
51 
52  USE modspecies, ONLY: t_spec_type
53 
54  USE modinterfaces, ONLY: mixtperf_r_m
55 
56  IMPLICIT NONE
57 
58 ! ******************************************************************************
59 ! Definitions and declarations
60 ! ******************************************************************************
61 
62 ! ==============================================================================
63 ! Arguments
64 ! ==============================================================================
65 
66  TYPE(t_region), DIMENSION(:), POINTER :: regions
67 
68 ! ==============================================================================
69 ! Locals
70 ! ==============================================================================
71 
72  CHARACTER(CHRLEN) :: rcsidentstring
73  INTEGER :: ireg,ispec
74  REAL(RFREAL) :: cp,g,gc
75  TYPE(t_global), POINTER :: global
76  TYPE(t_spec_type), POINTER :: pspectype
77 
78 ! ******************************************************************************
79 ! Start
80 ! ******************************************************************************
81 
82  rcsidentstring = '$RCSfile: SPEC_CheckUserInput.F90,v $ $Revision: 1.6 $'
83 
84  global => regions(1)%global
85 
86  CALL registerfunction(global,'SPEC_CheckUserInput',&
87  'SPEC_CheckUserInput.F90')
88 
89 ! ******************************************************************************
90 ! Check input values
91 ! ******************************************************************************
92 
93  DO ireg = lbound(regions,1),ubound(regions,1)
94 
95 ! ==============================================================================
96 ! Gas properties
97 ! ==============================================================================
98 
99  DO ispec = 1,regions(ireg)%specInput%nSpecies
100  pspectype => regions(ireg)%specInput%specType(ispec)
101 
102  gc = mixtperf_r_m(pspectype%pMaterial%molw)
103  cp = pspectype%pMaterial%spht
104  g = cp/(cp-gc)
105 
106  IF ( (g < 1.0_rfreal) .OR. (g > 2.0_rfreal) ) THEN
107  CALL errorstop(global,err_spec_props_invalid,__line__)
108  END IF ! pSpecType%pMaterial%spht
109  END DO ! iSpec
110 
111 ! ==============================================================================
112 ! EEM velocity
113 ! ==============================================================================
114 
115  SELECT CASE ( regions(ireg)%mixtInput%indSd )
116  CASE ( 0 )
117  CASE ( 1 )
118  IF ( regions(ireg)%mixtInput%computeTv .EQV. .false. ) THEN
119  CALL errorstop(global,err_illegal_value,__line__, &
120  'Attempting to use EEM without viscosity')
121  END IF ! regions(iReg)%mixtInput%computeTv
122 
123  IF ( regions(ireg)%mixtInput%moveGrid .EQV. .true. ) THEN
124  CALL errorstop(global,err_unknown_option,__line__, &
125  'EEM not yet implemented with moving grid')
126  END IF ! regions(iReg)%mixtInput%moveGrid
127  CASE default
128  CALL errorstop(global,err_reached_default,__line__)
129  END SELECT ! regions(iReg)%mixtInput%indSd
130  END DO ! iReg
131 
132 ! ******************************************************************************
133 ! End
134 ! ******************************************************************************
135 
136  CALL deregisterfunction(global)
137 
138 END SUBROUTINE spec_checkuserinput
139 
140 ! ******************************************************************************
141 !
142 ! RCS Revision history:
143 !
144 ! $Log: SPEC_CheckUserInput.F90,v $
145 ! Revision 1.6 2008/12/06 08:44:40 mtcampbe
146 ! Updated license.
147 !
148 ! Revision 1.5 2008/11/19 22:17:52 mtcampbe
149 ! Added Illinois Open Source License/Copyright
150 !
151 ! Revision 1.4 2006/04/07 15:19:24 haselbac
152 ! Removed tabs
153 !
154 ! Revision 1.3 2005/11/10 02:33:38 haselbac
155 ! Clean-up, added checks for gas properties
156 !
157 ! Revision 1.2 2004/07/30 22:47:37 jferry
158 ! Implemented Equilibrium Eulerian method for Rocflu
159 !
160 ! Revision 1.1 2003/11/25 21:08:37 haselbac
161 ! Initial revision
162 !
163 ! ******************************************************************************
164 
165 
166 
167 
168 
169 
170 
real(rfreal) function mixtperf_r_m(M)
Definition: MixtPerf_R.F90:54
subroutine spec_checkuserinput(regions)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
unsigned char g() const
Definition: Color.h:69