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

How to change pressure in iterative process

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 25, 2017, 04:19
Smile How to change pressure in iterative process
  #1
New Member
 
Duyikang
Join Date: Jun 2015
Location: Wuhan,China
Posts: 4
Rep Power: 10
DuYikang is on a distinguished road
Hello everyone! I am encountering an interesting problem.How to setthe negative gauge pressure to zero when negative values occur in the hydrodynamic bearings or hydrostatic bearings? From the fluent help, the define_adjust can change the pressure and velocity in every iterative step.However, it can't make it.The programm as follows:
#include "udf.h"
DEFINE_ADJUST(adjust_pressure, domain)
{
Thread *t;
cell_t c;
face_t f;
thread_loop_c(t, domain)
{
begin_c_loop(c, t)
{
if (C_P(c, t) < 0)
C_P(c, t) = 0;
}
end_c_loop(c, t)
}
thread_loop_f(t, domain)
{
begin_f_loop(c, t)
{
if (C_P(c, t) <= 0.0)
C_P(c, t) = 0.0;
}
end_f_loop(c, t)
}
}


Although the DEFINE_EXECUTE_AT_END can make it, it is unreason.The programm is from this forum.(UDF to fix the pressure in domain - not working)
#include "udf.h"
DEFINE_EXECUTE_AT_END(pressure_adjust)
{
Domain *d;
Thread *t;
cell_t c;
face_t f;
d = Get_Domain(1);
thread_loop_c(t,d)
{
begin_c_loop (c,t)
{
if (C_P(c,t)<=0.0)
C_P(c,t)=0.0;
}
end_c_loop (c,t)
}
thread_loop_f(t,d)
{
begin_f_loop(c,t)
{
if (C_P(c,t)<=0.0)
C_P(c,t)=0.0;
}
end_f_loop(c,t)
}
}
Attached Images
File Type: jpg pressure.jpg (70.0 KB, 4 views)
DuYikang is offline   Reply With Quote

Old   July 25, 2017, 06:26
Default
  #2
Senior Member
 
KaLium's Avatar
 
Kal-El
Join Date: Apr 2017
Location: Finland
Posts: 150
Rep Power: 9
KaLium is on a distinguished road
Have you tried solve/controls/limits?

https://www.sharcnet.ca/Software/Flu...g/node1381.htm
KaLium is offline   Reply With Quote

Old   July 25, 2017, 20:57
Smile
  #3
New Member
 
Duyikang
Join Date: Jun 2015
Location: Wuhan,China
Posts: 4
Rep Power: 10
DuYikang is on a distinguished road
Quote:
Originally Posted by KaLium View Post
Have you tried solve/controls/limits?

https://www.sharcnet.ca/Software/Flu...g/node1381.htm
Thank you for replying me.The method proposed by you had tried,but fail to success.
DuYikang is offline   Reply With Quote

Reply


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
What are ways to reduce the time taken by fluent and meshing process in phase change. ~Akshay350~ FLUENT 0 March 23, 2017 12:39
total pressure change in a pipe flow Im FLUENT 5 February 23, 2017 08:55
static vs. total pressure auf dem feld FLUENT 17 February 26, 2016 13:04
Calculate Density mumtaz ersan FloEFD, FloWorks & FloTHERM 1 September 17, 2015 04:26
pressure change in CFX 11 Greg CFX 3 May 8, 2007 15:05


All times are GMT -4. The time now is 23:17.