Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_CalcStrainRate.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 strain rate tensor S_ij from any given velocity gradients.
26 !
27 ! Description: The strain rate tensors are computed for i, j and k faces.
28 !
29 ! Input: region = data of current region
30 ! ibn,ien = begin and end nodes index
31 ! grIndx = ID index of the velocity gradients
32 ! gradi,j,k = velocity gradients at i, j and k faces
33 !
34 ! Output: sRateI,J,K = strain rate tensor at i, j and k faces
35 !
36 ! Notes: Strain rate values at all nodes are defined.
37 ! RFLU data structure makes use only of I components arrays.
38 !
39 !******************************************************************************
40 !
41 ! $Id: TURB_CalcStrainRate.F90,v 1.5 2008/12/06 08:44:41 mtcampbe Exp $
42 !
43 ! Copyright: (c) 2001 by the University of Illinois
44 !
45 !******************************************************************************
46 
47 #ifdef RFLO
48 SUBROUTINE turb_calcstrainrate( region,ibn,ien,grIndx,gradi,gradj,gradk, &
49  sratei,sratej,sratek )
50 #endif
51 #ifdef RFLU
52 SUBROUTINE turb_calcstrainrate( region,ibn,ien,grIndx,gradf,sRateI )
53 #endif
54 
55  USE moddatatypes
56  USE moddatastruct, ONLY : t_region
57  USE modglobal, ONLY : t_global
58  USE moderror
59  USE modparameters
61  IMPLICIT NONE
62 
63 ! ... parameters
64  TYPE(t_region) :: region
65  INTEGER :: ibn, ien
66 #ifdef RFLO
67  INTEGER :: grindx(9)
68  REAL(RFREAL), POINTER :: gradi(:,:),gradj(:,:),gradk(:,:)
69  REAL(RFREAL), POINTER :: sratei(:,:),sratej(:,:),sratek(:,:)
70 #endif
71 #ifdef RFLU
72  INTEGER :: grindx(3)
73  REAL(RFREAL), POINTER :: gradf(:,:,:)
74  REAL(RFREAL), POINTER :: sratei(:,:)
75 #endif
76 
77 ! ... loop variables
78  INTEGER :: in
79 
80 ! ... local variables
81  CHARACTER(CHRLEN) :: rcsidentstring
82  TYPE(t_global), POINTER :: global
83 
84  REAL(RFREAL) :: oo3,div
85  REAL(RFREAL) :: ux,uy,uz,vx,vy,vz,wx,wy,wz
86 
87 !******************************************************************************
88 
89  rcsidentstring = '$RCSfile: TURB_CalcStrainRate.F90,v $'
90 
91  global => region%global
92  CALL registerfunction( global,'TURB_CalcStrainRate',&
93  'TURB_CalcStrainRate.F90' )
94 
95  oo3 = 1.0_rfreal/3.0_rfreal
96 
97 ! get strain rate tensor at cell faces --------------------------------------
98 
99  DO in = ibn,ien
100 
101 ! - strain rate tensor at I faces
102 
103 #ifdef RFLO
104  ux = gradi(grindx(1),in)
105  vx = gradi(grindx(2),in)
106  wx = gradi(grindx(3),in)
107  uy = gradi(grindx(4),in)
108  vy = gradi(grindx(5),in)
109  wy = gradi(grindx(6),in)
110  uz = gradi(grindx(7),in)
111  vz = gradi(grindx(8),in)
112  wz = gradi(grindx(9),in)
113 #endif
114 #ifdef RFLU
115  ux = gradf(xcoord,grindx(1),in)
116  uy = gradf(ycoord,grindx(1),in)
117  uz = gradf(zcoord,grindx(1),in)
118  vx = gradf(xcoord,grindx(2),in)
119  vy = gradf(ycoord,grindx(2),in)
120  vz = gradf(zcoord,grindx(2),in)
121  wx = gradf(xcoord,grindx(3),in)
122  wy = gradf(ycoord,grindx(3),in)
123  wz = gradf(zcoord,grindx(3),in)
124 #endif
125 
126  div = oo3*(ux+vy+wz)
127 
128  sratei(e11,in) = 2.0_rfreal*(ux-div)
129  sratei(e12,in) = uy+vx
130  sratei(e13,in) = uz+wx
131 
132  sratei(e22,in) = 2.0_rfreal*(vy-div)
133  sratei(e23,in) = vz+wy
134 
135  sratei(e33,in) = 2.0_rfreal*(wz-div)
136 
137 #ifdef RFLO
138 ! - strain rate tensor at J faces
139 
140  ux = gradj(grindx(1),in)
141  vx = gradj(grindx(2),in)
142  wx = gradj(grindx(3),in)
143  uy = gradj(grindx(4),in)
144  vy = gradj(grindx(5),in)
145  wy = gradj(grindx(6),in)
146  uz = gradj(grindx(7),in)
147  vz = gradj(grindx(8),in)
148  wz = gradj(grindx(9),in)
149 
150  div = oo3*(ux+vy+wz)
151 
152  sratej(e11,in) = 2.0_rfreal*(ux-div)
153  sratej(e12,in) = uy+vx
154  sratej(e13,in) = uz+wx
155 
156  sratej(e22,in) = 2.0_rfreal*(vy-div)
157  sratej(e23,in) = vz+wy
158 
159  sratej(e33,in) = 2.0_rfreal*(wz-div)
160 
161 ! - strain rate tensor at K faces
162 
163  ux = gradk(grindx(1),in)
164  vx = gradk(grindx(2),in)
165  wx = gradk(grindx(3),in)
166  uy = gradk(grindx(4),in)
167  vy = gradk(grindx(5),in)
168  wy = gradk(grindx(6),in)
169  uz = gradk(grindx(7),in)
170  vz = gradk(grindx(8),in)
171  wz = gradk(grindx(9),in)
172 
173  div = oo3*(ux+vy+wz)
174 
175  sratek(e11,in) = 2.0_rfreal*(ux-div)
176  sratek(e12,in) = uy+vx
177  sratek(e13,in) = uz+wx
178 
179  sratek(e22,in) = 2.0_rfreal*(vy-div)
180  sratek(e23,in) = vz+wy
181 
182  sratek(e33,in) = 2.0_rfreal*(wz-div)
183 #endif
184 
185  ENDDO ! iN
186 
187 ! finalize --------------------------------------------------------------------
188 
189  CALL deregisterfunction( global )
190 
191 END SUBROUTINE turb_calcstrainrate
192 
193 !******************************************************************************
194 !
195 ! RCS Revision history:
196 !
197 ! $Log: TURB_CalcStrainRate.F90,v $
198 ! Revision 1.5 2008/12/06 08:44:41 mtcampbe
199 ! Updated license.
200 !
201 ! Revision 1.4 2008/11/19 22:17:53 mtcampbe
202 ! Added Illinois Open Source License/Copyright
203 !
204 ! Revision 1.3 2004/05/17 20:32:55 wasistho
205 ! reordering gradIndx for more efficient cache memory addressing
206 !
207 ! Revision 1.2 2004/03/19 02:44:55 wasistho
208 ! prepared for RFLU
209 !
210 ! Revision 1.1 2004/03/05 04:37:00 wasistho
211 ! changed nomenclature
212 !
213 ! Revision 1.1 2002/10/14 23:55:29 wasistho
214 ! Install Rocturb
215 !
216 !
217 !******************************************************************************
218 
219 
220 
221 
222 
223 
224 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
static void div(const Attribute *x, const Attribute *y, Attribute *z)
Operation wrapper for division.
Definition: op3args.C:269
**********************************************************************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 iEndG gradi(:,:)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
**********************************************************************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 iEndG gradj(:,:)