72 TYPE(t_region
),
TARGET :: region
75 TYPE(t_region
),
POINTER :: region
77 INTEGER :: ibn,ien,ijk
80 INTEGER ::
i,
j,
k,
m, ijkn, ipatch, ifl
83 CHARACTER(CHRLEN) :: rcsidentstring
85 TYPE(t_turb),
POINTER :: turb
90 INTEGER :: turbmodel, zofid, xco, yco, zco, errorflag
92 REAL(RFREAL) :: two3rd,csmag,delfac2,delta2, zoffac,bzoffac
93 REAL(RFREAL) :: vormag,volface,rhoface,muturb,rhomin,mutmin
94 REAL(RFREAL) :: sxx,sxy,sxz,syy,syz,szz
95 REAL(RFREAL),
POINTER :: fvol(:),fvar(:,:),cmodel(:,:),muet(:,:)
96 REAL(RFREAL),
POINTER :: tdv(:,:),sij(:,:),zof(:,:,:)
98 REAL(RFREAL),
POINTER :: bfvol(:),bfvar(:,:),bcmodel(:,:),bmuet(:,:),bsij(:,:)
99 REAL(RFREAL),
POINTER :: bzof(:,:,:)
104 INTEGER :: ilev, icoff, ijcoff, inoff, ijnoff, filtertype
108 INTEGER :: ifg,ifgt,ifgbeg,ifgtbeg
109 INTEGER :: npatches,
nfaces,nfacestot,nbfaces,nbfacestot
110 REAL(RFREAL) :: bvalfactor
115 rcsidentstring =
'$RCSfile: TURB_LesCalcEddyVis.F90,v $'
117 global => region%global
119 'TURB_LesCalcEddyVis.F90' )
126 zofid = zof_les_eddyvis
127 turbmodel = region%mixtInput%turbModel
128 csmag = region%turbInput%cSmag
129 delfac2 = region%turbInput%delFac2
131 filtertype = region%turbInput%filterType
132 ilev = region%currLevel
135 rhomin = 10000._rfreal
136 mutmin = 10000._rfreal
137 two3rd = 2._rfreal/3._rfreal
142 turb => region%levels(ilev)%turb
144 ALLOCATE( turb%coef(1,ibn:ien),stat=errorflag )
145 ALLOCATE( turb%fVar(cv_turb_nelm,ibn:ien),stat=errorflag )
146 global%error = errorflag
147 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
150 npatches = region%grid%nPatches
151 nfaces = region%grid%nFaces
152 nfacestot = region%grid%nFacesTot
156 DO ipatch = 1,npatches
157 patch => region%patches(ipatch)
159 nbfaces = nbfaces +
patch%nBTris +
patch%nBQuads
160 nbfacestot = nbfacestot +
patch%nBTrisTot +
patch%nBQuadsTot
163 IF (ijk /= diri)
THEN
164 CALL
errorstop( global,err_turb_fixparam,__line__,
'RFLU but ijk/=DIRI' )
168 ALLOCATE( turb%coef( 1,ibn:ien),stat=errorflag )
169 ALLOCATE( turb%bCoef(1,nbfaces),stat=errorflag )
170 global%error = errorflag
171 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
173 ALLOCATE( turb%fVar( cv_turb_nelm,
nfaces),stat=errorflag )
174 ALLOCATE( turb%bfVar(cv_turb_nelm,nbfaces),stat=errorflag )
175 global%error = errorflag
176 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
181 IF (turbmodel==turb_model_fixsmag)
THEN
186 turb%fVar(cv_turb_dens,ijkn) = 1._rfreal/turb%fVar(cv_turb_dens,ijkn)
187 turb%coef(1,ijkn) = csmag*csmag
193 turb%coef(1,ijkn) = csmag*csmag
194 turb%fVar(cv_turb_dens,ijkn) = 1._rfreal/turb%fVar(cv_turb_dens,ijkn)
197 turb%bCoef(1,ijkn) = csmag*csmag
198 turb%bfVar(cv_turb_dens,ijkn) = 1._rfreal/turb%bfVar(cv_turb_dens,ijkn)
201 ELSEIF (turbmodel==turb_model_dynsmag)
THEN
203 ELSEIF (turbmodel==turb_model_dynmixd)
THEN
212 ELSEIF (ijk==dirj)
THEN
214 ELSEIF (ijk==dirk)
THEN
218 zoffac = zof(xco,zofid,ijkn)*zof(yco,zofid,ijkn)*zof(zco,zofid,ijkn)
219 turb%coef(1,ijkn) = zoffac*turb%coef(1,ijkn)
226 zoffac = zof(xco,zofid,ijkn)*zof(yco,zofid,ijkn)*zof(zco,zofid,ijkn)
227 turb%coef(1,ijkn) = zoffac*turb%coef(1,ijkn)
230 bzoffac = bzof(xco,zofid,ijkn)*bzof(yco,zofid,ijkn)*bzof(zco,zofid,ijkn)
231 turb%bCoef(1,ijkn) = bzoffac*turb%bCoef(1,ijkn)
262 ELSEIF (ijk==dirj)
THEN
275 ELSEIF (ijk==dirk)
THEN
297 ijkc0 = indijk(
i ,
j ,
k ,icoff,ijcoff)
298 ijkc1 = ijkc0 + iadd + jadd*icoff + kadd*ijcoff
299 ijkn = indijk(
i ,
j ,
k ,inoff,ijnoff)
318 vormag = 0.5_rfreal*(sxx*sxx+syy*syy+szz*szz)+sxy*sxy+sxz*sxz+syz*syz
319 vormag =
sqrt(vormag)
322 delta2 = volface**two3rd
325 muturb = cmodel(1,ijkn)/fvar(cv_turb_dens,ijkn)*delfac2*delta2*vormag
328 muturb =
max(muturb,real_small)
334 muet(ijk,ijkn) = muturb
337 tdv(dv_turb_cdyn,ijkc0) = tdv(dv_turb_cdyn,ijkc0)+cmodel(1,ijkn)
338 tdv(dv_turb_cdyn,ijkc1) = tdv(dv_turb_cdyn,ijkc1)+cmodel(1,ijkn)
347 DO ijkn = 1,region%grid%nFaces
348 ijkc0 = region%grid%f2c(1,ijkn)
349 ijkc1 = region%grid%f2c(2,ijkn)
351 tdv(dv_turb_cdyn,ijkc0) = tdv(dv_turb_cdyn,ijkc0)+cmodel(1,ijkn)
352 tdv(dv_turb_cdyn,ijkc1) = tdv(dv_turb_cdyn,ijkc1)+cmodel(1,ijkn)
361 bcmodel => turb%bCoef
365 DO ipatch = 1,region%grid%nPatches
366 patch => region%patches(ipatch)
371 bctype =
patch%bcType
372 IF (bctype>=bc_noslipwall .AND. bctype<=bc_noslipwall+bc_range .OR. &
373 bctype>=bc_injection .AND. bctype<=bc_injection+bc_range)
THEN
374 IF (turbmodel==turb_model_fixsmag)
THEN
375 bvalfactor = 1._rfreal
377 bvalfactor = 0._rfreal
380 bvalfactor = 1._rfreal
387 DO ifl = 1,
patch%nBFaces
388 ijkc0 =
patch%bf2c(ifl)
400 vormag = 0.5_rfreal*(sxx*sxx+syy*syy+szz*szz)+sxy*sxy+sxz*sxz+syz*syz
401 vormag =
sqrt(vormag)
404 delta2 = volface**two3rd
407 muturb = cmodel(1,ifg)/bfvar(cv_turb_dens,ifg)*delfac2*delta2*vormag
409 muturb =
max(muturb,real_small)
415 bmuet(ijk,ifg) = bvalfactor*muturb
416 tdv(dv_turb_cdyn,ijkc0) = tdv(dv_turb_cdyn,ijkc0)+bcmodel(1,ifg)
423 IF (rhomin < 0._rfreal)
THEN
424 write(*,*)
'TURB_LesCalcEddyVis: rhoMin < 0'
426 IF (mutmin < 0._rfreal)
THEN
427 write(*,*)
'TURB_LesCalcEddyVis: muTMin < 0'
432 DEALLOCATE( turb%coef, turb%fVar )
434 DEALLOCATE( turb%bCoef, turb%bfVar )
**********************************************************************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
**********************************************************************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)
subroutine turb_flulesc2f(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 jpcbeg
subroutine turb_lescoefdynsmag(region, ibn, ien, ijk)
**********************************************************************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)
**********************************************************************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)
**********************************************************************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
**********************************************************************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 turb_lescalceddyvis(region, ibn, ien, 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
subroutine turb_lescoefdynmixd(region, ibn, ien, ijk)
**********************************************************************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 rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)
subroutine turb_flolesgenc2f(region, ijk)