Hello everyone, I'm working on
Hello everyone, I'm working on a project where I'm adding the flow of water into a submarine game and OpenFOAM got recommended.
What I want is a scene with some static objects affecting the flow of water. I will be using one of the sides of the scene as an inlet and the opposite side as an outlet. The effects I want it to simulate is the Coanda effect, turbulence and venturi. I'm also planning on using it for simulating airflow but only on a rough scale so the system is incompressible. Also, The surface of the water is not of interest, just the internals.
I've had a look at your C++ documentation and almost fainted when I saw the size of it, I don't have a clue where to begin and the project would be over before I figure out what classes/functions I need for my simulation. Also, I will be visualizing all this myself so I won't need any GUI or graphical representation of the simulation.
So my questions are:
Is OpenFOAM a good option for me to use?
If yes, where do I begin and what classes will I need?
Are there exporters for either 3DS Max or Maya to the format OpenFOAM uses?
Will it be difficult converting the results from OpenFLOW to a three dimensional matrix that covers my scene? (Each of the cubes in the matrix will be of equal size and I wish to average the flow within each of the cubes to the "cube's flow" so that I can easely limit the amount of time my particles will have to spend finding out what flow they are supposed to follow.)
To answer your first question:
To answer your first question: did you see the fluid simulation tool in Blender? Something like that is probably easier to integrate.
Looks interesting, although th
Looks interesting, although the mesh generation for each frame sounds hefty. I'll have to have a closer look at how it works.
Currently it seems that all more correct forms of simulation (Using navier-stokes equations) are to slow to perform in real time and very difficult to implement or integrate. I'm thinking more along the lines of using Cellular Automata instead since the simulation need only look realistic to the untrained eye. Do you think this might be a better choice for me?
A cellular-automata-like solut
A cellular-automata-like solution is probably the easiest way, yeah. You don't need cellular automata as such; mostly what you need is to approximate the Navier-Stokes equations in such a way that all the time-consuming parts are gone.
The big time-consuming part is the pressure equation in an incompressible flow, because that requires a simultaneous solution across the entire flowfield for each timestep. To eliminate that, you want to use an "artificial compressibility" approximation, which adds in the right amount of compressibility such that the pressure waves (the fastest information transfer in the system) travel at a speed of one grid cell per timestep.
Similarly, you can probably eliminate viscosity. Or, better yet, eliminate any explicit calculation of viscosity, and use a first-order upwind calculation of the convection derivatives, which gives you enough viscosity as a side effect to make the calculation unconditionally stable.
Turbulence is going to be tricky; you don't want to try to simulate it unless you really need it. The "turbulent viscosity" effect of it can probably be rolled into the rest of the viscosity calculation (which is, if you're doing first-order upwinding, very approximate anyway). The other effect you may want is dispersion of particles carried by the flow; just approximate this by adding a random perturbation to the flow velocity each one sees at each timestep.
You should use the 3D mesh of cubes that you already have as your computational mesh. Look into some sort of immersed-boundary method for handling the location of solid objects within it, or to a first approximation just divide all the cubes into "object" or "fluid", and set the fluid velocity in the "object" cubes to zero (or whatever the object velocity is) rather than the fluid velocity.
As a completely different approach, though, you might look at using a "meshfree" method that simulates the motion of particles without using a mesh at all; see Brian Schlatter's project at http://www.physics.oregonstate.edu/~...ian/index.html for one example.
Also, it occurs to me that the
Also, it occurs to me that there are some important questions to ask:
Are you wanting a steady-state solution, or one that changes with time? (Steady-state solutions are actually harder; essentially, you have to take an unsteady one and run it until it stops changing, though there are ways to make it a bit faster than that.)
What is the desired output from the simulation? Are you tracking particles moving passively in the flow? Computing the force exerted by the flow on small self-propelled particles? Computing the force exerted by the flow on large things? Computing the amount of flow that will go into different holes? Or something else? The sort of accuracy you need depends quite a bit on what exactly you're doing.
FYI, the CSIRO maths division
FYI, the CSIRO maths division are working on smooth particle hydrodynamics for movies - there's a small grab at the bottom of this page
not sure how far it's gone - I've seen an animation of water falling down stairs & a box floating in a stream of water - looking pretty realistic.
That link doesn't work if you
That link doesn't work if you click it - for some reason it gets mangled as I post it and cant correct it... you'll have to cut and paste from the "http... onwards.
Hi Richard! If I get it rig
If I get it right, did you asked if you can import your 3D models from 3D Studio Max/Maya for further in game simulations?
I am not sure what the game sort you are exactly trying to do, but as far as I know, typical game physics gets no more as 20% of CPU at most as the rest is going on graphics, AI and scene/world updates, networking. My personal point of view is that men here are those who gets mostly 100% time for their simulations and that are simulating (or at least trying it) near any possible physical interaction. Be aware of them!
I am not sure about that blender plugin mentioned above, but I am afraid it can take its time as well to compute whole scene animation. I would suggest you simply fake it in some very primitive manner even on the level of secondary school that will just provide a small feel of physics or you will get lost...
Thanks all for the feedback, t
Thanks all for the feedback, this is exactly the kind of information I'm looking for.
Now to answer questions:
Moses 1 - I'm looking for an unsteady state solution yes.
Moses 2 - I'm tracking particles moving passivly in the flow for large volumes of water, such as an underwater canal where some large bedrock sticks up. (Not that there are canals with that appearance, but that's about the precision I need.) The particles themselves won't affect the flow, everything affecting the flow will be static.
Vita- Yes, the physics part won't be getting that much time on the cpu. My question regarding models from maya/3ds max was concerning openfoam, if there are plugins for these programs to convert my models to a format that openfoam uses.
I'm afraid you will need some
I'm afraid you will need some other program apart from maya/3ds: these programs are only interested in the surface of things (sounds real philosophical): this means that they will only generate a mesh on the surface. For the CFD calculation you need a mesh of the volume too. So you'll need at least a program that can read the maya-surface, generate a volume mesh and write it to OF (or in a format that OF understands). (Might exist, but I don't know any)
Blender looks really nice!!!
Blender looks really nice!!!
|All times are GMT -4. The time now is 00:12.|