|
[Sponsors] |
November 27, 2014, 11:23 |
Problem w UDF parallel for porous media
|
#1 |
New Member
Join Date: Nov 2014
Posts: 2
Rep Power: 0 |
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 |
|
November 28, 2014, 06:26 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
One of your problems is here:
Code:
C_CENTROID(coordinate,c,t); begin_c_loop(c,t) { ... } 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); ... } |
|
November 28, 2014, 07:41 |
|
#3 |
New Member
Join Date: Nov 2014
Posts: 2
Rep Power: 0 |
You are so right. This completely solved my problem, even the MPI one!
Thank you so much. Cheers |
|
Tags |
udf porous parallel |
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |