@@ -50,7 +50,7 @@ def fluxes(myd, rp, ivars):
5050 # get the cell-average data
5151 U_avg = myd .data
5252
53- # convert U from cell-centers to cell averages
53+ # convert U from cell-averages to cell-centers
5454 U_cc = np .zeros_like (U_avg )
5555
5656 U_cc [:, :, ivars .idens ] = myd .to_centers ("density" )
@@ -81,6 +81,8 @@ def fluxes(myd, rp, ivars):
8181 # for debugging
8282 nolimit = 0
8383
84+ # do reconstruction on the cell-average primitive variable state, q_avg
85+
8486 for idir in [1 , 2 ]:
8587
8688 # interpolate <W> to faces (with limiting)
@@ -117,14 +119,15 @@ def fluxes(myd, rp, ivars):
117119 q_r .v (n = n , buf = 2 )[:, :] = xi .v (buf = 2 )* q_r .v (n = n , buf = 2 ) + \
118120 (1.0 - xi .v (buf = 2 ))* q_avg .v (n = n , buf = 2 )
119121
122+ # solve the Riemann problem to find the face-average q
120123 _q = cf .riemann_prim (idir , myg .ng ,
121124 ivars .irho , ivars .iu , ivars .iv , ivars .ip , ivars .ix , ivars .naux ,
122125 0 , 0 ,
123126 gamma , q_l , q_r )
124127
125128 q_int_avg = ai .ArrayIndexer (_q , grid = myg )
126129
127- # calculate the face-centered W using the transverse Laplacian
130+ # calculate the face-centered q using the transverse Laplacian
128131 q_int_fc = myg .scratch_array (nvar = ivars .nq )
129132
130133 if idir == 1 :
@@ -140,7 +143,8 @@ def fluxes(myd, rp, ivars):
140143 2 * q_int_avg .v (n = n , buf = myg .ng - 1 ) +
141144 q_int_avg .ip (- 1 , n = n , buf = myg .ng - 1 ))
142145
143- # compute the final fluxes
146+ # compute the final fluxes using both the face-average state, q_int_avg,
147+ # and face-centered q, q_int_fc
144148 F_fc = flux_cons (ivars , idir , gamma , q_int_fc )
145149 F_avg = flux_cons (ivars , idir , gamma , q_int_avg )
146150
0 commit comments