Skip to content

Fixes to particle coupling on arbitrary grid#540

Merged
llaniewski merged 7 commits intoCFD-GO:developfrom
shkodm:particles_fix
Mar 12, 2026
Merged

Fixes to particle coupling on arbitrary grid#540
llaniewski merged 7 commits intoCFD-GO:developfrom
shkodm:particles_fix

Conversation

@shkodm
Copy link
Copy Markdown
Member

@shkodm shkodm commented Mar 5, 2026

  • Added subgrid particles for the cumulant model (already tested by some working students in previous years, existed somewhere on my branch), useful to have it in the main repo and not free floating somewhere among my branches
  • Elevated getLocalBoundingBox to the LatticeBase method. Also noticed that ArbitraryLattice does not have options for px, py, pz offsets
  • Added destructor the the arbitrary lattice (other RFI connection never closes, which leads to some nice 100K lines csv files...)
  • Important bug fix: Previously X, Y, Z coordinates (as accessible from the node, or when using RInside for instance), were inconsistent between cartesian grid and arbitrary grid. Cartesian grid would always return them in lattice units (which is correct, especially for the particle coupling), whilst arbitrary grid returns them in real units (because they are written as real units to the cxn file). So if units were sets, arbitrary grid would have trouble finding particles correctly. And the results from RInside were completely wrong - multiplied by units twice. I changed that to store coordinates in LBM units, and convert using the grid spacing when necessary.

Tested by:

  • Running locally for general functionality, testing unit conversion and checking results from RInside
  • Running a simple case with simplepart on Setonix with and without arb grid and comparing particle coordinates -> match to 1-e10 precision.

shkodm added 4 commits March 10, 2026 15:19
On arbitrary lattice getCoord returns in real
units, whereas in cartesian lattice it is lattice units.

Then X, Y,Z macros on node return in real units which
is not expected, and maybe it impossible to find particles
(because particles are using lattice units). Need to
also tweak vtk export
Copy link
Copy Markdown
Member

@llaniewski llaniewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shkodm, this is good. Just fix the override tags the clang compiler is failing on https://github.com/CFD-GO/TCLB/actions/runs/22888346758/job/66406017687?pr=540#step:5:246

shkodm and others added 3 commits March 11, 2026 16:13
Were not triggered previously because destructor
was virtual. Now more consistent with CartLattice
@shkodm
Copy link
Copy Markdown
Member Author

shkodm commented Mar 12, 2026

I think in some bizzare way missing overrides were not flagged by compilers until I removed the default destructor.. The error because the class interface was not consistent, with only one function marked as override. I added overrides to all functions, so it consistent now (in CartLattice for instance we have all overrides marked)

@shkodm
Copy link
Copy Markdown
Member Author

shkodm commented Mar 12, 2026

@llaniewski this should be good now

@llaniewski llaniewski merged commit 4005492 into CFD-GO:develop Mar 12, 2026
53 checks passed
@shkodm shkodm deleted the particles_fix branch March 12, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants