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

UDF temperature profile

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree14Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   July 24, 2013, 06:04
Default
  #21
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,097
Rep Power: 19
flotus1 will become famous soon enoughflotus1 will become famous soon enough
The code remains valid in this case. But as always, you should check if the temperature profile is correct before running your actual simulations.
No need to give me credits in your report for just a few lines of code.
flotus1 is offline   Reply With Quote

Old   July 24, 2013, 07:32
Default
  #22
Member
 
sooraj
Join Date: Dec 2012
Posts: 38
Rep Power: 4
str6073 is on a distinguished road
i didnt check the profile. Can you please tell me how to do that also?? I googled it but got no positive results
str6073 is offline   Reply With Quote

Old   July 24, 2013, 08:41
Default
  #23
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,097
Rep Power: 19
flotus1 will become famous soon enoughflotus1 will become famous soon enough
Run a few iterations and look at a contour plot of the temperature at this boundary.
flotus1 is offline   Reply With Quote

Old   July 24, 2013, 12:14
Default
  #24
Member
 
sooraj
Join Date: Dec 2012
Posts: 38
Rep Power: 4
str6073 is on a distinguished road
thank you very much buddy. i wish i could return the favour somehow
str6073 is offline   Reply With Quote

Old   July 24, 2013, 12:38
Default
  #25
Member
 
sooraj
Join Date: Dec 2012
Posts: 38
Rep Power: 4
str6073 is on a distinguished road
"Warning: explicit time-stepping not available. Using 1st-order dual-time. '' i get this msg while interpreting. calculation goes smoothly.you know what this mean??
str6073 is offline   Reply With Quote

Old   July 24, 2013, 13:40
Default
  #26
Member
 
sooraj
Join Date: Dec 2012
Posts: 38
Rep Power: 4
str6073 is on a distinguished road
this is the contour i got . is this correct??
Attached Images
File Type: jpg newtemp.jpg (11.4 KB, 18 views)
str6073 is offline   Reply With Quote

Old   July 24, 2013, 16:28
Default
  #27
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,097
Rep Power: 19
flotus1 will become famous soon enoughflotus1 will become famous soon enough
I have no idea why you get this message during interpretation of the UDF. What transient scheme do you use? Which kind of solver?

About the contour: provided the range is from 298K to 323K and the y-axis points from bottom right to top left, the contour is ok. Dont mind the artifacts at the intersection with the other face, they are mostly caused by the visualization.
flotus1 is offline   Reply With Quote

Old   July 25, 2013, 00:22
Default
  #28
Member
 
sooraj
Join Date: Dec 2012
Posts: 38
Rep Power: 4
str6073 is on a distinguished road
now there's no warnings. some mistakes from my part,i think.And about the contours, i think i need the variation in a vertical manner.bottom of the tank(cylinder) face should be blue above that green like ways. Can you modify like that??
str6073 is offline   Reply With Quote

Old   July 25, 2013, 02:13
Default
  #29
Senior Member
 
Join Date: Aug 2011
Posts: 315
Rep Power: 11
blackmask will become famous soon enough
Kid, do your own work.

I lost my patience in this forum lately.
blackmask is offline   Reply With Quote

Old   July 25, 2013, 03:09
Default
  #30
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,097
Rep Power: 19
flotus1 will become famous soon enoughflotus1 will become famous soon enough
I cant. You are the only one who knows the orientation of your model. All you have to do is change the following line to match your requirements:

F_PROFILE(f, thread, position) = (tmin+tmax)/2.0 + (tmax-tmin)/d*x[1];

All the information you need can be found in this thread.
flotus1 is offline   Reply With Quote

Old   July 8, 2014, 20:18
Unhappy Please please, need help.
  #31
Member
 
Mohamed
Join Date: Jan 2011
Location: Algeria
Posts: 43
Rep Power: 6
B.Hamada is on a distinguished road
Hello,

I'm VERY new to Fluent and I'm attempting to write a UDF that will make the heat flux at a wall a function of time. I've never programmed in C before either so I'm having some trouble getting the correct sytax

