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

Get the maximum and minimum pressure in the domain(In parallel calculation)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 9, 2014, 10:44
Unhappy Get the maximum and minimum pressure in the domain(In parallel calculation)
  #1
New Member
 
XH
Join Date: Oct 2014
Posts: 16
Rep Power: 12
xh110120 is on a distinguished road
My simulation is transient for the calculation of pressure wave in the domain. And I want to know the maximum pressure and minimum pressure of the domain after every timestep. So I use the "DEFINE_EXECUTE_AT_END" to see the value, the program can be seen in the picture below. I use MAX(pmaxx,C_P(c,t)) and MIN(pminx,C_P(c,t)) to get the maximum pressure and minimum pressure for every partitions(28 partitions for the parallel calculation). And I use PRF_GRHIGH1(pmaxx) and PRF_GRLOW1(pminx) to get the maximum and minimum pressure for all of the domain. In theory, the value of pmax and pmin should be the same for every partition. But in the console, the first partition is different from the other partitions, and the other partitions are the same. The result can be seen in the picture below. And I wonder why the first partition is different, which will affect my following calculation.
Thank you for your help.
program.jpg

result1.jpg

result2.jpg

result3.jpg
xh110120 is offline   Reply With Quote

Old   October 9, 2014, 12:03
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
It is not the first partition that is different, but the first process, the host process. The host process does not deal with geometry, so you should exclude that.

For example, by changing the writing-part of your code to:
Code:
#if RP_NODE
 Message("Max:%e;Min:%e\n",pmax,pmin);
#endif /* RP_NODE */
In this way, only the results for compute nodes will be shown.
pakk is offline   Reply With Quote

Old   October 9, 2014, 22:05
Default
  #3
New Member
 
XH
Join Date: Oct 2014
Posts: 16
Rep Power: 12
xh110120 is on a distinguished road
Quote:
Originally Posted by pakk View Post
It is not the first partition that is different, but the first process, the host process. The host process does not deal with geometry, so you should exclude that.

For example, by changing the writing-part of your code to:
Code:
#if RP_NODE
 Message("Max:%e;Min:%e\n",pmax,pmin);
#endif /* RP_NODE */
In this way, only the results for compute nodes will be shown.
Hey pakk,
Your answer is helpful. And I want to use the pmin and pmax to do the logical judgment for the next calculation.(The detail program is below) And I wonder whether it use the pmax and pmin in the host process or in the node process to do the logical judgment. I want it use the value in the node process to do this work, because the value in the node process is the real maximum and minimum pressure in this domain. And what can I do to realize it ?
Thank you very much!

thread_loop_c(t,d)
{
begin_c_loop_int(c,t)
{
if(C_P(c,t)>=(pmin+ratio*(pmax-pmin)))
C_UDMI(c,t,2)=2;
if((pmin+ratio*(pmax-pmin))>C_P(c,t)>=pmin)
C_UDMI(c,t,2)=1;
if(C_UDMI(c,t,0)!=1&&C_UDMI(c,t,2)==1)
x+=(C_VOLUME(c,t)*2*PI);
if(C_UDMI(c,t,0)!=1&&C_UDMI(c,t,2)==2)
x+=(k*C_VOLUME(c,t)*2*PI);
}
end_c_loop_int(c,t)
}
xh110120 is offline   Reply With Quote

Old   October 10, 2014, 08:46
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Probably you can achieve what you want by putting "#if RP_NODE" and "#endif" around your code you showed here.

I would advise you to read section 7 (Parallel considerations) of the UDF manual. It has some clear examples of this.
pakk is offline   Reply With Quote

Old   October 10, 2014, 09:06
Default
  #5
New Member
 
XH
Join Date: Oct 2014
Posts: 16
Rep Power: 12
xh110120 is on a distinguished road
Dear pakk,
Thank you for your help. By arounding my code with the "#if RP_NODE" and "#endif", the problem indeed work out!
xh110120 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
Issues on the simulation of high-speed compressible flow within turbomachinery dowlee OpenFOAM Running, Solving & CFD 11 August 6, 2021 07:40
convergenceof natural convection prob. in cfx cpkewat CFX 15 January 31, 2014 07:29
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
CFD Post: Location of maximum and minimum velocities! JuPa CFX 6 August 31, 2012 10:51
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 06:13


All times are GMT -4. The time now is 15:51.