|
[Sponsors] |
April 14, 2014, 10:37 |
conductivity, viscosity, and density udf
|
#1 |
New Member
m.akbari
Join Date: Apr 2014
Posts: 14
Rep Power: 12 |
hello friends, i have 3 .c files that need to be checked cause i am not sure which they work or not.
i really appreciate u to check it for me, i'm waiting for ur comments dudes best wishes for u conductivity.c density.c viscos.c |
|
April 14, 2014, 13:33 |
Re: My UDF Code
|
#2 | |
Member
Engr Adeniyi
Join Date: Jan 2011
Posts: 32
Rep Power: 16 |
Quote:
Hi, Can you explain what problem you are facing with the code? You don't have to have 3 different files for your code. You can place them all in one file (since they are not that lengthy). Since I don't know what you are trying to do. I will suggest you try and debug the code using a simple way as follows. 1) Do the calculations in an Excel sheet with different inputs 2) Place some lines to print the output to the console in Fluent. 2a) Note that I have put a limit to the number of times your code will print to the console so that it does not hang up your system. I hope that will help in what you are trying to do. I did not run the code but I think it looks OK, the red parts are my addition to your code to help you in debugging, I have not changed anything, you can remove them after the debugging. Regards APPENDIX /************************************************** ******************* UDF that simulates solidification by specifying a temperaturedependent thermal conductivity property ************************************************** ********************/ #include "udf.h" int printStopper=0; /*This is a dummy counter */ DEFINE_PROPERTY(cell_density,cell,thread) { real rho; real temp = C_T(cell,thread); rho=(-3.570*(pow(10,-3))*(pow(temp,2))+(1.88*temp+753.2)); if(printStopper<=100) {printStopper++; CX_Message("*****Cell Temp: %3.2f Kelvin, Rho= %E kg/m3 \n",temp,rho); } return rho; } DEFINE_PROPERTY(cell_conductivity,cell,thread) { real ktc; real temp = C_T(cell,thread); ktc=(-8.354*0.000001*(pow(temp,2)))+((6.53*0.001*temp)-0.5981); if(printStopper<=100) {printStopper++; CX_Message("*****Cell Temp: %3.2f Kelvin, KTC= %E W/m.K \n",temp,ktc); } return ktc; } DEFINE_PROPERTY(cell_viscosity,cell,thread) { real mu; real temp = C_T(cell,thread); mu=2.591*(pow(10,-5))*(pow(10,(238.3/(temp-143.2)))); if(printStopper<=100) {printStopper++; CX_Message("*****Cell Temp: %3.2f Kelvin, Viscosity= %E Pa.s \n",temp,mu); } return mu; } |
||
April 15, 2014, 04:15 |
|
#3 |
New Member
m.akbari
Join Date: Apr 2014
Posts: 14
Rep Power: 12 |
hello my friend galileo, ur reply was so helpful and i really appreciate it.
it did work finally for me but i used just that part of ur recommendation: You don't have to have 3 different files for your code. You can place them all in one file (since they are not that lengthy) it was a very nice and on time reply. thank u very veryyyyyyyyy much |
|
December 12, 2018, 13:08 |
|
#4 |
New Member
Shivanshu Bajpai
Join Date: Dec 2018
Posts: 4
Rep Power: 7 |
@Mdakbari I miss also using udf for density, viscosity, and conductivity. But when I am using the same in fluent my solution is not converging. How to solve this problem
|
|
Tags |
check, conductivity, density, udf, viscosity |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Simulation of a single bubble with a VOF-method | Suzzn | CFX | 21 | January 29, 2018 01:58 |
Variable density and viscosity | ravibhadauria | FLUENT | 0 | September 15, 2011 18:09 |
Constant velocity of the material | Sas | CFX | 15 | July 13, 2010 09:56 |
REAL GAS UDF | brian | FLUENT | 6 | September 11, 2006 09:23 |
Two-Phase Buoyant Flow Issue | Miguel Baritto | CFX | 4 | August 31, 2006 13:02 |