Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_CalcBreakup.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: invoke breakup model case for Lagrangian particles.
26 !
27 ! Description: none.
28 !
29 ! Input: region = current region.
30 !
31 ! Output: region%levels(iLev)%plag%cv
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: PLAG_CalcBreakup.F90,v 1.3 2008/12/06 08:44:33 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2003 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE plag_calcbreakup( region, iReg )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
48  USE modpartlag, ONLY : t_plag, t_plag_input
49  USE moderror
51 
52  IMPLICIT NONE
53 
54 ! ... parameters
55  TYPE(t_region), INTENT(INOUT), TARGET :: region
56 
57  INTEGER, INTENT(IN) :: ireg
58 
59 ! ... loop variables
60  INTEGER :: icont, ipcls
61 
62 ! ... local variables
63  CHARACTER(CHRLEN) :: rcsidentstring
64 
65  INTEGER :: breakupmodel, breakupwebswi, ncont, npcls
66 #ifdef RFLO
67  INTEGER :: ilev
68 #endif
69  INTEGER, POINTER, DIMENSION(:) :: pcvplagmass, pdvplagvolu
70 
71  REAL(RFREAL) :: breakupfac, breakupfacr, densg, diaml, diamlsplit, &
72  onethird, pi, presg, relvelmagl, surftensl, &
73  surftenssum, volusum, volusumr, weberl, webercrit
74 
75  REAL(RFREAL), DIMENSION(3) :: relvel
76  REAL(RFREAL), POINTER, DIMENSION(:) :: psurftens
77  REAL(RFREAL), POINTER, DIMENSION(:,:) :: parv,pcv, pdv
78 
79  TYPE(t_plag), POINTER :: pplag
80  TYPE(t_global), POINTER :: global
81 
82 !******************************************************************************
83 
84  rcsidentstring = '$RCSfile: PLAG_CalcBreakup.F90,v $ $Revision: 1.3 $'
85 
86  global => region%global
87 
88  CALL registerfunction( global,'PLAG_CalcBreakup',&
89  'PLAG_CalcBreakup.F90' )
90 
91 ! begin =======================================================================
92 
93 ! Check if there are any particles
94 
95 #ifdef RFLO
96  ilev = region%currLevel
97  npcls = 0
98  IF (global%plagUsed) npcls = region%levels(ilev)%plag%nPcls
99 #endif
100 #ifdef RFLU
101  npcls = 0
102  IF (global%plagUsed) npcls = region%plag%nPcls
103 #endif
104  IF (npcls < 1) go to 999
105 
106 ! Set pointers ----------------------------------------------------------------
107 
108 #ifdef RFLO
109  pplag => region%levels(ilev)%plag
110 #endif
111 #ifdef RFLU
112  pplag => region%plag
113 #endif
114 
115  parv => pplag%arv
116  pcv => pplag%cv
117  pdv => pplag%dv
118 
119  pcvplagmass => pplag%cvPlagMass
120  pdvplagvolu => pplag%dvPlagVolu
121  psurftens => region%plagInput%surftens
122 
123 ! Get dimensions --------------------------------------------------------------
124 
125  pi = global%pi
126  onethird = 1.0_rfreal/3.0_rfreal
127 
128  ncont = region%plagInput%nCont
129 
130  breakupmodel = region%plagInput%breakupModel
131  breakupwebswi = region%plagInput%breakupWebSwi
132  breakupfac = region%plagInput%breakupFac
133  breakupfacr = 1.0_rfreal/breakupfac
134 
135 ! Set appropriate coefficients pertinent to breakup Model ---------------------
136 
137  SELECT CASE (breakupmodel)
138 
139  CASE (plag_breakup_model1)
140  webercrit = 10.0_rfreal
141 
142  CASE default
143  CALL errorstop( global,err_reached_default,__line__ )
144 
145  END SELECT ! breakupModel
146 
147 ! Loop over all the particles -------------------------------------------------
148 
149  DO ipcls = 1,npcls
150 
151 ! - Extract gas properties ----------------------------------------------------
152 
153  densg = pdv(dv_plag_densmixt,ipcls)
154 
155 ! - Compute Particle surface tension ------------------------------------------
156 
157  volusum = sum( pdv(pdvplagvolu(:),ipcls) )
158  volusumr = 1.0_rfreal/volusum
159 
160  surftenssum = sum( pdv(pdvplagvolu(:),ipcls) * psurftens(:) )
161 
162  surftensl = surftenssum * volusumr
163 
164  diaml = pdv(dv_plag_diam,ipcls)
165 
166 ! - Compute relative velocities and its magnitude ----------------------------
167 
168  relvel(1) = pdv(dv_plag_uvelmixt,ipcls)-pdv(dv_plag_uvel,ipcls)
169  relvel(2) = pdv(dv_plag_vvelmixt,ipcls)-pdv(dv_plag_vvel,ipcls)
170  relvel(3) = pdv(dv_plag_wvelmixt,ipcls)-pdv(dv_plag_wvel,ipcls)
171 
172  relvelmagl = relvel(1)*relvel(1) &
173  + relvel(2)*relvel(2) &
174  + relvel(3)*relvel(3)
175 
176 ! - Compute weber number ------------------------------------------------------
177 
178  weberl = densg * diaml * relvelmagl / surftensl
179 
180 ! - Check if critical weber number is met -------------------------------------
181 
182  IF ( weberl >= webercrit ) THEN
183 
184 #ifdef PLAG_DEBUG
185  WRITE(*,'(A,3X,I3,3X,I4,3X,1PE12.5)') &
186  'PLAG_CalcBreakup-Critical We reached: iReg, iPcls, We = ',&
187  ireg, ipcls, weberl
188 #endif
189 
190 ! -- Redefine breakupFactor based on critical Weber, if needed ----------------
191 
192  IF ( breakupwebswi == plag_breakup_webswi1 ) THEN
193  breakupfac = ( densg * diaml * relvelmagl /( surftensl *webercrit ) ) **3
194  breakupfacr = 1.0_rfreal/breakupfac
195 
196 #ifdef PLAG_DEBUG
197  WRITE(*,'(A,3X,I3,3X,I4,3X,1PE12.5)') &
198  'PLAG_CalcBreakup-Breakup Switch Active: iReg, iPcls, breakupFac = ',&
199  ireg, ipcls, breakupfac
200 #endif
201 
202  END IF ! breakupSwi
203 
204 ! -- Update cv and arv values --------------------------------------------------
205 
206  DO icont = 1, ncont
207  pcv(pcvplagmass(icont),ipcls) = pcv(pcvplagmass(icont),ipcls)*breakupfacr
208  END DO ! iCont
209 
210  pcv(cv_plag_xmom,ipcls) = pcv(cv_plag_xmom,ipcls) * breakupfacr
211  pcv(cv_plag_ymom,ipcls) = pcv(cv_plag_ymom,ipcls) * breakupfacr
212  pcv(cv_plag_zmom,ipcls) = pcv(cv_plag_zmom,ipcls) * breakupfacr
213  pcv(cv_plag_ener,ipcls) = pcv(cv_plag_ener,ipcls) * breakupfacr
214  pcv(cv_plag_enervapor,ipcls) = pcv(cv_plag_enervapor,ipcls) * breakupfacr
215 
216  parv(arv_plag_spload,ipcls) = parv(arv_plag_spload,ipcls)* breakupfac
217  END IF ! weberL
218 
219  END DO ! iPcls
220 
221 ! finalize --------------------------------------------------------------------
222 
223 999 CONTINUE
224 
225  CALL deregisterfunction( global )
226 
227 END SUBROUTINE plag_calcbreakup
228 
229 !******************************************************************************
230 !
231 ! RCS Revision history:
232 !
233 ! $Log: PLAG_CalcBreakup.F90,v $
234 ! Revision 1.3 2008/12/06 08:44:33 mtcampbe
235 ! Updated license.
236 !
237 ! Revision 1.2 2008/11/19 22:17:45 mtcampbe
238 ! Added Illinois Open Source License/Copyright
239 !
240 ! Revision 1.1 2004/12/01 20:57:00 fnajjar
241 ! Initial revision after changing case
242 !
243 ! Revision 1.5 2004/03/25 21:16:43 jferry
244 ! fixed Vapor Energy bug
245 !
246 ! Revision 1.4 2004/03/05 22:09:03 jferry
247 ! created global variables for peul, plag, and inrt use
248 !
249 ! Revision 1.3 2004/02/06 21:18:20 fnajjar
250 ! Initial Integration of Rocpart with Rocflu
251 !
252 ! Revision 1.2 2003/09/15 20:26:54 fnajjar
253 ! Corrected breakupFac and removed cubeRootFac
254 !
255 ! Revision 1.1 2003/09/13 20:15:13 fnajjar
256 ! Initialimport of breakup model
257 !
258 !******************************************************************************
259 
260 
261 
262 
263 
264 
265 
Tfloat sum() const
Return the sum of all the pixel values in an image.
Definition: CImg.h:13022
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine plag_calcbreakup(region, iReg)
static const double pi
Definition: smooth_medial.C:43
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469