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

Cell number from UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 21, 2017, 10:21
Default Cell number from UDF
  #1
New Member
 
Rakesh
Join Date: Jan 2014
Location: Delft
Posts: 13
Rep Power: 12
rsarma is on a distinguished road
Hello,

I am writing a parallel UDF code for a deforming mesh problem. Basically I want to update the cells of a boundary at every time step. This update is based on a matrix which I read into my code. Each element of this matrix corresponds to a cell centre in the boundary that needs to be updated.

My problem is since the mesh is updating at each time step, it's coordinates change. As such, I cannot identify the cells and read the matrix values for a particular cell.

I was wondering if it possible to write the cell ID to a file? Or could you kindly give me any other suggestions?

Best,
R
rsarma is offline   Reply With Quote

Old   March 23, 2017, 08:33
Default
  #2
Member
 
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 9
kirmaks is on a distinguished road
Hallo,

I've recently thought about similar problem. You may use UDM to store the cell's ID and then use it to get the required element of the matrix. Several steps are required:

1. store the cell's number and its coordinates (if required) in UDM, you may also save these data in a text for analysis how to order the elements in the matrix (DEFINE_ON_DEMAND).

2. use the stored ID's from UDM to access the matrix elements during iterations.

That's it, good luck and have a nice day.
Regards, Maks
kirmaks is offline   Reply With Quote

Old   March 23, 2017, 09:00
Default
  #3
New Member
 
Rakesh
Join Date: Jan 2014
Location: Delft
Posts: 13
Rep Power: 12
rsarma is on a distinguished road
Hi Maks,

Thank you for the reply. I will implement it. What is actually the macro for extracting the cell ID. I saw somewhere there is C_ID(cell_t c,Thread*t), but I am not quite sure if this exists as I could not locate it in the fluent udf manual. Could you kindly let me know?

Best,
R
rsarma is offline   Reply With Quote

Old   March 23, 2017, 09:12
Default
  #4
Member
 
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 9
kirmaks is on a distinguished road
I'm not sure, You may define Your own indexing based for example on the coordinates. May be looping is also always done in the same order. You may check it. It also states in the help that
Quote:
face_t is an integer data type that identifies a particular face within a face thread.
cell_t is an integer data type that identifies a particular cell within a cell thread.
so You may check what value has the appropriate variable when You are looping throug the cells or faces.
Regards, Maks
kirmaks 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
decomposePar no field transfert Jeanp OpenFOAM Pre-Processing 3 June 18, 2022 12:01
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 09:42
foam-extend_3.1 decompose and pyfoam warning shipman OpenFOAM 3 July 24, 2014 08:14
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 15:03
FvMatrix coefficients shrina OpenFOAM Running, Solving & CFD 10 October 3, 2013 14:38


All times are GMT -4. The time now is 19:16.