I need to initialize a multiphase VOF model for a FSI, 2-way simulation. When I initialize it normally using the fluent GUI, the initialization state is not saved and passed into system coupling so I get a ton of errors. I'm looking into UDFs to initialize the fluid domain automatically at the start of the solution process so that I don't run into these errors. The problem is that I'm getting a parse error in my UDF; I'm not a C expert. I've found this UDF from the documentation that I'm trying to modify:

https://www.sharcnet.ca/Software/Fluent6/html/udf/node98.htm

I want to modify this UDF to patch the VOF in a rectangular region, NOT a spherical region. This is what I have:

/*****************************************************************

UDF for initializing phase volume fraction

******************************************************************/

#include "udf.h"

/* domain pointer that is passed by INIT function is mixture domain */

DEFINE_INIT(patch_vof, mixture_domain)

{

int phase_domain_index;

cell_t cell;

Thread *cell_thread;

Domain *subdomain;

real xc[ND_ND];

/* loop over all subdomains (phases) in the superdomain (mixture) */

sub_domain_loop(subdomain, mixture_domain, phase_domain_index)

{

/* loop if secondary phase */

if (DOMAIN_ID(subdomain) == 3)

/* loop over all cell threads in the secondary phase domain */

thread_loop_c (cell_thread,subdomain)

{

/* loop over all cells in secondary phase cell threads */

begin_c_loop_all (cell,cell_thread)

{

C_CENTROID(xc,cell,cell_thread);

if -0.35

Similar questions and discussions