|
[Sponsors] |
Question about cel function arg-X,Y,Z. Duplicate vertices. |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 26, 2020, 06:02 |
Question about cel function arg-X,Y,Z. Duplicate vertices.
|
#1 |
New Member
Hu
Join Date: Jan 2014
Posts: 22
Rep Power: 12 |
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. |
|
September 28, 2020, 07:43 |
|
#2 |
Senior Member
Join Date: Jun 2009
Posts: 1,804
Rep Power: 32 |
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. |
|
September 29, 2020, 11:17 |
|
#3 | |
New Member
Hu
Join Date: Jan 2014
Posts: 22
Rep Power: 12 |
Quote:
According to your suggestion, I guess cel functions loop through elements therefore there are duplicates vertices. Thanks a lot |
||
September 29, 2020, 13:38 |
|
#4 |
Senior Member
Join Date: Jun 2009
Posts: 1,804
Rep Power: 32 |
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. |
|
|
|
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 |