CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Get Pressure and Velocity at point (https://www.cfd-online.com/Forums/fluent/102013-get-pressure-velocity-point.html)

Vitaly May 20, 2012 02:45

Get Pressure and Velocity at point
 
Hello,

I may have a basic question.

I need to write a UDF that will read a point coordinate from a table and provide me with Velocity Magnitude and Pressure values at that point. That point might not be at a node, so fluent would have to interpolate.

Is there a UDF line command to get the Velocity Magnitude and Pressure at a specific X,Y,Z location?

Thanks,

Vitaly

eishinsnsayshin May 21, 2012 14:23

I've never done this kind of thing using a UDF. In FLUENT I would typically do this via journal file(s). Lets say you have an excel sheet table of x,y,and z locations in your domain that you want to track the pressure/velocity at. The idea would be to create a bunch of point surfaces, then to create monitors for each of these surfaces. In excel I would start a new sheet and write in a column of cells the TUI command that would go into FLUENT to create a point surface. For example it might go something like this (as a text, so you will probably use the "concatenate" command in excel):
/surface/point-surface point-01 1.5 2.2 8.9
Where the "point-01" would be the desired name of your point, and the following 3 numbers are the xyz coordinates.

You could do this for all your points in a single column in excel. This would get saved as a .txt file then a .jou file and read into fluent to create all of your points. You could alternately bypass excel if you only have a few points and type that TUI input directly into fluent as a whole or step by step. for example, just type /surface into fluent and hit enter to see the list of options within that menu, then type point-surface and hit enter, etc.

Next you would need to set up a surface monitor for all your points you just created by using a different TUI command. For example:

/solve/monitors/surface/set-monitor/point-01/"Area-Weighted Average" pressure point-01 () no no yes staticpressuremonitor.mfr-01 1

You personally would have to go through fluent command by command to make sure that the command above would work for your specific case and your specific version of fluent. For example you might not want to save the monitor file as a ".mfr" file, and you might want velocity instead of pressure, etc.

You could do this in excel the same way as the point surface creation described above, or, if you don't have a lot of points, just type the TUI command into fluent directly.

So that's what I would do but I'm sure there's other ways to do it. That might get you started in the right direction.

Hope this idea helps!

Vitaly May 21, 2012 19:33

Dear Eishinsnsayshin,

Thank You for the lengthy reply. That is definitely an option for me to try. I have a cloud that consists of thousands of points, so obviously I am trying to avoid doing anything non-automated.

Thanks again!

Vitaly

sbaffini May 22, 2012 05:50

1 Attachment(s)
This is a very recurring topic. I admit it, i never had to do that, however it turns out that i have some material (UDFs) on this. With the premise that i share it with you WITHOUT ANY WARRANTY as I AM NOT THE AUTHOR of these UDFs and I NEVER USED THEM, you can try to figure out which one is better suited to your case (find them attached). Also, consider that much of them are similar if not identical, i put them all together as some may have subtle differences... just in case.

Actually, could you then share the UDF which you find is working, if any? Thanks

Edit: When you get the cell containing your point (as this is the main issue in the attached UDFs), you can use the locel cell value or use the gradient in this cell and interpolate linearly to the point from the centroid of the cell.

eishinsnsayshin May 22, 2012 07:26

My way of doing it using a journal file might not be the best way to go in your case now that I think of it. If you have thousands of points, maybe a UDF is the better way to go but I have no idea how to do it. If you had say just a few hundred (I've done around 300 pts before to get wake profiles), the journal method might be simpler, but with thousands, the solution will take forever to run, not to mention you will get a .mfr or .mon file for each point. These files can be combined to a single file using a script or something but yea I don't know; it will still output all those files....If you're dealing with that many, better to not use journals.

Maybe others have suggestions out there!

Vitaly May 22, 2012 10:00

Yes, I will look through them! Thanks a lot!

Roark April 23, 2013 19:39

Could this also be done with CFD-Post?

Roark April 25, 2013 10:39

I used CFD-Post to do this. It is very easy to make "session" files, which will probe a point given XYZ coordinates and write the flow field variables into a spreadsheet.

dcp December 28, 2014 20:58

Velocity at a given point locations
 
Hi,

Sorry for digging this old thread but have we found the UDF/ CFD-post method in fluent to get the interpolated velocity values for huge number of location points provided in excel/csv file?

Thanks,
dcp

djing April 11, 2017 06:46

Quote:

Originally Posted by sbaffini (Post 362390)
This is a very recurring topic. I admit it, i never had to do that, however it turns out that i have some material (UDFs) on this. With the premise that i share it with you WITHOUT ANY WARRANTY as I AM NOT THE AUTHOR of these UDFs and I NEVER USED THEM, you can try to figure out which one is better suited to your case (find them attached). Also, consider that much of them are similar if not identical, i put them all together as some may have subtle differences... just in case.

Actually, could you then share the UDF which you find is working, if any? Thanks

Edit: When you get the cell containing your point (as this is the main issue in the attached UDFs), you can use the locel cell value or use the gradient in this cell and interpolate linearly to the point from the centroid of the cell.

Hello dear colleague ,

Thank you for the help , I would like to ask you if you know any macro which can be used in order to give the values of velocity in each cell center of the inlet boundary condition ?
the calculation of the velocity will be imposed by an equation that i already have and it should be inside a loop that give me the possibility to apply this equation for each cell of the inlet boundary condition , actualy i found many loop in Fluent UDF user Guid ' Fludf ' so please wich loop should we use in order to resolve this probleme ?
I will be very grateful if you can help me ...

Thank you .

nishi May 26, 2017 02:07

Hello,

I am modelling solidification model in fluent. I have very less knowledge of fluent though.
Could anyone please help me,I want a file containing y,z coordinates of all cell centroids and corresponding liquid fraction at each point.

LuckyTran May 26, 2017 22:12

Quote:

Originally Posted by nishi (Post 650344)
Hello,

I am modelling solidification model in fluent. I have very less knowledge of fluent though.
Could anyone please help me,I want a file containing y,z coordinates of all cell centroids and corresponding liquid fraction at each point.

go to file solution data export

raishigeta January 26, 2020 22:06

Please Help!! I need to get velocities at points which is not at nodes (2D)
 
Quote:

Originally Posted by sbaffini (Post 362390)
This is a very recurring topic. I admit it, i never had to do that, however it turns out that i have some material (UDFs) on this. With the premise that i share it with you WITHOUT ANY WARRANTY as I AM NOT THE AUTHOR of these UDFs and I NEVER USED THEM, you can try to figure out which one is better suited to your case (find them attached). Also, consider that much of them are similar if not identical, i put them all together as some may have subtle differences... just in case.

Actually, could you then share the UDF which you find is working, if any? Thanks

Edit: When you get the cell containing your point (as this is the main issue in the attached UDFs), you can use the locel cell value or use the gradient in this cell and interpolate linearly to the point from the centroid of the cell.

I need to write a UDF that will read a point coordinate from a table and provide me with Velocity(u and v) at that point. That point might not be at a node, so fluent would have to interpolate.

Is there a UDF line command to get the Velocity at a specific X,Y location?

Did you find the UDF which is working?


All times are GMT -4. The time now is 01:33.