|
[Sponsors] |
January 21, 2014, 09:52 |
regarding the following UDF
|
#1 |
New Member
rajendra soni
Join Date: Nov 2013
Location: guwahati
Posts: 7
Rep Power: 13 |
Hii friends...i am using UDF for source term of volumetric heat generation for my 2D simulation of heat transfer. Since i am new user for UDF, so i am in doubt whether i have written a correct UDF or not. UDF is given below.
/* sinusoidal heat generation in heater*/ #include "udf.h" DEFINE_SOURCE(heat_gen_1e5,cell,thread,dS,eqn) { double source,time,A,B,omega,pi,time_period ; A = 1.0e2, B=1.0e5; pi= 22.0/7.0; time_period = 900.0; //time in seconds; time = CURRENT_TIME; //taking time value; omega = (2.0*pi)/time_period; source = A+B*(1+sin(omega*time)); //dS[eqn]= B*omega*cos(omega*time); dS[eqn]= 0.0; return source; } Kindly go through this UDF and reply whether it is in correct format or not. Thanking you |
|
January 21, 2014, 10:46 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
We could (with a lot of effort) check it for you, but I think it is better if you learn how do check it yourself.
Code:
pi= 22.0/7.0; Just use the built-in constant M_PI instead. |
|
January 22, 2014, 01:25 |
regarding UDF
|
#3 |
New Member
rajendra soni
Join Date: Nov 2013
Location: guwahati
Posts: 7
Rep Power: 13 |
Thanks Pakk....
I have already compiled and i did not get any error. Actually I was thinking that if antbody have used this type of UDF then they can guide me whether I have written correct UDF or not.. I will run simulation and try to analyse the results.. Thanks for giving your valuble time... |
|
January 22, 2014, 04:35 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
If your UDF compiles and runs without errors, you have written a correct UDF. But there are billions of correct UDFs; most of them don't have the effect what you want. You haven't specified which effect you want, so nobody here can check that.
|
|
January 22, 2014, 14:39 |
|
#5 |
Senior Member
|
My two cents, just for you to know.
The term "dS[eqn]", which you have fortunately commented, is intended to be the derivative of the source term with respect to the dependent variable of the equation you are solving for. In your case it should be the derivative with respect to the TEMPERATURE, so for your source term it has to remain 0. |
|
January 23, 2014, 09:26 |
regarding UDF
|
#6 |
New Member
rajendra soni
Join Date: Nov 2013
Location: guwahati
Posts: 7
Rep Power: 13 |
Thank u sbaffini for your valuble suggestions..
Ir means whatever code I have written is correct, right? Actually I was not sure that's why I asked for this UDF issue... |
|
January 27, 2014, 01:08 |
|
#8 |
New Member
rajendra soni
Join Date: Nov 2013
Location: guwahati
Posts: 7
Rep Power: 13 |
thanks a lot 4 replying...
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Source Term UDF VS Porous Media Model | pchoopanya | Fluent UDF and Scheme Programming | 1 | August 28, 2013 07:12 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 22:38 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 05:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |