Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_EdgeDeformation.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: calculate node displacements on those edges whose end points have
26 ! moved, but the associated boundaries were not updated yet (finest
27 ! grid only).
28 !
29 ! Description: points along an edge are shifted using 1-D linear transfinite
30 ! interpolation (TFI).
31 !
32 ! Input: region = grid dimensions
33 ! boundMoved = flag for boundaries of a region which have moved
34 ! arcLen12 = arclength between i=const. boundaries for each j, k
35 ! arcLen34 = arclength between j=const. boundaries for each k, i
36 ! arcLen56 = arclength between k=const. boundaries for each i, j
37 ! xyzOld = grid from previous time step.
38 !
39 ! Output: edgeMoved = flag if discretization at an edge was changed
40 ! dNode = updated deformations at edges.
41 !
42 ! Notes: variable dNode contains the whole 3-D field.
43 !
44 !******************************************************************************
45 !
46 ! $Id: RFLO_EdgeDeformation.F90,v 1.4 2008/12/06 08:44:06 mtcampbe Exp $
47 !
48 ! Copyright: (c) 2001 by the University of Illinois
49 !
50 !******************************************************************************
51 
52 SUBROUTINE rflo_edgedeformation( region,boundMoved,edgeMoved, &
53  arclen12,arclen34,arclen56,xyzold,dnode )
54 
55  USE moddatatypes
56  USE moddatastruct, ONLY : t_region
59  USE moderror
60  USE modparameters
61  IMPLICIT NONE
62 
63 #include "Indexing.h"
64 
65 ! ... parameters
66  LOGICAL :: boundmoved(6), edgemoved(12)
67 
68  REAL(RFREAL), POINTER :: arclen12(:,:), arclen34(:,:), arclen56(:,:)
69  REAL(RFREAL), POINTER :: dnode(:,:), xyzold(:,:)
70 
71  TYPE(t_region) :: region
72 
73 ! ... loop variables
74  INTEGER :: iedge, ind
75 
76 ! ... local variables
77  INTEGER :: ilev, ipnbeg, ipnend, jpnbeg, jpnend, kpnbeg, kpnend, l1c, l2c
78  INTEGER :: indbeg, indend, ijkn, ijkn1, ijknbeg, ijknend, inoff, ijnoff
79  INTEGER :: switch(12,9)
80 
81  REAL(RFREAL) :: arclen, ds, s, dn(3), dnbeg(3), dnend(3)
82 
83 !******************************************************************************
84 
85  CALL registerfunction( region%global,'RFLO_EdgeDeformation',&
86  'RFLO_EdgeDeformation.F90' )
87 
88 ! get dimensions --------------------------------------------------------------
89 
90  ilev = 1
91  CALL rflo_getdimensphysnodes( region,ilev,ipnbeg,ipnend, &
92  jpnbeg,jpnend,kpnbeg,kpnend )
93  CALL rflo_getnodeoffset( region,ilev,inoff,ijnoff )
94 
95 ! set edge switch -------------------------------------------------------------
96 ! switch(:,1) = begins at boundary
97 ! switch(:,2) = ends on boundary
98 ! switch(:,3) = right boundary
99 ! switch(:,4) = left boundary
100 ! switch(:,5) = direction (from-to boundary)
101 ! switch(:,6) = start index
102 ! switch(:,7) = end index
103 ! switch(:,8) = constant index in 1st direction
104 ! switch(:,9) = constant index in 2nd direction
105 
106  switch( 1,:) = (/5, 6, 1, 3, 56, kpnbeg, kpnend, ipnbeg, jpnbeg/)
107  switch( 2,:) = (/3, 4, 1, 6, 34, jpnbeg, jpnend, kpnend, ipnbeg/)
108  switch( 3,:) = (/5, 6, 1, 4, 56, kpnbeg, kpnend, ipnbeg, jpnend/)
109  switch( 4,:) = (/3, 4, 1, 5, 34, jpnbeg, jpnend, kpnbeg, ipnbeg/)
110  switch( 5,:) = (/5, 6, 2, 3, 56, kpnbeg, kpnend, ipnend, jpnbeg/)
111  switch( 6,:) = (/3, 4, 2, 6, 34, jpnbeg, jpnend, kpnend, ipnend/)
112  switch( 7,:) = (/5, 6, 2, 4, 56, kpnbeg, kpnend, ipnend, jpnend/)
113  switch( 8,:) = (/3, 4, 2, 5, 34, jpnbeg, jpnend, kpnbeg, ipnend/)
114  switch( 9,:) = (/1, 2, 3, 5, 12, ipnbeg, ipnend, jpnbeg, kpnbeg/)
115  switch(10,:) = (/1, 2, 3, 6, 12, ipnbeg, ipnend, jpnbeg, kpnend/)
116  switch(11,:) = (/1, 2, 4, 5, 12, ipnbeg, ipnend, jpnend, kpnbeg/)
117  switch(12,:) = (/1, 2, 4, 6, 12, ipnbeg, ipnend, jpnend, kpnend/)
118 
119 ! edge movement flag ----------------------------------------------------------
120 
121  edgemoved(:) = .false.
122 
123  IF (boundmoved(1)) THEN
124  edgemoved( 1) = .true.; edgemoved( 2) = .true.
125  edgemoved( 3) = .true.; edgemoved( 4) = .true.
126  ENDIF
127  IF (boundmoved(2)) THEN
128  edgemoved( 5) = .true.; edgemoved( 6) = .true.
129  edgemoved( 7) = .true.; edgemoved( 8) = .true.
130  ENDIF
131  IF (boundmoved(3)) THEN
132  edgemoved( 1) = .true.; edgemoved( 5) = .true.
133  edgemoved( 9) = .true.; edgemoved(10) = .true.
134  ENDIF
135  IF (boundmoved(4)) THEN
136  edgemoved( 3) = .true.; edgemoved( 7) = .true.
137  edgemoved(11) = .true.; edgemoved(12) = .true.
138  ENDIF
139  IF (boundmoved(5)) THEN
140  edgemoved( 4) = .true.; edgemoved( 8) = .true.
141  edgemoved( 9) = .true.; edgemoved(11) = .true.
142  ENDIF
143  IF (boundmoved(6)) THEN
144  edgemoved( 2) = .true.; edgemoved( 6) = .true.
145  edgemoved(10) = .true.; edgemoved(12) = .true.
146  ENDIF
147 
148 ! loop over all 12 edges ------------------------------------------------------
149 
150  DO iedge=1,12
151  IF ((boundmoved(switch(iedge,1)) .OR. boundmoved(switch(iedge,2))) .AND. &
152  ((.NOT.boundmoved(switch(iedge,3))) .OR. &
153  (.NOT.boundmoved(switch(iedge,4)))) .AND. &
154  (.NOT.edgemoved(iedge))) THEN
155 
156  edgemoved(iedge) = .true.
157 
158  ds = 0._rfreal
159  indbeg = switch(iedge,6)
160  indend = switch(iedge,7)
161  l1c = switch(iedge,8)
162  l2c = switch(iedge,9)
163  DO ind=indbeg+1,indend-1
164  IF (switch(iedge,5) == 12) THEN
165  ijkn = indijk(ind ,l1c,l2c,inoff,ijnoff)
166  ijkn1 = indijk(ind-1 ,l1c,l2c,inoff,ijnoff)
167  ijknbeg = indijk(indbeg,l1c,l2c,inoff,ijnoff)
168  ijknend = indijk(indend,l1c,l2c,inoff,ijnoff)
169  arclen = arclen12(l1c,l2c)
170  dnbeg(:) = dnode(:,ijknbeg)
171  dnend(:) = dnode(:,ijknend)
172  ELSE IF (switch(iedge,5) == 34) THEN
173  ijkn = indijk(l2c,ind ,l1c,inoff,ijnoff)
174  ijkn1 = indijk(l2c,ind-1 ,l1c,inoff,ijnoff)
175  ijknbeg = indijk(l2c,indbeg,l1c,inoff,ijnoff)
176  ijknend = indijk(l2c,indend,l1c,inoff,ijnoff)
177  arclen = arclen34(l1c,l2c)
178  dnbeg(:) = dnode(:,ijknbeg)
179  dnend(:) = dnode(:,ijknend)
180  ELSE IF (switch(iedge,5) == 56) THEN
181  ijkn = indijk(l1c,l2c,ind ,inoff,ijnoff)
182  ijkn1 = indijk(l1c,l2c,ind-1 ,inoff,ijnoff)
183  ijknbeg = indijk(l1c,l2c,indbeg,inoff,ijnoff)
184  ijknend = indijk(l1c,l2c,indend,inoff,ijnoff)
185  arclen = arclen56(l1c,l2c)
186  dnbeg(:) = dnode(:,ijknbeg)
187  dnend(:) = dnode(:,ijknend)
188  ENDIF
189  ds = ds + sqrt((xyzold(xcoord,ijkn)-xyzold(xcoord,ijkn1))**2 + &
190  (xyzold(ycoord,ijkn)-xyzold(ycoord,ijkn1))**2 + &
191  (xyzold(zcoord,ijkn)-xyzold(zcoord,ijkn1))**2)
192  s = ds/arclen
193 
194  CALL rflo_tfint1d( s,dnbeg,dnend,dn )
195  dnode(:,ijkn) = dn(:)
196  ENDDO ! i
197 
198  ENDIF ! boundMoved
199  ENDDO ! iEdge
200 
201 ! finalize --------------------------------------------------------------------
202 
203  CALL deregisterfunction( region%global )
204 
205 END SUBROUTINE rflo_edgedeformation
206 
207 !******************************************************************************
208 !
209 ! RCS Revision history:
210 !
211 ! $Log: RFLO_EdgeDeformation.F90,v $
212 ! Revision 1.4 2008/12/06 08:44:06 mtcampbe
213 ! Updated license.
214 !
215 ! Revision 1.3 2008/11/19 22:17:20 mtcampbe
216 ! Added Illinois Open Source License/Copyright
217 !
218 ! Revision 1.2 2005/05/27 01:53:41 wasistho
219 ! added rflo_gridremesh
220 !
221 ! Revision 1.1 2004/11/29 21:25:16 wasistho
222 ! lower to upper case
223 !
224 ! Revision 1.7 2003/11/20 16:40:34 mdbrandy
225 ! Backing out RocfluidMP changes from 11-17-03
226 !
227 ! Revision 1.4 2003/05/15 02:57:01 jblazek
228 ! Inlined index function.
229 !
230 ! Revision 1.3 2003/03/14 22:05:10 jblazek
231 ! Improved mesh motion algorithm - node movement exchaged between blocks.
232 !
233 ! Revision 1.2 2002/09/05 17:40:19 jblazek
234 ! Variable global moved into regions().
235 !
236 ! Revision 1.1 2002/08/15 19:48:05 jblazek
237 ! Implemented grid deformation capability.
238 !
239 !******************************************************************************
240 
241 
242 
243 
244 
245 
246 
subroutine rflo_edgedeformation(region, boundMoved, edgeMoved, arcLen12, arcLen34, arcLen56, xyzOld, dNode)
**********************************************************************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 jpnbeg
double s
Definition: blastest.C:80
**********************************************************************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 kpnbeg
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
double sqrt(double d)
Definition: double.h:73
subroutine rflo_tfint1d(s, p1, p2, xyz)
Definition: RFLO_Tfint.F90:59
**********************************************************************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 jpnend
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
**********************************************************************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 ipnbeg
subroutine rflo_getdimensphysnodes(region, iLev, ipnbeg, ipnend, jpnbeg, jpnend, kpnbeg, kpnend)
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 ipnend