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

Mesh Morphing UDF Issue

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 17, 2020, 16:16
Default Mesh Morphing UDF Issue
  #1
Member
 
j
Join Date: Apr 2020
Posts: 34
Rep Power: 0
buckngnr11 is on a distinguished road
Hi everyone, this might be hard to answer on here, but I'm hoping someone can help me out. I am simulating deposition on a surface. I deliver particles in Fluent, predict whether they stick or rebound from a surface, and then approximate the amount of volume the particles would take up on the surface, and use define grid motion to displace the wall boundary and simulate deposit growth. I use Define_Grid_Motion for this. I am able to do this successfully for one iteration. The mesh moves as expected and then I run flow iterations until the solution converges on the new, adjusted mesh. I then run particles through the updated flow. In the process of calculating the mass and volume of deposit in each cell, I know get a SIGSEGV error that crashes fluent that didn't occur in the first iteration. I attached an image of the portion of the code that appears to fail. If I delete the three lines where the Avgnorm components are added, the UDF works. The minute these three lines are added, I get the error and crash. This is simply a += operation that doesn't call any memory, so I don't understand why this is happening. The x-comp, y-comp, and z-comp in the loop are calculated perfectly fine, so I'm confused why dividing each by three and summing them in the loop would be an issue. I will note that when I recalculate the flow solution, it saves a new .ip file that I think is interpolated flow data. Another very odd thing I noticed. If I remove the three problematic lines and run the UDF, it works. Then if I add the lines back in and run it will calculate and work correctly. The issue only emerges when I run the particle tracks or clear all of the UDF's, and then try to run the entire code at once, with the problematic section included. This makes no sense to me.
Attached Images
File Type: jpg Screen Shot 2020-04-17 at 4.00.07 PM.jpg (39.5 KB, 26 views)
buckngnr11 is offline   Reply With Quote

Old   April 18, 2020, 16:23
Default The bug
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
You are absolutely correct in stating that a += statement should not cause a trouble. And these statements are certainly not causing any trouble. The issue most likely is with the UDMs. The statements make use the values fetched from the UDMs. Do you have a part of the code that initializes all the UDMs to some values before using those? Or do you initialize these UDMs via patch or Initialize before starting the simulation? If not, do that before compiling the code. To debug the code, try replacing the xcomp, ycomp, and zcomp in those equations with some constant values.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 18, 2020, 16:31
Default The Bug
  #3
Member
 
j
Join Date: Apr 2020
Posts: 34
Rep Power: 0
buckngnr11 is on a distinguished road
Thanks for the reply. I have an executable that I run that loops through every UDM and clears the values. I run this and then plot the UDM and make sure everything is cleared (this works). Then, those UDM's are filled in with the DPM UDF. I check these after I run the particles, and the UDM values are all there and all work correctly. The three UDM's called into xcomp, ycomp, and zcomp are all working fine. Like I said what is very unusual to me, is that if I get rid of the lines that calculate the Avgnorms, there is no failure. The xcomp, ycomp, and zcomp call the UDM just fine. It's only when I add those lines back in that there is an issue. Any chance that this could be due to a memory allocation issue?
buckngnr11 is offline   Reply With Quote

Old   April 18, 2020, 16:45
Default May Have Found it
  #4
Member
 
j
Join Date: Apr 2020
Posts: 34
Rep Power: 0
buckngnr11 is on a distinguished road
Okay I think I might know where the issue is. After moving the mesh, I then run the flow calculation, but I realized that after the iterations are run, the console says "Registering UDFsource and Registering UDFLib". The particle tracking stats also appear even though I did not run the particle tracks. Does this have something to do with the profle update interval option in the calculation settings? If this is set to the default (1), is the UDF calculating every iteration? If I want to stop the particle tracks from automatically running and also stop the UDF from calculating until I hit execute_on_demand, how do I achieve this?
buckngnr11 is offline   Reply With Quote

Old   April 20, 2020, 03:30
Default Particle Tracks and Execute on Demand
  #5
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
Particle are tracked as per user's DPM setup. If you do not want those to be tracked, either disable Interaction with Continuous Phase under DPM or increase the number of Continuous Phase Iterations to a high number. As far as Execute on Demand is concerned, you may use DEFINE_ON_DEMAND instead of whatever DEFINE_ macro you are using right now.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Reply

Tags
morphing mesh, particle agglomeration, udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
How to check residuals in UDF for dynamic mesh? Prikane FLUENT 3 May 8, 2019 09:33
[snappyHexMesh] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! divergence OpenFOAM Meshing & Mesh Conversion 0 January 23, 2019 04:17
Mesh morphing in parallel: procBoundary faces don't match after many iterations jmf OpenFOAM Programming & Development 0 February 4, 2017 13:22
Gambit problems Althea FLUENT 22 January 4, 2017 03:19
[snappyHexMesh] SnappyHexMesh for internal Flow vishwa OpenFOAM Meshing & Mesh Conversion 24 June 27, 2016 08:54


All times are GMT -4. The time now is 06:57.