Problem w UDF parallel for porous media
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 |
One of your problems is here:
Code:
C_CENTROID(coordinate,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) |
You are so right. This completely solved my problem, even the MPI one!
Thank you so much. Cheers |
All times are GMT -4. The time now is 22:03. |