ExtremeFLOW / neko

/ᐠ. 。.ᐟ\ᵐᵉᵒʷˎˊ˗
https://neko.cfd/
Other
159 stars 27 forks source link

Add probe generators for simple geometries #1205

Closed timfelle closed 2 months ago

timfelle commented 3 months ago

This pull request adds the functionality to generate probe points on simple geometric objects. The objects are assigned as a "point" list in the JSON specification for the simcomp.

The old specification of a points_file is preserved, but the new specification can also read from csv files.

The code has also been refactored to move the adding of new points to a separate function and remove unused variables.

Plane and STL files have been postponed

Closes #967

timofeymukha commented 3 months ago

Great stuff. I think STL would indeed be nice to support, but not sure if we need it explcitly here of it is enough to be able to create an STL-based point zone, and then define the probes based on that.

I would not call the input via file "legacy". We had people introduce hundreds of thousands of probes for some cases, so one would not have that in the case file I think. Then again, it should probably not be a .csv either, but still a file.

Regarding geometries, I don't think we need much more, for special stuff one should just write a Python script to dump whatever one needs to a file. I think even circle is a bit borderline, but I guess for pipes it is nice, so we can for sure keep it.

How were you thinking about the plane? Particularly, its bounds.

timfelle commented 3 months ago

Great stuff. I think STL would indeed be nice to support, but not sure if we need it explcitly here of it is enough to be able to create an STL-based point zone, and then define the probes based on that.

Hmm well the STL can be done in a couple of different way. You could use the vertices of the mesh, centers of faces, or the entire space that is enclosed by it. In general I think any 1D or 2D manifold whould be candidates for this way of doing things. For 3D objects I would definitely say that point zones are the way forward. However, currently point zones are only defined based on the GLL points. We could probably extend that with some other sampling algorithms.

I would not call the input via file "legacy". We had people introduce hundreds of thousands of probes for some cases, so one would not have that in the case file I think. Then again, it should probably not be a .csv either, but still a file.

Oh, I just meant that specifying the file it through the points_file rather than the points array with a type: "file". It seemed silly to only allow a single input type for the probes, so I figured I'd move the file specification to the same interface.

Regarding geometries, I don't think we need much more, for special stuff one should just write a Python script to dump whatever one needs to a file. I think even circle is a bit borderline, but I guess for pipes it is nice, so we can for sure keep it.

Sure, that is definitely also what should be done if you need a complex system. I just personally needed a circle for verifying the vortex shedding for our brinkman terms so i might as well add it while i was working on the other stuff instead of making a new file in a different language ;P

How were you thinking about the plane? Particularly, its bounds.

I were thinking intersecting the plane with the bounding box and then sample that way. I should be able to determine the 4 parametric corners corners of the plane and then in the parametric space distribute points wither with some sampling algorithm such as Poisson Disk Sampling or just in a linear grid in parametric space.

timofeymukha commented 3 months ago

Right, the point zone is just a collection of GLLs. Then I guess it makes sense to treat the STL directly with probes. I think just sampling at each node in the triangulation is probably good enough for most cases.

timfelle commented 3 months ago

Right, the point zone is just a collection of GLLs. Then I guess it makes sense to treat the STL directly with probes. I think just sampling at each node in the triangulation is probably good enough for most cases.

Yea, that would atleast be the starting point i would go for. If we want some random sapling at some point it would be possible to choose a random face and sample a point randomly on that through barycentric interpolation. But i dont think that will be relevant any time soon. Atleast for the probing, maybe for other purposes?

timfelle commented 2 months ago

@timfelle Very nice stuff indeed! Would it be possible to add the new functionality to the documentation, particularly since this one is to go into 0.8?

I think the circle in particular could make use of an example, I didn't quite get how that axis parameter works :-).

In a later PR we should see if some of the examples can make use of this new stuff. I think the scalar_mms example uses probes along a line for example.

I'll look into it.

I am currently working on a vortex shedding benchmark which could be moved over to Neko if we want it later on. That one uses the circle of points around a cylinder to measure the flow.