Details on virtual gauges

In working with the Wave Tank example, I can see that there is an ability to “add_gage” and “addTestPoint”. Both of these features are wonderful, as they speed up the simulation time by not having to save the entire domain. In effect, they are “simulation time” processing features, but they lack documentation on how the processing is performed. Since the data I collect from the simulation will be derived from these features, I feel I should know more about how they are defined.

  1. How are these two options related? Intuitively I would assume that the gauge is just a vertical alignment of test points. However, if the test points are discrete, there must be some sampling distribution along the vertical to form the gauge?

  2. I’m assuming from the way the test points are defined in the code, they are fixed points in the domain (Eulerian observation). How are the test point values calculated from the Lagrangian particle motion? Is there some special interpolation scheme?

  3. How is the surface elevation defined by the gauge? Imagine a single particle splashing on the gauge…clearly the “max” elevation should not register as the surface elevation. I’m pretty sure this is handled correctly, but again, I’m not sure on the mathematical definition.

I do realize I could side step these features and define my own post processing pipeline. However, like I said, it’s a wonderful feature when only such information is required. I’m just trying to ensure I know how GPUSPH is defining their data processing.

Also, it would help to understand how the gauges are implemented in the code, so that users can define their own definitions if they wanted. For example, maybe GPUSPH defines the velocity by nearest neighbor interpolation, whereas I want to use a tricubic spline interpolation (or whatever). I can code it up and commit the feature, but I need to know where to include the option. I’m not asking for a full development breakdown…just point me in the right direction.

Hello @GWAVE, the main difference between testpoints and gages is what they measure.

A testpoint can be used to collect information about the SPH pressure and velocity at the given point (with the k-epsilon turbulence model they also probe the k and epsilon value). Values are obtained as the standard 3D SPH interpolation, and the computation is done in the calcTestpointsVelocityDevice() post-processing engine.

Gages are wave gages, and they track the height of the water level (assumed to be in the z direction) at a given point on the xy plane. The water height is computed using 2D SPH interpolation of the z coordinate of the surface particles around the gage. A single particle splashing the gage would influence the measurement, but its contribution would be smoothed out by the rest of the surface around the gage position.

Oh, and by the way, if you want to define your own post-processing, you can still rely on the testpoints if you need to track some additional variable in a fixed position in 3D space. Your problem needs to overload the calcPrivate method, from which it can run a problem-defined kernel (or do any other processing it might want). This feature is still a bit experimental, but feel free to ask about additional details or requirements, and we can discuss how to improve it.