How to loop over all cells along a particular direction(z-direction)?
I want to loop over all the faces of all the cells along the z direction only. For this I understand I can use c_face_loop inside begin_c_loop. Now I have defined a unit vector along z direction and using INTERIOR_FACE_GEOMETRY, I get es[ND_ND]. For looping along the z direction, I use a if condition and make use of dot product of unit vector along z direction and es[ND_ND]. Is my approach right? I am not an expert in writing UDFs and any help is much appreciated. Thanks in advance.
Here is my UDF:
It is a two-phase flow and I want to track the interfacial cells between the two phases after every iteration.