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

results of transient analysis

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By blackmask

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 27, 2013, 07:49
Default results of transient analysis
  #1
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
Hi,

I am doing transient analysis. the temperature profile was hooked to Fluent as UDF file (attached the graph of the profile), which the range of temperature is between ~11C to ~27C. this profile considered as a convection boundary condition to the model.

the results after 2 step with sizing of 10sec gives me temepraute of min -50C and max 26C.

why its happen?

any helps ?

regards,
Attached Images
File Type: jpg Capture.JPG (26.3 KB, 19 views)
Attached Files
File Type: c TransientTempProfileWITH10 to 15.C (578 Bytes, 4 views)
ahvz is offline   Reply With Quote

Old   April 27, 2013, 09:22
Default
  #2
Member
 
Engr Adeniyi
Join Date: Jan 2011
Posts: 32
Rep Power: 16
Galileo is on a distinguished road
Quote:
Originally Posted by ahvz View Post
Hi,

I am doing transient analysis. the temperature profile was hooked to Fluent as UDF file (attached the graph of the profile), which the range of temperature is between ~11C to ~27C. this profile considered as a convection boundary condition to the model.

the results after 2 step with sizing of 10sec gives me temepraute of min -50C and max 26C.

why its happen?

any helps ?

regards,
Take note of the following:

(1) The profile you specified is in degrees centigrade, this should be in Kelvin. You need to convert the equation to the kelvin equivalent.
(2) It looks like your geometry is TOOOO large. From the graph, highest temperature is about 25.5 degree C at the geometry location 10.3 kilometres! You should be sure of what the dimensions are.


To debug, try the following (adapted from your code)





/************************************************** *********************
udfexample.c
UDF for specifying transient temperature profile boundary condition
************************************************** **********************/

#include "udf.h"

/*Remove this after debug*/
int stopper=1;


DEFINE_PROFILE(Temp_Profile, thread, position)
{

real x[ND_ND]; /* this will hold the position vector */
real y;

real theProfile;

face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];


theProfile= (2e-12*y*y*y)-(2e-7*y*y)+(0.0029*y)+11.238;
/*
Are you using a double precision solver? 2e-12 is almost zero..just thinking
*/


if(stopper<20)
{/*Dont hang my computer trying to print too much */

/*This will print the temperature profile Note the units used! */
CX_Message("Location y=%E (m) Temp.= %3.3f (Kelvin) \n", y,theProfile);
stopper++;
}


F_PROFILE(f, thread, position) =theProfile;

}
end_f_loop(f,thread)
}
Galileo is offline   Reply With Quote

Old   April 27, 2013, 10:21
Default
  #3
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
Thank you very much for the reply,

I changed the temperature formula to Kelvin for such a case. still the temperature variations are too much strange!

indeed, my geometry is small with boundary dimensions of 200mm by 200mm by 200mm.

I guess, there is some things wrong with my code! as I understood from your texts " It looks like your geometry is TOOOO large. From the graph, highest temperature is about 25.5 degree C at the geometry location 10.3 kilometres! You should be sure of what the dimensions are"


the graph which is presented the temperature versus "TIME" (not dimension of the supposed model)
In fact, I taking to account to control the time with time steps and sizing through the Fluent I am doing right? maybe here is my problem!


in this situations I must be have UDF file with both temperature and time ? if so, how to do this?



need help please,
ahvz is offline   Reply With Quote

Old   April 27, 2013, 12:29
Default
  #4
Member
 
Engr Adeniyi
Join Date: Jan 2011
Posts: 32
Rep Power: 16
Galileo is on a distinguished road
Quote:
Originally Posted by ahvz View Post
Thank you very much for the reply,

I changed the temperature formula to Kelvin ------

--- my geometry ---- 200mm by 200mm by 200mm.

-------in this situations I must be have UDF file with both temperature and time ?----
if so, how to do this?



need help please,



If the x-Axis of the figure you attached is a time axis, then you have attached the wrong profile.

From what you wrote, it seems you want to create a boundary profile that varies with time and perhaps with the face coordinate. eg
theProfile=theProfile(y,t);
where y is face coordinate and t is the current time.


