|
[Sponsors] |
January 16, 2017, 08:56 |
Auto-compile error
|
#1 |
Member
Howard
Join Date: Jun 2012
Posts: 43
Rep Power: 14 |
Hi everybody,
So I have this annoying error that pops up every day: when I save a case with a UDF library attached to it and then go to reopen it, fluent tries to do this auto-compile thing. It would be very useful, but it keeps throwing segmentation errors that don't happen when I compile the normal way. Specifically these segmentation errors happen when I use F_AREA or F_CENTROID in the DEFINE_ON_LOAD macro. From that I imagine that fluent hasn't fully loaded the mesh from the saved case yet, but I could be wrong. Anybody has an idea of how to fix this? I can give more information including the code. I'm using ANSYS Fluent 16.0 with Visual Studio 13 for compiling. |
|
January 24, 2017, 03:32 |
|
#2 |
Member
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 10 |
Hallo,
it may happen if Your UDF is using some data which is generated during the solver run like gradients of the variables. You may check Your code and comment out such places and see if UDF is loaded without errors afterwards. Then You may try to check if the data are present with constructions similar to Code:
if (NULL != THREAD_STORAGE(t,SV_U_G) ) |
|
January 24, 2017, 06:45 |
|
#3 | |
Member
Howard
Join Date: Jun 2012
Posts: 43
Rep Power: 14 |
Quote:
So, yes, I've been doing that. The code seems to reject the F_AREA, F_CENTROID, THREAD_ID macros present on the EXECUTE_ON_LOADING macro, which led me to believe that the mesh was not available during loading. Is that true? |
||
January 25, 2017, 03:31 |
|
#4 |
Member
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 10 |
Hallo,
You may try to replace EXECUTE_ON_LOADING with EXECUTE_ON_DEMAND and call the second macro before starting the iterations. Then You will be sure that the mesh and data are loaded. Regards, Maksim |
|
January 25, 2017, 14:44 |
|
#5 | |
Member
Howard
Join Date: Jun 2012
Posts: 43
Rep Power: 14 |
Quote:
So... yeah... what I have been doing (to preserve my sanity) is including everything that was in the EXECUTE_ON_LOADING in the DEFINE_INIT so that it would load after the mesh was loaded. I'd still really like to have it in the EXECUTE_LOADING macro though, but what are you gonna do. I am right in thinking that that the loading phase for the EXECUTE_ON_LOADING happens before the mesh is loaded? because that doesn't seem to make sense to me |
||
February 2, 2017, 14:50 |
|
#6 |
Member
Howard
Join Date: Jun 2012
Posts: 43
Rep Power: 14 |
Just to close the thread: the conclusion was that when using the DEFINE_ON_LOADING macro, you dont always have access to the macros that access the mesh variables like F_AREA and F_CENTROID. long story short, if you use these macros and fluent tries to auto-compile, you'll get a segmentation fault.
The solution was to move the problematic code to the DEFINE_INIT macro. The initialization is run after the mesh has been loaded and I haven't had a problem since. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DPM udf error | haghshenasfard | FLUENT | 0 | April 13, 2016 07:35 |
error compiling modified applications | yvyan | OpenFOAM Programming & Development | 21 | March 1, 2016 05:53 |
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch | gschaider | OpenFOAM Installation | 225 | August 25, 2015 20:43 |
[swak4Foam] groovyBC: problems compiling: "flex: not found" and "undefined reference to ..." | sega | OpenFOAM Community Contributions | 12 | February 17, 2010 10:30 |
Version 15 on Mac OS X | gschaider | OpenFOAM Installation | 113 | December 2, 2009 11:23 |