CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Segmentation fault error while calculating liquid volume

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 30, 2020, 01:37
Default Segmentation fault error while calculating liquid volume
  #1
New Member
 
Ajinkya S
Join Date: Feb 2020
Posts: 4
Rep Power: 6
Aj_45 is on a distinguished road
I want to calculate the liquid phase volume of a droplet in a 2D axisymmetric domain. I have written following UDF for it. But I get segmentation fault error after the "I am here" message at the end of a time step.





Code:
DEFINE_EXECUTE_AT_END(execute_at_end)
{
Domain *domain;
Thread *t;
Thread **pt;

real volume = 0.;
cell_t c;
domain = Get_Domain(1);

mp_thread_loop_c(t, domain, pt)
Message("I am here");
if (FLUID_THREAD_P(t))
Message("Hey there!");
{
begin_c_loop(c, t)
{
volume += 2*3.1415*C_VOLUME(c, t)*C_VOF(c, pt[1]);
}
end_c_loop(c, t)
}
Message("Volume = %f", volume);
}
How do I make sure a which thread is being passed?
Thanks!
Aj_45 is offline   Reply With Quote

Old   December 30, 2020, 07:11
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
was
Code:
Message("I am here");
if (FLUID_THREAD_P(t))
Message("Hey there!");
{
to be
Code:
{
Message("I am here");
if (FLUID_THREAD_P(t))
{
Message("Hey there!");
Aj_45 likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   January 1, 2021, 00:47
Default
  #3
New Member
 
Ajinkya S
Join Date: Feb 2020
Posts: 4
Rep Power: 6
Aj_45 is on a distinguished road
Thanks for the help. Although, I used the volume integral option in Monitors tab. That solved the issue.
Aj_45 is offline   Reply With Quote

Reply

Tags
execute at end, looping over the cells, segmentation fault: 11


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
interDyMFoam - change in volume fraction gopala OpenFOAM Running, Solving & CFD 0 April 27, 2009 11:46
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 12:16
Calculating volume of Phase Pavan FLUENT 2 March 5, 2008 11:04
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 18:27


All times are GMT -4. The time now is 12:53.