Importing fluid dynamics data from an engineering simulation software like ANSYS

Hey SoorajSynyster!
So as I said am I importing a .fga file into UE which lets me then place it as a vector field actor into the world. Then I put Cascade emitters into the vector field and let them follow the vector field.
The structure of the desired .fga files is pictured in the image file I attached 1. So basically it is a comma seperated table with 3 columns. Every column stands for one spatial direction (x,y,z). The first row indicates how many nodes should exist in each direction. Then you’ve got two rows with the size vectors of the vector fields. Usually I take number of nodes*-50 for direction #1 vector and number of nodes*50 for direction #2 vector. Then I append the velocity vectors I get from ansys (the “main”).

I attached another image which hopefully helps in understanding how UE places the nodes from the .fga file to world space2

Now, how do I do this?
I export a .csv file from Ansys which gets me the location of each node (x,y,z) and its velocity (u,v,w) of the simulation. Important thing here is your nodes have to be arranged in a cuboid!

Then I import the .csv file in Matlab. I let Matlab sort the data-rows by x,y and z respectively to get the spacial arrangement UE “understands”. Then just the velocity columns are read out and “header” gets added on top of the data. I seperate each entry of this matrix with a comma, save it as “sample.txt” and rename it to “sample.fga”.

I also attached cubicalsamplefield.txt which shows you a manually created vectorfield I used to reverse engineer the spacial arrangement of nodes in UE. If you rename it to “cubicalsamplefield.fga” you can directly import it into UE (just drag and drop it to your content browser).

Hope this helps!

1 Like