62 TYPE(t_region
) :: region
65 INTEGER ::
i,
j,
k,
n, ir
68 CHARACTER(CHRLEN) :: rcsidentstring
72 INTEGER :: ilev, icoff, ijcoff, inoff, ijnoff, ijkc0, ijkc1
73 INTEGER :: ijkn, ijknp1, ipc, kpc, istage
75 REAL(RFREAL) :: rhoc, rhouc, rhovc, rhowc, rhoec, pc
76 REAL(RFREAL) :: refmassflux, rescaler,
alpha, massflux
77 REAL(RFREAL) :: cfl, dt, rucm,
delta, deltamassflux, aversize
78 REAL(RFREAL) :: sndmassflux, rcvmassflux, sndaversize, rcvaversize
79 REAL(RFREAL) :: snddt, rcvdt, avgdt, dtfactor, refmeanpgrad, reftauwall
80 REAL(RFREAL) :: tauwall, avgtauwall, sndtauwall, rcvtauwall
81 REAL(RFREAL) :: rn, sndrn, rcvrn
82 REAL(RFREAL),
POINTER :: xyz(:,:), cv(:,:), dv(:,:), tv(:,:), rdt(:)
86 rcsidentstring =
'$RCSfile: PERI_coPgradUpdateFlo.F90,v $ $Revision: 1.8 $'
88 global => region%global
90 'PERI_coPgradUpdateFlo.F90' )
94 ilev = region%currLevel
100 xyz => region%levels(ilev)%grid%xyz
101 cv => region%levels(ilev)%mixt%cv
102 dv => region%levels(ilev)%mixt%dv
103 tv => region%levels(ilev)%mixt%tv
104 rdt => region%levels(ilev)%dt
106 istage = mod(region%irkStep,global%nrkSteps) + 1
107 alpha = region%mixtInput%ark(istage)
108 refmassflux = region%periInput%bulkmFlux
110 IF (region%periInput%flowKind == peri_flow_cpr)
THEN
111 rescaler = region%periInput%cprEpsilon
112 IF (global%flowType == flow_unsteady .AND. &
113 global%solverType == solv_explicit )
alpha = 1._rfreal
114 ELSEIF (region%periInput%flowKind == peri_flow_channel)
THEN
118 IF (global%flowType==flow_steady)
THEN
119 cfl = region%mixtInput%cfl
121 IF (global%solverType == solv_implicit )
THEN
122 dtfactor = 10._rfreal
125 dtfactor = 10._rfreal
132 ijkc0 = indijk(
i ,
j ,
k ,icoff,ijcoff)
133 avgdt = avgdt + rdt(ijkc0)
140 CALL mpi_allreduce( snddt,rcvdt,1,mpi_double_precision, mpi_sum, &
141 global%mpiComm, global%mpierr )
144 CALL mpi_allreduce( sndrn,rcvrn,1,mpi_double_precision, mpi_sum, &
145 global%mpiComm, global%mpierr )
148 avgdt = dtfactor*avgdt/rn
157 refmeanpgrad = region%periInput%meanPgrad
160 IF (refmeanpgrad /= global%moduleVar(1) )
THEN
161 CALL
errorstop( global,err_peri_physparam,__line__, &
162 'mean pressure gradient vary between regions' )
170 aversize = dble(ipc*kpc)
178 ijkc0 = indijk(
i ,
j ,
k ,icoff,ijcoff)
179 ijkn = indijk(
i ,
j ,
k ,inoff,ijnoff)
180 ijknp1= indijk(
i ,
j+1,
k ,inoff,ijnoff)
181 rucm = rucm + cv(cv_mixt_xmom,ijkc0)
184 massflux = massflux + rucm*(xyz(ycoord,ijknp1)-xyz(ycoord,ijkn))
189 avgtauwall = 0._rfreal
191 IF (region%periInput%flowKind == peri_flow_channel .AND. &
192 region%periInput%split(jcoord) /= off )
THEN
194 IF (region%procId == masterproc)
THEN
197 ijkc0 = indijk(
i ,1 ,
k ,icoff,ijcoff)
198 ijkc1 = indijk(
i ,2 ,
k ,icoff,ijcoff)
199 ijkn = indijk(
i ,1 ,
k ,inoff,ijnoff)
200 ijknp1= indijk(
i ,2 ,
k ,inoff,ijnoff)
201 tauwall = 0.5_rfreal*tv(tv_mixt_muel,ijkc0)* &
202 (dv(dv_mixt_uvel,ijkc1)+dv(dv_mixt_uvel,ijkc0))/ &
203 (xyz(ycoord,ijknp1)-xyz(ycoord,ijkn))
204 avgtauwall = avgtauwall + tauwall
209 IF (region%procId == global%nProcAlloc-1)
THEN
212 ijkc0 = indijk(
i ,
jpcend ,
k ,icoff,ijcoff)
213 ijkc1 = indijk(
i ,
jpcend-1 ,
k ,icoff,ijcoff)
214 ijkn = indijk(
i ,
jpcend ,
k ,inoff,ijnoff)
215 ijknp1= indijk(
i ,
jpcend+1 ,
k ,inoff,ijnoff)
216 tauwall = 0.5_rfreal*tv(tv_mixt_muel,ijkc0)* &
217 (dv(dv_mixt_uvel,ijkc1)+dv(dv_mixt_uvel,ijkc0))/ &
218 abs( xyz(ycoord,ijknp1)-xyz(ycoord,ijkn) )
219 avgtauwall = avgtauwall + tauwall
228 sndmassflux = massflux
229 CALL mpi_allreduce( sndmassflux,rcvmassflux,1,mpi_double_precision,mpi_sum, &
230 global%mpiComm, global%mpierr )
231 massflux = rcvmassflux
233 IF (region%periInput%flowKind == peri_flow_channel)
THEN
234 sndtauwall = avgtauwall
235 CALL mpi_allreduce( sndtauwall,rcvtauwall,1,mpi_double_precision,mpi_sum, &
236 global%mpiComm, global%mpierr )
237 avgtauwall = rcvtauwall
240 IF (region%periInput%split(jcoord) == off)
THEN
241 sndaversize = aversize
242 CALL mpi_allreduce( sndaversize,rcvaversize,1,mpi_double_precision,mpi_sum, &
243 global%mpiComm, global%mpierr )
244 aversize = rcvaversize
247 IF (global%myProcId==masterproc)
write(*,*)massflux,aversize
251 delta = global%refLength
252 massflux = massflux/aversize
253 avgtauwall = 0.5_rfreal*avgtauwall/aversize
257 deltamassflux = refmassflux - massflux
258 IF (global%myProcId==masterproc)
WRITE(*,*) region%localNumber, &
259 'refMassFlux-massFlux prior updating u',refmassflux,massflux,deltamassflux, &
262 refmeanpgrad = refmeanpgrad - 0.5_rfreal*deltamassflux/ &
265 IF ((region%periInput%flowKind == peri_flow_channel) .AND. &
266 (region%periInput%pgradType == cnl_pgrad_tauwall))
THEN
269 refmeanpgrad =
min( refmeanpgrad, -avgtauwall/global%refLength )
272 IF (global%myProcId==masterproc)
WRITE(*,*) region%localNumber, &
273 ' meanPgrad ',refmeanpgrad,dt,
alpha
276 region%periInput%meanPgrad = refmeanpgrad
280 IF (region%periInput%flowKind == peri_flow_cpr)
THEN
288 ijkc0 = indijk(
i ,
j ,
k ,icoff,ijcoff)
289 ijkn = indijk(
i ,
j ,
k ,inoff,ijnoff)
290 ijknp1= indijk(
i ,
j+1,
k ,inoff,ijnoff)
291 cv(cv_mixt_xmom,ijkc0) = cv(cv_mixt_xmom,ijkc0) + 0.5_rfreal* &
293 dv(dv_mixt_uvel,ijkc0) = cv(cv_mixt_xmom,ijkc0)/cv(cv_mixt_dens,ijkc0)
294 rucm = rucm + cv(cv_mixt_xmom,ijkc0)
297 massflux = massflux + rucm*(xyz(ycoord,ijknp1)-xyz(ycoord,ijkn))
301 CALL mpi_barrier( global%mpiComm, global%mpierr )
302 sndmassflux = massflux
303 CALL mpi_allreduce( sndmassflux,rcvmassflux,1,mpi_double_precision,mpi_sum, &
304 global%mpiComm, global%mpierr )
305 massflux = rcvmassflux
308 massflux = massflux/aversize
310 deltamassflux = refmassflux - massflux
311 IF (global%myProcId==masterproc)
WRITE(*,*) region%localNumber, &
312 'refMassFlux-massFlux AFTER updating u',refmassflux,massflux,deltamassflux
318 global%moduleVar(1) = refmeanpgrad
**********************************************************************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
subroutine registerfunction(global, funName, fileName)
subroutine peri_copgradupdate(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
**********************************************************************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 ipcbeg
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
**********************************************************************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 errorstop(global, errorCode, errorLine, addMessage)
unsigned char alpha() const
subroutine deregisterfunction(global)
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)