Good
That's good. Let me know if you need further help.
|
Good morning vinerm,
thanks to your help, i was able to get the UDF working (at least in serial mode)! It is perfectly doing what it is supposed to be now and when I finnished the parallelization I will post the final solution here! Now I am wondering if it is possible to also interpolate the q-criterion in these desired points! I've read some threads regarding custom field functions and user defined scalars, but i dont know what will be the most elegant solution as I not only need the values of Q in the cell centers, but also the derivatives for the final interpoaltion! Do you have any suggestions how to approach this problem? Thanks in advance!! Mohinder |
Q-Criterion
As far as defining a Custom Field Function is concerned, it is easy. You can refer the following
useful-les-tools-fluent As far as UDF is concerned, though strain rate is directly available, vorticity is not. So, you have to use velocity gradients to define Q-criterion. You can fetch gradients or reconstruction gradients using C_DUDX(c, t), C_DUDY(c, t), etc. These can also be fetched using C_U_G(c, t)[0], where 0 implies x and so on. You may have to issue the following command in your setup before the gradients become available because Fluent does not store those values. solve set expert And then Yes as a response to the question to keep the temporary memory from being freed. Then using these gradients, you can define q-criterion and write it to file. |
Thank you for your reply!
I think that both ways only give me the values of q at the node centers, but I also need the gradients of q to finally interpolate the value at the desired monitor points. Is there a way to also get access to the gradients of q? Greets Mohinder |
Q gradients
As such, q-criterion is not defined as a primitive variable in Fluent. Therefore, its gradients are not available as well. So, the only way is to determine its gradient from its definition (using a pencil and paper) and then make use of that equation to determine its gradients within UDF. Do note that all values starting with C_ are cell center based. To fetch values at nodes, you have to loop over nodes.
|
Yes, that would be a solution...
but I also found this example in the manual (example2) Do you think that this would also be an option? https://www.afs.enea.it/project/nept...udf/node20.htm |
Uds
This will increase an equation in your case. Fluent solves full conservation equation for UDS. In my view, this would be an overkill just to fetch q-criterion at some points. Secondly, you have to ensure that despite UDS being solved, its values are determined on the basis of velocity gradients.
|
Im referring o this post:
https://www.cfd-online.com/Forums/fl...-function.html |
Cff
There are no options (nor is there any requirement) to determine gradients of CFF. Gradients are available only for field variables. CFF is a field variable but an algebraic one. So, only those fields for which conservation equation is solved need their gradients because flux need to be determined at the faces for solving the equation.
|
Quote:
Did you manage to use the code in parallel? I want to extract Cp and V from more than 2000 points, which are defined in a separate file(as was in your case) I used your udf to test it, I appreciated, however, when I try to use it in parallel cores (160 cores) it gives me an error, and it seems that udf needs parallelization. I am a newbie in udf usage, any help is welcome. Regards Sergen |
show your code and error log if you need help
|
All times are GMT -4. The time now is 17:10. |