Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_InjcSetInjection.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 the next particle diameter and superparticle loading
26 ! for the multiphase injection algorithm.
27 !
28 ! Description: none.
29 !
30 ! Input: injcDiamDist = injection model type
31 ! diam = particle diameter
32 ! spLoad = superparticle loading
33 !
34 ! Output: diam and spLoad
35 !
36 ! Notes: none.
37 !
38 !******************************************************************************
39 !
40 ! $Id: PLAG_InjcSetInjection.F90,v 1.3 2008/12/06 08:44:34 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2002 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE plag_injcsetinjection( region, pTilePlag, iTile, tCoeff, tSum, &
47  poolvol, injectq, ratio )
48 
49  USE moddatatypes
50  USE moddatastruct, ONLY : t_region
51  USE modglobal, ONLY : t_global
52  USE modrandom, ONLY : rand1uniform
53  USE modpartlag, ONLY : t_tile_plag
54  USE moderror
55  USE modparameters
57  IMPLICIT NONE
58 
59 ! ... parameters
60  TYPE(t_region) :: region
61  TYPE(t_tile_plag), POINTER :: ptileplag
62 
63  INTEGER :: itile
64  LOGICAL :: injectq
65 
66  REAL(RFREAL) :: poolvol, ratio, tcoeff, tsum
67 
68 ! ... loop variables
69 
70 ! ... local variables
71  CHARACTER(CHRLEN) :: rcsidentstring
72 
73  REAL(RFREAL) :: coefratio, pi, poolvolnew, randunif, volpart
74  REAL(RFREAL), POINTER, DIMENSION(:,:) :: pdv
75  TYPE(t_global), POINTER :: global
76 
77 !******************************************************************************
78 
79  rcsidentstring = '$RCSfile: PLAG_InjcSetInjection.F90,v $ $Revision: 1.3 $'
80 
81  global => region%global
82 
83  CALL registerfunction( global, 'PLAG_InjcSetInjection',&
84  'PLAG_InjcSetInjection.F90' )
85 
86 ! Set pointer -----------------------------------------------------------------
87 
88  pdv => ptileplag%dv
89 
90 ! Set particle volume and new pool volume -------------------------------------
91 
92  pi = global%pi
93 
94  volpart = pi/6.0_rfreal* pdv(dv_tile_diam,itile)**3
95  poolvolnew = poolvol - pdv(dv_tile_spload,itile)*volpart
96 
97  ratio = 0.0_rfreal
98  injectq = .false.
99 
100  IF ( poolvolnew > 0.0_rfreal ) THEN
101 
102  coefratio = tcoeff/poolvolnew
103  tsum = tsum + coefratio*pdv(dv_tile_countdown,itile)
104 
105  IF ( tsum <= 1.0_rfreal ) THEN
106  injectq = .true.
107  ratio = volpart/poolvol
108 
109  randunif = rand1uniform(region%randData)
110  IF ( randunif <= 0.0_rfreal) THEN
111  pdv(dv_tile_countdown,itile) = 50.0_rfreal
112  ELSE
113  pdv(dv_tile_countdown,itile) = -log(randunif)
114  END IF ! randUnif
115 
116  ELSE
117 
118 ! - Decrease time factor to account for time waited in this step --------------
119 
120  pdv(dv_tile_countdown,itile) = (tsum-1.0_rfreal)/coefratio
121 
122  END IF ! tSum
123 
124  END IF !poolVolNew
125 
126 ! finalize --------------------------------------------------------------------
127 
128  CALL deregisterfunction( global )
129 
130 END SUBROUTINE plag_injcsetinjection
131 
132 !******************************************************************************
133 !
134 ! RCS Revision history:
135 !
136 ! $Log: PLAG_InjcSetInjection.F90,v $
137 ! Revision 1.3 2008/12/06 08:44:34 mtcampbe
138 ! Updated license.
139 !
140 ! Revision 1.2 2008/11/19 22:17:46 mtcampbe
141 ! Added Illinois Open Source License/Copyright
142 !
143 ! Revision 1.1 2004/12/01 20:57:42 fnajjar
144 ! Initial revision after changing case
145 !
146 ! Revision 1.3 2004/06/16 23:06:33 fnajjar
147 ! Renamed variabled for CRE kernel
148 !
149 ! Revision 1.2 2003/11/21 22:35:51 fnajjar
150 ! Update Random Number Generator
151 !
152 ! Revision 1.1 2002/10/25 14:16:31 f-najjar
153 ! Initial Import of Rocpart
154 !
155 !******************************************************************************
156 
157 
158 
159 
160 
161 
162 
subroutine plag_injcsetinjection(region, pTilePlag, iTile, tCoeff, tSum, poolVol, injectQ, ratio)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
REAL(RFREAL) function rand1uniform(rdata)
Definition: ModRandom.F90:345
static const double pi
Definition: smooth_medial.C:43
subroutine deregisterfunction(global)
Definition: ModError.F90:469