@@ -194,12 +194,12 @@ struct BCFill
194194        const  amrex::IntVect& iv,
195195        const  int  q,
196196        const  amrex::IntVect& ev,
197-         const  int  idir,
198-         const  int  ndir,
197+         const  int  /* idir*/ 
198+         const  int  /* ndir*/ 
199+         const  amrex::Real& rho_bc,
199200        const  amrex::RealVect& vel_bc,
200201        const  amrex::Real& RT,
201-         amrex::Array4<amrex::Real> const & data,
202-         amrex::Real& rho_bc_out) const 
202+         amrex::Array4<amrex::Real> const & data) const 
203203    {
204204        //  Prepare the ghost cell layer of f_ for
205205        //  streaming due to a prescribed velocity. This
@@ -213,33 +213,8 @@ struct BCFill
213213        //  In this case, a value for u, v, and w must be
214214        //  specified, either hard coded or set by a
215215        //  user-specified function
216-         amrex::Real rho_out = 0.0 ;
217-         amrex::Real rho_tan = 0.0 ;
218- 
219-         const  amrex::IntVect ivn (iv + ev);
220- 
221-         //  Build the 3-part rho calculation at the
222-         //  (iv+ev) fluid cell
223-         for  (int  qq = 0 ; qq < constants::N_MICRO_STATES; qq++) {
224- 
225-             const  auto & evn_out = m_evs[qq];
226-             const  int  bounce_qq = m_bounce_dirs[qq];
227-             const  auto & evn_in = m_evs[bounce_qq];
228- 
229-             if  (evn_in[idir] == -ndir) {
230-                 rho_out += 2.0  * data (ivn + evn_out, bounce_qq);
231-             } else  if  (evn_in[idir] == 0 ) {
232-                 rho_tan += 1.0  * data (ivn + evn_out, bounce_qq);
233-             }
234-         }
235- 
236-         const  amrex::Real rho_bc =
237-             (rho_out + rho_tan) / (1.0  - ndir * vel_bc[idir]);
238- 
239216        data (iv, q) = set_equilibrium_value (
240217            rho_bc, vel_bc, RT, m_mesh_speed, m_weights[q], ev);
241- 
242-         rho_bc_out = rho_bc;
243218    }
244219
245220    AMREX_GPU_DEVICE
@@ -423,41 +398,41 @@ struct BCFill
423398                                    temperature (1.0  / 3.0 );
424399                                amrex::Real gamma (5.0  / 3.0 );
425400
426-                                 amrex::Real rho_bcout ( 1 .0
401+                                 amrex::Real rho_bc ( 0 .0
427402
428403                                m_vel_bc_op (
429-                                     iv, idir, normal_dir, time, geom, vel_bc,
430-                                     specific_gas_constant, temperature, gamma);
404+                                     iv, idir, normal_dir, time, geom, rho_bc,
405+                                     vel_bc, specific_gas_constant, temperature,
406+                                     gamma);
431407
432408                                if  (m_is_energy_lattice) {
433-                                     rho_bcout = 1.0 ;
434- 
435409                                    velocity_bc_g (
436-                                         iv, q, ev, idir, normal_dir, rho_bcout ,
410+                                         iv, q, ev, idir, normal_dir, rho_bc ,
437411                                        vel_bc, specific_gas_constant,
438412                                        temperature, gamma, data);
439413                                } else  {
440414                                    velocity_bc_f (
441-                                         iv, q, ev, idir, normal_dir, vel_bc,
415+                                         iv, q, ev, idir, normal_dir, rho_bc,
416+                                         vel_bc,
442417                                        specific_gas_constant * temperature,
443-                                         data, rho_bcout );
418+                                         data);
444419                                }
445420
446421                            } else  if  (m_bc_type[bc_idx] == PRESSURE) {
447422
448-                                 const  amrex::Real rho_bc = 1.0 ;
449- 
450423                                amrex::RealVect vel_bc (
451424                                    AMREX_D_DECL (0.0 , 0.0 , 0.0 ));
452425                                amrex::Real specific_gas_constant (1.0 ),
453426                                    temperature (1.0  / 3.0 );
454427                                amrex::Real gamma (5.0  / 3.0 );
455428
456429                                amrex::Real rho_bcout (1.0 );
430+                                 amrex::Real rho_bc (1.0 );
457431
458432                                m_vel_bc_op (
459-                                     iv, idir, normal_dir, time, geom, vel_bc,
460-                                     specific_gas_constant, temperature, gamma);
433+                                     iv, idir, normal_dir, time, geom, rho_bc,
434+                                     vel_bc, specific_gas_constant, temperature,
435+                                     gamma);
461436
462437                                if  (m_is_energy_lattice) {
463438
0 commit comments