|
[Sponsors] |
(ask) temperature profile that include the pressure |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 11, 2018, 11:08 |
(ask) temperature profile that include the pressure
|
#1 |
New Member
yanghai
Join Date: Mar 2018
Posts: 16
Rep Power: 8 |
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) } |
|
April 11, 2018, 12:42 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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) } |
|
April 11, 2018, 22:02 |
|
#3 | |
New Member
yanghai
Join Date: Mar 2018
Posts: 16
Rep Power: 8 |
Quote:
|
||
April 12, 2018, 03:45 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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. |
|
April 12, 2018, 04:16 |
|
#5 | |
New Member
yanghai
Join Date: Mar 2018
Posts: 16
Rep Power: 8 |
Quote:
what's more, in fluent, shouldn't the pressure be solved before the temperature? thanks for your reply, thank you very much. |
||
Tags |
f_p(f, t) temprature pressure |
|
|
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 |