Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SPEC_RFLU_SetEEv.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: Compute EE approximation to velocity and temperature of particulate
26 ! species.
27 !
28 ! Description: None.
29 !
30 ! Input:
31 ! pRegion Pointer to data of current region
32 ! iSpec Index of species
33 !
34 ! Output: None.
35 !
36 ! Notes:
37 ! 1. Use nomenclature (gas instead of mixture) of document describing
38 ! governing equations for compressible multiphase flow.
39 !
40 ! ******************************************************************************
41 !
42 ! $Id: SPEC_RFLU_SetEEv.F90,v 1.5 2008/12/06 08:44:40 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2005 by the University of Illinois
45 !
46 ! ******************************************************************************
47 
48 SUBROUTINE spec_rflu_seteev(pRegion,iSpec)
49 
50  USE moddatatypes
51  USE modglobal, ONLY: t_global
52  USE moddatastruct, ONLY: t_region
53  USE modgrid, ONLY: t_grid
54  USE moderror
55  USE modparameters
56 
57  USE modspecies, ONLY: t_spec_type
58 
60 
61  IMPLICIT NONE
62 
63 ! ******************************************************************************
64 ! Definitions and declarations
65 ! ******************************************************************************
66 
67 ! ==============================================================================
68 ! Arguments
69 ! ==============================================================================
70 
71  INTEGER, INTENT(IN) :: ispec
72  TYPE(t_region), POINTER :: pregion
73 
74 ! ==============================================================================
75 ! Locals
76 ! ==============================================================================
77 
78  CHARACTER(CHRLEN) :: rcsidentstring
79  INTEGER :: icg,ispeceev
80  REAL(RFREAL) :: gx,gy,gz,irg,tau,taucoef,tee,tg,ug,uee,vg,vee,wg,wee
81  REAL(RFREAL), DIMENSION(:,:), POINTER :: pcvg,pdvg,psd,ptvg
82  REAL(RFREAL), DIMENSION(:,:,:), POINTER :: peev
83  TYPE(t_global), POINTER :: global
84  TYPE(t_grid), POINTER :: pgrid
85  TYPE(t_spec_type), POINTER :: pspectype
86 
87 ! ******************************************************************************
88 ! Start
89 ! ******************************************************************************
90 
91  rcsidentstring = '$RCSfile: SPEC_RFLU_SetEEv.F90,v $ $Revision: 1.5 $'
92 
93  global => pregion%global
94 
95  CALL registerfunction(global,'SPEC_RFLU_SetEEv',&
96  'SPEC_RFLU_SetEEv.F90')
97 
98 ! ******************************************************************************
99 ! Set dimensions and pointers
100 ! ******************************************************************************
101 
102  pgrid => pregion%grid
103  psd => pregion%mixt%sd
104  pcvg => pregion%mixt%cv
105  pdvg => pregion%mixt%dv
106  ptvg => pregion%mixt%tv
107  peev => pregion%spec%eev
108 
109  pspectype => pregion%specInput%specType(ispec)
110 
111  taucoef = pspectype%tauCoefficient
112  ispeceev = pspectype%iSpec2iSpecEEv
113 
114 ! ******************************************************************************
115 ! Checks: Defensive coding, should never occur
116 ! ******************************************************************************
117 
118  IF ( pspectype%discreteFlag .EQV. .false. ) THEN
119  CALL errorstop(global,err_illegal_value,__line__)
120  END IF ! pSpecType%discreteFlag
121 
122  IF ( pspectype%velocityMethod /= spec_methv_eqeul ) THEN
123  CALL errorstop(global,err_illegal_value,__line__)
124  END IF ! pSpecType%velocityMethod
125 
126  IF ( taucoef <= 0.0_rfreal ) THEN
127  CALL errorstop(global,err_illegal_value,__line__)
128  END IF ! tauCoef
129 
130  IF ( pregion%mixtInput%indSd /= 1 ) THEN
131  CALL errorstop(global,err_illegal_value,__line__)
132  END IF ! pRegion%mixtInput%indSd
133 
134  IF ( pregion%mixt%cvState /= cv_mixt_state_cons ) THEN
135  CALL errorstop(global,err_cv_state_invalid,__line__)
136  END IF ! pRegion%mixt%cvState
137 
138 ! ******************************************************************************
139 ! Set gravity vector for settling velocity contribution
140 ! ******************************************************************************
141 
142  IF ( pspectype%settlingFlag .EQV. .true. ) THEN
143  IF ( global%accelOn .EQV. .true. ) THEN
144  gx = global%accelX
145  gy = global%accelY
146  gz = global%accelZ
147  ELSE
148  gx = 0.0_rfreal
149  gy = 0.0_rfreal
150  gz = 0.0_rfreal
151  END IF ! global%accelOn
152  ELSE
153  gx = 0.0_rfreal
154  gy = 0.0_rfreal
155  gz = 0.0_rfreal
156  END IF ! pSpecType%settlingFlag
157 
158 ! ******************************************************************************
159 ! Compute EE variables
160 ! ******************************************************************************
161 
162  DO icg = 1,pgrid%nCellsTot
163  irg = 1.0_rfreal/pcvg(cv_mixt_dens,icg)
164  ug = irg*pcvg(cv_mixt_xmom,icg)
165  vg = irg*pcvg(cv_mixt_ymom,icg)
166  wg = irg*pcvg(cv_mixt_zmom,icg)
167  tg = pdvg(dv_mixt_temp,icg)
168 
169  tau = taucoef/ptvg(tv_mixt_muel,icg)
170 
171  uee = ug - tau*(psd(sd_xmom,icg) - gx)
172  vee = vg - tau*(psd(sd_ymom,icg) - gy)
173  wee = wg - tau*(psd(sd_zmom,icg) - gz)
174 
175  tee = tg ! TEMPORARY
176 
177  peev(eev_spec_xvel,ispeceev,icg) = uee
178  peev(eev_spec_yvel,ispeceev,icg) = vee
179  peev(eev_spec_zvel,ispeceev,icg) = wee
180  peev(eev_spec_temp,ispeceev,icg) = tee
181  END DO ! icg
182 
183 ! ******************************************************************************
184 ! End
185 ! ******************************************************************************
186 
187  CALL deregisterfunction(global)
188 
189 END SUBROUTINE spec_rflu_seteev
190 
191 ! ******************************************************************************
192 !
193 ! RCS Revision history:
194 !
195 ! $Log: SPEC_RFLU_SetEEv.F90,v $
196 ! Revision 1.5 2008/12/06 08:44:40 mtcampbe
197 ! Updated license.
198 !
199 ! Revision 1.4 2008/11/19 22:17:53 mtcampbe
200 ! Added Illinois Open Source License/Copyright
201 !
202 ! Revision 1.3 2006/04/07 15:19:25 haselbac
203 ! Removed tabs
204 !
205 ! Revision 1.2 2006/01/06 22:43:14 haselbac
206 ! Bug fix: Incorrect declaration of iSpecEEv
207 !
208 ! Revision 1.1 2005/11/27 01:47:26 haselbac
209 ! Initial revision
210 !
211 ! ******************************************************************************
212 
213 
214 
215 
216 
217 
218 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine spec_rflu_seteev(pRegion, iSpec)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469