CFD-GO / TCLB

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

Export / Access of Geometry using RunR is not correct #463

Closed shkodm closed 11 months ago

shkodm commented 11 months ago

I found that the export of geometry in RunR has some issues. The BOUNDARY array does not have any Wall values, and instead has Solid values, even for configurations where Solid is never defined in the xml file. Originally found when my d3q27_pf_velocity_staircaseimp was producing wrong results (Because I was filtering similar to example below, took really long time to find the reason), but also applicable to other models.

Minimal example - modify example/flow/2d/karman.xml to include in e.g Solver handler


 <RunR Iterations="5">
         wall_boundary = (Solver$Geometry$BOUNDARY == 'Wall')
         solid_boundary = (Solver$Geometry$BOUNDARY == 'Solid')
         print(paste0("Wall sum ", sum(wall_boundary)))
         print(paste0("Solid sum ", sum(solid_boundary)))
 </RunR>

Running CLB/d2q9/main example/flows2d/karman.xml, the outputs

[  ] ----- RunR -----
[  ]
[  ]       wall_boundary = (Solver$Geometry$BOUNDARY == 'Wall')
[  ]       solid_boundary = (Solver$Geometry$BOUNDARY == 'Solid')
[  ]       print(paste0("Wall sum ", sum(wall_boundary)))
[  ]       print(paste0("Solid sum ", sum(solid_boundary)))
[  ]
[  ] ----------------
[  ] R: [1] "Wall sum 0"
[  ] R: [1] "Solid sum 2888"
[  ] You can run interactive R session with Ctrl+X

Eventhough the XML file clearly defined Wall and not Solid. The model itself works as expected, the nodes are marked as NODE_Wall, so it is a problem during export I suspect.