Question about adding wave gages

Hi!

I would like to start adding wave gages to my wave tank simulation, but I noticed that adding wave gages changes the amount of fluid particles at each time step. The way I am currently post-processing my code, I usually count on the number of fluid, fixed, floating, and moving particles being constant (as I feel like they usually should be for a simulation that is behaving has it should). Is the number of fluid particles supposed to change when I add a wave gage? And if so, why does it do that and can I adjust my code so that I can have a constant number of fluid particles? Or am I doing something wrong in general?

Thank you!

Hello @brittlyd,

wave gages are part of the post-processing and adding them (with add_gage) should not have any impact on the number of fluid particles. I’ve just done a quick check by adding a gage to the DamBreak3D test case, and the number of particles does not change for me, so if this is indeed the case in your test cases there’s definitely something wrong. How are you adding the gages?

Sorry for the long response, I realized that the fluid particle type can be either 0, or 512 for fluid particles. When I figured that out, everything works. Thanks!

Hello @brittlyd,

ah, I see. Within the code, the info field encodes information not only about the particle type, but also a number of flags. You can check the source file src/particleinfo.h for more information both about the flags and the macros and functions available to extract the relevant information, in particular PART_TYPE will extract only the type (PT_FLUID vs PT_BOUNDARY).

The reason why with wave gages some fluid particles have 512 encoded in the .x field is that wave gages automatically enable free surface detection (which is needed for them to work), and the particles on the surfaces have the FG_SURFACE flag encoded in their .x field.