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

Monitor Points/Surfaces

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 22, 2020, 06:04
Default Good
  #21
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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.
vinerm is offline   Reply With Quote

Old   March 24, 2020, 01:11
Default
  #22
Member
 
Mohinder Suresh
Join Date: Dec 2014
Posts: 32
Rep Power: 11
Mohinder Suresh is on a distinguished road
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
Mohinder Suresh is offline   Reply With Quote

Old   March 24, 2020, 02:53
Default Q-Criterion
  #23
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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.
vinerm is offline   Reply With Quote

Old   March 26, 2020, 06:59
Default
  #24
Member
 
Mohinder Suresh
Join Date: Dec 2014
Posts: 32
Rep Power: 11
Mohinder Suresh is on a distinguished road
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
Mohinder Suresh is offline   Reply With Quote

Old   March 26, 2020, 07:05
Default Q gradients
  #25
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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.
vinerm is offline   Reply With Quote

Old   March 26, 2020, 07:12
Default
  #26
Member
 
Mohinder Suresh
Join Date: Dec 2014
Posts: 32
Rep Power: 11
Mohinder Suresh is on a distinguished road
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
Mohinder Suresh is offline   Reply With Quote

Old   March 26, 2020, 07:16
Default Uds
  #27
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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.
vinerm is offline   Reply With Quote

Old   March 26, 2020, 07:17
Default
  #28
Member
 
Mohinder Suresh
Join Date: Dec 2014
Posts: 32
Rep Power: 11
Mohinder Suresh is on a distinguished road
Im referring o this post:
Gradient of the Custom Field Function
Mohinder Suresh is offline   Reply With Quote

Old   March 26, 2020, 07:21
Default Cff
  #29
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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.
vinerm is offline   Reply With Quote

Old   April 1, 2022, 09:32
Default
  #30
New Member
 
serg
Join Date: Dec 2015
Posts: 28
Rep Power: 10
kont87 is on a distinguished road
Quote:
Originally Posted by Mohinder Suresh View Post
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
Hello Mohinder,

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
kont87 is offline   Reply With Quote

Old   April 5, 2022, 01:06
Default
  #31
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
show your code and error log if you need help
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ 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



All times are GMT -4. The time now is 02:44.