69 TYPE(t_region
),
TARGET :: region
73 INTEGER ::
i,
j,
k,
ic
76 CHARACTER(CHRLEN) :: rcsidentstring
78 TYPE(t_turb),
POINTER :: turb
81 INTEGER :: ijk, bctype, indcp, ijkcb0, ijkcd, ijknb, ijknbg
82 INTEGER :: n1, n2, noff, j2d, aerocoeff
84 REAL(RFREAL) :: beta,rprt,cpprt,muel,tcol,tcot,engmodel
85 REAL(RFREAL) :: tx,ty,tz,tgradf, bvalfactor
86 REAL(RFREAL) :: velf(3),fd(4),sf(3),sij(3,3)
87 REAL(RFREAL) :: velcb0(3),tfd(4),ucitauij,taukk, ac0,ac1
88 REAL(RFREAL) :: rref, vref, rcfref, rchref
89 REAL(RFREAL),
POINTER :: diss(:,:),tv(:,:),gv(:,:),muet(:,:),srate(:,:)
90 REAL(RFREAL),
POINTER ::
trace(:),vol(:)
94 INTEGER :: ilev, lbound, icoff, ijcoff, inoff, ijnoff, acid0, acid1
96 REAL(RFREAL),
POINTER :: avgco(:,:), sface(:,:), dv(:,:), grad(:,:)
100 REAL(RFREAL) :: rdens0
101 REAL(RFREAL),
POINTER :: fn(:,:), cv(:,:), grad(:,:,:)
105 REAL(RFREAL) :: muf, modstrain
109 rcsidentstring =
'$RCSfile: TURB_VisFluxEddyPatch.F90,v $'
111 global => region%global
113 'TURB_VisFluxEddyPatch.F90' )
118 bctype =
patch%bcType
121 ilev = region%currLevel
122 lbound =
patch%lbound
123 vol => region%levels(ilev)%grid%vol
124 dv => region%levels(ilev)%mixt%dv
125 tv => region%levels(ilev)%mixt%tv
126 gv => region%levels(ilev)%mixt%gv
127 diss => region%levels(ilev)%mixt%diss
128 muet => region%levels(ilev)%turb%mueT
129 trace => region%levels(ilev)%turb%trace
130 turb => region%levels(ilev)%turb
133 vol => region%grid%vol
137 diss => region%mixt%diss
138 muet => region%turb%bMueT
139 trace => region%turb%trace
145 IF (region%turbInput%engModel==0)
THEN
150 beta = region%mixtInput%betrk(region%irkStep)
152 IF (bctype>=bc_noslipwall .AND. bctype<=bc_noslipwall+bc_range)
THEN
153 bvalfactor = 0._rfreal
155 bvalfactor = 1._rfreal
159 rprt = 1._rfreal/region%levels(ilev)%mixt%prTurb
160 indcp = region%levels(ilev)%mixt%indCp
161 aerocoeff = global%aeroCoeffs
165 rprt = 1._rfreal/region%mixtInput%prTurb
166 indcp = region%mixtInput%indCp
169 rref = global%refDensity
170 vref = global%refVelocity
172 rcfref = 2.0_rfreal/(rref*vref*vref)
173 rchref = 2.0_rfreal/(rref*vref*vref*vref)
190 IF (lbound==2 .OR. lbound==4 .OR. lbound==6)
THEN
202 IF (lbound==1 .OR. lbound==2)
THEN
204 avgco => region%levels(ilev)%grid%c2fCoI
205 sface => region%levels(ilev)%grid%si
206 grad => region%levels(ilev)%mixt%gradi
207 srate => region%levels(ilev)%turb%mISij
208 ELSE IF (lbound==3 .OR. lbound==4)
THEN
210 avgco => region%levels(ilev)%grid%c2fCoJ
211 sface => region%levels(ilev)%grid%sj
212 grad => region%levels(ilev)%mixt%gradj
213 srate => region%levels(ilev)%turb%mJSij
216 avgco => region%levels(ilev)%grid%c2fCoK
217 sface => region%levels(ilev)%grid%sk
218 grad => region%levels(ilev)%mixt%gradk
219 srate => region%levels(ilev)%turb%mKSij
226 IF (bctype>=bc_regionint .AND. bctype<=bc_regionint+bc_range)
THEN
228 ELSE IF (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range)
THEN
240 ijkcb0 = indijk(
i ,
j ,
k ,icoff,ijcoff)
245 sf(1) = sgn*sface(xcoord,ijknb)
246 sf(2) = sgn*sface(ycoord,ijknb)
247 sf(3) = sgn*sface(zcoord,ijknb)
248 ac0 = avgco(acid0,ijknb)
249 ac1 = avgco(acid1,ijknb)
253 IF (region%mixt%cvState /= cv_mixt_state_cons) &
254 CALL
errorstop(global,err_reached_default,__line__)
265 grad =>
patch%mixt%gradFace
266 srate => region%turb%bmISij
272 ijknbg =
ic + ifgbeg-1
274 sf(1) = fn(xcoord,ijknb)*fn(xyzmag,ijknb)
275 sf(2) = fn(ycoord,ijknb)*fn(xyzmag,ijknb)
276 sf(3) = fn(zcoord,ijknb)*fn(xyzmag,ijknb)
277 rdens0 = 1._rfreal/cv(cv_mixt_dens,ijkcb0)
281 cpprt = (ac0*gv(gv_mixt_cp,ijkcb0*indcp) + &
282 ac1*gv(gv_mixt_cp,ijkcd*indcp))*rprt
283 muel = ac0*tv(tv_mixt_muel,ijkcb0)+ac1*tv(tv_mixt_muel,ijkcd)
284 tcol = ac0*tv(tv_mixt_tcol,ijkcb0)+ac1*tv(tv_mixt_tcol,ijkcd)
285 tcot = cpprt*muet(ijk,ijknbg)
289 velcb0(1)= dv(dv_mixt_uvel,ijkcb0)
290 velcb0(2)= dv(dv_mixt_vvel,ijkcb0)
291 velcb0(3)= dv(dv_mixt_wvel,ijkcb0)
292 velf(1)= ac0*dv(dv_mixt_uvel,ijkcb0)+ac1*dv(dv_mixt_uvel,ijkcd)
293 velf(2)= ac0*dv(dv_mixt_vvel,ijkcb0)+ac1*dv(dv_mixt_vvel,ijkcd)
294 velf(3)= ac0*dv(dv_mixt_wvel,ijkcb0)+ac1*dv(dv_mixt_wvel,ijkcd)
295 tx = grad(gr_mixt_tx,ijknb)
296 ty = grad(gr_mixt_ty,ijknb)
297 tz = grad(gr_mixt_tz,ijknb)
300 velcb0(1)= cv(cv_mixt_xmom,ijkcb0)*rdens0
301 velcb0(2)= cv(cv_mixt_ymom,ijkcb0)*rdens0
302 velcb0(3)= cv(cv_mixt_zmom,ijkcb0)*rdens0
306 velf(1:3)= bvalfactor*velf(1:3)
307 tx = grad(xcoord,grf_mixt_temp,ijknbg)
308 ty = grad(ycoord,grf_mixt_temp,ijknbg)
309 tz = grad(zcoord,grf_mixt_temp,ijknbg)
312 tgradf = tx*sf(1)+ty*sf(2)+tz*sf(3)
314 sij(1,1) = srate(e11,ijknbg)
315 sij(1,2) = srate(e12,ijknbg)
316 sij(1,3) = srate(e13,ijknbg)
319 sij(2,2) = srate(e22,ijknbg)
320 sij(2,3) = srate(e23,ijknbg)
324 sij(3,3) = srate(e33,ijknbg)
326 fd(1) = muel*(sij(1,1)*sf(1)+sij(1,2)*sf(2)+sij(1,3)*sf(3))
327 fd(2) = muel*(sij(2,1)*sf(1)+sij(2,2)*sf(2)+sij(2,3)*sf(3))
328 fd(3) = muel*(sij(3,1)*sf(1)+sij(3,2)*sf(2)+sij(3,3)*sf(3))
329 fd(4) =
dot_product(fd(1:3),velf(1:3)) + tcol*tgradf
338 modstrain =
sqrt(sij(1,1)*sij(1,1) &
344 taukk = 2._rfreal*muet(ijk,ijknbg)*modstrain
347 muf = -muet(ijk,ijknbg)/muel
352 tfd(4) = ucitauij - tcot*tgradf
358 fd(4) = fd(4)-engmodel*tfd(4)
361 turb%stwork(1,ijkcb0)=turb%stwork(1,ijkcb0)+ucitauij
362 turb%stwork(2,ijkcb0)=turb%stwork(2,ijkcb0)+tcot*tgradf
364 diss(cv_mixt_xmom,ijkcb0) = diss(cv_mixt_xmom,ijkcb0)+fd(1)*beta
365 diss(cv_mixt_ymom,ijkcb0) = diss(cv_mixt_ymom,ijkcb0)+fd(2)*beta
366 diss(cv_mixt_zmom,ijkcb0) = diss(cv_mixt_zmom,ijkcb0)+fd(3)*beta
367 diss(cv_mixt_ener,ijkcb0) = diss(cv_mixt_ener,ijkcb0)+fd(4)*beta
368 global%esg1Sum = global%esg1Sum + vol(ijkcb0)*ucitauij
373 IF (lbound==1 .OR. lbound==2)
THEN
376 ELSE IF (lbound==3 .OR. lbound==4)
THEN
379 ELSE IF (lbound==5 .OR. lbound==6)
THEN
383 j2d = aerocoeff * indij(n1,n2,noff)
384 patch%cf(xcoord,j2d) = rcfref*fd(1)
385 patch%cf(ycoord,j2d) = rcfref*fd(2)
386 patch%cf(zcoord,j2d) = rcfref*fd(3)
387 patch%ch( j2d) = rchref*fd(4)
395 patch%cf(xcoord,
ic) = rcfref*fd(1)
396 patch%cf(ycoord,
ic) = rcfref*fd(2)
397 patch%cf(zcoord,
ic) = rcfref*fd(3)
**********************************************************************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 rflo_getpatchdirection(patch, idir, jdir, kdir)
**********************************************************************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 inode
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
subroutine rflo_getpatchindices(region, patch, iLev, ibeg, iend, jbeg, jend, kbeg, kend)
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 jdir
**********************************************************************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 idir
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
Tfloat trace() const
Return the trace of the image, viewed as a matrix.
subroutine turb_visfluxeddypatch(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
**********************************************************************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 kdir
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)
**********************************************************************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 jnode