68 TYPE(t_region
),
POINTER :: regions(:)
71 INTEGER :: ireg,
i,
j,
k,
n, ipatch, ilev
77 INTEGER ::
status(mpi_status_size)
80 INTEGER :: icoff,ijcoff,inoff,ijnoff,
ic,ijkn,ijkni,ijknj,ijknk
81 INTEGER :: snddim, rcvdim, ncount, icount, accwalldim
82 INTEGER,
POINTER :: walldim(:)
83 REAL(RFREAL) ::
distance, xdist, ydist, zdist, loclens, cdes
84 REAL(RFREAL) :: adsi, adsj, adsk, dsi(3), dsj(3), dsk(3)
85 REAL(RFREAL),
POINTER :: xyz(:,:), cofg(:,:), lens(:)
89 global => regions(1)%global
91 'TURB_coRansWallDistOVFlo.F90' )
93 IF (global%turbWallDim == 0) goto 888
97 ALLOCATE( walldim(global%nRegions) )
99 IF (.NOT. (global%turbWorkUnused .eqv. .true.)) &
100 CALL
errorstop( global,err_turb_workspace,__line__ )
101 global%turbWorkDim = ndir*global%turbWallDim
102 ALLOCATE( global%turbWork1D(global%turbWorkDim) )
104 global%turbWorkUnused = .false.
109 global%turbWorkDim = 0
114 DO ireg=1,global%nRegions
116 IF (regions(ireg)%procid==global%myProcid .AND. &
117 regions(ireg)%active==active)
THEN
118 DO ipatch=1,regions(ireg)%nPatches
120 regions(ireg)%levels(1)%patches(ipatch) )
122 walldim(ireg) = global%turbWorkDim - accwalldim
123 accwalldim = accwalldim + walldim(ireg)
129 CALL mpi_bcast( walldim(ireg),1,mpi_integer,regions(ireg)%procId, &
130 global%mpiComm,global%mpierr )
131 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
139 IF (global%myProcid == masterproc)
THEN
141 IF (walldim(ireg) > 0)
THEN
142 IF (regions(ireg)%procid /= global%myProcid)
THEN
144 CALL mpi_recv( global%turbWork1D(1+ncount),walldim(ireg),mpi_rfreal, &
145 regions(ireg)%procId,ireg,global%mpiComm,
status,global%mpierr )
146 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
150 ncount = ncount + walldim(ireg)
157 IF (regions(ireg)%procid == global%myProcid)
THEN
158 IF (walldim(ireg) > 0)
THEN
163 CALL mpi_send( global%turbWork1D(1+icount),walldim(ireg),mpi_rfreal, &
164 masterproc,ireg,global%mpiComm,
status,global%mpierr )
165 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
167 icount = icount + walldim(ireg)
177 IF (global%myProcid == masterproc)
THEN
179 global%turbWorkDim = ncount
181 IF (global%turbWorkDim /= ndir*global%turbWallDim) &
182 CALL
errorstop( global,err_turb_ransinput,__line__, &
183 'work array dim. is not consistent with wall array dim.')
189 CALL mpi_bcast( global%turbWork1D,ndir*global%turbWallDim,mpi_rfreal, &
190 masterproc,global%mpiComm,global%mpierr )
191 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
198 DO ireg=1,global%nRegions
199 IF (regions(ireg)%procid==global%myProcid .AND. &
200 regions(ireg)%active==active)
THEN
202 IF (regions(ireg)%mixtInput%moveGrid .eqv. .true.)
THEN
203 ilevbeg = regions(ireg)%currLevel
204 ilevend = regions(ireg)%currLevel
207 ilevend = regions(ireg)%nGridLevels
210 cdes = regions(ireg)%turbInput%cDes
212 DO ilev = ilevbeg, ilevend
218 xyz => regions(ireg)%levels(ilev)%grid%xyz
219 cofg => regions(ireg)%levels(ilev)%grid%cofg
220 lens => regions(ireg)%levels(ilev)%turb%lens
221 lens = global%refLength
228 ic = indijk(
i,
j,
k,icoff,ijcoff)
229 lens(
ic) = 1.e+32_rfreal
230 DO n = 1,ndir*global%turbWallDim,ndir
231 xdist = cofg(xcoord,
ic)-global%turbWork1D(
n)
232 ydist = cofg(ycoord,
ic)-global%turbWork1D(
n+1)
233 zdist = cofg(zcoord,
ic)-global%turbWork1D(
n+2)
246 IF ((regions(ireg)%mixtInput%turbModel == turb_model_dessa) .OR. &
247 (regions(ireg)%mixtInput%turbModel == turb_model_hdessa) .OR. &
248 (global%turbWallDim == 0))
THEN
252 ic = indijk(
i ,
j ,
k ,icoff,ijcoff)
253 ijkn = indijk(
i ,
j ,
k ,inoff,ijnoff)
254 ijkni = indijk(
i+1,
j ,
k ,inoff,ijnoff)
255 ijknj = indijk(
i ,
j+1,
k ,inoff,ijnoff)
256 ijknk = indijk(
i ,
j ,
k+1,inoff,ijnoff)
257 dsi(1:3) = xyz(xcoord:zcoord,ijkni)-xyz(xcoord:zcoord,ijkn)
258 dsj(1:3) = xyz(xcoord:zcoord,ijknj)-xyz(xcoord:zcoord,ijkn)
259 dsk(1:3) = xyz(xcoord:zcoord,ijknk)-xyz(xcoord:zcoord,ijkn)
260 adsi =
sqrt( dsi(1)*dsi(1)+dsi(2)*dsi(2)+dsi(3)*dsi(3) )
261 adsj =
sqrt( dsj(1)*dsj(1)+dsj(2)*dsj(2)+dsj(3)*dsj(3) )
262 adsk =
sqrt( dsk(1)*dsk(1)+dsk(2)*dsk(2)+dsk(3)*dsk(3) )
263 loclens =
max( adsi,adsj,adsk )
264 lens(
ic) =
min( lens(
ic),cdes*loclens )
280 DEALLOCATE( global%turbWork1D, walldim )
281 global%turbWorkUnused = .true.
**********************************************************************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 kpcbeg
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
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 ic
**********************************************************************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 jpcbeg
**********************************************************************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 ipcend
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
subroutine turb_coranswalldistov(regions)
**********************************************************************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 ipcbeg
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
**********************************************************************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 jpcend
subroutine errorstop(global, errorCode, errorLine, addMessage)
CImg< T > & distance(const T isovalue, const float sizex=1, const float sizey=1, const float sizez=1, const bool compute_sqrt=true)
Compute the Euclidean distance map to a shape of specified isovalue.
subroutine turb_ranswalldistovpatch(region, patch)
subroutine deregisterfunction(global)
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)