July 2, 2018 at 12:03 pmmatusSubscriber
I am trying to incorporate a very simple UDF code into my problem, but it shows segmentation fault. The UDF code attached here works with other 2d geometries. I have checked the possible reasons for segmentation faults, like checking allocated memory locations number, zone id no ..etc.but not able to solve this issue.
I would be very thankful if someone can help me.
The simplified geometry and UDF code are attached.
July 2, 2018 at 12:50 pmKarthik RAdministrator
Segmentation fault generally occurs because of multiple reasons. Here are a few: if your code
- is trying to access incorrect memory locations.
- is incorrectly compiled.
- is not accessing the right zone.
- has something hard-coded (when it is not supposed to be).
Here is some general thoughts that I have employed in past to debug UDF errors.
- Check if you have allocated the correct number of UDMIs in Fluent and they match with your UDF.
- Make sure your UDF is being complied properly (without any errors or even warnings). It is important to read the compiled text line by line. There have been multiple scenarios in past where I skim through the compilation (and assume everything is right) and I have overlooked compilation errors. This also generally identifies syntactical errors.
- Are you accessing the correct zone in your UDF (zone IDs can be accessed in the boundary conditions panel)?
- If your UDMIs are physical quantities / source terms / BCs etc., try to appropriately plot them as contours plots right after initialization. If you are not able to see the correct values in your contours, there could be a problem and you might have to revisit your UDF.
- Another way I debug my code is using 'fprintf' or 'message' commands where ever necessary / possible. This way I ensure that my UDF is behaving the way it should. Please refer to the Fluent customization manual for more details.
- If my UDF contains a lot of macros, I try to debug one macro at a time. It is easy to isolate errors if your code is simple.
I hope these pointers help you debug your code. If your code is working correctly on other 2d geometries, it is likely that there is something hard-coded in your UDF (which might not be generic).
July 3, 2018 at 3:00 ammatusSubscriber
Thanks for all your detailed suggestions.
I have followed all of your suggestion.
- 3 UDMI are used in UDF so 3 memory locations are allocated.
- it is not showing any error message after compilation
- rechecked the zone id
- UDF is very simple and only using one macro
But still, the error exists..
July 4, 2018 at 2:05 pmKarthik RAdministrator
Could you please post a screenshot of your UDF?
July 4, 2018 at 2:30 pmmatusSubscriber
Thread *t = Lookup_Thread(d,zone_id);
if(NNULLP( THREAD_STORAGE(t, SV_P)))
July 5, 2018 at 6:12 amDrAmineAnsys Employee
Help yourself by adding some debugging messages which will show you where the error might happen. Moreover check if you are really solving transient.
December 8, 2018 at 7:41 pmzypresse91Subscriber
Dear all thanks for the discussion, it gives me such insight about my project.
Still, I have to ask since I couldn't manage to run it properly.
My system is composed of 3 bodies, and the middle body will be the host of a reaction. All those three systems have the porous zone option activated. I want the water liquid which flows through the undermost body and arriving the porous jump boundary, passing through this boundary, reacting with the chemicals I designated in the middle body, creating those other products, and finally once again those products for this time passing through the second porous jump boundary and reaching to the uppermost body.
I hope you could imagine the system. Now I created 2 cell zones just above these porous jump boundaries with a width of 1 grid cell which was 8 m for my case, and also set the Y velocities of those interior cell zones as 0. Logically, since they are just above the porous jump boundaries they are actually in-situ of the reaction area(the middle body). So, I did activate the porous zone and reaction options for my cell zones, and set '0' value for the Y velocities in the fixed values tab (A researcher who encountered the same problem proposed this method, so I wanted to give it a try.).
December 8, 2018 at 7:54 pmzypresse91Subscriber
My problem is that I keep getting this error of Segmentation fault due to the zero flow at porous jump boundary. I tried to create cell zones just above the porous jump boundaries and set their Y-velocities as '0' to ensure that there's no slip in-situ boundaries. It didn't work out. Also for the values of porous jump boundary condition, how do I assign them?(I know that thickness is '0') If you could share your e-mail adresses with me , I would be much appreciated and grateful for giving me some insight on that matter. Cheers,Selvi.
December 11, 2018 at 2:53 ammatusSubscriber
Hai...did you manage to solve your problem?
December 11, 2018 at 2:43 pmDrAmineAnsys Employee
Check this thread if it is helpful for you: https://studentcommunity.ansys.com/thread/segmentation-fault-error-due-to-zero-flow-at-porous-jump-boundary/ if not create a new thread with your question and add more information.
- You must be logged in to reply to this topic.
Simulation World 2022
Check out more than 70 different sessions now available on demand. Get inspired as you hear from visionary companies, leading researchers and educators from around the globe on a variety of topics from life-saving improvements in healthcare, to bold new realities of space travel. Take a leap of certainty and check out a session today here.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Heat transfer coefficient
- What are the differences between CFX and Fluent?
- Floating point exception in Fluent
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Getting graph and tabular data from result in workbench mechanical
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
© 2022 Copyright ANSYS, Inc. All rights reserved.