If that is true, then you need to know the following and adjust appropriately:
x[ND_ND] means get the system of the solution, in your case, ND_ND would tell your code, it is a 3D case. Therefore, in the cartesian coordinate system, x[0] is the x-axis, x[1] is the y-axis and x[2] is the z-axis respectively.
Calling, F_CENTROID(x,f,thread) in that loop and making y=x[1] will help you get the y axis coordinate for the boundary where you are hooking the UDF. It is not the time!

You can modify the code by following this hypothetical example.
T=255y^2+0.04t (y is the y-axis, and t is the current time)
That is a parabolic temperature profile that changes with time.


#include "udf.h"
#include "mem.h"


/*Remove this after debug*/
int stopper=1;

DEFINE_PROFILE(Temp_Profile, thread, position)
{

real x[ND_ND]; /* this will hold the position vector */
real y;
real theProfile;

face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
t = CURRENT_TIME;

theProfile= 255.0*pow(y,2.)+0.04*t ;

/*Note the .0 after 255 */


if(stopper<20)
{/*Dont hang my computer trying to print too much */

/*This will print the temperature profile Note the units used! */
CX_Message("Location y=%E (m) Temp.= %3.3f (Kelvin) Flow time =%g \n", y,theProfile,t);
stopper++;
}

F_PROFILE(f, thread, position) =theProfile;

}
end_f_loop(f,thread)
}



-------------NB
It is possible you are doing your work in a too complicated way than is actually required. You should first test with constant boundary conditions before using a UDF.
Eg Set the Temp. to 350K and see if it is still giving crap results. If it is doing that, then make sure you have a good mesh and set the other boundary conditions right. Good luck with it.
Galileo is offline   Reply With Quote

Old   April 29, 2013, 07:08
Default
  #5
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
Thank you very much for your effort on my problem,


As you suggest in my case, I did several analysis with constant temperatures (eg. 10C, 15C, 20C) and it gives lojical results through the model. regarding to check the Fluent results I am seeking for analytical solutions in this stage.

Regarding to your second suggestion, how can I be sure about the mesh ? I mean, what parameter needed to be evaluate due to the mesh performance on the model structure ? I just create the mesh according to some tutorials and so on. don't you mean that, I should change the dimension of the mesh or change in the methods of the meshing to see the effect on the results ?




give me your feedback on this question please, my problem is 3D model which is compose of solid and air parts, I want to impose the temperature profile (corresponding formula) to the boundary condition as convention load to boundary surfaces of the model, am I doing right way?




About the code that supposed to be use for my purpose:

I have an error "parse error" it belong to "theProfile=(2.0e-12*pow(y,3.)-(2.0e-7*pow(y,2.)+(0.0029*pow(y,1.)+(284.39);" when I write the formula according to this :"theProfile=(2e-12*y*y*y)-(2e-7*y*y)+(0.0029*y)+(284.39);" the error will be solved. is there any difference between this two formula ? as you suggested I should write like the first one.


when the second written formula used I have an error belong to this line "

{
CX_Message("Location y=%E (m) Temp.= %3.3f (Kelvin) Flow time =%g \n", y,theProfile);
stopper++;
}"

which its "Error: C:\\Users\\Mohammad\\Desktop\\Solidwork-ANSYS-FLUENT\\TransientTempProfile.C: line 44: function "CX_Message" not found (pc=174)"



#include "udf.h"
#include "mem.h"

int stopper=1;

DEFINE_PROFILE(Temp_Profile, thread, position)
{

real x[ND_ND];
real y;
real theProfile;

face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];


