CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   segmentation fault in multiphase flow simulation (https://www.cfd-online.com/Forums/fluent/215510-segmentation-fault-multiphase-flow-simulation.html)

Zhao Weijie March 7, 2019 05:54

segmentation fault in multiphase flow simulation
 
Hello everyone, I'm doing a multiphase flow simulation using mixture model. I want to calculate wall shear stress during iteration and store it for postprocessing purpose. I use the DEFINE_ON_DEMAND macro to achieve this, and the whole udf is in the screenshot below. Everything is fine when l build library and load this udf, which, I think, means compilation is no problem. But when I try to hook the compiled udf to Fluent, segmentation fault comes up as below. I've read some relevant posts on this forum, but their solution just don't work for me.:o:o:o Anyone can help?

https://www.cfd-online.com/Forums/me...stress-udf.png
https://www.cfd-online.com/Forums/me...tion-fault.png

Best regards,

Zhao

MKuhn March 7, 2019 06:13

Why you will use a macro? Did you try to write a simple output file using "Report Definitions" --> "Monitors" --> "Report Files"?

Zhao Weijie March 7, 2019 09:00

Quote:

Originally Posted by MKuhn (Post 727082)
Why you will use a macro? Did you try to write a simple output file using "Report Definitions" --> "Monitors" --> "Report Files"?

Thank you for your advice MKuhn, I'm sure I have tried this method before, but somehow it didn't work and I conjectured that it's because my case is a multiphase flow problem, which tend to be more complicated. But I will try this again to make sure if I'm wrong or not. I'll share progress with you later, thank you!

LuckyTran March 7, 2019 15:23

Did you forget to go to user defined memory and allocate space for the var?

Zhao Weijie March 7, 2019 20:32

Quote:

Originally Posted by LuckyTran (Post 727146)
Did you forget to go to user defined memory and allocate space for the var?

Hi Tran, I didn't forget UDM space allocation, because I just follow the Fluent customization manual. But thanks anyway[handshake].

LuckyTran March 8, 2019 07:32

Did you initialize the case before hooking the udf?

Instead of just saying I've tried stuff and it didn't work. Tell us what you've done?

Zhao Weijie March 9, 2019 21:56

Quote:

Originally Posted by MKuhn (Post 727082)
Why you will use a macro? Did you try to write a simple output file using "Report Definitions" --> "Monitors" --> "Report Files"?

Hi MKuhn, hope you had a good time. I have rearranged my calculation using "report files" to calculate wall shear stress in my multiphase problem. But the segmentation fault message still exists. In the process, I wrote a user-defined definition of wall-shear-stress first using the DEFINE_REPORT_DEFINITION_FN macro, and then I assigned it to the report file. Anything wrong?

Zhao Weijie March 9, 2019 22:03

Quote:

Originally Posted by LuckyTran (Post 727240)
Did you initialize the case before hooking the udf?

Instead of just saying I've tried stuff and it didn't work. Tell us what you've done?

Hello Tran, hope you had a good time too. How negligent I was to forget details you need to help address my problem. I did initialize the case before hooking the udf. And now I try to initialize the case after hooking the udf. But unfortunately, it just didn't work out. If you need any other details, just let me know. Thanks.

MKuhn March 11, 2019 02:50

Quote:

Originally Posted by Zhao Weijie (Post 727333)
Hi MKuhn, hope you had a good time. I have rearranged my calculation using "report files" to calculate wall shear stress in my multiphase problem. But the segmentation fault message still exists. In the process, I wrote a user-defined definition of wall-shear-stress first using the DEFINE_REPORT_DEFINITION_FN macro, and then I assigned it to the report file. Anything wrong?


Hi Zhao Weijie, sorry I'm not an expert in UDF. Did you check that the segmentation fault message is caused by your UDF? Did you try to run your case without the UDF?


All times are GMT -4. The time now is 09:26.