CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Is real time indoor airflow modeling possible? (https://www.cfd-online.com/Forums/main/253901-real-time-indoor-airflow-modeling-possible.html)

open_a_window January 8, 2024 22:52

Is real time indoor airflow modeling possible?
 
Hi All -


I am an artist wondering if it is possible to model indoor airflow in real time? I am guessing it would involve an installation of anemometers in a room sending data do a CFD program.


I have very little knowledge of CFD (I am proficient in Fusion360 drawing (not CFD) and have messed around a little bit in Simscale)


Does anyone have any experience with this? Is this even possible?



Thanks,



Nick

aerosayan January 9, 2024 03:35

Wow, that's very cool.

Generally fluid simulation for scientific research is extremely costly, so they're not real time.

However, in gaming industry, they've figured out some ways to approximate the fluid simulations in a way that's very easy to compute, and allow them to do realtime fluid simulations.

Unreal Engine has many examples on water simulation for oceans, rivers, waterfalls.

Recently, they've also been able to do realtime gas simulations, as seen in this video: https://youtu.be/hmO2Vvcr4JA

So, you can google more on "Unreal Engine realtime fluid and gas simulation" to learn more, and maybe that will be helpful in finding what you wanted.

But I'm not sure about the anemometer thing, because they don't provide data for the whole room.

It might be better to use motion capture, or "computer vision" methods to figure out where thet people are in the room, then ******approximiate****** how the fluid motion will look inside the room.

Best of luck.

sbaffini January 9, 2024 16:41

Not sure about the details and how close to real time it is, but ansys discovery does something like that.

In general, conceptually, yes, it is doable. BUT, shortcuts must be taken. It is also very easy to understand why.

Take the most efficient algorithm to advance the equations of 1 time step. Say, it will need N flops per cell per time step. People from the 80s or older would be fine with 24 time steps per second, but gen z princesses seems to get eye stress for anything under 60 fps, so let's take that as measure, which puts us in need of 60N flops per cell.

Now, pick up your hardware, and you have fixed your flops, say, X. Which means that, you can respect the prescribed fps only with up to X/(60N) cells... and these are pretty much ideal and simplified conditions.

What is then the problem? There are several. First, fluid flows have cells per length requirements that are function of the problem: your given hardware will practically allow real time resolution only of problems up to a certain size.

Second, such requirements are not constant in time and/or space, so there is not an algorithmically global optimum giving you the min N. If N is too low, you are probably wasting time in a lot of cells and/or time steps, otherwise optimal resource occupation will imply a larger N. In practice, there is a barrier which can't be crossed without wasting resources

Third, the most efficient algorithms also have a link between the number of cells and number of time steps required, which means that for a given problem (number of cells) you might actually need to do much more than 60 time steps per second in order to stay real time.

Finally, the reverse reasoning might simply tell you that for a given problem size and algorithm there simply isn't any reasonable hardware to actually have the computation run in real time.

All of the above is true in general and, to the best of my knowledge, there isn't any tool out there actually capable to do real time computations for general flows on somewhat arbitrary hardware.

What video games do (when they don't annoy gen z with non stable fps lower than 60) is cutting corners on N. They take it low by opportunistically breaking the physics of the solver, so that the visual part is still convincing but there is no more a link with the number of cells (so they can be sized on the hardware) and between the latter and the number of time steps (so that you can surely stay into a certain number of time steps per second independently from the problem and number of cells).

Long story short, it can be done, but for most cases you need to either break the physics, relax what you mean by "real time" or invest on some unrealistic hardware for the purpose.

open_a_window January 10, 2024 14:14

Thanks Paolo -



To be honest a lot of this goes over my head but its exciting to hear that it is theoretically/ practically possible.



I am not sure if we will have access to exceptional compute power -it is a project in collaboration with a arge university, so maybe.



If not, I am am fine to fill in gaps with algorithm.



What do you think would be the minimum spacing of anemometers in the array? 3 meters? I think a hot wire anemometer is the only type sensitive enough to detect indoor airflow. However, it does not sense direction. Does this present a problem?


Do you have recommendations for team members for a project like this? Is this within your wheelhouse?












Quote:

Originally Posted by sbaffini (Post 862850)
Not sure about the details and how close to real time it is, but ansys discovery does something like that.

In general, conceptually, yes, it is doable. BUT, shortcuts must be taken. It is also very easy to understand why.

Take the most efficient algorithm to advance the equations of 1 time step. Say, it will need N flops per cell per time step. People from the 80s or older would be fine with 24 time steps per second, but gen z princesses seems to get eye stress for anything under 60 fps, so let's take that as measure, which puts us in need of 60N flops per cell.

Now, pick up your hardware, and you have fixed your flops, say, X. Which means that, you can respect the prescribed fps only with up to X/(60N) cells... and these are pretty much ideal and simplified conditions.

What is then the problem? There are several. First, fluid flows have cells per length requirements that are function of the problem: your given hardware will practically allow real time resolution only of problems up to a certain size.

Second, such requirements are not constant in time and/or space, so there is not an algorithmically global optimum giving you the min N. If N is too low, you are probably wasting time in a lot of cells and/or time steps, otherwise optimal resource occupation will imply a larger N. In practice, there is a barrier which can't be crossed without wasting resources

Third, the most efficient algorithms also have a link between the number of cells and number of time steps required, which means that for a given problem (number of cells) you might actually need to do much more than 60 time steps per second in order to stay real time.

Finally, the reverse reasoning might simply tell you that for a given problem size and algorithm there simply isn't any reasonable hardware to actually have the computation run in real time.

All of the above is true in general and, to the best of my knowledge, there isn't any tool out there actually capable to do real time computations for general flows on somewhat arbitrary hardware.

What video games do (when they don't annoy gen z with non stable fps lower than 60) is cutting corners on N. They take it low by opportunistically breaking the physics of the solver, so that the visual part is still convincing but there is no more a link with the number of cells (so they can be sized on the hardware) and between the latter and the number of time steps (so that you can surely stay into a certain number of time steps per second independently from the problem and number of cells).

Long story short, it can be done, but for most cases you need to either break the physics, relax what you mean by "real time" or invest on some unrealistic hardware for the purpose.


open_a_window January 10, 2024 14:16

Thanks Sayan - I will look further into Unreal Engine!






Quote:

Originally Posted by aerosayan (Post 862803)
Wow, that's very cool.

Generally fluid simulation for scientific research is extremely costly, so they're not real time.

However, in gaming industry, they've figured out some ways to approximate the fluid simulations in a way that's very easy to compute, and allow them to do realtime fluid simulations.

Unreal Engine has many examples on water simulation for oceans, rivers, waterfalls.

Recently, they've also been able to do realtime gas simulations, as seen in this video: https://youtu.be/hmO2Vvcr4JA

So, you can google more on "Unreal Engine realtime fluid and gas simulation" to learn more, and maybe that will be helpful in finding what you wanted.

But I'm not sure about the anemometer thing, because they don't provide data for the whole room.

It might be better to use motion capture, or "computer vision" methods to figure out where thet people are in the room, then ******approximiate****** how the fluid motion will look inside the room.

Best of luck.


sbaffini January 12, 2024 08:12

Quote:

Originally Posted by open_a_window (Post 862909)
Thanks Paolo -



To be honest a lot of this goes over my head but its exciting to hear that it is theoretically/ practically possible.



I am not sure if we will have access to exceptional compute power -it is a project in collaboration with a arge university, so maybe.



If not, I am am fine to fill in gaps with algorithm.



What do you think would be the minimum spacing of anemometers in the array? 3 meters? I think a hot wire anemometer is the only type sensitive enough to detect indoor airflow. However, it does not sense direction. Does this present a problem?


Do you have recommendations for team members for a project like this? Is this within your wheelhouse?

Actually, my intent was to delineate the fact that it is theoretically possible but I have doubts that something scientifically sound is feasible in practic, that's what cutting corners gets you. All the tools out there actually do that (cut corners) so, if you really need to do it, you need to know your corners very well. Even algorithmically, there isn't something out there which is ready out of the box, or even at the research level. Long story short, my argument was all hypothetical.

As for the instrumental part, it really isn't in my direct field of experience, so I can't help.


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