CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Question about cel function arg-X,Y,Z. Duplicate vertices.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 26, 2020, 06:02
Default Question about cel function arg-X,Y,Z. Duplicate vertices.
  #1
New Member
 
Hu
Join Date: Jan 2014
Posts: 22
Rep Power: 12
hcs129 is on a distinguished road
I write a CEL function for the momentum source term in my simulaiton which uses coordinates x,y,z as input.
When I print the NLOC(correspond to the number of vertices), it is 1180. However, the total number of vertices is 275.
Then I print all the x,y,z and find there are duplicate points and there are at most 6 duplicate points for the same vertices.
My question is, should I assign the same momentum source term for the duplicate points.
hcs129 is offline   Reply With Quote

Old   September 28, 2020, 07:43
Default
  #2
Senior Member
 
Join Date: Jun 2009
Posts: 1,804
Rep Power: 32
Opaque will become famous soon enough
May I ask how you found out those locations are vertices/nodes?

ANSYS CFX uses a hybrid control volume finite element based discretization approach; therefore, there are times some evaluations are done in elements, some times on vertices.

For sources, several evaluations are done on elements that have their own vertices.

Advice: read documentation for USER_CALC_INFO and find out which "location" the source is evaluated at, my guess is elements, and the additional information provided.

Say you have a mesh with 100 hex elements, and the software evaluates all the elements at once, very likely the count is either 100 (element single value), or 800 (every vertex of each element)
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
Opaque is offline   Reply With Quote

Old   September 29, 2020, 11:17
Default
  #3
New Member
 
Hu
Join Date: Jan 2014
Posts: 22
Rep Power: 12
hcs129 is on a distinguished road
Quote:
Originally Posted by Opaque View Post
May I ask how you found out those locations are vertices/nodes?

ANSYS CFX uses a hybrid control volume finite element based discretization approach; therefore, there are times some evaluations are done in elements, some times on vertices.

For sources, several evaluations are done on elements that have their own vertices.

Advice: read documentation for USER_CALC_INFO and find out which "location" the source is evaluated at, my guess is elements, and the additional information provided.

Say you have a mesh with 100 hex elements, and the software evaluates all the elements at once, very likely the count is either 100 (element single value), or 800 (every vertex of each element)
In my CEL functions, the input arguments are x,y,z. So I looped through the arguments to show the coordinates. Also I used the getvar to find out vertices coordinates.
According to your suggestion, I guess cel functions loop through elements therefore there are duplicates vertices. Thanks a lot
hcs129 is offline   Reply With Quote

Old   September 29, 2020, 13:38
Default
  #4
Senior Member
 
Join Date: Jun 2009
Posts: 1,804
Rep Power: 32
Opaque will become famous soon enough
Glad you understand where your function is being called, but please keep in mind a UserCEL Function can be called in many different ways. Your conclusion is not a generic behavior.

For example,
1 - when initializing a field like velocity, temperature, pressure it will be called on all the vertices of a domain, i.e. no duplicate entries.
2 - when called for a boundary condition, it will be called for a list of faces on the boundary, but not necessarily all the faces at once. In addition, it may be also be called for the elements touching the boundary as well; therefore, it may contain vertices adjacent to the boundary but not on it.
3 - For sources, you already saw one way to be called.

That is why is best to use the provided API's such USER_CALC_INFO, check the returned values and add a check for the valid entries you have written the function for. Otherwise, your code downstream may not be appropriate and silently return incorrect evaluations.

Hope it helps,
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
Opaque 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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 13:06
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


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