|
[Sponsors] |
Error after adding (Interpreted) the UDF code |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 26, 2018, 15:00 |
Error after adding (Interpreted) the UDF code
|
#1 |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Dear All,
I Interpreted a UDF code. When I want to solve it, the following error occurs ! Please help me. Thanks a lot. |
|
October 26, 2018, 16:04 |
|
#2 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66 |
SIGSEGV is a segmentation fault which happens when you try to access a variable that doesn't exist. You probably got a printout for each processor/thread you were running Fluent on.
If no compilation problems, then check to make sure you ran the UDM before activating the UDF, you need to allocate space for the variables eventually called by the UDF. It might help to post the contents of your udf. |
|
October 26, 2018, 16:11 |
|
#3 | |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Quote:
I successfully interpreted the UDF code in Fluent. But when I want to solve it, the error occurs. What is the UDM? How can I run the UDM before activating the UDF? How can I allocate space for the variables eventually called by the UDF? Please help me. My UDF file is attached by this post. |
||
October 27, 2018, 15:29 |
|
#4 |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Where is the one who helps me? Please please help me...
Thank you in advance. |
|
October 29, 2018, 10:23 |
|
#5 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
Hi ebtedaei,
LuckyTran's suggestion about UDM (User-Defined Memory) was just a guess about the most common way to reach that error. Now that we can see your UDF, it is clear that this is not the issue here. In your UDF, you look up the value of "C_VOF(c,pt[5])" -- which immediately requires that you have a multiphase model with at least 6 phases. Is that correct in your model? Also, "C_MU_L(c,pt[5])" implies that viscosity is calculated and stored for each phase. Is that correct? A crude but effective way to check would be to add these lines to your UDF (before the first calculation "alfa="): Code:
Message("Here in cell_viscosity, C_VOF(c,pt[5]) = %g\n", C_VOF(c,pt[5])); Message("Here in cell_viscosity, C_MU_L(c,pt[5]) = %g\n", C_MU_L(c,pt[5])); Good luck! Ed |
|
October 30, 2018, 04:58 |
|
#6 | |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Quote:
I will test your suggested commands and inform you of the results. I have just three phases including Water, Air and Powdered material in micron size as the third fluid. Fluent software itself has defined the third fluid as the fifth phase!!! I just want to mix water (the first fluid) and the third fluid to produce a suspension by mixture model. Of course, before simulating the mixture model as secondary step, I've simulated water and air with the VOF model in first step. I just want to change the viscosity of the third fluid based on its volume fraction inside the computational domain. The image of the equation is attached by this reply. In this equation, μm is the mixture (water and the third fluid) viscosity, μc is the continuous phase (water) viscosity, and alpha (d) is the powder (the third fluid) volume fraction. The fact is that one of my friends has written this UDF code for me!!! Thanks a lot. Last edited by ebtedaei; October 30, 2018 at 08:56. |
||
October 30, 2018, 08:54 |
The results of your suggested commands
|
#7 |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
I used your suggested commands but the UDF code did not interpreted! When I interpreted the code, the attachment error occurred!
|
|
October 30, 2018, 08:55 |
|
#8 |
Senior Member
Join Date: Sep 2017
Posts: 246
Rep Power: 12 |
Hi ebtedaei,
There are occasions where secondary phases are referred to by thread ID numbers, but this is not one of them -- go and look in the manual for C_VOF. If you have water as primary phase, air as secondary phase 1 and powder as secondary phase 2, then the volume fraction of powder is "C_VOF(c,pt[2])". If you can use a constant value for mu_c (the viscosity of water), rather than looking it up from Fluent's cell value, then this will save a lot of trouble. If you set up Fluent to use a mixture viscosity, as supplied by this UDF, then Fluent does not calculate (and, even more certainly, does not store) viscosities for all the separate phases. So, I am doubtful that C_MU_L lookups will work (though I could be wrong, depending on exactly how you have set up viscosity). Good luck! Ed |
|
October 30, 2018, 09:18 |
Question?
|
#9 |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Did I use your suggestions correctly in the following code?
Last edited by ebtedaei; October 30, 2018 at 14:10. |
|
October 30, 2018, 13:33 |
|
#10 | |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Quote:
Again, thank you for your guides. At first, I have a question you --- Why are the IDs of different phases not regular in Fluent? that's mean, water ID= 1, Air ID= 2 and Third phase ID= 3. In the following, I will answer your sentences above one by one: - Yes, I have water as primary phase, air as secondary phase 1 and powder as secondary phase 2 (the attached shapes). But I do not know why Fluent has different IDs assigned to the phases!!! With this, can I the ID of the volume fraction of powder assign equal with 2 ("C_VOF(c,pt[2])")? - I think that I can use a constant value for mu_c (the viscosity of water= 0.001003) as the attached code called "Viscosity by Ed (2)"! What do you think? Thanks |
||
December 18, 2018, 13:59 |
|
#11 | |
Senior Member
ali
Join Date: Jul 2016
Posts: 147
Rep Power: 10 |
Quote:
Thanks so much |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Interpreted UDF | Bikash | FLUENT | 10 | December 3, 2019 01:52 |
HELP! adding a mass source to VOF eqn. by UDF??? | ROOZBEH | FLUENT | 5 | December 3, 2016 18:53 |
conjugateHeatFoam + interFoam | farhagim | OpenFOAM Programming & Development | 15 | July 19, 2016 08:55 |
chtMultiRegionSimpleFoam | samiam1000 | OpenFOAM Running, Solving & CFD | 39 | March 31, 2016 09:43 |
Problem interpreted Reaction Code | oTopero | FLUENT | 11 | November 24, 2015 07:25 |