58 TYPE(t_region
),
POINTER :: regions(:)
61 INTEGER :: ireg, ipatch
64 CHARACTER(2*CHRLEN+4) :: fname
65 CHARACTER(CHRLEN) ::
msg
67 INTEGER :: regionnum, nlevels, npatches, ipc, jpc, kpc, bctype, align
68 INTEGER :: ncellstot, errorflag
75 'RFLO_ReadRegionTopology.F90' )
79 fname = trim(global%inDir)//trim(global%casename)//
'.top'
80 OPEN(if_topol,file=fname,
form=
'formatted',
status=
'old',iostat=errorflag)
81 global%error = errorflag
82 IF (global%error /= 0) &
84 __line__,
'File: '//trim(fname) )
86 READ(if_topol,
'(1X)',err=10,
end=10)
87 READ(if_topol,
'(1X)',err=10,
end=10)
88 READ(if_topol, * ,err=10,
end=10) global%nRegions
92 ALLOCATE( regions(global%nRegions),stat=errorflag )
93 global%error = errorflag
94 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
100 DO ireg=1,global%nRegions
101 READ(if_topol,*,err=10,
end=10) regionnum,nlevels
102 READ(if_topol,*,err=10,
end=10) npatches,ipc,jpc,kpc
104 ALLOCATE( regions(regionnum)%levels(nlevels),stat=errorflag )
105 ALLOCATE( regions(regionnum)%levels(1)%patches(npatches),stat=errorflag )
106 global%error = errorflag
107 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
109 regions(regionnum)%iRegionGlobal = regionnum
110 regions(regionnum)%nGridLevels = nlevels
111 regions(regionnum)%nPatches = npatches
112 regions(regionnum)%levels(1)%grid%ipc = ipc
113 regions(regionnum)%levels(1)%grid%jpc = jpc
114 regions(regionnum)%levels(1)%grid%kpc = kpc
115 regions(regionnum)%active = active
116 regions(regionnum)%mixtInput%externalBc = .false.
118 ncellstot = ncellstot + ipc*jpc*kpc
122 regions(regionnum)%global => global
127 patch => regions(regionnum)%levels(1)%patches(ipatch)
128 READ(if_topol,*,err=10,
end=10) &
137 IF (
patch%bcCoupled <= 0)
THEN
138 patch%bcCoupled = bc_internal
139 patch%bcMotion = bc_internal
141 patch%bcCoupled = bc_external
142 patch%bcMotion = bc_external
144 IF (
patch%bcType == bc_slipwall_free .OR. &
145 patch%bcType == bc_slipwall_fixed .OR. &
146 patch%bcType == bc_slipwall_xslide .OR. &
147 patch%bcType == bc_slipwall_yslide .OR. &
148 patch%bcType == bc_slipwall_zslide .OR. &
149 patch%bcType == bc_slipwall_xyslide .OR. &
150 patch%bcType == bc_slipwall_xzslide .OR. &
151 patch%bcType == bc_slipwall_yzslide)
THEN
152 patch%bcMotion = bc_external
154 IF (
patch%bcType == bc_symmetry_free .OR. &
155 patch%bcType == bc_symmetry_fixed .OR. &
156 patch%bcType == bc_symmetry_xslide .OR. &
157 patch%bcType == bc_symmetry_yslide .OR. &
158 patch%bcType == bc_symmetry_zslide .OR. &
159 patch%bcType == bc_symmetry_xyslide .OR. &
160 patch%bcType == bc_symmetry_xzslide .OR. &
161 patch%bcType == bc_symmetry_yzslide)
THEN
162 patch%bcMotion = bc_external
164 IF (
patch%bcType == bc_noslipwall_free .OR. &
165 patch%bcType == bc_noslipwall_fixed .OR. &
166 patch%bcType == bc_noslipwall_xslide .OR. &
167 patch%bcType == bc_noslipwall_yslide .OR. &
168 patch%bcType == bc_noslipwall_zslide .OR. &
169 patch%bcType == bc_noslipwall_xyslide .OR. &
170 patch%bcType == bc_noslipwall_xzslide .OR. &
171 patch%bcType == bc_noslipwall_yzslide)
THEN
172 patch%bcMotion = bc_external
174 IF (
patch%bcType == bc_outflow_free .OR. &
175 patch%bcType == bc_outflow_fixed .OR. &
176 patch%bcType == bc_outflow_xslide .OR. &
177 patch%bcType == bc_outflow_yslide .OR. &
178 patch%bcType == bc_outflow_zslide .OR. &
179 patch%bcType == bc_outflow_xyslide .OR. &
180 patch%bcType == bc_outflow_xzslide .OR. &
181 patch%bcType == bc_outflow_yzslide)
THEN
182 patch%bcMotion = bc_external
184 IF (
patch%bcCoupled == bc_external) &
185 regions(regionnum)%mixtInput%externalBc = .true.
188 IF (
patch%bcType<bc_code_min .OR.
patch%bcType>bc_code_max)
THEN
189 WRITE(
msg,
'(A,I5,A)')
'Boundary code ',
patch%bcType,
" ???"
195 CALL
errorstop( global,err_wrong_regionface,__line__ )
198 patch%mixt%bcSet = .true.
199 patch%mixt%distrib = bcdat_constant
201 patch%mixt%nSwitches = 0
203 patch%turb%bcSet = .true.
204 patch%turb%distrib = bcdat_constant
206 patch%turb%nSwitches = 0
208 patch%spec%bcSet = .true.
209 patch%spec%distrib = bcdat_constant
211 patch%spec%nSwitches = 0
213 patch%peul%bcSet = .true.
214 patch%peul%distrib = bcdat_constant
216 patch%peul%nSwitches = 0
218 patch%valRadi%bcSet = .true.
219 patch%valRadi%distrib = bcdat_constant
220 patch%valRadi%nData = 0
221 patch%valRadi%nSwitches = 0
224 bctype =
patch%bcType
226 IF ((bctype>=bc_slipwall .AND. bctype<=bc_slipwall +bc_range) .OR. &
227 (bctype>=bc_noslipwall .AND. bctype<=bc_noslipwall+bc_range) .OR. &
228 (bctype>=bc_inflow .AND. bctype<=bc_inflow +bc_range) .OR. &
229 (bctype>=bc_outflow .AND. bctype<=bc_outflow +bc_range) .OR. &
230 (bctype>=bc_farfield .AND. bctype<=bc_farfield +bc_range) .OR. &
231 (bctype>=bc_injection .AND. bctype<=bc_injection +bc_range))
THEN
232 patch%mixt%bcSet = .false.
235 IF ((bctype>=bc_inflow .AND. bctype<=bc_inflow +bc_range) .OR. &
236 (bctype>=bc_farfield .AND. bctype<=bc_farfield +bc_range) .OR. &
237 (bctype>=bc_injection .AND. bctype<=bc_injection +bc_range))
THEN
238 patch%peul%bcSet = .false.
244 CLOSE(if_topol,iostat=errorflag)
245 global%error = errorflag
246 IF (global%error /= 0) &
247 CALL
errorstop( global,err_file_close,__line__,
'File: '//trim(fname) )
251 DO ireg=1,global%nRegions
252 DO ipatch=1,regions(ireg)%nPatches
254 patch => regions(ireg)%levels(1)%patches(ipatch)
258 bctype =
patch%bcType
259 IF ((bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
260 (bctype>=bc_regionint .AND. bctype<=bc_regionint +bc_range) .OR. &
261 (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range) .OR. &
262 (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri +bc_range) .OR. &
263 (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri +bc_range))
THEN
267 IF (
patch%srcRegion > global%nRegions) &
268 CALL
errorstop( global,err_region_range,__line__ )
272 IF (
patch%srcLbound<1 .OR.
patch%srcLbound>6) &
273 CALL
errorstop( global,err_wrong_regionface,__line__,
'(source region).' )
281 CALL
errorstop( global,err_patch_2align,__line__ )
282 ELSE IF (
patch%l2beg<0 .OR.
patch%l2end<0 )
THEN
287 CALL
errorstop( global,err_patch_noalign,__line__ )
291 IF (
patch%srcL1beg<0 .OR.
patch%srcL1end<0 )
THEN
295 IF (
patch%srcL2beg<0 .OR.
patch%srcL2end<0 ) &
296 CALL
errorstop( global,err_patch_2align,__line__ )
297 ELSE IF (
patch%srcL2beg<0 .OR.
patch%srcL2end<0 )
THEN
302 CALL
errorstop( global,err_patch_noalign,__line__ )
306 IF (align==11 .OR. align==22)
THEN
309 patch%align = .false.
315 patch%srcRegion = -999
316 patch%srcPatch = -999
318 patch%srcLbound = -999
319 patch%srcL1beg = -999
320 patch%srcL1end = -999
321 patch%srcL2beg = -999
322 patch%srcL2end = -999
330 IF (global%myProcid==masterproc .AND. global%verbLevel>=verbose_med)
THEN
331 WRITE(stdout,
'(/,A,I8)') solver_name//
' total no. of cells = ',ncellstot
332 WRITE(stdout,
'(A,I8,/)') solver_name//
' no. of grid regions = ', &
342 CALL
errorstop( global,err_file_read,__line__,
'File: '//trim(fname) )
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
**********************************************************************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 form
subroutine rflo_readregiontopology(global, regions)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)