CLSVOF

From PHASTA Wiki
Revision as of 11:25, 22 October 2013 by Mkm06 (talk | contribs) (Serial Algorithm)
Jump to: navigation, search

A coupled level set volume of fluid method is being implemented in the incompressible code for interface tracking.


Serial Algorithm

Loop over elements (find the elements containing interface pieces)

1. Tag each element as incomplete

 Need a tag for elemental completeness

2. Truncate volume fractions so they’re 0 ≤ F ≤ 1

 Volume fraction is the second scalar
 

3. If 0 < F < 1 (element contains interface)

3.a. Use advected φ at element nodes to find interface slope for the element There are 7 possible cases for φ in a cell with 0 < VOF < 1 1. All nodal φ are the same sign - use smallest φ and assume interface plane is parallel to opposite face 2. 1 node φ=0, other nodes are all the same sign - assume interface plane is parallel to opposite face 3. 1 node φ=0, other nodes are different signs 4. 2 nodal φ=0, others are the same sign 5. 2 nodal φ=0, others are different signs 6. 3 nodal φ=0 7. All φ are different signs Cases 3, 5, and 7 are non-degenerate cases in which the interface plane passes through the element. The resulting volumes are either 1 tetrahedron and 1 pentahedron, or 2 pentahedra.

 For tetrahedra, find the points at which the interface intersects the edges
 Use those three points (defining the plane) to find the interface normal
 <math> \bold  n = ( \bold p_2 - \bold p_1 ) \times ( \bold p_3 - \bold p_1 ) </math>
 Need a way to temporarily store those points (for volume computation)
 Need to temporarily store the normal

3.b. Move interface along normal until computed F = advected F

 Figure out which side of the interface is a tetrahedron
 Depending on which side of the interface is a tetrahedron, F is either the volume of the interface tetrahedron or the volume of the element minus the interface tetrahedron.  How to know which???
 For a tetrahedron with vertices a, b, c, and d, the volume is:  <math>V = \frac { |(\mathbf{a}-\mathbf{d}) \cdot ((\mathbf{b}-\mathbf{d}) \times (\mathbf{c}-\mathbf{d}))| } {6}.</math>
 Shashkov uses a line search algorithm to adjust the interface.  -> Use a recursive bisection.
 After each movement of the interface, the LS=0 points on the edges have to be found again (for computing volume)

3.c. Use established interface to compute φ at each node and tag those nodes as reconstructed

 At each node, φ is the distance to the nearest point, unless two points are equidistant.
 Need a tag for nodal completeness/reconstruction

3.d. If any node has already been reconstructed, φ is min (previous reconstruction, current reconstruction) (ensure that φ is min to interface everywhere)

3.e. Mark the element as complete

3.f. Loop over elements adjacent by shared faces - If it’s not marked as complete and not an interface element, add it to the reconstruction list

 Need reconstruction list
 Need data structure of each element's faces
 Need data structure of which two elements are adjacent to each face

While reconstruction list is not empty, loop over the reconstruction list (establish and walk out φ)

1. N_fixed = 0

2. For each element

2.a. num_const = 0

2.b. loop over nodes

2.b.1. If a node has been reconstructed, num_const = num_const+1

2.c. If num_const <= 3

2.c.1 Compute gradient of φ for the element using the three smallest values of reconstructed φ

 if num_const = 3, then use the reconstructed nodes
 if num_const > 3, then loop over nodes to find the three smallest
 re-use PHASTA's gradient calculation method?

2.c.2. If computed gradient is very different from advected gradient (nearest interface is not the one walked out from)

 if computed gradient dotted with advected gradient is less than pi/4 (or some other suitable value)

2.c.2.a. The current element is done for now, and left in the list; move on to the next element

2.c.3. Else

2.c.3.a. Compute φ at all other nodes

 gradient gives normal to the planar field
 φ at a node is φ at another node plus the normal distance from the plane that other node is in to the current node

2.c.3.b.1. If a node is tagged as reconstructed, φ = min (current value, new computed value)

2.c.3.b.2. Else φ = computed value, node is tagged as reconstructed

2.c.3.c. Mark the element as complete

2.c.3.d. Loop over elements adjacent by shared faces

2.c.3.d.1. If the adjacent element is not marked as complete, and not in the reconstruction list, and reconstructed φ of shared nodes is < nε add it to the list (stop adding nodes when > nε from interface)

 check completeness
 check reconstruction list
 check φ of shared nodes, which requires some nodal adjacency information

2.c.3.e. Remove the element from the reconstruction list

2.c.3.f. N_fixed = N_fixed + 1

2.d. Else (element has only 1 or 2 reconstructed nodes), skip the element and move on to next in list

3. At the end of a cycle through the list, if N_fixed ≠ 0, go to start of loop

3.a. Else N_fixed = 0 and list is not empty, loop again through the list (less accurate method)

3.a.1. If reconstructed nodes ≤ 2

3.a.1.a. For each node not yet reconstructed, φ = min (distance to adjacent node + reconstructed φ of that node)

 for tetrahedra, all element nodes are adjacent

3.a.1.b. Mark the element as complete

3.a.1.c. Loop over elements adjacent by shared faces

3.a.1.c.1. If it’s not marked as complete, and not in the reconstruction list, and reconstructed φ of shared nodes is < nε add it to the list (stop adding nodes when > nε from interface)

3.a.1.d. Remove the element from the reconstruction list

3.a.1.e. N_fixed = N_fixed + 1

3.a.2. Else (at least 3 nodes are tagged as reconstructed)

3.a.2.a. Handle element as above (for at least three reconstructed nodes)

3.a.2.b. N_fixed = N_fixed + 1

When list is empty, for all elements not tagged as reconstructed, φ = nε for all nodes not tagged as reconstructed

Parallel Algorithm