72 TYPE(t_region
),
TARGET :: region
75 INTEGER ::
i,
j,
k,
ic, ipatch
78 CHARACTER(CHRLEN) :: rcsidentstring
81 TYPE(t_turb),
POINTER :: turb
83 INTEGER :: ijkc0,ijkc1,ijkn, indcp, ibn,ien
84 REAL(RFREAL) :: one6th,beta,engmodel,rprt,cpprt,muel,tcol,tcot
85 REAL(RFREAL) :: muf,tx,ty,tz,tgradf
86 REAL(RFREAL) :: velf(3),fd(4),sface(3),sij(3,3)
87 REAL(RFREAL) :: velc0(3),velc1(3),tfd(4),fd4,ucitauij,taukk
88 REAL(RFREAL),
POINTER :: diss(:,:),tv(:,:),gv(:,:),muet(:,:),srate(:,:)
89 REAL(RFREAL),
POINTER ::
trace(:),vol(:)
94 INTEGER :: ilev,icoff,ijcoff,inoff,ijnoff
95 REAL(RFREAL),
POINTER :: avgco(:,:), sf(:,:), dv(:,:), grad(:,:)
98 INTEGER,
POINTER :: f2c(:,:)
99 REAL(RFREAL) :: rdens0, rdens1
100 REAL(RFREAL),
POINTER :: fn(:,:), cv(:,:), grad(:,:,:)
105 rcsidentstring =
'$RCSfile: TURB_VFluxHybrid.F90,v $'
107 global => region%global
109 'TURB_VFluxHybrid.F90' )
115 ilev = region%currLevel
116 dv => region%levels(ilev)%mixt%dv
117 tv => region%levels(ilev)%mixt%tv
118 gv => region%levels(ilev)%mixt%gv
119 diss => region%levels(ilev)%mixt%diss
120 muet => region%levels(ilev)%turb%mueT
121 trace => region%levels(ilev)%turb%trace
122 vol => region%levels(ilev)%grid%vol
123 turb => region%levels(ilev)%turb
134 diss => region%mixt%diss
135 muet => region%turb%mueT
136 trace => region%turb%trace
137 vol => region%grid%vol
143 one6th = 1._rfreal/6._rfreal
145 IF (region%turbInput%engModel==off)
THEN
150 beta = region%mixtInput%betrk(region%irkStep)
153 rprt = 1._rfreal/region%levels(ilev)%mixt%prTurb
154 indcp = region%levels(ilev)%mixt%indCp
157 rprt = 1._rfreal/region%mixtInput%prTurb
158 indcp = region%mixtInput%indCp
165 ibn = lbound(
trace,1 )
166 ien = ubound(
trace,1 )
167 ALLOCATE( turb%stwork(2,ibn:ien) )
168 turb%stwork = 0._rfreal
179 DO ipatch=1,region%nPatches
180 patch => region%levels(ilev)%patches(ipatch)
183 DO ipatch=1,region%grid%nPatches
184 patch => region%patches(ipatch)
189 IF (
patch%bcType>=bc_noslipwall .AND. &
190 patch%bcType<=bc_noslipwall+bc_range)
THEN
191 IF (
patch%valBola%switches(wlm_input_model) /= wlm_model_nomodel)
THEN
211 IF ((region%turbInput%nSt > 0) .AND. (region%turbInput%engModel/=off))
THEN
212 turb%stwork(:,:) = one6th*turb%stwork(:,:)
215 DEALLOCATE( turb%stwork )
219 IF (region%turbInput%engModel/=off)
THEN
240 REAL(RFREAL) :: ac0, ac1
243 REAL(RFREAL) :: tij(3,3),sijsij,sijtij
244 REAL(RFREAL),
POINTER :: tauij(:,:)
252 tauij => region%levels(ilev)%turb%fISij
253 ELSEIF (ijk==dirj)
THEN
254 tauij => region%levels(ilev)%turb%fJSij
255 ELSEIF (ijk==dirk)
THEN
256 tauij => region%levels(ilev)%turb%fKSij
260 tauij => region%turb%fISij
277 srate => region%levels(ilev)%turb%mISij
278 grad => region%levels(ilev)%mixt%gradi
279 sf => region%levels(ilev)%grid%si
280 avgco => region%levels(ilev)%grid%c2fCoI
281 ELSEIF (ijk==dirj)
THEN
291 srate => region%levels(ilev)%turb%mJSij
292 grad => region%levels(ilev)%mixt%gradj
293 sf => region%levels(ilev)%grid%sj
294 avgco => region%levels(ilev)%grid%c2fCoJ
295 ELSEIF (ijk==dirk)
THEN
305 srate => region%levels(ilev)%turb%mKSij
306 grad => region%levels(ilev)%mixt%gradk
307 sf => region%levels(ilev)%grid%sk
308 avgco => region%levels(ilev)%grid%c2fCoK
313 iend = region%grid%nFaces
314 f2c => region%grid%f2c
315 srate => region%turb%mISij
316 grad => region%mixt%gradFace
325 ijkc0 = indijk(
i ,
j ,
k ,icoff,ijcoff)
326 ijkc1 = indijk(
i+iadd,
j+jadd,
k+kadd,icoff,ijcoff)
327 ijkn = indijk(
i ,
j ,
k ,inoff,ijnoff)
328 sface(1)= sf(xcoord,ijkn)
329 sface(2)= sf(ycoord,ijkn)
330 sface(3)= sf(zcoord,ijkn)
336 IF (region%mixt%cvState /= cv_mixt_state_cons) &
337 CALL
errorstop(global,err_reached_default,__line__)
344 sface(1)= fn(xcoord,ijkn)*fn(xyzmag,ijkn)
345 sface(2)= fn(ycoord,ijkn)*fn(xyzmag,ijkn)
346 sface(3)= fn(zcoord,ijkn)*fn(xyzmag,ijkn)
347 rdens0 = 1._rfreal/cv(cv_mixt_dens,ijkc0)
348 rdens1 = 1._rfreal/cv(cv_mixt_dens,ijkc1)
350 cpprt = (ac0*gv(gv_mixt_cp,ijkc0*indcp) + &
351 ac1*gv(gv_mixt_cp,ijkc1*indcp))*rprt
352 muel = ac0*tv(tv_mixt_muel,ijkc0)+ac1*tv(tv_mixt_muel,ijkc1)
353 tcol = ac0*tv(tv_mixt_tcol,ijkc0)+ac1*tv(tv_mixt_tcol,ijkc1)
354 tcot = cpprt*muet(ijk,ijkn)
356 velc0(1)= dv(dv_mixt_uvel,ijkc0)
357 velc0(2)= dv(dv_mixt_vvel,ijkc0)
358 velc0(3)= dv(dv_mixt_wvel,ijkc0)
359 velc1(1)= dv(dv_mixt_uvel,ijkc1)
360 velc1(2)= dv(dv_mixt_vvel,ijkc1)
361 velc1(3)= dv(dv_mixt_wvel,ijkc1)
362 velf(1) = ac0*dv(dv_mixt_uvel,ijkc0)+ac1*dv(dv_mixt_uvel,ijkc1)
363 velf(2) = ac0*dv(dv_mixt_vvel,ijkc0)+ac1*dv(dv_mixt_vvel,ijkc1)
364 velf(3) = ac0*dv(dv_mixt_wvel,ijkc0)+ac1*dv(dv_mixt_wvel,ijkc1)
365 tx = grad(gr_mixt_tx,ijkn)
366 ty = grad(gr_mixt_ty,ijkn)
367 tz = grad(gr_mixt_tz,ijkn)
370 velc0(1)= cv(cv_mixt_xmom,ijkc0)*rdens0
371 velc0(2)= cv(cv_mixt_ymom,ijkc0)*rdens0
372 velc0(3)= cv(cv_mixt_zmom,ijkc0)*rdens0
373 velc1(1)= cv(cv_mixt_xmom,ijkc1)*rdens1
374 velc1(2)= cv(cv_mixt_ymom,ijkc1)*rdens1
375 velc1(3)= cv(cv_mixt_zmom,ijkc1)*rdens1
376 velf(1) = ac0*velc0(1)+ac1*velc1(1)
377 velf(2) = ac0*velc0(2)+ac1*velc1(2)
378 velf(3) = ac0*velc0(3)+ac1*velc1(3)
379 tx = grad(xcoord,grf_mixt_temp,ijkn)
380 ty = grad(ycoord,grf_mixt_temp,ijkn)
381 tz = grad(zcoord,grf_mixt_temp,ijkn)
384 tgradf= (tx*sface(1)+ty*sface(2)+tz*sface(3))
386 sij(1,1) = srate(e11,ijkn)
387 sij(1,2) = srate(e12,ijkn)
388 sij(1,3) = srate(e13,ijkn)
391 sij(2,2) = srate(e22,ijkn)
392 sij(2,3) = srate(e23,ijkn)
396 sij(3,3) = srate(e33,ijkn)
398 fd(1) = muel*(sij(1,1)*sface(1)+sij(1,2)*sface(2)+sij(1,3)*sface(3))
399 fd(2) = muel*(sij(2,1)*sface(1)+sij(2,2)*sface(2)+sij(2,3)*sface(3))
400 fd(3) = muel*(sij(3,1)*sface(1)+sij(3,2)*sface(2)+sij(3,3)*sface(3))
401 fd(4) =
dot_product(fd(1:3),velf(1:3)) + tcol*tgradf
403 tij(1,1) = tauij(e11,ijkn) - muet(ijk,ijkn)*sij(1,1)
404 tij(1,2) = tauij(e12,ijkn) - muet(ijk,ijkn)*sij(1,2)
405 tij(1,3) = tauij(e13,ijkn) - muet(ijk,ijkn)*sij(1,3)
407 tij(2,1) = tauij(e12,ijkn) - muet(ijk,ijkn)*sij(2,1)
408 tij(2,2) = tauij(e22,ijkn) - muet(ijk,ijkn)*sij(2,2)
409 tij(2,3) = tauij(e23,ijkn) - muet(ijk,ijkn)*sij(2,3)
411 tij(3,1) = tauij(e13,ijkn) - muet(ijk,ijkn)*sij(3,1)
412 tij(3,2) = tauij(e23,ijkn) - muet(ijk,ijkn)*sij(3,2)
413 tij(3,3) = tauij(e33,ijkn) - muet(ijk,ijkn)*sij(3,3)
415 taukk = tij(1,1)+tij(2,2)+tij(3,3)
416 taukk =
max( 0._rfreal,taukk )
420 tfd(1) = tij(1,1)*sface(1)+tij(1,2)*sface(2)+tij(1,3)*sface(3)
421 tfd(2) = tij(2,1)*sface(1)+tij(2,2)*sface(2)+tij(2,3)*sface(3)
422 tfd(3) = tij(3,1)*sface(1)+tij(3,2)*sface(2)+tij(3,3)*sface(3)
431 tfd(4) = ucitauij - tcot*tgradf
432 fd(4) = fd4 - engmodel*tfd(4)
435 turb%stwork(1,ijkc0)=turb%stwork(1,ijkc0)+ucitauij
436 turb%stwork(2,ijkc0)=turb%stwork(2,ijkc0)+tcot*tgradf
438 diss(cv_mixt_xmom,ijkc0) = diss(cv_mixt_xmom,ijkc0) + fd(1)*beta
439 diss(cv_mixt_ymom,ijkc0) = diss(cv_mixt_ymom,ijkc0) + fd(2)*beta
440 diss(cv_mixt_zmom,ijkc0) = diss(cv_mixt_zmom,ijkc0) + fd(3)*beta
441 diss(cv_mixt_ener,ijkc0) = diss(cv_mixt_ener,ijkc0) + fd(4)*beta
442 global%esg1Sum = global%esg1Sum + vol(ijkc0)*ucitauij
445 tfd(4) = ucitauij - tcot*tgradf
446 fd(4) = fd4 - engmodel*tfd(4)
449 turb%stwork(1,ijkc1)=turb%stwork(1,ijkc1)+ucitauij
450 turb%stwork(2,ijkc1)=turb%stwork(2,ijkc1)+tcot*tgradf
452 diss(cv_mixt_xmom,ijkc1) = diss(cv_mixt_xmom,ijkc1) - fd(1)*beta
453 diss(cv_mixt_ymom,ijkc1) = diss(cv_mixt_ymom,ijkc1) - fd(2)*beta
454 diss(cv_mixt_zmom,ijkc1) = diss(cv_mixt_zmom,ijkc1) - fd(3)*beta
455 diss(cv_mixt_ener,ijkc1) = diss(cv_mixt_ener,ijkc1) - fd(4)*beta
456 global%esg1Sum = global%esg1Sum - vol(ijkc1)*ucitauij
479 ELSEIF (ijk==dirj)
THEN
486 ELSEIF (ijk==dirk)
THEN
498 ijkn = indijk(
i ,
j ,
k ,inoff,ijnoff)
502 iend = region%grid%nFaces
506 sij(1,1) = srate(e11,ijkn)
507 sij(1,2) = srate(e12,ijkn)
508 sij(1,3) = srate(e13,ijkn)
511 sij(2,2) = srate(e22,ijkn)
512 sij(2,3) = srate(e23,ijkn)
516 sij(3,3) = srate(e33,ijkn)
519 sijsij = sij(1,1)*sij(1,1) &
522 +2.0d0*sij(1,2)*sij(1,2) &
523 +2.0d0*sij(1,3)*sij(1,3) &
524 +2.0d0*sij(2,3)*sij(2,3)
527 sijtij = sij(1,1)*tauij(e11,ijkn) &
528 +sij(2,2)*tauij(e22,ijkn) &
529 +sij(3,3)*tauij(e33,ijkn) &
530 +2.0d0*sij(1,2)*tauij(e12,ijkn) &
531 +2.0d0*sij(1,3)*tauij(e13,ijkn) &
532 +2.0d0*sij(2,3)*tauij(e23,ijkn)
534 muf =
max( 0._rfreal, -(sijtij/
max( sijsij,real_small )) )
535 muet(ijk,ijkn) = muet(ijk,ijkn) + muf
**********************************************************************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 ibeg
subroutine turb_vfluxhybrid(region)
**********************************************************************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)
**********************************************************************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 turb_wlmtauwallmapping(region, patch)
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
subroutine turb_wlmupdate(region, patch)
**********************************************************************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 knode iend
**********************************************************************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)
subroutine turb_statccollector(region, iBegSt, iEndSt, colVar)
subroutine turb_lesesgmodel4(region)
Tfloat trace() const
Return the trace of the image, viewed as a matrix.
**********************************************************************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 turb_vfluxhybridpatch(region, patch)
**********************************************************************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 knode jend
subroutine computefluxtot(ijk)
subroutine errorstop(global, errorCode, errorLine, addMessage)
**********************************************************************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 knode jbeg
long double dot_product(pnt vec1, pnt vec2)
**********************************************************************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 knode kbeg
subroutine deregisterfunction(global)
subroutine turb_wlmfluxpatch(region, patch)
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)