Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
INRT_CalcScouring.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 interaction sources on Lagrangian particles
26 ! for the scouring process.
27 !
28 ! Description: none.
29 !
30 ! Input: region = current region.
31 !
32 ! Output: region%levels(iLev)%plag%inrtSources
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: INRT_CalcScouring.F90,v 1.4 2008/12/06 08:44:31 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE inrt_calcscouring( region )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
49 #ifdef RFLO
50 #ifdef PEUL
51  USE modparteul, ONLY : t_peul
52 #endif
53 #endif
54 #ifdef RFLU
55  USE modspecies, ONLY : t_spec
56 #endif
57  USE modpartlag, ONLY : t_plag
58  USE modmixture, ONLY : t_mixt
59  USE modinteract
60  USE moderror
61  USE modparameters
63 
64 #ifdef PLAG
66 #endif
67 
68  IMPLICIT NONE
69 
70 ! ... parameters
71  TYPE(t_region), INTENT(INOUT), TARGET :: region
72 
73 ! ... loop variables
74  INTEGER :: iedge, icont, ipcls
75 
76 ! ... local variables
77  CHARACTER(CHRLEN) :: rcsidentstring
78 
79  INTEGER :: icell, indpeul0, ipeul, ncont, nedges, npcls
80 #ifdef RFLO
81  INTEGER :: ilev
82 #endif
83  INTEGER, POINTER, DIMENSION(:) :: pcvplagmass
84  INTEGER, POINTER, DIMENSION(:,:) :: paivl
85 
86  REAL(RFREAL) :: capturearea, coeffscour, diaml, mdotdepo, &
87  onefourth, peulconc, pi, relvelmagl
88  REAL(RFREAL), DIMENSION(3) :: vell, vels
89  REAL(RFREAL), POINTER, DIMENSION(:,:) :: pcvs, pdvl
90 #ifdef RFLO
91  REAL(RFREAL), POINTER, DIMENSION(:,:) :: pdvg
92 #endif
93 #ifdef RFLU
94  REAL(RFREAL), POINTER, DIMENSION(:,:) :: pcvg
95 #endif
96 
97  TYPE(t_inrt_input), POINTER :: pinputinrt
98  TYPE(t_inrt_interact), POINTER :: pinrtscour
99  TYPE(t_plag), POINTER :: pplag
100 #ifdef RFLO
101 #ifdef PEUL
102  TYPE(t_peul), POINTER :: ppeul
103 #endif
104 #endif
105 #ifdef RFLU
106  TYPE(t_spec), POINTER :: ppeul
107 #endif
108  TYPE(t_mixt), POINTER :: pmixt
109  TYPE(t_global), POINTER :: global
110 
111 !******************************************************************************
112 
113  rcsidentstring = '$RCSfile: INRT_CalcScouring.F90,v $ $Revision: 1.4 $'
114 
115  global => region%global
116 
117  CALL registerfunction( global,'INRT_CalcScouring',&
118  'INRT_CalcScouring.F90' )
119 
120 #ifdef PLAG
121 ! begin =======================================================================
122 
123 ! Check if there are any particles
124 
125  npcls = 0
126 
127 #ifdef RFLO
128  ilev = region%currLevel
129  IF (global%plagUsed) npcls = region%levels(ilev)%plag%nPcls
130 #endif
131 #ifdef RFLU
132  IF (global%plagUsed) npcls = region%plag%nPcls
133 #endif
134 
135  IF (npcls < 1) go to 999
136 
137 #ifdef RFLU
138 ! Check that have primitive state vector --------------------------------------
139 
140  IF ( region%mixt%cvState /= cv_mixt_state_duvwp ) THEN
141  CALL errorstop(global,err_cv_state_invalid,__line__)
142  END IF ! region%mixt%cvState
143 #endif
144 
145 ! Set pointers ----------------------------------------------------------------
146 
147 #ifdef RFLO
148  pplag => region%levels(ilev)%plag
149 #ifdef PEUL
150  ppeul => region%levels(ilev)%peul
151 #endif
152  pmixt => region%levels(ilev)%mixt
153 #endif
154 #ifdef RFLU
155  pplag => region%plag
156  ppeul => region%spec
157  pmixt => region%mixt
158 #endif
159 
160  pinputinrt => region%inrtInput
161 
162  paivl => pplag%aiv
163 #ifdef RFLO
164 #ifdef PEUL
165  pcvs => ppeul%cv
166 #endif
167 #endif
168 #ifdef RFLU
169  pcvs => ppeul%cv
170 #endif
171  pdvl => pplag%dv
172 
173 #ifdef RFLO
174  pdvg => pmixt%dv
175 #endif
176 #ifdef RFLU
177  pcvg => pmixt%cv
178 #endif
179 
180  pinrtscour => pinputinrt%inrts(inrt_type_scouring)
181 
182 ! Get dimensions --------------------------------------------------------------
183 
184  onefourth = 1.0_rfreal/4.0_rfreal
185  pi = global%pi
186 
187  ncont = region%plagInput%nCont
188  nedges = pinrtscour%nEdges
189 
190  indpeul0 = pinputinrt%indPeul0
191 
192 ! Loop over all the particles -------------------------------------------------
193 
194  DO ipcls = 1,npcls
195 
196  diaml = pdvl(dv_plag_diam,ipcls)
197 
198  vell(1) = pdvl(dv_plag_uvel,ipcls)
199  vell(2) = pdvl(dv_plag_vvel,ipcls)
200  vell(3) = pdvl(dv_plag_wvel,ipcls)
201 
202  icell = paivl(aiv_plag_icells,ipcls)
203 
204 ! - the computation of relVelMagL will have to be moved inside the iEdge
205 ! - loop when a smoke velocity not equal to fluid velocity is implemented.
206 
207 #ifdef RFLO
208  vels(1) = pdvg(dv_mixt_uvel,icell)
209  vels(2) = pdvg(dv_mixt_vvel,icell)
210  vels(3) = pdvg(dv_mixt_wvel,icell)
211 #endif
212 #ifdef RFLU
213  vels(1) = pcvg(cv_mixt_xvel,icell)
214  vels(2) = pcvg(cv_mixt_yvel,icell)
215  vels(3) = pcvg(cv_mixt_zvel,icell)
216 #endif
217 
218  relvelmagl = sqrt( ( vell(1)-vels(1) )**2 &
219  + ( vell(2)-vels(2) )**2 &
220  + ( vell(3)-vels(3) )**2 )
221 
222  DO iedge = 1,nedges
223 
224  ipeul = pinrtscour%edges(iedge)%iNode(1) - indpeul0
225  peulconc = pcvs(ipeul,icell)
226 
227 ! Use definitions like these when smoke velocity comes to exist
228 ! velS(1) = pDvS(DV_PEUL_UVEL,iCell)
229 ! velS(2) = pDvS(DV_PEUL_VVEL,iCell)
230 ! velS(3) = pDvS(DV_PEUL_WVEL,iCell)
231 !
232 ! relVelMagL = SQRT( ( velL(1)-velS(1) )**2 &
233 ! + ( velL(2)-velS(2) )**2 &
234 ! + ( velL(3)-velS(3) )**2 )
235 
236  coeffscour = pinrtscour%data(inrt_dat_scouring_coef0 + iedge)
237 
238  capturearea = onefourth * pi * diaml**2 * coeffscour
239 
240  mdotdepo = peulconc * capturearea * relvelmagl
241 
242  pplag%inrtSources(iedge,ipcls) = mdotdepo
243 
244  ENDDO ! iEdge
245  ENDDO ! iPcls
246 
247 ! finalize --------------------------------------------------------------------
248 
249 999 CONTINUE
250 #endif
251  CALL deregisterfunction( global )
252 
253 END SUBROUTINE inrt_calcscouring
254 
255 !******************************************************************************
256 !
257 ! RCS Revision history:
258 !
259 ! $Log: INRT_CalcScouring.F90,v $
260 ! Revision 1.4 2008/12/06 08:44:31 mtcampbe
261 ! Updated license.
262 !
263 ! Revision 1.3 2008/11/19 22:17:44 mtcampbe
264 ! Added Illinois Open Source License/Copyright
265 !
266 ! Revision 1.2 2006/02/15 20:18:11 wasistho
267 ! put peul within ifdef
268 !
269 ! Revision 1.1 2004/12/01 21:56:16 fnajjar
270 ! Initial revision after changing case
271 !
272 ! Revision 1.7 2004/07/23 22:43:16 jferry
273 ! Integrated rocspecies into rocinteract
274 !
275 ! Revision 1.6 2004/03/05 22:09:03 jferry
276 ! created global variables for peul, plag, and inrt use
277 !
278 ! Revision 1.5 2004/02/02 22:52:21 haselbac
279 ! Fixed bug: Wrong parameter subscript
280 !
281 ! Revision 1.4 2004/01/31 03:59:22 haselbac
282 ! Initial integration for Rocflu and Rocpart
283 !
284 ! Revision 1.3 2003/04/03 22:52:56 fnajjar
285 ! Included correct pointer for InputInrt
286 !
287 ! Revision 1.2 2003/04/03 21:10:18 jferry
288 ! implemented additional safety checks for rocinteract
289 !
290 ! Revision 1.1 2003/04/03 16:19:28 fnajjar
291 ! Initial Import of routines for burning and scouring
292 !
293 !******************************************************************************
294 
295 
296 
297 
298 
299 
300 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
IndexType nedges() const
Definition: Mesh.H:564
double sqrt(double d)
Definition: double.h:73
static const double pi
Definition: smooth_medial.C:43
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE icell
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine inrt_calcscouring(region)