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

Problem w UDF parallel for porous media

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2014, 11:23
Default Problem w UDF parallel for porous media
  #1
New Member
 
Join Date: Nov 2014
Posts: 2
Rep Power: 0
Well is on a distinguished road
Hi there,

first post in this forum. Hope it does work!

I am having problems with a UDF for the calculation of viscous and intertial resistances, see the code later on. I am able to compile it for parallel use. The only warning I get is:
y:\libudf2\src\porosity02505ny.c(10) : warning C4700: uninitialized local variable 'c' used

I load the UDF and try to initialize the case, but get the following message:
MPI Application rank 0 exited before MPI_Finalize() with status -1073741819

999999: mpt_write: error: write failed trying to write 4 bytes: No such file or directory
The fl process could not be started.


Here is the UDF code:
#include "udf.h"

DEFINE_PROFILE(visc_resistance_ny, t, nv)
{
cell_t c;
#if !RP_HOST

real coordinate[ND_ND];

C_CENTROID(coordinate,c,t);
begin_c_loop(c,t)
{
C_PROFILE(c,t,nv)=-1884707.52662278*coordinate[2]+6577498.83890377;
}
end_c_loop(c,t)
#endif
}


DEFINE_PROFILE(inert_resistance_ny, t, nv)
{
cell_t c;
#if !RP_HOST

real coordinate[ND_ND];

C_CENTROID(coordinate,c,t);
begin_c_loop(c,t)
{
C_PROFILE(c,t,nv)=-1846.70361906*coordinate[2]+6770.36620687;
}
end_c_loop(c,t)
#endif
}


Any help is appreciated!!!
Cheers
Well is offline   Reply With Quote

Old   November 28, 2014, 06:26
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
One of your problems is here:
Code:
C_CENTROID(coordinate,c,t);
begin_c_loop(c,t)
{
...
}
In the first line, you tell Fluent to calculate the coordinates of cell c, but Fluent has no idea which cell c is. That is what the warning "uninitialized local variable 'c' used" means.
In the second line, you tell Fluent that c should be all of the cells in thread t. Now Fluent knows which cell c should be, but that is too late.

The solution: change them: first tell Fluent which cell c is, and tell fluent to calculate the position of cell c. In code:
Code:
begin_c_loop(c,t)
{
C_CENTROID(coordinate,c,t);
...
}
The MPI problem might be something completely else, and might be much harder to solve. I don't know.
pakk is offline   Reply With Quote

Old   November 28, 2014, 07:41
Default
  #3
New Member
 
Join Date: Nov 2014
Posts: 2
Rep Power: 0
Well is on a distinguished road
You are so right. This completely solved my problem, even the MPI one!
Thank you so much.

Cheers
Well is offline   Reply With Quote

Reply

Tags
udf porous parallel

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
problem loading UDF library in parallel cluster Veera Gutti FLUENT 8 July 26, 2016 07:24
Parallel UDF problem Lindsay FLUENT 4 June 20, 2016 09:37
simpleFoam parallel AndrewMortimer OpenFOAM Running, Solving & CFD 12 August 7, 2015 18:45
problem to make a UDF parallel, the "hello world version" pilou Fluent UDF and Scheme Programming 0 March 10, 2011 08:19
Help: how to realize UDF on parallel cluster? Haoyin FLUENT 1 August 6, 2007 13:53


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