My function in Attach Files:

Please help me to witre it

I : Heat flux.
A : area of the front surface.
t : Time.
T : Temperature.
h : heat transfer coefficient.
\DeltaX : depth.
Cp: specific heat
\rho: density.
Attached Images
File Type: jpg udf.jpg (7.7 KB, 14 views)
B.Hamada is offline   Reply With Quote

Old   July 10, 2014, 06:42
Default
  #32
Member
 
David
Join Date: Aug 2012
Posts: 47
Rep Power: 4
GM_XIII is on a distinguished road
Quote:
Originally Posted by B.Hamada View Post
Hello,

I'm VERY new to Fluent and I'm attempting to write a UDF that will make the heat flux at a wall a function of time. I've never programmed in C before either so I'm having some trouble getting the correct sytax

My function in Attach Files:

Please help me to witre it

I : Heat flux.
A : area of the front surface.
t : Time.
T : Temperature.
h : heat transfer coefficient.
\DeltaX : depth.
Cp: specific heat
\rho: density.
Here you have a little example (first result from google)
http://bytes.com/topic/c/answers/866...ube-surface-3d
In your case if the heat flux doesn't depend of the position of the face in the boundary, it is even simpler. Something like this:

  1. #include "udf.h"
  2. /* profile for heat flux*/
  3. DEFINE_PROFILE(heatflux_profile, t, i)
  4. {
  5. /* declaring variables */
  6. face_t f;
  7. real area=0;
  8. begin_f_loop(f, t) /*This loop calculate the area of the boundary*/
  9. {
  10. area=area+NV_MAG(f);
  11. }
  12. end_f_loop(f, t)
  13. F_PROFILE(f,t,i)=YOUR EXPRESSION FOR I;
  14. }

The values of density, specific heat etc... can be found here:
http://aerojet.engr.ucdavis.edu/flue...udf/node90.htm
I dont know what depth in your model means, you shall give more information.

Regards
GM_XIII is offline   Reply With Quote

Old   July 10, 2014, 21:38
Default
  #33
Member
 
Mohamed
Join Date: Jan 2011
Location: Algeria
Posts: 43
Rep Power: 6
B.Hamada is on a distinguished road
Quote:
Originally Posted by GM_XIII View Post
Here you have a little example (first result from google)
http://bytes.com/topic/c/answers/866...ube-surface-3d
In your case if the heat flux doesn't depend of the position of the face in the boundary, it is even simpler. Something like this:

  1. #include "udf.h"
  2. /* profile for heat flux*/
  3. DEFINE_PROFILE(heatflux_profile, t, i)
  4. {
  5. /* declaring variables */
  6. face_t f;
  7. real area=0;
  8. begin_f_loop(f, t) /*This loop calculate the area of the boundary*/
  9. {
  10. area=area+NV_MAG(f);
  11. }
  12. end_f_loop(f, t)
  13. F_PROFILE(f,t,i)=YOUR EXPRESSION FOR I;
  14. }

The values of density, specific heat etc... can be found here:
http://aerojet.engr.ucdavis.edu/flue...udf/node90.htm
I dont know what depth in your model means, you shall give more information.

Regards
Thank you for your help.

About my problem, I'll explain. I treat the solidification of a material phase change in a photovoltaic system, a picture attachment allows you to know all the included in the model used to determine the heat flux exerted on the photovoltaic system variables.

Greetings
Attached Images
File Type: jpg bipv.jpg (33.9 KB, 10 views)
B.Hamada is offline   Reply With Quote

Old   July 11, 2014, 04:14
Default
  #34
Member
 
David
Join Date: Aug 2012
Posts: 47
Rep Power: 4
GM_XIII is on a distinguished road
Quote:
Originally Posted by B.Hamada View Post
Thank you for your help.

About my problem, I'll explain. I treat the solidification of a material phase change in a photovoltaic system, a picture attachment allows you to know all the included in the model used to determine the heat flux exerted on the photovoltaic system variables.

Greetings
Thanks, what i still cant understand is how do you get Tpv, can you attach a scheme of your domain and BV?
GM_XIII is offline   Reply With Quote

