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

(ask) temperature profile that include the pressure

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 11, 2018, 11:08
Post (ask) temperature profile that include the pressure
  #1
New Member
 
yanghai
Join Date: Mar 2018
Posts: 16
Rep Power: 8
yanghai is on a distinguished road
hello everyone,

i want to set the temperature profile to a wall, the value is include the pressure of the wall, the equation is :T=100+ln(p). the below is my udf, in my case, the flow have pressure drop along the wall. so the temperature value of the wall is different, but the result is that the pressure drop is very small ,it is about 0.01Pa. so the temperature of the wall is constant. so where is the problem?Thanks anybody. thanks thanks thanks!!!


#include "udf.h"
#include <math.h>
real p_eva;
DEFINE_EXECUTE_AT_END(eva_pressure)
{
real p_op = RP_Get_Real("operating-pressure");
int ID=11;
Thread*thread;
Domain*domain;
face_t f;
domain=Get_Domain(1);
thread=Lookup_Thread(domain,ID);

begin_f_loop(f,thread)
{
p_eva = F_P(f,thread)+p_op;
}
end_f_loop(f,thread)
printf("p_eva is %g\n",p_eva);
fflush(stdout);
}

DEFINE_PROFILE(eva_temperature,t,i)
{
face_t f;

begin_f_loop(f,t)
{
F_PROFILE(f,t,i)=100+log(p_eva);
}
end_f_loop(f,t)
}
yanghai is offline   Reply With Quote

Old   April 11, 2018, 12:42
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Your p_eva is the pressure of the last face that Fluent happens to visit... I don't think it is what you want.

If you want the temperature to be a function of the local pressure:

Code:
#include "udf.h"
#include <math.h>
DEFINE_PROFILE(eva_temperature,t,i)
 {
	  face_t f;

	  begin_f_loop(f,t)
	   {
		F_PROFILE(f,t,i)=100+log(F_P(f,t)+RP_Get_Real("operating-pressure"));
	   }
	  end_f_loop(f,t)
 }
pakk is offline   Reply With Quote

Old   April 11, 2018, 22:02
Default
  #3
New Member
 
yanghai
Join Date: Mar 2018
Posts: 16
Rep Power: 8
yanghai is on a distinguished road
Quote:
Originally Posted by pakk View Post
Your p_eva is the pressure of the last face that Fluent happens to visit... I don't think it is what you want.

If you want the temperature to be a function of the local pressure:

Code:
#include "udf.h"
#include <math.h>
DEFINE_PROFILE(eva_temperature,t,i)
 {
	  face_t f;

	  begin_f_loop(f,t)
	   {
		F_PROFILE(f,t,i)=100+log(F_P(f,t)+RP_Get_Real("operating-pressure"));
	   }
	  end_f_loop(f,t)
 }
thanks for your reply, i have tried the way you said. it will have a Error: received a fatal signal (Segmentation fault). if i change the profile of temperature like :F_PROFILE(f,t,i)=100 that don't include the F_P(f,t), it is OK. i think that maybe the profile shouldn't have some variable just like F_P(f,t). is it true? do you know this ? thank you so much.
yanghai is offline   Reply With Quote

Old   April 12, 2018, 03:45
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
The problem is that F_P(c,t) does not exist yet when you initialize, because (apparently) the temperature is calculated before the pressure.

The quick solution: first initialize (with whatever pressure you want), then attach this UDF.
pakk is offline   Reply With Quote

Old   April 12, 2018, 04:16
Default
  #5
New Member
 
yanghai
Join Date: Mar 2018
Posts: 16
Rep Power: 8
yanghai is on a distinguished road
Quote:
Originally Posted by pakk View Post
The problem is that F_P(c,t) does not exist yet when you initialize, because (apparently) the temperature is calculated before the pressure.

The quick solution: first initialize (with whatever pressure you want), then attach this UDF.
you mean click the Initialization with the pressure i want firstly,and then to compiled the udf?? i have tried this , it still have the same problem. do you mean that?
what's more, in fluent, shouldn't the pressure be solved before the temperature?
thanks for your reply, thank you very much.
yanghai is offline   Reply With Quote

Reply

Tags
f_p(f, t) temprature pressure


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
[waves2Foam] Problems compiling waves2foam solver kenrichaiz OpenFOAM Community Contributions 15 January 2, 2021 03:58
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 18:00
help with boundary profile in pressure inlet quiqui FLUENT 21 June 18, 2013 13:55
OpenFOAM15 paraFoam bug koen OpenFOAM Bugs 19 June 30, 2009 11:46
Hydrostatic pressure in 2-phase flow modeling (long) DS & HB Main CFD Forum 0 January 8, 2000 16:00


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