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

What is Problem with F_C0 (f, t)...?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 7, 2018, 21:45
Post What is Problem with F_C0 (f, t)...?
  #1
New Member
 
JuBong
Join Date: Jan 2018
Posts: 16
Rep Power: 8
JuBong is on a distinguished road
Hi,
By reflecting the sun and measuring the heat flux of the air entering the channel, I will try to use the heat flux using temperature at the inlet.
I’m trying to use a UDF with velocity of 1.06 m/s in a velocity-inlet at the inlet to a rectangle of 0.075 * 0.1 m2 with the upper and lower walls as the fluent 2D, the inlet at the left, and the oulet at the right.

I want to use the temperature of the next cell in the flow direction to give a temperature 30K higher than that cell at inlet.

To use data of adjacent cells, I want to use c0 = F_C0 (f, t) and C_T (c0, t).
However, if my UDF code that worked well without any problems adds only a macro called c0 = F_C0 (f, t), it will not work and the program will end.

Can you see what's wrong?

Can you fix it?

Thank you very much for your reply.


This is my code.
It works well. but If I enter only 16 lines, the program will not work.

------------------------------------------------------------------------------

#include "udf.h"

DEFINE_PROFILE(temperature, thread, position)
{
real x[ND_ND];
real y;
Thread *t;
face_t f;
cell_t c, c0;

begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
c0=F_C0(f,t); /* line 16 */
F_PROFILE(f, thread, position) = -71111.111*y*y+5333.333*y+300;
}
end_f_loop(f, thread)
}

-------------------------------------------------------------------
JuBong is offline   Reply With Quote

Old   February 8, 2018, 06:55
Default
  #2
Member
 
ehsan
Join Date: Sep 2014
Posts: 38
Rep Power: 11
e_cfd is on a distinguished road
Hi,
I am not sure if your boundary is a wall BC or not.

Last edited by e_cfd; February 12, 2018 at 06:05.
e_cfd is offline   Reply With Quote

Old   February 8, 2018, 20:41
Post
  #3
New Member
 
JuBong
Join Date: Jan 2018
Posts: 16
Rep Power: 8
JuBong is on a distinguished road
Hi, e_cfd

Thank you very much.
That was the problem.
Is there any way to know the data of neighboring cells outside of the wall?
Thank you for your reply.
JuBong is offline   Reply With Quote

Old   February 8, 2018, 21:16
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
use this code for line 16.
Code:
c0=F_C0(f,thread); /* line 16 */
AlexanderZ is offline   Reply With Quote

Old   February 9, 2018, 00:24
Post
  #5
New Member
 
JuBong
Join Date: Jan 2018
Posts: 16
Rep Power: 8
JuBong is on a distinguished road
Hi, AlexanderZ.

Thank you.
I changed it to what you said and it worked.

But then the program stops working
If I enter the code F_PROFILE (f, thread, position) = C_T (c, t); /* line 17 */

Can we see what's wrong here?
Is the flow of the fluid not determined?

Thank you for your reply.

This is my code.

-----------------------------------------------------------------------
#include "udf.h"

DEFINE_PROFILE(temperature, thread, position)
{
real x[ND_ND];
real y;
face_t f;
Thread *t;
cell_t c, c0;

begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
c0=F_C0(f,thread);
F_PROFILE(f, thread, position) = C_T(c0,t); /* line 17*/
}
end_f_loop(f, thread)
}

-----------------------------------------------------------------------
JuBong is offline   Reply With Quote

Old   February 9, 2018, 02:52
Default
  #6
Member
 
annan
Join Date: Nov 2016
Posts: 72
Rep Power: 9
annan is on a distinguished road
Hi JuBong,
Isn't it the thread in F_PROFILE(f, thread, position) = C_T(c0,t); ?
if you need the thread related to cell c0 then you need to add this line (in bold) to your code :

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

t = THREAD_T0(thread);

F_PROFILE(f, thread, position) = C_T(c0,t); /* line 17*/
}
end_f_loop(f, thread)
}

hope this will help.
good luck
annan is offline   Reply With Quote

Old   February 9, 2018, 03:58
Default
  #7
Member
 
ehsan
Join Date: Sep 2014
Posts: 38
Rep Power: 11
e_cfd is on a distinguished road
Hi JuBong,

If I am not mistaken you want to change your inlet T (which is a boundary and definitely it or its gradient should be known) based on the next cells (which are generally unknown and are calculated based on the boundary conditions). You probably can define a gradient of T at the inlet (Neumann condition) as a heat flux (very similar to what you are looking for but in fact is different). On the other hand, it seems to me that your problem would not converge to a correct and stable solution because the problem seems to be ill-posed and undetermined (defining the bondary based on unknown T of adjacent cells )
Anyway, you always have access to the gradient of T (and other information linked to the adjacent cells) in any cells by using C_T_G(c,t) and C_T_RG(c,t)macro.

Pay attention that
C_T_G(c,t) and C_T_RG(c,t) are avalable only when the energy equation is solved!



Last edited by e_cfd; February 9, 2018 at 05:12.
e_cfd is offline   Reply With Quote

Old   February 11, 2018, 22:29
Post
  #8
New Member
 
JuBong
Join Date: Jan 2018
Posts: 16
Rep Power: 8
JuBong is on a distinguished road
Hello annan.

Thank you for your reply.

I put t = THREAD_T0 (thread) in your code as you told me.

However, the program will terminate with the following message.
"MPI Application rank 0 exited before MPI_Finalize () with status 2"

Can you see what's wrong?
please answer about my question.

This is my code.
---------------------------------------------------------------------
#include "udf.h"

DEFINE_PROFILE(temperature, thread, position)
{
real x[ND_ND];
real y;
face_t f;
Thread *t;
cell_t c, c0;

begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
c0=F_C0(f,thread);
t=THREAD_T0(thread);
F_PROFILE(f, thread, position) = C_T(c0,t)+30;
}
end_f_loop(f, thread)
}

---------------------------------------------------------------------
JuBong is offline   Reply With Quote

Old   February 11, 2018, 22:36
Post
  #9
New Member
 
JuBong
Join Date: Jan 2018
Posts: 16
Rep Power: 8
JuBong is on a distinguished road
Hello e_cfd.

What you want to say is that I can directly input the temperature gradient into the inlet?
If so, it is really good news.

Can you give me an example of a code that can be used to enter temperature gradients in the inlet?

I would really appreciate your reply.
JuBong is offline   Reply With Quote

Old   August 1, 2018, 08:30
Default
  #10
New Member
 
Hoang Nhu Quynh
Join Date: Jul 2016
Posts: 6
Rep Power: 9
MsRuby is on a distinguished road
Hi JuBong,

Did you find the solution for this?
For me, each time I used c0=F_C0(f,t), the program will end as well.
MsRuby is offline   Reply With Quote

Reply

Tags
udf code, udf temperature


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
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 05:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


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