Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_MoveGridSurfaces.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: receive and distribute the deformations of surfaces
26 ! in block-wise manner.
27 !
28 ! Description: none.
29 !
30 ! Input: regions = data of all grid regions.
31 !
32 ! Output: regions%levels%grid%xyz = deformations at the boundaries
33 ! someMoved = parts of grid moved.
34 !
35 ! Notes: grid%xyz temporarily stores nodal displacements. The deformation
36 ! is applied to the finest grid first.
37 !
38 !******************************************************************************
39 !
40 ! $Id: RFLO_MoveGridSurfaces.F90,v 1.5 2008/12/06 08:44:27 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2003 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE rflo_movegridsurfaces( regions,someMoved )
47 
48  USE moddatatypes
49  USE modglobal, ONLY : t_global
50  USE moddatastruct, ONLY : t_region
51  USE modgrid, ONLY : t_grid
55  USE moderror
56  USE modparameters
57  IMPLICIT NONE
58 
59 ! ... parameters
60  LOGICAL :: somemoved
61 
62  TYPE(t_region), POINTER :: regions(:)
63 
64 ! ... loop variables
65  INTEGER :: ireg
66 
67 ! ... local variables
68  TYPE(t_grid), POINTER :: grid, gridold
69  TYPE(t_global), POINTER :: global
70 
71 !******************************************************************************
72 
73  global => regions(1)%global
74 
75  CALL registerfunction( global,'RFLO_MoveGridSurfaces',&
76  'RFLO_MoveGridSurfaces.F90' )
77 
78 ! move grid separately for each region ----------------------------------------
79 
80  somemoved = .false.
81 
82  DO ireg=1,global%nRegions
83  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
84  regions(ireg)%active==active .AND. & ! on my processor
85  regions(ireg)%mixtInput%moveGrid) THEN ! and moving
86 
87  grid => regions(ireg)%levels(1)%grid
88  gridold => regions(ireg)%levels(1)%gridOld
89  somemoved = .true.
90 
91 ! --- store the old grid
92 
93  gridold%indSvel = grid%indSvel
94  gridold%ipc = grid%ipc
95  gridold%jpc = grid%jpc
96  gridold%kpc = grid%kpc
97  gridold%xyz(:,:) = grid%xyz(:,:)
98  gridold%si(:,:) = grid%si(:,:)
99  gridold%sj(:,:) = grid%sj(:,:)
100  gridold%sk(:,:) = grid%sk(:,:)
101  gridold%vol(:) = grid%vol(:)
102 
103 ! --- calculate arclengths between boundaries
104 
105  CALL rflo_arclengthbounds( regions(ireg),gridold%xyzOld, &
106  grid%arcLen12,grid%arcLen34,grid%arcLen56 )
107 
108 ! --- get the boundary deformations
109 
110  CALL rflo_getdeformation( regions(ireg),grid%boundMoved,grid%xyz )
111 
112 ! --- calculate deformations at remaining edges
113 
114  CALL rflo_edgedeformation( regions(ireg),grid%boundMoved,grid%edgeMoved, &
115  grid%arcLen12,grid%arcLen34,grid%arcLen56, &
116  gridold%xyzOld,grid%xyz )
117 
118 ! --- correct deformations at straight edges
119 
120  IF (global%moveGridNiter < 1) THEN
121  CALL rflo_edgedeformationstraight( regions(ireg),grid%boundMoved, &
122  grid%edgeStraight,grid%edgeMoved, &
123  grid%arcLen12,grid%arcLen34,grid%arcLen56, &
124  gridold%xyzOld,gridold%xyz,grid%xyz )
125  ENDIF
126 
127 ! --- calculate deformations at remaining boundaries
128 
129  CALL rflo_boundarydeformation( regions(ireg),grid%boundMoved, &
130  grid%edgeMoved,grid%arcLen12, &
131  grid%arcLen34,grid%arcLen56, &
132  gridold%xyzOld,grid%xyz )
133 
134  ENDIF ! region on this processor and active, grid moving
135  ENDDO ! iReg
136 
137 ! finalize --------------------------------------------------------------------
138 
139  CALL deregisterfunction( global )
140 
141 END SUBROUTINE rflo_movegridsurfaces
142 
143 !******************************************************************************
144 !
145 ! RCS Revision history:
146 !
147 ! $Log: RFLO_MoveGridSurfaces.F90,v $
148 ! Revision 1.5 2008/12/06 08:44:27 mtcampbe
149 ! Updated license.
150 !
151 ! Revision 1.4 2008/11/19 22:17:38 mtcampbe
152 ! Added Illinois Open Source License/Copyright
153 !
154 ! Revision 1.3 2006/03/14 04:38:49 wasistho
155 ! added RFLO_EdgeDeformationStraight
156 !
157 ! Revision 1.2 2006/03/05 19:02:53 wasistho
158 ! set computational space coordinates from initial grid
159 !
160 ! Revision 1.1 2004/11/29 20:51:39 wasistho
161 ! lower to upper case
162 !
163 ! Revision 1.5 2003/11/20 16:40:39 mdbrandy
164 ! Backing out RocfluidMP changes from 11-17-03
165 !
166 ! Revision 1.1 2003/08/11 21:51:18 jblazek
167 ! Added basic global grid smoothing scheme.
168 !
169 !******************************************************************************
170 
171 
172 
173 
174 
175 
176 
subroutine rflo_edgedeformation(region, boundMoved, edgeMoved, arcLen12, arcLen34, arcLen56, xyzOld, dNode)
subroutine rflo_arclengthbounds(region, xyz, arcLen12, arcLen34, arcLen56)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflo_edgedeformationstraight(region, boundMoved, edgeStraight, edgeMoved, arcLen12, arcLen34, arcLen56, xyzOrig, xyzOld, dNode)
subroutine rflo_movegridsurfaces(regions, someMoved)
subroutine rflo_getdeformation(region, boundMoved, dNode)
subroutine rflo_boundarydeformation(region, boundMoved, edgeMoved, arcLen12, arcLen34, arcLen56, xyzOld, dNode)
subroutine grid(bp)
Definition: setup_py.f90:257
subroutine deregisterfunction(global)
Definition: ModError.F90:469