Hi all,
I've been working through the code and trying to understand which variables are modified in each step of the simulation and how they affect other steps, and I'm stuck at the lines gfs_source_tension_coefficients and gfs_correct_normal_velocities within gfs_velocity_face_sources, which is called from mac_projection.
In gfs_source_tension_coefficients, from my understanding, the result is to traverse all faces where the curvature kappa is defined and set
s->f[face->d].v = alpha*sigma*kappa*solid_fraction
where s = GFS_STATE(face->cell) (or neighbor cells) and f contains temporary face variables un and v.
Then in gfs_correct_normal_velocities, GFS_SOURCE_TENSION_GENERIC (s)->c (which I believe is the volume fraction field) is passed as the effective pressure, the pressure gradient dp is calculated, and the normal velocity of faces (which are stored in s->f[face->d].un) are incremented by + or - dp*dt.
It appears that the weight of the normal velocity is stored in f[d].v and to get the right correction due to surface tension, the normal velocity at a face should be changed by f[d].un*f[d].v, but I don't see this happen here. More importantly, the very next step in mac_projection is gfs_poisson_coefficients (domain, alpha, TRUE, TRUE, TRUE), which resets f[d].v for all faces and directions to 0, so it looks to me like the values of f[d].v are never used.
Does anyone know what I'm missing here?
Thanks,
Frederik