
[Sponsors] 
March 20, 2020, 12:43 
UDF to obtain and store node number

#1 
New Member
Shivank
Join Date: May 2019
Posts: 13
Rep Power: 2 
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 ? 

March 20, 2020, 14:39 
Define_grid_motion

#2 
Senior Member

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 on the Forum 

March 20, 2020, 15:24 

#3  
New Member
Shivank
Join Date: May 2019
Posts: 13
Rep Power: 2 
Quote:
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. 

March 20, 2020, 16:40 
Nodes and Memory

#4 
Senior Member

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 on the Forum 

March 20, 2020, 21:52 

#5 
New Member
Shivank
Join Date: May 2019
Posts: 13
Rep Power: 2 
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 ycoordinate 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. 

March 21, 2020, 05:41 
Equation of Motion

#6 
Senior Member

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 ycoordinate values in UDM. But as mentioned before, this would work as long as the remeshing is not done.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared on the Forum 

Thread Tools  Search this Thread 
Display Modes  


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 