theProfile=(2.0e-12*pow(y,3.)-(2.0e-7*pow(y,2.)+(0.0029*pow(y,1.)+284.39;


if(stopper<20)
{


CX_Message("Location y=%E (m) Temp.= %3.3f (Kelvin) Flow time =%g \n", y,theProfile);
stopper++;
}


F_PROFILE(f, thread, position) =theProfile;
}
end_f_loop(f,thread)
}


another question that I have, when I am using transient analysis, its possible to give sizing and time steps before calculation in Fluent. so in this such a way, the temperature profile should be writen as time dependent again ?



Sorry for presenting a lot of questions...

regards,
Attached Images
File Type: jpg Capture.JPG (37.8 KB, 4 views)
ahvz is offline   Reply With Quote

Old   April 30, 2013, 03:06
Default
  #6
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 21
blackmask will become famous soon enough
The "parser error" occurs because the parenthesis are not balanced.
theProfile=(2.0e-12*pow(y,3.))-(2.0e-7*pow(y,2.))+(0.0029*pow(y,1.))+(284.39);
Use the 'pow' function is more powerful but they do not make much difference here.

Try to use Message0 instead of CX_Message and modify the format string according to the number of arguments, i.e.,

Message0("Location y=%E (m) Temp.= %3.3f (Kelvin) \n", y, theProfile);



Regarding to your last question, I am confused, whether the temperature is a function of y or a function of t?
blackmask is offline   Reply With Quote

Old   April 30, 2013, 05:02
Default
  #7
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
Thank you very much for the reply,

Regarding to the change in the below line of the code:

CX_Message("Location y=%E (m) Temp.= %3.3f (Kelvin) Flow time =%g \n", y,theProfile);

with

Message0("Location y=%E (m) Temp.= %3.3f (Kelvin) \n", y, theProfile);



the error not solved ": line 45: function "CX_Message" not found (pc=184)."





due to answer your question "Regarding to your last question, I am confused, whether the temperature is a function of y or a function of t? "

the temperature in a function of time as its shown in the graph attached to this post.

am I doing right? in deed, I want to use this "temperature-time" profile as convection load in boundary condition to the 3D model at outer surfaces.

please provide feedback on this issues,

regards,
Attached Images
File Type: jpg Capture.JPG (37.8 KB, 0 views)
ahvz is offline   Reply With Quote

Old   April 30, 2013, 05:17
Default
  #8
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 21
blackmask will become famous soon enough
My bad. The "Message" function could not be used for interpreted UDF. So just comment that line out.

As you said, the temperature is a function of time. Then you should change this line
y = x[1];
to
y = CURRENT_TIME;
Also note that your analysis type should be transient analysis.
blackmask is offline   Reply With Quote

Old   April 30, 2013, 05:43
Default
  #9
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
Thank you very much for the guidance,

I did the changes and its hooked to Fluent. A point that I couldn't understand the reason of why we must use Kelvin unit instead of Celsius for the temperature at UDF file ?

Many thanks,
ahvz is offline   Reply With Quote

Old   April 30, 2013, 08:29
Default
  #10
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 21
blackmask will become famous soon enough
According to the fluent user's guide:
You must always define the following in SI units, regardless of the unit system you are using:
– Boundary profiles
– Source terms
– Custom field functions
– Data in externally-created XY plot files
– User-defined functions
ahvz likes this.
blackmask is offline   Reply With Quote

Old   May 6, 2013, 10:20
Default
  #11
Senior Member
 
Moha
Join Date: Mar 2013
Location: EU
Posts: 103
Rep Power: 0
ahvz is on a distinguished road
Quote:
Originally Posted by blackmask View Post
My bad. The "Message" function could not be used for interpreted UDF. So just comment that line out.

As you said, the temperature is a function of time. Then you should change this line
y = x[1];
to
y = CURRENT_TIME;
Also note that your analysis type should be transient analysis.

would you please tell me what does mean, when we change y = x[1];
to
y = CURRENT_TIME; ?

the current time will be called from where ? does it means that, the current time is from time steps ?
as I have defined Temperature-Time variation by formula. I want to have exact profile (independent profile of time steps or any things). how to have it ?




regards,
ahvz 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
vortex shedding, transient or steady state analysis type? alfonsojurado CFX 0 October 25, 2012 05:33
TRANSIENT ANALYSIS OF JET FLOW shriramjegan FLUENT 0 July 28, 2007 12:04
Transient periodic analysis & Boundary conditions Michele FLUENT 0 March 25, 2006 16:07
Transient analysis Andy F CFX 8 January 6, 2006 09:55
time-averaging transient results azmir Siemens 5 May 25, 2004 09:09


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