Importing fluid dynamics data from an engineering simulation software like ANSYS

I am new to Unreal and working on a simulation for a fire emergency scenario on a hospital floor. To achieve a real life based fire simulation, the data for the fire growth and smoke modelling, etc. are to be bought in through an engineering simulation software like Ansys and C-fast. Is there any way to script in that data into UE4s particle system? This is very important to me. If there is anything else that can be done to achieve similar results. Thank you so much.

1 Like

I was up to a similar thing and found some kind of a workaround:

You can export for example the Velocity field with Ansys post-processor as .csv file.
But to import it in UE you’ve got to manipulate it first because UE can just import .fga files (I think there’s an entry about this on https://docs.unrealengine.com .
So you want to have a .fga file which you can achieve by simply renaming from File.csv to File.txt and then File.fga .
BUT it’s still not that simple. The .fga data needs a header which consists of this: Number of nodes in x-y and z-direction respectively, spatial extension of the desired vectorfield.

If you want/still are interested in this topic I can send you some sample files, which will help hopefully :wink:

1 Like

Hi SalvusApfel! I am glad someone else has been trying to do a similar thing. I would like you to know that since it has been a long time that I posted this question. I have made it possible by using the Ensight tool provided by ansys to convert data files like FDS to get .obj files and then sequencing them in max to make a flipbook for Unreal engine.

I would really like to explore your method as well. Please if you can provide the details of the workflow.

Thanks!

1 Like

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

Hi SalvusApfel,

I’m trying to achieve something similar to SoorajSynyster for an architecture project, however, I’m trying to simulate outdoor airflow and exporting my .csv from grasshopper.
Are you able to explain a little more about how I sort the .csv file in Matlab? I’ve never used the program, nor am I amazing at math, so I don’t really know where to start haha…

I would really appreciate the help :slight_smile:
Thanks!

Hello! I am trying to do the same thing for a project too. Have you been able to do it?