67 TYPE(t_region
),
TARGET :: region
71 INTEGER ::
i,
j,
k,
ic
74 CHARACTER(CHRLEN) :: rcsidentstring
76 TYPE(t_turb),
POINTER :: turb
79 INTEGER :: ijk, bctype, indcp, ijkcb0, ijkcd, ijknb, ijknbg
80 INTEGER :: n1, n2, noff, j2d, aerocoeff
82 REAL(RFREAL) :: beta,rprt,cpprt,muel,tcol,tcot,engmodel
83 REAL(RFREAL) :: tx,ty,tz,tgradf, bvalfactor
84 REAL(RFREAL) :: velf(3),fd(4),sf(3),sij(3,3)
85 REAL(RFREAL) :: velcb0(3),tfd(4),ucitauij,taukk, ac0,ac1
86 REAL(RFREAL) :: rref, vref, rcfref, rchref
87 REAL(RFREAL),
POINTER :: diss(:,:),tv(:,:),gv(:,:),muet(:,:),srate(:,:)
88 REAL(RFREAL),
POINTER ::
trace(:),vol(:)
92 INTEGER :: ilev, lbound, icoff, ijcoff, inoff, ijnoff, acid0, acid1
94 REAL(RFREAL),
POINTER :: avgco(:,:), sface(:,:), dv(:,:), grad(:,:)
98 REAL(RFREAL) :: rdens0
99 REAL(RFREAL),
POINTER :: fn(:,:), cv(:,:), grad(:,:,:)
103 REAL(RFREAL) :: tij(3,3)
104 REAL(RFREAL),
POINTER :: tauij(:,:)
108 rcsidentstring =
'$RCSfile: TURB_VFluxHybridPatch.F90,v $'
110 global => region%global
112 'TURB_VFluxHybridPatch.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 tauij => region%levels(ilev)%turb%fISij
209 ELSE IF (lbound==3 .OR. lbound==4)
THEN
211 avgco => region%levels(ilev)%grid%c2fCoJ
212 sface => region%levels(ilev)%grid%sj
213 grad => region%levels(ilev)%mixt%gradj
214 srate => region%levels(ilev)%turb%mJSij
215 tauij => region%levels(ilev)%turb%fJSij
218 avgco => region%levels(ilev)%grid%c2fCoK
219 sface => region%levels(ilev)%grid%sk
220 grad => region%levels(ilev)%mixt%gradk
221 srate => region%levels(ilev)%turb%mKSij
222 tauij => region%levels(ilev)%turb%fKSij
229 IF (bctype>=bc_regionint .AND. bctype<=bc_regionint+bc_range)
THEN
231 ELSE IF (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range)
THEN
243 ijkcb0 = indijk(
i ,
j ,
k ,icoff,ijcoff)
248 sf(1) = sgn*sface(xcoord,ijknb)
249 sf(2) = sgn*sface(ycoord,ijknb)
250 sf(3) = sgn*sface(zcoord,ijknb)
251 ac0 = avgco(acid0,ijknb)
252 ac1 = avgco(acid1,ijknb)
256 IF (region%mixt%cvState /= cv_mixt_state_cons) &
257 CALL
errorstop(global,err_reached_default,__line__)
268 grad =>
patch%mixt%gradFace
269 srate => region%turb%bmISij
270 tauij => region%turb%bfISij
276 ijknbg =
ic + ifgbeg-1
278 sf(1) = fn(xcoord,ijknb)*fn(xyzmag,ijknb)
279 sf(2) = fn(ycoord,ijknb)*fn(xyzmag,ijknb)
280 sf(3) = fn(zcoord,ijknb)*fn(xyzmag,ijknb)
281 rdens0 = 1._rfreal/cv(cv_mixt_dens,ijkcb0)
285 cpprt = (ac0*gv(gv_mixt_cp,ijkcb0*indcp) + &
286 ac1*gv(gv_mixt_cp,ijkcd*indcp))*rprt
287 muel = ac0*tv(tv_mixt_muel,ijkcb0)+ac1*tv(tv_mixt_muel,ijkcd)
288 tcol = ac0*tv(tv_mixt_tcol,ijkcb0)+ac1*tv(tv_mixt_tcol,ijkcd)
289 tcot = cpprt*muet(ijk,ijknbg)
293 velcb0(1)= dv(dv_mixt_uvel,ijkcb0)
294 velcb0(2)= dv(dv_mixt_vvel,ijkcb0)
295 velcb0(3)= dv(dv_mixt_wvel,ijkcb0)
296 velf(1)= ac0*dv(dv_mixt_uvel,ijkcb0)+ac1*dv(dv_mixt_uvel,ijkcd)
297 velf(2)= ac0*dv(dv_mixt_vvel,ijkcb0)+ac1*dv(dv_mixt_vvel,ijkcd)
298 velf(3)= ac0*dv(dv_mixt_wvel,ijkcb0)+ac1*dv(dv_mixt_wvel,ijkcd)
299 tx = grad(gr_mixt_tx,ijknb)
300 ty = grad(gr_mixt_ty,ijknb)
301 tz = grad(gr_mixt_tz,ijknb)
304 velcb0(1)= cv(cv_mixt_xmom,ijkcb0)*rdens0
305 velcb0(2)= cv(cv_mixt_ymom,ijkcb0)*rdens0
306 velcb0(3)= cv(cv_mixt_zmom,ijkcb0)*rdens0
310 velf(1:3)= bvalfactor*velf(1:3)
311 tx = grad(xcoord,grbf_mixt_temp,ijknbg)
312 ty = grad(ycoord,grbf_mixt_temp,ijknbg)
313 tz = grad(zcoord,grbf_mixt_temp,ijknbg)
316 tgradf = tx*sf(1)+ty*sf(2)+tz*sf(3)
318 sij(1,1) = srate(e11,ijknbg)
319 sij(1,2) = srate(e12,ijknbg)
320 sij(1,3) = srate(e13,ijknbg)
323 sij(2,2) = srate(e22,ijknbg)
324 sij(2,3) = srate(e23,ijknbg)
328 sij(3,3) = srate(e33,ijknbg)
330 fd(1) = muel*(sij(1,1)*sf(1)+sij(1,2)*sf(2)+sij(1,3)*sf(3))
331 fd(2) = muel*(sij(2,1)*sf(1)+sij(2,2)*sf(2)+sij(2,3)*sf(3))
332 fd(3) = muel*(sij(3,1)*sf(1)+sij(3,2)*sf(2)+sij(3,3)*sf(3))
333 fd(4) =
dot_product(fd(1:3),velf(1:3)) + tcol*tgradf
335 tij(1,1) = tauij(e11,ijknbg) - muet(ijk,ijknbg)*sij(1,1)
336 tij(1,2) = tauij(e12,ijknbg) - muet(ijk,ijknbg)*sij(1,2)
337 tij(1,3) = tauij(e13,ijknbg) - muet(ijk,ijknbg)*sij(1,3)
339 tij(2,1) = tauij(e12,ijknbg) - muet(ijk,ijknbg)*sij(2,1)
340 tij(2,2) = tauij(e22,ijknbg) - muet(ijk,ijknbg)*sij(2,2)
341 tij(2,3) = tauij(e23,ijknbg) - muet(ijk,ijknbg)*sij(2,3)
343 tij(3,1) = tauij(e13,ijknbg) - muet(ijk,ijknbg)*sij(3,1)
344 tij(3,2) = tauij(e23,ijknbg) - muet(ijk,ijknbg)*sij(3,2)
345 tij(3,3) = tauij(e33,ijknbg) - muet(ijk,ijknbg)*sij(3,3)
347 taukk = tij(1,1)+tij(2,2)+tij(3,3)
348 taukk =
max( 0._rfreal,taukk )
351 tfd(1) = tij(1,1)*sf(1)+tij(1,2)*sf(2)+tij(1,3)*sf(3)
352 tfd(2) = tij(2,1)*sf(1)+tij(2,2)*sf(2)+tij(2,3)*sf(3)
353 tfd(3) = tij(3,1)*sf(1)+tij(3,2)*sf(2)+tij(3,3)*sf(3)
355 tfd(4) = ucitauij - tcot*tgradf
361 fd(4) = fd(4)-engmodel*tfd(4)
364 turb%stwork(1,ijkcb0)=turb%stwork(1,ijkcb0)+ucitauij
365 turb%stwork(2,ijkcb0)=turb%stwork(2,ijkcb0)+tcot*tgradf
367 diss(cv_mixt_xmom,ijkcb0) = diss(cv_mixt_xmom,ijkcb0)+fd(1)*beta
368 diss(cv_mixt_ymom,ijkcb0) = diss(cv_mixt_ymom,ijkcb0)+fd(2)*beta
369 diss(cv_mixt_zmom,ijkcb0) = diss(cv_mixt_zmom,ijkcb0)+fd(3)*beta
370 diss(cv_mixt_ener,ijkcb0) = diss(cv_mixt_ener,ijkcb0)+fd(4)*beta
371 global%esg1Sum = global%esg1Sum + vol(ijkcb0)*ucitauij
376 IF (lbound==1 .OR. lbound==2)
THEN
379 ELSE IF (lbound==3 .OR. lbound==4)
THEN
382 ELSE IF (lbound==5 .OR. lbound==6)
THEN
386 j2d = aerocoeff * indij(n1,n2,noff)
387 patch%cf(xcoord,j2d) = rcfref*fd(1)
388 patch%cf(ycoord,j2d) = rcfref*fd(2)
389 patch%cf(zcoord,j2d) = rcfref*fd(3)
390 patch%ch( j2d) = rchref*fd(4)
398 patch%cf(xcoord,
ic) = rcfref*fd(1)
399 patch%cf(ycoord,
ic) = rcfref*fd(2)
400 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
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
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_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
**********************************************************************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