|
[Sponsors] |
March 22, 2020, 06:04 |
Good
|
#21 |
Senior Member
|
That's good. Let me know if you need further help.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
March 24, 2020, 01:11 |
|
#22 |
Member
Mohinder Suresh
Join Date: Dec 2014
Posts: 32
Rep Power: 11 |
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 |
|
March 24, 2020, 02:53 |
Q-Criterion
|
#23 |
Senior Member
|
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.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
March 26, 2020, 06:59 |
|
#24 |
Member
Mohinder Suresh
Join Date: Dec 2014
Posts: 32
Rep Power: 11 |
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 |
|
March 26, 2020, 07:05 |
Q gradients
|
#25 |
Senior Member
|
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.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
March 26, 2020, 07:12 |
|
#26 |
Member
Mohinder Suresh
Join Date: Dec 2014
Posts: 32
Rep Power: 11 |
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 |
|
March 26, 2020, 07:16 |
Uds
|
#27 |
Senior Member
|
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.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
March 26, 2020, 07:17 |
|
#28 |
Member
Mohinder Suresh
Join Date: Dec 2014
Posts: 32
Rep Power: 11 |
Im referring o this post:
Gradient of the Custom Field Function |
|
March 26, 2020, 07:21 |
Cff
|
#29 |
Senior Member
|
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.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
April 1, 2022, 09:32 |
|
#30 | |
New Member
serg
Join Date: Dec 2015
Posts: 28
Rep Power: 10 |
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 |
||
April 5, 2022, 01:06 |
|
#31 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
show your code and error log if you need help
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|