59 TYPE(t_region
) :: region
63 INTEGER ::
i,
j,
k, n1, n2
66 INTEGER :: ilev, lbound, bctype, distrib, flowmodel, gasmodel, indcp, indmol
67 INTEGER ::
ibeg,
iend,
jbeg,
jend,
kbeg, kend,
idir,
jdir,
kdir, i2d, noff
68 INTEGER :: icoff, ijcoff, inoff, ijnoff, ijkcd, ijkcb0, ijkcb1, ijknb
69 INTEGER ::
inode,
jnode, knode, indsvel, acid0, acid1, aerocoeff, j2d
71 REAL(RFREAL) :: sgn, rhoa, rhoua, rhova, rhowa, rhoea, rhovrel(3)
72 REAL(RFREAL) :: pa, mrate, tburn, rgas, ds, sf(3)
73 REAL(RFREAL) :: uinj, vinj, winj, vcont, sv, ac0, ac1
74 REAL(RFREAL) :: pref, rref, vref, rcpref
75 REAL(RFREAL),
POINTER :: cv(:,:), dv(:,:), gv(:,:),
rhs(:,:)
76 REAL(RFREAL),
POINTER :: avgco(:,:), sface(:,:), svel(:), vals(:,:)
81 'RFLO_CentralFluxPatch.F90' )
85 ilev = region%currLevel
95 distrib =
patch%mixt%distrib
96 flowmodel = region%mixtInput%flowModel
97 gasmodel = region%mixtInput%gasModel
98 indcp = region%levels(ilev)%mixt%indCp
99 indmol = region%levels(ilev)%mixt%indMol
100 indsvel = region%levels(ilev)%grid%indSvel
102 cv => region%levels(ilev)%mixt%cv
103 dv => region%levels(ilev)%mixt%dv
104 gv => region%levels(ilev)%mixt%gv
105 rhs => region%levels(ilev)%mixt%rhs
106 vals =>
patch%mixt%vals
108 aerocoeff = region%global%aeroCoeffs
109 pref = region%global%refPressure
110 rref = region%global%refDensity
111 vref = region%global%refVelocity
113 rcpref = 2.0_rfreal/(rref*vref*vref)
123 IF (lbound==2 .OR. lbound==4 .OR. lbound==6)
THEN
134 IF (lbound==1 .OR. lbound==2)
THEN
135 avgco => region%levels(ilev)%grid%c2fCoI
136 sface => region%levels(ilev)%grid%si
137 svel => region%levels(ilev)%grid%siVel
138 ELSE IF (lbound==3 .OR. lbound==4)
THEN
139 avgco => region%levels(ilev)%grid%c2fCoJ
140 sface => region%levels(ilev)%grid%sj
141 svel => region%levels(ilev)%grid%sjVel
142 ELSE IF (lbound==5 .OR. lbound==6)
THEN
143 avgco => region%levels(ilev)%grid%c2fCoK
144 sface => region%levels(ilev)%grid%sk
145 svel => region%levels(ilev)%grid%skVel
151 IF (bctype>=bc_slipwall .AND. bctype<=bc_slipwall+bc_range)
THEN
156 ijkcb0 = indijk(
i ,
j ,
k ,icoff,ijcoff)
159 pa = 0.5_rfreal*(3._rfreal*dv(dv_mixt_pres,ijkcb0)- &
160 dv(dv_mixt_pres,ijkcb1))
161 sf(1) = sgn*sface(xcoord,ijknb)
162 sf(2) = sgn*sface(ycoord,ijknb)
163 sf(3) = sgn*sface(zcoord,ijknb)
164 sv = sgn*svel(ijknb*indsvel)
166 rhs(cv_mixt_xmom,ijkcb0) =
rhs(cv_mixt_xmom,ijkcb0) + pa*sf(1)
167 rhs(cv_mixt_ymom,ijkcb0) =
rhs(cv_mixt_ymom,ijkcb0) + pa*sf(2)
168 rhs(cv_mixt_zmom,ijkcb0) =
rhs(cv_mixt_zmom,ijkcb0) + pa*sf(3)
169 rhs(cv_mixt_ener,ijkcb0) =
rhs(cv_mixt_ener,ijkcb0) + pa*sv
171 IF (lbound==1 .OR. lbound==2)
THEN
174 ELSE IF (lbound==3 .OR. lbound==4)
THEN
177 ELSE IF (lbound==5 .OR. lbound==6)
THEN
181 j2d = aerocoeff * indij(n1,n2,noff)
182 patch%cp(j2d) = rcpref*(pa - pref)
190 ELSE IF (bctype>=bc_noslipwall .AND. bctype<=bc_noslipwall+bc_range)
THEN
195 ijkcb0 = indijk(
i ,
j ,
k ,icoff,ijcoff)
197 pa = dv(dv_mixt_pres,ijkcb0)
198 sf(1) = sgn*sface(xcoord,ijknb)
199 sf(2) = sgn*sface(ycoord,ijknb)
200 sf(3) = sgn*sface(zcoord,ijknb)
201 sv = sgn*svel(ijknb*indsvel)
203 rhs(cv_mixt_xmom,ijkcb0) =
rhs(cv_mixt_xmom,ijkcb0) + pa*sf(1)
204 rhs(cv_mixt_ymom,ijkcb0) =
rhs(cv_mixt_ymom,ijkcb0) + pa*sf(2)
205 rhs(cv_mixt_zmom,ijkcb0) =
rhs(cv_mixt_zmom,ijkcb0) + pa*sf(3)
206 rhs(cv_mixt_ener,ijkcb0) =
rhs(cv_mixt_ener,ijkcb0) + pa*sv
208 IF (lbound==1 .OR. lbound==2)
THEN
211 ELSE IF (lbound==3 .OR. lbound==4)
THEN
214 ELSE IF (lbound==5 .OR. lbound==6)
THEN
218 j2d = aerocoeff * indij(n1,n2,noff)
219 patch%cp(j2d) = rcpref*(pa - pref)
227 ELSE IF (bctype>=bc_symmetry .AND. bctype<=bc_symmetry+bc_range)
THEN
232 ijkcb0 = indijk(
i ,
j ,
k ,icoff,ijcoff)
235 pa = 0.5_rfreal*(dv(dv_mixt_pres,ijkcb0)+dv(dv_mixt_pres,ijkcd))
236 sf(1) = sgn*sface(xcoord,ijknb)
237 sf(2) = sgn*sface(ycoord,ijknb)
238 sf(3) = sgn*sface(zcoord,ijknb)
239 sv = sgn*svel(ijknb*indsvel)
241 rhs(cv_mixt_xmom,ijkcb0) =
rhs(cv_mixt_xmom,ijkcb0) + pa*sf(1)
242 rhs(cv_mixt_ymom,ijkcb0) =
rhs(cv_mixt_ymom,ijkcb0) + pa*sf(2)
243 rhs(cv_mixt_zmom,ijkcb0) =
rhs(cv_mixt_zmom,ijkcb0) + pa*sf(3)
244 rhs(cv_mixt_ener,ijkcb0) =
rhs(cv_mixt_ener,ijkcb0) + pa*sv
246 IF (lbound==1 .OR. lbound==2)
THEN
249 ELSE IF (lbound==3 .OR. lbound==4)
THEN
252 ELSE IF (lbound==5 .OR. lbound==6)
THEN
256 j2d = aerocoeff * indij(n1,n2,noff)
257 patch%cp(j2d) = rcpref*(pa - pref)
265 ELSE IF (bctype>=bc_injection .AND. bctype<=bc_injection+bc_range)
THEN
270 ijkcb0 = indijk(
i ,
j ,
k ,icoff,ijcoff)
273 sf(1) = sgn*sface(xcoord,ijknb)
274 sf(2) = sgn*sface(ycoord,ijknb)
275 sf(3) = sgn*sface(zcoord,ijknb)
276 sv = sgn*svel(ijknb*indsvel)
278 IF (lbound==1 .OR. lbound==2)
THEN
281 ELSE IF (lbound==3 .OR. lbound==4)
THEN
284 ELSE IF (lbound==5 .OR. lbound==6)
THEN
288 i2d = distrib * indij(n1,n2,noff)
289 mrate = vals(bcdat_inject_mfrate,i2d)
290 tburn = vals(bcdat_inject_temp ,i2d)
291 rhovrel(1) = vals(bcdat_inject_rfvfu ,i2d)
292 rhovrel(2) = vals(bcdat_inject_rfvfv ,i2d)
293 rhovrel(3) = vals(bcdat_inject_rfvfw ,i2d)
295 IF (mrate > 0._rfreal)
THEN
296 ds =
sqrt(sf(1)*sf(1)+sf(2)*sf(2)+sf(3)*sf(3))
297 IF (gasmodel == gas_model_tcperf)
THEN
299 sf(1)/ds,sf(2)/ds,sf(3)/ds, &
300 gv(gv_mixt_cp ,ijkcb0*indcp ), &
301 gv(gv_mixt_mol ,ijkcb0*indmol), &
302 dv(dv_mixt_pres,ijkcb0 ), &
303 rhoa,rhoua,rhova,rhowa,rhoea,pa, &
306 CALL
errorstop( region%global,err_unknown_bc,__line__ )
308 vcont = uinj*sf(1) + vinj*sf(2) + winj*sf(3)
317 IF (flowmodel == flow_euler)
THEN
318 pa = 0.5_rfreal*(3._rfreal*dv(dv_mixt_pres,ijkcb0)- &
319 dv(dv_mixt_pres,ijkcb1))
321 pa = dv(dv_mixt_pres,ijkcb0)
325 rhs(cv_mixt_dens,ijkcb0) =
rhs(cv_mixt_dens,ijkcb0) + vcont*rhoa
326 rhs(cv_mixt_xmom,ijkcb0) =
rhs(cv_mixt_xmom,ijkcb0) + vcont*rhoua + &
328 rhs(cv_mixt_ymom,ijkcb0) =
rhs(cv_mixt_ymom,ijkcb0) + vcont*rhova + &
330 rhs(cv_mixt_zmom,ijkcb0) =
rhs(cv_mixt_zmom,ijkcb0) + vcont*rhowa + &
332 rhs(cv_mixt_ener,ijkcb0) =
rhs(cv_mixt_ener,ijkcb0) + &
333 vcont*(rhoea+pa) + pa*sv
335 j2d = aerocoeff * indij(n1,n2,noff)
336 patch%cp(j2d) = rcpref*(pa - pref)
344 ELSE IF (bctype>=bc_regionint .AND. bctype<=bc_regionint +bc_range)
THEN
346 ELSE IF (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range)
THEN
355 ijkcb0 = indijk(
i ,
j ,
k ,icoff,ijcoff)
358 ac0 = avgco(acid0,ijknb)
359 ac1 = avgco(acid1,ijknb)
361 rhoa = ac0*cv(cv_mixt_dens,ijkcb0)+ac1*cv(cv_mixt_dens,ijkcd)
362 rhoua = ac0*cv(cv_mixt_xmom,ijkcb0)+ac1*cv(cv_mixt_xmom,ijkcd)
363 rhova = ac0*cv(cv_mixt_ymom,ijkcb0)+ac1*cv(cv_mixt_ymom,ijkcd)
364 rhowa = ac0*cv(cv_mixt_zmom,ijkcb0)+ac1*cv(cv_mixt_zmom,ijkcd)
365 rhoea = ac0*cv(cv_mixt_ener,ijkcb0)+ac1*cv(cv_mixt_ener,ijkcd)
366 pa = ac0*dv(dv_mixt_pres,ijkcb0)+ac1*dv(dv_mixt_pres,ijkcd)
367 sf(1) = sgn*sface(xcoord,ijknb)
368 sf(2) = sgn*sface(ycoord,ijknb)
369 sf(3) = sgn*sface(zcoord,ijknb)
370 sv = sgn*svel(ijknb*indsvel)
371 vcont = (rhoua*sf(1)+rhova*sf(2)+rhowa*sf(3))/rhoa - sv
373 rhs(cv_mixt_dens,ijkcb0) =
rhs(cv_mixt_dens,ijkcb0) + vcont*rhoa
374 rhs(cv_mixt_xmom,ijkcb0) =
rhs(cv_mixt_xmom,ijkcb0) + &
375 vcont*rhoua + pa*sf(1)
376 rhs(cv_mixt_ymom,ijkcb0) =
rhs(cv_mixt_ymom,ijkcb0) + &
377 vcont*rhova + pa*sf(2)
378 rhs(cv_mixt_zmom,ijkcb0) =
rhs(cv_mixt_zmom,ijkcb0) + &
379 vcont*rhowa + pa*sf(3)
380 rhs(cv_mixt_ener,ijkcb0) =
rhs(cv_mixt_ener,ijkcb0) + &
381 vcont*(rhoea+pa) + sv*pa
383 IF (lbound==1 .OR. lbound==2)
THEN
386 ELSE IF (lbound==3 .OR. lbound==4)
THEN
389 ELSE IF (lbound==5 .OR. lbound==6)
THEN
393 j2d = aerocoeff * indij(n1,n2,noff)
394 patch%cp(j2d) = rcpref*(pa - pref)
**********************************************************************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)
subroutine bcondinjectionperf(distrib, minj, tinj, rhoVrel, sxn, syn, szn, cpgas, mm, p, rhob, rhoub, rhovb, rhowb, rhoeb, pb, uinj, vinj, winj)
**********************************************************************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)
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)
**********************************************************************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
**********************************************************************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_centralfluxpatch(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 jnode