CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF temperature profile (https://www.cfd-online.com/Forums/fluent-udf/113104-udf-temperature-profile.html)

flotus1 July 24, 2013 06:04

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.

str6073 July 24, 2013 07:32

i didnt check the profile. Can you please tell me how to do that also?? I googled it but got no positive results

flotus1 July 24, 2013 08:41

Run a few iterations and look at a contour plot of the temperature at this boundary.

str6073 July 24, 2013 12:14

thank you very much buddy. i wish i could return the favour somehow

str6073 July 24, 2013 12:38

"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 July 24, 2013 13:40

1 Attachment(s)
this is the contour i got . is this correct??

flotus1 July 24, 2013 16:28

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.

str6073 July 25, 2013 00:22

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??

blackmask July 25, 2013 02:13

Kid, do your own work.

I lost my patience in this forum lately.

flotus1 July 25, 2013 03:09

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.

B.Hamada July 8, 2014 20:18

Please please, need help.
 
1 Attachment(s)
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.

GM_XIII July 10, 2014 06:42

Quote:

Originally Posted by B.Hamada (Post 500659)
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

B.Hamada July 10, 2014 21:38

1 Attachment(s)
Quote:

Originally Posted by GM_XIII (Post 500908)
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

GM_XIII July 11, 2014 04:14

Quote:

Originally Posted by B.Hamada (Post 501043)
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?

B.Hamada July 11, 2014 06:29

Quote:

Originally Posted by GM_XIII (Post 501082)
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.

GM_XIII July 11, 2014 12:36

Quote:

Originally Posted by B.Hamada (Post 501106)
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

B.Hamada July 11, 2014 21:20

1 Attachment(s)
Quote:

Originally Posted by GM_XIII (Post 501180)
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.

ghost82 July 12, 2014 09:56

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

B.Hamada July 12, 2014 10:13

Quote:

Originally Posted by ghost82 (Post 501269)
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

ghost82 July 12, 2014 10:21

Quote:

Originally Posted by B.Hamada (Post 501272)
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


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