CFD-GO / TCLB

TCLB - Templated MPI+CUDA/CPU Lattice Boltzmann code
https://tclb.io
GNU General Public License v3.0
178 stars 70 forks source link

d3q27_pf_velocity - read and write stencil fields in same stage #437

Open TravisMitchell opened 1 year ago

TravisMitchell commented 1 year ago

There are currently a couple issues with the d3q27_pf_velocity model that need to be resolved. These do not necessarily impact results, but are unsafe access behaviours that should be amended:

  1. Currently the wall phase update reads PhaseF and writes PhaseF. This creates potential race condition as it is a stencil field. To amend this, the solid flag field could be modified to wall phase field value and updated from PhaseF in the wall phase update.
  2. Init_distributions currently saves and writes PhaseF. This doesn't look to be necessary, but could create issues in e.g. boundary cells.

@shkodm this might concern you. But I will either fix when I have time or if you have time feel free to also fix.

llaniewski commented 9 months ago

@TravisMitchell @shkodm Seems like the model wants to save pnorm in PhaseInit stage, but doesn't set it in Init() function: https://github.com/CFD-GO/TCLB/blob/develop/models/multiphase/d3q27_pf_velocity/Dynamics.c.Rt#L259