Within the last 5 days I was able to generate a block structured Cartesian grid generation system with a combination of Fortran,C++ and Python.
I am running intersection tests of the imported geometry with the bounding box it is surrounded by and if the intersection test succeeds then I am subdividing the parent bounding box into 4 children boundary box.
As it can be understood for this 2D case, I am using Quad Tree decomposition.
And now I am planning to code a FVM / FEM solver for it.
However, I am unable to think of an algorithm that would help me identify cells which are SOLID (i.e inside the body) and FLUID ( i.e outside the body) at a fast speed.
I can run a double ray intersection test by casting two opposite rays out of all the cells and see if both of the rays intersect with the boundary of the geometry or not to identify the solid domain. However such a test will be computationally very expensive to run after we have decomposed the quad tree to a certain mesh level.
The figure given below has 40,577 quad elements, so it is not very high. But future meshes will have more elements. And hence this particular problem can become a performance bottleneck.
i) Can I perform any kind of initial tests to reduce my computational load ?
ii) Is there any other algorithm that would be more suited for this problem ?