63 TYPE(t_region
),
POINTER :: regions(:)
66 INTEGER :: ireg,
ic,
n, ipatch
72 INTEGER ::
status(mpi_status_size)
74 INTEGER :: iregglob, ncount, icount, accwalldim
75 INTEGER,
POINTER :: walldim(:)
76 REAL(RFREAL) :: onethird,
distance, xdist, ydist, zdist, loclens, cdes
77 REAL(RFREAL),
POINTER :: xyz(:,:), cofg(:,:), lens(:)
81 global => regions(1)%global
83 'TURB_coRansWallDistOVFlu.F90' )
85 IF (global%turbWallDim == 0) goto 888
89 ALLOCATE( walldim(global%nRegions) )
91 IF (.NOT. (global%turbWorkUnused .eqv. .true.)) &
92 CALL
errorstop( global,err_turb_workspace,__line__ )
93 global%turbWorkDim = ndir*global%turbWallDim
94 ALLOCATE( global%turbWork1D(global%turbWorkDim) )
96 global%turbWorkUnused = .false.
97 onethird = 1._rfreal/3._rfreal
102 global%turbWorkDim = 0
106 DO ireg=1,global%nRegionsLocal
107 iregglob = regions(ireg)%iRegionGlobal
109 DO ipatch=1,regions(ireg)%grid%nPatches
111 regions(ireg)%patches(ipatch) )
113 walldim(iregglob) = global%turbWorkDim - accwalldim
114 accwalldim = accwalldim + walldim(iregglob)
121 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
129 IF (global%myProcid == masterproc)
THEN
131 IF (walldim(iregglob) > 0)
THEN
137 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
141 ncount = ncount + walldim(iregglob)
148 IF (walldim(iregglob) > 0)
THEN
153 CALL mpi_send( global%turbWork1D(1+icount),walldim(iregglob),mpi_rfreal, &
154 masterproc,iregglob,global%mpiComm,
status,global%mpierr )
155 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
157 icount = icount + walldim(iregglob)
166 IF (global%myProcid == masterproc)
THEN
168 global%turbWorkDim = ncount
170 IF (global%turbWorkDim /= ndir*global%turbWallDim) &
171 CALL
errorstop( global,err_turb_ransinput,__line__, &
172 'work array dim. is not consistent with wall array dim.')
178 CALL mpi_bcast( global%turbWork1D,ndir*global%turbWallDim,mpi_rfreal, &
179 masterproc,global%mpiComm,global%mpierr )
180 IF (global%mpierr /=0 ) CALL
errorstop( global,err_mpi_trouble,__line__ )
187 DO ireg=1,global%nRegionsLocal
189 cdes = regions(ireg)%turbInput%cDes
191 xyz => regions(ireg)%grid%xyz
192 cofg => regions(ireg)%grid%cofg
193 lens => regions(ireg)%turb%lens
194 lens = global%refLength
198 DO ic = 1,regions(ireg)%grid%nCellsTot
199 lens(
ic) = 1.e+32_rfreal
200 DO n = 1,ndir*global%turbWallDim,ndir
201 xdist = cofg(xcoord,
ic)-global%turbWork1D(
n)
202 ydist = cofg(ycoord,
ic)-global%turbWork1D(
n+1)
203 zdist = cofg(zcoord,
ic)-global%turbWork1D(
n+2)
214 IF ((regions(ireg)%mixtInput%turbModel == turb_model_dessa) .OR. &
215 (regions(ireg)%mixtInput%turbModel == turb_model_hdessa) .OR. &
216 (global%turbWallDim == 0))
THEN
217 DO ic = 1,regions(ireg)%grid%nCellsTot
218 loclens = regions(ireg)%grid%vol(
ic)**onethird
220 lens(
ic) =
min( lens(
ic),cdes*loclens )
228 DEALLOCATE( global%turbWork1D, walldim )
229 global%turbWorkUnused = .true.
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
subroutine turb_coranswalldistov(regions)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
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)