|
[Sponsors] |
Oddly diffuse results from UDF in multiphase (picture and udf) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 10, 2016, 22:03 |
Oddly diffuse results from UDF in multiphase (picture and udf)
|
#1 |
New Member
Mark Schulte
Join Date: Dec 2015
Posts: 19
Rep Power: 10 |
I have been trying to catch the interface in my vertical falling liquid film simulation. Through kind help from these forums I have figured out how to mark the interface at the beginning using DEFINE_ON_DEMAND and store the results in a UDM just to make sure I am setting everything up right. The results are:
image.png Which is great as it marks the interface. However, the value at the interface is ~0.25-0.5 and I marked it as 1 in my UDM. Any ideas why that would be? The udf has some things commented out and likely has some superfluous bits but I wanted to include it all in case something in there is the problem and in case anyone wanted to use it. It's: #include "udf.h" #define zone_id 1 /* REPLACE THIS WITH APPROPRIATE BOUNDARY ID */ #define air_phase 0 #define water_phase 1 DEFINE_ON_DEMAND(my_mark_cells) { Domain *d = Get_Domain(1); /* POINTER FOR THE DOMAIN */ Thread *t, *t0; Thread **pt; cell_t c0, c1; real vof_cutoff = 0.5; face_t f; t = Lookup_Thread(d, zone_id); /* POINTER FOR THE SPECIFIED BOUNDARY */ t0 = THREAD_T0(t); /* POINTER FOR THE FLUID ADJACENT TO SPECIFIED BOUNDARY */ pt = THREAD_SUB_THREADS(t0); begin_f_loop(f,t) /* LOOP OVER FACES OF THE SPECIFIED BOUNDARY */ { c0 = F_C0(f,t); /*c1 = F_C1(f,t0);*/ if ( (C_VOF(c0,pt[water_phase]) > vof_cutoff ) && (C_VOF(c0,pt[water_phase]) < (1 - vof_cutoff))) { /*if (C_VOF(c1,pt[water_phase]) > 1 - vof_cutoff ) {*/ C_UDMI(c0,t0, 0) = 1; /* }*/ } } end_f_loop(f,t); } |
|
February 10, 2016, 23:48 |
|
#2 |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
I am not good at all with UDF's but since you asked for it, here it goes:
From what I understand you specified a value of 1 at the boundary for water phase with your UDF? The interface depends on the cell size and is only a representation of the actual (real) interphase. Your boundary may have a volume fraction of 1 of the liquid phase but since the interface itself is supposed to show you a transition from one phase to another this is what I would have expected your results to show. |
|
February 11, 2016, 05:53 |
|
#3 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
How can this conditional statement ever be true with a vof_cutoff = 0.5? It's only true if the volume fraction is both greater than and less than 0.5 (not possible).
Code:
if ( (C_VOF(c0,pt[water_phase]) > vof_cutoff ) && (C_VOF(c0,pt[water_phase]) < (1 - vof_cutoff))) Code:
begin_f_loop(f,t) { c0 = F_C0(f,t); C_UDMI(c0,t0,0) = 0.; } Also, you could double check the interface location by plotting contours of the volume fraction. |
|
Tags |
multiphase, udf, udm |
|
|