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

UDF to obtain and store node number

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By vinerm

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 20, 2020, 12:43
Default UDF to obtain and store node number
  #1
New Member
 
Shivank
Join Date: May 2019
Posts: 27
Rep Power: 6
Shiv1510 is on a distinguished road
Hello everyone,

I am trying to write an UDF to store x,y,z and node number of a 3D geometry/mesh at 1st time step. Later I want to refer the same node number and positions (at first time step) to calculate new positions of nodes in further time step. I am using DEFINE_GRID_MOTION macro to move my nodes. Is it possible to obtain the node number at any time step? If yes how can I store it in an array ?
Shiv1510 is offline   Reply With Quote

Old   March 20, 2020, 14:39
Default Define_grid_motion
  #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
Grid motion macro will anyway provide you with access to each Node. Why would you want to save the node numbers in array? Do note that these numbers will change if you use deforming mesh.
__________________
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   March 20, 2020, 15:24
Default
  #3
New Member
 
Shivank
Join Date: May 2019
Posts: 27
Rep Power: 6
Shiv1510 is on a distinguished road
Quote:
Originally Posted by vinerm View Post
Grid motion macro will anyway provide you with access to each Node. Why would you want to save the node numbers in array? Do note that these numbers will change if you use deforming mesh.
Hi Vinerm,

Thank you for your interest in my problem. I am moving the nodes in a certain fashion that requires the coordinates of that particular node from t=0. Hence I was thinking to put a marker to each node at t=0 that can be referred back at each time step for t>0. So I thought that node number would be a good option. But if you can guide me to a better idea I would be glad as I have been on this problem for quite a while and I am stuck.
Shiv1510 is offline   Reply With Quote

Old   March 20, 2020, 16:40
Default Nodes and Memory
  #4
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 can try by assuming that the nodes keep their number but I am doubtful of that if there is remeshing. The other option is UDM for nodes. Just like UDMs for cells and faces, nodes have their own UDMs where you can store whatever you want, such as, a marker. Even with UDMs, if the mesh deforms and is remeshed, nodes will be lost and along with that their UDM value will be lost as well.
__________________
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   March 20, 2020, 21:52
Default
  #5
New Member
 
Shivank
Join Date: May 2019
Posts: 27
Rep Power: 6
Shiv1510 is on a distinguished road
Yes you are write and this actually fails what I am trying to do. However, full disclosure here is my actual problem, so please share if you have any advice on this:

I am trying to write an UDF to deform and perform undulating motion on a 3D cylinder, so it can move like an eel. The picture of the cylinder is attached. I do have the equation of motion along the centerline. I have also figured the motion for a 2D case (picture attached), however to apply the logic in 3D case I need to figure out the y-coordinate of each node at t=0. Because the equation to position the nodes at each time step is different for nodes which had positive y value at t=0 and negative y value at t=0, hence I was trying to store the node number to refer the nodes but it seems like this wont work. Please share if you have any ideas and let me know if my problem was understandable.
Attached Images
File Type: jpg cylinder.jpg (52.4 KB, 9 views)
File Type: jpg eel.jpg (31.8 KB, 10 views)
Shiv1510 is offline   Reply With Quote

Old   March 21, 2020, 05:41
Default Equation of Motion
  #6
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
In my view, you do not need to store the position coordinates or node numbers. You have to look at the equation of motion that you are using. I doubt that the equation would predict the movement based on the nodes' initial position. Most likely, it would be incremental, i.e., the next position would be dependent on the current position and not on the initial position. If it is dependent on the current position, you can fetch the current position of node, then update the position based on the equation. In case the equation determines the position on the basis of original position, it would be better to transform the equation so that the motion is dependent on current position. Another option is to store original y-coordinate values in UDM. But as mentioned before, this would work as long as the remeshing is not done.
Shiv1510 likes this.
__________________
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   November 27, 2023, 21:36
Default
  #7
New Member
 
zhuoyue
Join Date: Nov 2023
Posts: 1
Rep Power: 0
yuezhuo is on a distinguished road
May I ask if you have solved this problem, I had a similar problem
yuezhuo is offline   Reply With Quote

Reply


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
UDF: How to load data from an external file into a vector EmiS Fluent UDF and Scheme Programming 17 January 14, 2019 01:55
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53
UDF to obtain total mass of species Michael.Z Fluent UDF and Scheme Programming 0 July 21, 2015 21:15
Please check out my parallelized udf code aleisia Fluent UDF and Scheme Programming 0 June 10, 2011 16:16


All times are GMT -4. The time now is 03:27.