|
[Sponsors] |
UDF code for variable viscosity in y-direction |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 16, 2016, 22:11 |
UDF code for variable viscosity in y-direction
|
#1 |
New Member
shayan
Join Date: Jul 2012
Location: Australia
Posts: 27
Rep Power: 14 |
Hi,
I am dealing with a multi phase problem ; a 2D domain filled with air as the primary phase and a fluid flow with variable viscosity in y-direction moving in x-direction on the bottom wall as the secondary phase. Wondering if you could help with a UDF code by which I can define a function that varies the viscosity values in y-direction? Thanks Shayan |
|
August 21, 2016, 23:16 |
How about this
|
#2 |
Senior Member
Real Name :)
Join Date: Jan 2010
Location: United States
Posts: 192
Rep Power: 16 |
What about something like this, hooked to the viscosity of whatever phase in your simulation you're trying to change?
Code:
DEFINE_PROPERTY(cell_viscosity, c, t) { real mu; real x[ND_ND]; real Y_coord; C_CENTROID(x,c,t); Y_coord=x[1]; mu= /*YOUR FUNCTION OF VISCOSITY HERE */ return mu; } ComputerGuy |
|
August 23, 2016, 07:17 |
|
#3 |
New Member
shayan
Join Date: Jul 2012
Location: Australia
Posts: 27
Rep Power: 14 |
Thanks a lot for the code;it was really helpful. I did some minor changes to get what I want, but there's still an issue:
#include "udf.h" DEFINE_PROPERTY(cell_viscosity, c, t) { real mu; real x[ND_ND]; real Y_coord; C_CENTROID(x,c,t); Y_coord=x[1]; if(Y_coord<=/ H) /*H: thickness of the secondary phase)*/ mu=(a*Y_coord)+A; /*viscosity profile & a and b are constants*/ else mu=A; return mu; } Well, I'm actually dealing with two layers of fluids with various viscosities. Instead of defining the 3rd phase, I decided to change the viscosity in y-direction! nevertheless, there's also a variation in "mu" in y-dir for each layer. Assuming "A(@Y_coord=0 or wall)"<=mu<="B(@ Y_coord=H or interface)", I couldn't get the B value for the viscosity at the interface, and its contour shows me a less value. Like, B=5.7 Pa.S instead of 6! Is there any chance to fix this issue?? Cheers |
|
Tags |
udf;fluent;viscosity |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Difficulty with UDF code for HEAT FLUX | etudiant_IITB | Fluent UDF and Scheme Programming | 1 | December 7, 2015 09:07 |
something wrong when compiling udf, however the code is correct when interpreting | richard ben | Fluent UDF and Scheme Programming | 7 | May 11, 2013 08:36 |
viscosity in UDF! | denhan | FLUENT | 0 | April 6, 2007 02:12 |
subgrid turbulent viscosity for UDF in LES | David TAIEB | FLUENT | 0 | April 2, 2007 09:27 |
Please help me run UDF code for source | Suga | FLUENT | 1 | February 3, 2006 04:40 |