Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PEUL_DerivedInputValues.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: set values derived from user input for Eulerian particles.
26 !
27 ! Description: none.
28 !
29 ! Input: regions = input parameters for all regions.
30 !
31 ! Output: regions = numerical parameters and no. of equations for each region.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: PEUL_DerivedInputValues.F90,v 1.3 2008/12/06 08:44:39 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2002 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE peul_derivedinputvalues( regions )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
49  USE moderror
50  USE modparameters
52  IMPLICIT NONE
53 
54 ! ... parameters
55  TYPE(t_region), POINTER :: regions(:)
56 
57 ! ... loop variables
58  INTEGER :: ireg, ilev, iptype
59 
60 ! ... local variables
61  CHARACTER(CHRLEN) :: rcsidentstring
62 
63  TYPE(t_global), POINTER :: global
64  TYPE(t_peul_input), POINTER :: input
65  TYPE(t_peul_ptype), POINTER :: ptype
66  TYPE(t_peul), POINTER :: peul
67 
68 !******************************************************************************
69 
70  rcsidentstring = '$RCSfile: PEUL_DerivedInputValues.F90,v $ $Revision: 1.3 $'
71 
72  global => regions(1)%global
73 
74  CALL registerfunction( global,'PEUL_DerivedInputValues',&
75  'PEUL_DerivedInputValues.F90' )
76 
77 ! global values ---------------------------------------------------------------
78 
79 ! (none currently)
80 
81 ! region related values -------------------------------------------------------
82 
83  DO ireg=lbound(regions,1),ubound(regions,1)
84 
85  input => regions(ireg)%peulInput
86 
87 ! - number of variables
88 
89  DO ilev=1,regions(ireg)%nGridLevels
90 
91  peul => regions(ireg)%levels(ilev)%peul
92 
93  peul%nCv1 = cv_peul_neqs
94  peul%nDv1 = 0
95  peul%nTv1 = 0
96 
97  peul%nCv = input%nPtypes * peul%nCv1
98  peul%nDv = input%nPtypes * peul%nDv1
99  peul%nTv = input%nPtypes * peul%nTv1
100 
101  ENDDO ! iLev
102 
103 ! - Check peulInput quantities (none currently)
104 
105 !- Fill auxillary peulInput variables (none currently)
106 
107  DO iptype = 1,input%nPtypes
108 
109  ptype => input%ptypes(iptype)
110 
111 ! --- Check peulInput%ptypes quantities
112 
113  IF (.NOT. ASSOCIATED(ptype%material)) &
114  CALL errorstop( global,err_val_undefined,__line__ )
115 
116  IF (ptype%material%molw <= 0._rfreal) &
117  CALL errorstop( global,err_peul_badval,__line__ )
118 
119  IF (ptype%material%molw > 10._rfreal) THEN
120  WRITE(stdout,*)
121  WRITE(stdout,*) '### WARNING: Molecular weight suspiciously large: ', &
122  ptype%material%molw
123  WRITE(stdout,*) '### E.g., in SI units carbon is 0.012'
124  WRITE(stdout,*)
125  ENDIF
126 
127  IF (ptype%material%dens <= 0._rfreal) &
128  CALL errorstop( global,err_peul_badval,__line__ )
129 
130  IF (ptype%material%spht <= 0._rfreal) &
131  CALL errorstop( global,err_peul_badval,__line__ )
132 
133  IF (ptype%diam <= 0._rfreal) &
134  CALL errorstop( global,err_peul_badval,__line__ )
135 
136  IF (ptype%diam > 0.099_rfreal) THEN
137  WRITE(stdout,*)
138  WRITE(stdout,*) '### WARNING: Particle diameter suspiciously large: ', &
139  ptype%diam
140  WRITE(stdout,*) '### Input units are meters'
141  WRITE(stdout,*)
142  ENDIF
143 
144  IF (ptype%puff < 1._rfreal) THEN
145  IF (ptype%puff < 0.999_rfreal) THEN
146  CALL errorstop( global,err_peul_badval,__line__ )
147  ELSE
148  ptype%puff = 1._rfreal
149  ENDIF
150  ENDIF
151 
152 ! --- Sc not actually used
153 ! IF (ptype%Sc <= 0._RFREAL) &
154 ! CALL ErrorStop( global,ERR_PEUL_BADVAL,__LINE__ )
155 
156 ! --- k2 not actually used
157 ! IF (ptype%vis2 < 0._RFREAL) &
158 ! CALL ErrorStop( global,ERR_PEUL_BADVAL,__LINE__ )
159 
160  IF (ptype%vis4 <= 0._rfreal) &
161  CALL errorstop( global,err_peul_badval,__line__ )
162 
163  ptype%vis4 = 1._rfreal/ptype%vis4
164 
165  SELECT CASE (ptype%negReport)
166  CASE (peul_neg_report_none)
167  CASE (peul_neg_report_used)
168  CASE default
169  CALL errorstop( global,err_peul_badval,__line__ )
170  END SELECT ! ptype%negReport
171 
172  SELECT CASE (ptype%clipModel)
173  CASE (peul_clip_model_none)
174  CASE (peul_clip_model_used)
175  CASE default
176  CALL errorstop( global,err_peul_badval,__line__ )
177  END SELECT ! ptype%clipModel
178 
179  SELECT CASE (ptype%methodV)
180 
181  CASE (peul_methv_fluidvel)
182 
183  CASE (peul_methv_eqeul)
184 
185 ! ----- require Navier-Stokes for Eq. Eul. because it uses the velocity
186 ! ----- gradient information computed in ViscousFluxes
187 
188  IF (regions(ireg)%mixtInput%flowModel /= flow_navst) THEN
189  WRITE(stdout,*) '### PEUL: Eq. Eul. method requires Navier-Stokes'
190  CALL errorstop( global,err_peul_badval,__line__ )
191  END IF ! flowModel
192 
193  regions(ireg)%mixtInput%computeTv = .true.
194  DO ilev=1,regions(ireg)%nGridLevels
195  IF (regions(ireg)%levels(ilev)%mixt%nTv < 2) THEN
196  regions(ireg)%levels(ilev)%mixt%nTv = 2
197  END IF ! nTv
198  END DO ! iLev
199  IF (regions(ireg)%mixtInput%viscModel < visc_suthr .OR. &
200  regions(ireg)%mixtInput%viscModel > visc_antib) THEN
201  CALL errorstop(global,err_unknown_viscmodel,__line__)
202  END IF ! viscModel
203 
204  CASE default
205  CALL errorstop( global,err_peul_badval,__line__ )
206 
207  END SELECT ! ptype%methodV
208 
209 ! --- Fill auxillary peulInput%ptypes variables
210 
211  ptype%denseff = ptype%material%dens / ptype%puff
212  ptype%voleff = ptype%diam**3 * global%pi / 6._rfreal
213  ptype%volmat = ptype%voleff / ptype%puff
214 
215 ! --- Note: include pressure correction: (1 - beta) factor
216  ptype%tauVcoef = (ptype%denseff - 1._rfreal)*ptype%diam**2 / 18._rfreal
217 
218  ptype%maxConc = 0.7_rfreal*ptype%denseff
219 
220  ENDDO ! iPtype
221  ENDDO ! iReg
222 
223 ! finalize --------------------------------------------------------------------
224 
225  CALL deregisterfunction( global )
226 
227 END SUBROUTINE peul_derivedinputvalues
228 
229 !******************************************************************************
230 !
231 ! RCS Revision history:
232 !
233 ! $Log: PEUL_DerivedInputValues.F90,v $
234 ! Revision 1.3 2008/12/06 08:44:39 mtcampbe
235 ! Updated license.
236 !
237 ! Revision 1.2 2008/11/19 22:17:51 mtcampbe
238 ! Added Illinois Open Source License/Copyright
239 !
240 ! Revision 1.1 2004/12/01 21:09:32 haselbac
241 ! Initial revision after changing case
242 !
243 ! Revision 1.6 2004/08/02 16:38:40 jferry
244 ! Added pressure correction to tau coefficient
245 !
246 ! Revision 1.5 2004/07/30 22:47:36 jferry
247 ! Implemented Equilibrium Eulerian method for Rocflu
248 !
249 ! Revision 1.4 2004/05/03 15:09:42 jferry
250 ! added equilibrium Eulerian capability for smoke
251 !
252 ! Revision 1.3 2004/03/05 22:09:04 jferry
253 ! created global variables for peul, plag, and inrt use
254 !
255 ! Revision 1.2 2003/03/11 16:04:57 jferry
256 ! Created data type for material properties
257 !
258 ! Revision 1.1 2003/02/11 22:52:50 jferry
259 ! Initial import of Rocsmoke
260 !
261 !******************************************************************************
262 
263 
264 
265 
266 
267 
268 
subroutine peul_derivedinputvalues(regions)
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 errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469