how to search all cells that have the same value of x[0]
Hi, All,
Thank you for taking your time. I have a problem on how to loop search all cells that have the same value of x[0] in a domain using UDF of FLUENT. Thanks, lig |
If you want to do it for the same value of x[0] each time, you can mark the cells (Adapt > Mark), which you can then access in your UDF as a separate zone. Otherwise I see no better alternative than to loop over all cells and check x[0].
|
Try this unchecked code...It is a partial UDF, in that I don't know where you're using it (DEFINE_PROPERTY, etc...), but it should loop over all threads and all cells in a domain. Note that this assumes your UDF is passed a domain pointer.
Code:
real value_to_search_for; |
Hi, ComputerGuy,
Really thank you for the reply. I was working on my code using the similar method you mentioned. However, I could not be able to make the program work. The main purpose is to get the summation of values of cells in same rows of a zone (the code is for the source term in UDS and applied for a porous zone). If possible, could you please help me to check the code I wrote? If so I am really appreciated, and please tell me your email address that I can sent the code file to you. Thanks and Happy New Year, Lig |
Check your inbox. Reply with your code.
Cheers! |
All times are GMT -4. The time now is 23:10. |