CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

I have a contour display problem need some help...

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 19, 2018, 11:00
Default I have a contour display problem need some help...
  #1
New Member
 
Lee JP
Join Date: Dec 2018
Posts: 3
Rep Power: 8
ljpGBL is on a distinguished road
I was simulating the separate flow over the sandwave using SST k-w modeling.
As you can see, I wrote an udf in order to calculate the shear-stress and shear-velocity inside the fluid, the compiling process and loading were ok, calculating is also fine, the problem occurs when I display the User Memory 0 and 1. They are separately shear-stress and shear-velocity, but the contour of the shear-velocity apparently has some problem.
I had tried change the options in view menu but it doesn't work.
78c6595105cc19b81c12cd2a2437e6c.jpg
Clip_20181219_225447.png
The code I wrote is as follows. If you had met a similar problem as I do please let me know how you solve it, or any suggestion is also welcome! Thank you!

#include "udf.h"
#include "mem.h"
#include "sg_udms.h"

#define rho 998.2
#define g 9.81
#define wl 0.046

/* #define NUM_UDM 2 */

// static int offset = UDM_UNRESERVED;

DEFINE_PROFILE(vof_profile, t, i)
{
#if !RP_HOST

real x[ND_ND];
face_t f;

begin_f_loop(f, t)
{
F_CENTROID(x, f, t);

if (x[1] <= wl)
{
F_PROFILE(f, t, i) = 1;
}
else
{
F_PROFILE(f, t, i) = 0;
}
}
end_f_loop(f, t)

#endif
}

DEFINE_PROFILE(outlet_pressure, t, i)
{
#if !RP_HOST

real x[ND_ND];
face_t f;
begin_f_loop(f, t)
{
F_CENTROID(x, f, t);
if (x[1] >= wl)
{
F_PROFILE(f, t, i) = 0.0;
}
else
{
F_PROFILE(f, t, i) = rho*g*(wl-x[1]);
}
end_f_loop(f, t)
}

#endif
}

DEFINE_PROFILE(inlet_velocity, t, i)
{
#if !RP_HOST

real x[ND_ND];
face_t f;
begin_f_loop(f, t)
{
F_CENTROID(x, f, t);
if (x[1] > wl)
{
F_PROFILE(f, t, i) = 0.0;
}
else
{
F_PROFILE(f, t, i) = 0.21;
}
end_f_loop(f, t)
}
#endif
}

/*DEFINE_EXECUTE_ON_LOADING(on_loading, libname)
{
offset = Reserve_User_Memory_Vars(NUM_UDM);
Set_User_Memory_Name(offset, "shear-stress");
Set_User_Memory_Name(offset+1, "shear-velocity");
} */

DEFINE_EXECUTE_AT_END(calculate_shear_scales)
{
#if !RP_HOST

Domain *d;
Thread *t;
cell_t c;

d = Get_Domain(3); /* The id of the water domain in multiphase case */

thread_loop_c(t, d)
{
begin_c_loop(c, t)
{
C_UDMI(c, t, 0) = C_MU_EFF(c, t)*(C_DUDY(c, t)+C_DVDX(c, t));
C_UDMI(c, t, 1) = sqrt(C_UDMI(c, t, 0)/C_R(c, t));
}
end_c_loop(c, t)
}
#endif
}
ljpGBL is offline   Reply With Quote

Old   December 20, 2018, 00:33
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
what kind of problem do you have?
what's wrong with velocities?

best regards
AlexanderZ is offline   Reply With Quote

Old   December 20, 2018, 00:57
Default
  #3
New Member
 
Lee JP
Join Date: Dec 2018
Posts: 3
Rep Power: 8
ljpGBL is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
what kind of problem do you have?
what's wrong with velocities?

best regards
hi, good to see your asking.
I mean isn't there should be a full mapping with the contour display?
But my first picture shows that there is some "empty data" or display mistake happen, how could I fix this or it is the right displaying? But it makes no sense right?
ljpGBL is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
contour display, some black points frank FLUENT 3 December 15, 2020 13:25
Problem with extracting data from contour in matlab mihirmakwana6 Main CFD Forum 6 August 5, 2015 18:43
CFX Contour (Problem in displaying contours) ali8500 CFX 2 January 2, 2012 17:21
DPM uncoupled display problem K. Jagus FLUENT 0 July 7, 2005 04:06
Problem about contour LQ CFX 4 July 2, 2005 22:57


All times are GMT -4. The time now is 15:44.