Old   July 11, 2014, 06:29
Default
  #35
Member
 
Mohamed
Join Date: Jan 2011
Location: Algeria
Posts: 43
Rep Power: 6
B.Hamada is on a distinguished road
Quote:
Originally Posted by GM_XIII View Post
Thanks, what i still cant understand is how do you get Tpv, can you attach a scheme of your domain and BV?
Please, I did not understand, for your question about the domain scheme and BV?
Thank you for your help.
B.Hamada is offline   Reply With Quote

Old   July 11, 2014, 12:36
Default
  #36
Member
 
David
Join Date: Aug 2012
Posts: 47
Rep Power: 4
GM_XIII is on a distinguished road
Quote:
Originally Posted by B.Hamada View Post
Please, I did not understand, for your question about the domain scheme and BV?
Thank you for your help.
I asked if you could attach a simple sketch of your geometry and boundary conditions
GM_XIII is offline   Reply With Quote

Old   July 11, 2014, 21:20
Smile
  #37
Member
 
Mohamed
Join Date: Jan 2011
Location: Algeria
Posts: 43
Rep Power: 6
B.Hamada is on a distinguished road
Quote:
Originally Posted by GM_XIII View Post
I asked if you could attach a simple sketch of your geometry and boundary conditions

Hi

An image attached shows geometry and boundary conditions.

Thank you so much.
Attached Images
File Type: jpg BIPV.jpg (30.6 KB, 11 views)
B.Hamada is offline   Reply With Quote

Old   July 12, 2014, 09:56
Default
  #38
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 899
Rep Power: 15
ghost82 will become famous soon enough
What is Tpv? It's the mean of temperature in the pcm domain or a specific temperature in a specific point?

For Tpv(t-deltat) you could try to use C_T_M1(c,t), which returns the cell temperature value of the previous time step.

In your equation consider "t" as "t-deltat" and "t+deltat" as "t".

Try to start writing some code.

Daniele
ghost82 is offline   Reply With Quote

Old   July 12, 2014, 10:13
Default
  #39
Member
 
Mohamed
Join Date: Jan 2011
Location: Algeria
Posts: 43
Rep Power: 6
B.Hamada is on a distinguished road
Quote:
Originally Posted by ghost82 View Post
What is Tpv? It's the mean of temperature in the pcm domain or a specific temperature in a specific point?

For Tpv(t-deltat) you could try to use C_T_M1(c,t), which returns the cell temperature value of the previous time step.

In your equation consider "t" as "t-deltat" and "t+deltat" as "t".

Try to start writing some code.

Daniele
Tpv It's the mean of temperature photovoltaic layer domain.
T_{pv,t} The temperature of the photovoltaic panel at the instant t.
T_{pv,t+\Delta t} The temperature of the photovoltaic panel at the instant t+\Delta t
B.Hamada is offline   Reply With Quote

Old   July 12, 2014, 10:21
Default
  #40
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 899
Rep Power: 15
ghost82 will become famous soon enough
Quote:
Originally Posted by B.Hamada View Post
Tpv It's the mean of temperature photovoltaic layer domain.
T_{pv,t} The temperature of the photovoltaic panel at the instant t.
T_{pv,t+\Delta t} The temperature of the photovoltaic panel at the instant t+\Delta t
Ok, but since we cannot read the future you can only evaluate temperatures at time t and t-deltat and not deltat+t.

Again, start writing some code, someone will help you to go through your code.

Daniele
ghost82 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF error - parabolic velocity profile - 3D turbine Zaqie Fluent UDF and Scheme Programming 8 May 11, 2014 08:34
defining temperature profile with UDF mohammadkm Fluent UDF and Scheme Programming 11 July 3, 2013 00:15
please help UDF for velocity profile in y-directio raju FLUENT 3 September 22, 2008 16:36
UDF temp. profile BC Shashikant FLUENT 0 June 24, 2006 03:16
temperature profile on boundary sivakumar FLUENT 5 November 24, 2002 01:58


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