How can i introduce a UDF of density and depth. That is density varying linearly with depth.
User defined function
- 86 Views
- Last Post 10 October 2018
- Topic Is Solved
In order to get a linearly stratified medium. Thanks Karthik
Please check out the DEFINE_PROPERTY UDF macro in the Fluent Customization manual. There are some examples such as defining viscosity as a function of temperature, and density function for compressible fluids. You might want to make density a function of your coordinate which indicates depth.
You might also want to look into this example - "UDF for specifying an x-momentum source term in a spatially dependent porous media". This will give you some idea as to how to use the centroid macro in such UDFs.
I hope this helps.
Can any one please help me writing the UDF function Its a function of detph Density varies linearly with depth Assuming the fuction as f(x)
I'd strongly recommend you go through the Fluent customization manual. It contains several examples. You might find a similar UDF which you can make small modifications to suit your needs. I've found this approach to writing UDFs extremely useful. I'll let other members of this community weigh in their opinions.
I am very new to this .. it will be really helpful if any body could help me..please..
KKR, attached is a snippet of the UDF you need.
real y, x[ND_ND];
y = x;
rho = /*define your function rho(y)*/ ;
And as Karthik (Kremella) mentioned, you need to go through the given examples to write your own UDFs. And if you are writing a complicated UDF, you can ask specific questions and users of the community would be of help. Good luck!
What is the fluid used here? Are you trying to model atmospheric problem? Using DEFINE_PROPERTY for density is generally only suitable for temperature depdendency or for compressible liquid (small compressibility).
Fluid is water.. and i want to create a linearly density stratified medium. That is density increases linearly with depth(y axis). I want simulate sea condition (pycnocline)
This code is not working properly. There is an error 'undefined variable x)
First of all ANSYS Stuff colleagues are not here to debug your code as this is mainly your task. We are here only to provide guidance.
The snipped provided has to work:
real y, x[ND_ND];
y = x;
rho =y*1000 ;/*define your function rho(y)*/
You might past you final function here.
I have done the same . But there is an error can 'undefined variable x')
Error: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).\n\nThe system cannot find the path specified.
\n\nC:\Users\Sunayan\Desktop\KARNAV\20.7 successful\GEOM AND MESH\1_files\dp0\FFF\Fluent\libudf\win64\3ddp_host\libudf.dll
while I complied my code this error popped up. how can I rectify this problem.
Error: The UDF library you are trying to load (C:\Users\Sunayan\Desktop\KARNAV\20.7 successful\GEOM AND MESH\1_files\dp0\FFF\Fluent\libudf) is not compiled for 3ddp on the current platform (win64).\n\nThe system cannot find the path specified.
\n\nC:\Users\Sunayan\Desktop\KARNAV\20.7 successful\GEOM AND MESH\1_files\dp0\FFF\Fluent\C:\Users\Sunayan\Desktop\KARNAV\20.7 successful\GEOM AND MESH\1_files\dp0\FFF\Fluent\libudf\win64\3ddp\libudf.dll
Error Object: #f
Terminate Fluent. Compile and try again. You can even try Standalone.
Thank you raul.raghav,abenhadj for the advice.thank you very much.
You are welcome and thanks for marking this issue as resolved.
- All Categories
- Community Rules, Guidelines, and Tips
- News & Announcements
- Student Products
- Pre and Post Processing
- Physics Simulation
- Tutorials, Articles and Textbooks
- Installation and Licensing
- Student Competition Teams
- eMasters Degree from UPM
- Site Feedback
This Weeks High Earners
- 1 Product and CAD Configuration Manager - No Products Displayed
- 2 student v 19.2 quits right after loading
- 3 Mass flow inlet in Eulerian VOF model
- 4 How to define Boundary Conditions for my complex model (and how to unite the similar geometries)
- 5 SpaceClaim - The geometry editor was closed abnormally.