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

source code of UDF for Viscosity function ?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By lsqiet

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 5, 2017, 16:48
Default source code of UDF for Viscosity function ?
  #1
Senior Member
 
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10
ebtedaei is on a distinguished road
Hi All,
I want to write a source code of UDF for Viscosity function in mixture model:

y = 3.8 * 0.001003 * (1-(x/0.62))^(-1.55)

Please help me...

Thanks
ebtedaei is offline   Reply With Quote

Old   June 5, 2017, 21:43
Default
  #2
New Member
 
jack li
Join Date: Apr 2017
Posts: 1
Rep Power: 0
lsqiet is on a distinguished road
#include "udf.h"

DEFINE_PROPERTY(viscosity,c,t)
{

real x[ND_ND];
real y,a;
C_CENTROID(x,c,t);
a = 1-x[0]/0.62;

y = 3.8*0.001003*pow(a,-1.55);

rerurn y;

}
KaLium likes this.
lsqiet is offline   Reply With Quote

Old   June 5, 2017, 23:59
Default
  #3
Senior Member
 
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10
ebtedaei is on a distinguished road
Thank you...

you mean is:
return y;

Last edited by ebtedaei; June 6, 2017 at 01:21.
ebtedaei is offline   Reply With Quote

Old   June 6, 2017, 01:28
Default
  #4
Senior Member
 
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10
ebtedaei is on a distinguished road
At the function, the parameter "x" is equal to "volume fraction of particles" in Mixture model.

variation range of x : 20 - 30

How do I define it into the source code?

Last edited by ebtedaei; June 6, 2017 at 13:07.
ebtedaei is offline   Reply With Quote

Old   June 26, 2017, 12:32
Default
  #5
Senior Member
 
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10
ebtedaei is on a distinguished road
please help me...
ebtedaei is offline   Reply With Quote

Old   July 12, 2017, 03:13
Default
  #6
Senior Member
 
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10
ebtedaei is on a distinguished road
Hi All,
I'm using a multi-phase model. I need to write the UDF function for an output variable (derived from two other input parameters of each phase).
But this variable does not exist in the inlet boundary conditions, so I can not add the udf function to its boundary conditions!!!

what should I do? Thank you for advising.

Last edited by ebtedaei; July 13, 2017 at 01:23.
ebtedaei is offline   Reply With Quote

Old   July 12, 2017, 06:41
Default
  #7
Member
 
MayTheFlowBeWithYou's Avatar
 
I have to remain anonymous, I'm sorry.
Join Date: Jun 2017
Location: The Netherlands, Delft University of Technology
Posts: 48
Rep Power: 9
MayTheFlowBeWithYou is on a distinguished road
Maybe you could use a user defined scalar or user defined memory? Need more details to help you.
MayTheFlowBeWithYou is offline   Reply With Quote

Old   July 13, 2017, 01:45
Default
  #8
Senior Member
 
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10
ebtedaei is on a distinguished road
I am using "mixture" multi-phase model and two fluids (Water and X) that Water Viscosity is constant but the X Viscosity is changed.

So Viscosity of the mixture phase is changed and I have to add a viscosity UDF to the inlet boundary conditions.

As mentioned above, this variable does not exist in the inlet boundary conditions, so I can not add the udf function to its boundary conditions!!!
ebtedaei 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
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 04:30
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 17:02
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 10:17
[swak4Foam] swak4Foam-groovyBC build problem zxj160 OpenFOAM Community Contributions 18 July 30, 2013 14:14
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 10:31


All times are GMT -4. The time now is 18:37.