I am trying to use user defined functions to set dynamic contact angle at a wall boundary condition for a droplet impingement problem. It is a Volume of Fluid, multiphase model with air as the primary fluid and water as the secondary fluid. The model is a 2D axi-symmetric model which is basically modeled using a rectangular meshed surface. The rectangular interior surface is surrounded by wall boundary condition, but the wall at which the droplet impingement happens is set to have dynamic contact angle using DEFINE_PROFILE. I need to calculate the Y-velocity at cells one cell layer away from this wall boundary. I use DEFINE_ADJUST to do this. I mark a region (in the setup, using mark/adapt cells) and note the zone ID for the interior for this zone. Then I use the code below to extract the Y velocity in each cells. This code works fine if I try to extract density from the mixture domain or the volume fraction of the secondary phase (from the secondary phase domain). I use two different threads, 'thread' for mixture domain and 'subthread' for secondary phase domain.
When I use 'C_V(c,t)' to extract the Y velocity, the program crashes with the following errors:
('Node 0: Process 47752: Received signal SIGSEGV.'
'999999: mpt_accept: error: accept failed: No such file')
I tried to extract the velocity using both the mixture level domain and secondary phase domain threads but both results in crashing the program with the same errors.
I use DEFINE_PROFILE at the wall boundary and it gives the Y velocity in the mixture domain without any errors. I cant seem to figure out why it is giving an error at the interior cells (using define adjust) trying to extract velocity but works fine for density, volume fraction etc.. I would greatly appreciate if you could let me know any suggestions you have. Thanks The code is as follows:
int counter = 0;
int zone_ID = 13;
int phase_domain_index = 1;
Thread *thread = Lookup_Thread(d,zone_ID);
Thread *subthread = THREAD_SUB_THREAD(thread,phase_domain_index);