0. Scene Overview
1.The following will be simulated in the scene.
a. Water pours out from the staircase.
b. The water collides with the structures and gathers on both sides.
c. Subway train comes in to the station and reacts with the water gathered on the track by splashing it.
A. Preparation and Project Setting
1. Preparing the geometry.
a. Preparing the dummy geometry.
The geometry for the scene is very complicated and if it is converted into the level set for collision, it might produce unpredictable results. Therefore a simple dummy geometry that incorporates the shapes of only the major structures is necessary. (When creating the geometry, it has to be considered that the current version of FluX can run simulations only in areas where X, Y, Z axes are greater than 0.)
The file name of geometry sequences to be animated should be in the form of "filename.0000.####.ext" (#### is a padded four-digit frame number)
I. The outer boundaries of the entire station have to be considered when setting the simulation area.
II. Columns and stairs inside the station.
III. Dummy for collisions with the ceiling (The yellow area).
IV. Dummy geometry sequence of the train coming into the station (animated geometry sequence).
a. Preparing the detailed geometry.
FluX supports both the level set collision and mesh collision.
The collision with Level set is stable, but to be able to show the details, the cell size which is the base unit for simulation, should be very small. This causes heavy waste of memory space and increase in computation load.
The calculation of the collision with mesh makes the meshes and particles collide allowing small meshes to interact with particles. However a small number of particles might pass through the mesh sometimes.
Therefore, it is best to use level set for the big chunks’ initial collisions, and mesh for detailed collisions.
I. Station interior details – detailed meshes for bench were prepared. (Grey area)
II. Detailed mesh of the first subway train – only the geometry of the first train sequence was prepared for the collision with details of pushed out from the level set.
1. Creating and Preparing a New Project.
a. Select New Project from the File menu and set the root path of the project.
b. Copy the prepared collision geometry to the Import folder in the project path.
2. Scene Composition
Load the geometries to compose the scene for simulation.
a. Create a Cache node. (Node List menu > File tab > Cache)
b. Activate the parameter window by double-clicking the created Cache Node.
c. Make sure the Cache Mode is set to ‘Read Files’. If it is set to ‘Write Files’ change it to ‘Read Files’.
d. Set the file to be loaded by clicking the folder icon next to the FileName input box. (Selecting one of the sequences will automatically register all the sequences.)
e. Activate Interpolation by clicking its check box for the geometry sequence (dummy subway train and the detailed geometry of the subway train) to be animated so that estimations can be made for computing in-between frames.
f. For the convenience of MPI simulation etc, change the path to the relative path that is based on the project root.
Change the above as shown below.
g. From the NodeName box in the parameter window, change the name of cache node to an appropriate one.
Change the above as shown below.
h. For display, create a MeshShape node. (Node List menu > Shape tab > MeshShape)
i. Link the Station_BOX (cache node)’s outData with MeshShape node’s inDstMesh port.
j. Click the Refresh button at the bottom right corner of the time slider to check if the geometry has been loaded properly. (Click the Play button to check the sequence.)
k. Repeat the steps above to load all the geometries in the scene.
a. Setting the simulation resolution and domain.
I. To reference simulation domain, open the parameter window by double clicking the MeshShape linked with StationWall_Simple(cache node).
II. Click the Drawing checkbox in the parameter window to display the node. (Turn off the unnecessary nodes’ display.)
III. To adjust the global settings, double-click the Global node.
IV. Adjust Resolution (X, Y, and Z) and CellSize in the parameter window to set the simulation area. (Train simulation occurs from the boundaries of the wall, so the simulation area is set to match with the wall of the reference geometry.)
a. CFL Setting
I. CFL determines the accuracy of the simulation. A smaller value makes the simulation slower, but more accurate. (For average simulations 10 is adequate)
b. Project Root Setting
I. Make sure the ProjectRoot is the same as the directory currently being used. (They are set to be the same by default if the project was created by selecting NewProject in the File menu, otherwise they might be different.)
II. In order to utilize the distributed simulation through MPI, the ProjectRoot should be set as a universal path of a shared disk accessible by the simulation farm. (The path name of the farm and the workstation has to be the same.)
B. Simulation Network Configuration
1. Level Set Computation & Verification for Collision Calculation.
a. The following geometries were loaded for water interaction.
I. Columns, stairs, floors inside the subway station (for level set collision)
II. Ceiling (for level set collision)
III. Train dummy (for level set collision, light green area)
IV. Train detail (for mesh collision)
V. Benches inside the subway station (for mesh collision)
b. Convert three geometries into level set for the level set collision and combine them to check for abnormalities.
I. Create three MeshToLevelSet nodes. (Node List menu > Converter tab > MeshToLevelSet / click three times to create three nodes)
II. Link each MeshToLevelSet node with level-set-collision geometry nodes (cache nodes). (Link Cache node’s outData port with MeshToLevelSet node’s Mesh port.)
In the same way, link three level-set-collision meshes with MeshToLevelSet nodes to convert them into level sets.
III. Create a MergeLevelSet node. (Node List menu > Field tab > MergeLevelSet)
MergeLevelSet Node computes two level sets together.
IV. Link the two level sets converted from meshes with MergeLevelSet node’s input port.
V. Create one more MergeLevelSet node and link it with the combined level set and the remaining level set to combine all three level sets.
VI. The combined level set has to be converted to mesh in order to check the level set computation results. (The current version of FluX cannot display level set directly.)
VII. Create a LevelSetToMesh node. (Node List menu > Converter tab > LevelSetToMesh)
VIII. Link the outDstLevelSet port of the combined level set’s final node and LevelSetToMesh node’s LevelSet port.
IX. Link ‘Cache’ and’ MeshShape’ to the converted mesh node (LevelSetToMesh node) and display them in the viewport to check for abnormalities.
2.Basic Node Setup for Simulation Node Configuration.
Preparing the basic simulation node configuration.
a. Create a FluidContainer node. (Node List menu > Primitive tab > FluidContainer)
b. Create a GetMaxSpeed node. (Node List menu > Field tab > GetMaxSpeed)
c. Link FluidContainer’s VectorField output port with GetMaxSpeed’s VelocityField input port.
d. Create a ComputeTimeStep node. (Node List menu > Misc tab > ComputeTimeStep)
e. Link GetMaxSpeed’s MaxSpeed output port with ComputeTimeStep’s MaxSpeed input port.
f. This procedure will stabilize the simulation result by automatically reducing the time intervals if the speed is too high. From now on, all the DTs which are time step parameters will be converted and linked to the DTs output from ComputeTimeStep node. (Except for GetMaxSpeed’s input.)
3. Particle and Solver Node Configuration
a. Create a Particle node. (Node List menu> Particle tab > Particle / Particle node is a data set for particle, in other words a container for particle.)
b. To generate particle, add emitter and a level set that defines the generation area.
c. Create an ImplicitBox node. (Node List menu > Primitive tab > ImplicitBox)
d. Create an EmitParticleFromLevelSet node. (Particle tab > EmitParticleFromLevelSet)
e. Link Particle output port of the Particle node created above with EmitParticleFromLevelSet node’s inParticle input port.
f. Link ImplicitBox node’s LevelSet output port with EmitParticlefromLevelSet node’s inLevelSet input port.
g. Link the newly added node’s DT input port with ComputeTimeStep’s DT again.
h. Create a VARSolver node. (Node List menu > Particle tab > VARSolver)
i. Link EmitParticleFromLevelSet’s outParticle output port with VARSolver’s inParticle input port.
j. Link FluidContainer with VARsolver as shown below.
FluidContainer:VectorFiled -> VARSolver:inVelocityField (Links simulation space’s velocity field to the solver.)
FluidContainer:SolidVectorFiled -> VARSolver:SolidVelocityField (When a level set that will be animated is in the space, link that level set’s velocity field to the solver.)
FluidContainer:SolidLevelSet -> VARSolver:SolidLevelSet (When a level set for collision computation is in the space, link that level set.)
k. Lastly, link VARSolver’s time step DT with ComputeTimeStep’s output port DT.
4.Cache Node Settings for Saving Results
Now the basic simulation node structure is complete. The following steps will save and display the results to review, and adjust the detail settings to obtain desired results. The Cache node at the end of the simulation node network will be recognized as the simulation’s end point.
a. Create a Cache node. (Node List menu > File tab > Cache)
b. Link VARSolver’s outParticle input port with Cache’s inData output port.
c. Create a ParticleShape node. (Node List menu > Shape tab > ParticleShape)
d. Link Cache’s outData output port with ParticleShape’s inParticle input port. ( Also, relink DT with ComputeTimeStep’s DT input port.)
e. Activate the parameter window by double clicking the Cache node.
f. Set the saving path of the cache file and the file extension.
The file extensions can be set as Realflow particle format .bin and FluX private format .fxp
g. Press the refresh button by verifying if the particle is created. (If there isn’t any separate setting, the particles will be created near the origin.)
5. Detailed emitter setting – adjust the emitter to set the particle generating position.
a. Find the ImplicitBox node from the connected nodes network and then activate the parameter window by double clicking the node.
b. In the parameter window, adjust the value of BoxMinPosition (X, Y and Z) and BoxMaxPosition (X, Y and Z) to place ImplicitBox above the stairs of the station. (It is convenient to use BoxShape (Node List menu > Shape tab > BoxShape). No connection with the existing node.
c. Double Click on the EmitParticleFromLevelSet node to activate the parameter window.
d. Specify how many particles will be generated in one cell based on the cell sized that was set from the Global node.
e. In addition, set the interval of particle recreation per frame. It is good to set the value as 5~10 to see the effect with a relatively small amount of particles rather than setting the value as (RepeatInterval: 1) which will generate particles in every frame.
6. Adding a collision
a. LevelSet collision
I. Reconnect outDstLevelSet of previously summed up LevelSet (MergeLevelSet1) with the SolidLevelSet input port of VARSolver. Through this connection, VARSolver receives the collision range of LevelSet. (the simple version of the animated subway dummy is also included in this summed up LevelSet)
b. Mesh collision
I. For the calculation of a collision with a moving mesh, connect detailed version of the subway the Train_HiGH (Cache) node with VARSolver.
The outData output port of Train_HiGH with the SolidMesh input port of VARSolver.
Through this connection, VARSolver will calculate more detailed collision with the mesh.
II. Connect an additional node to for adjusting the details of the accuracy apart from the solver calculating on its own and the repulsive force when colliding with the friction etc.
Create a CollideParticleToMesh node.
(Node List menu > particle tab > CollideParticleToMesh)
III. Connect the CollideParticleToMesh node in between Cache for saving the final simulation result and VARSolver.
In other words, connect the outParticle output port of VARSolver with the inParticle input port of the CollideParticleToMesh node, and reconnect the outParticle output port of the CollideParticleToMesh node with the inData port of the Cache node.
IV. Connect the outData port of the Train_High(Cache) node with the Mesh input port of CollideParticleToMesh to adjust the friction of collision. Through this connection, the details of the subway mesh and the particle collision can be set more detailed.
V. Activate the parameter window by double clicking on the CollideParticleToMesh node.
VI. Set the value of Elasticity and Friction as 1 to increase the interaction of the subway and the water.
VII. Reconnect the DT input port of the CollideParticleToMesh node with DT of the ComputeTimeStep node.
VIII. Repeat the process above to set the mesh collision of the benches and the dummy model in the subway station. The collision with the benches is for operating the collision with the small meshes, and the collision with the floor and column-dummies of the subway station is for setting up the friction when collision occurs.
IX. Set the coefficient of friction with benches and the floor as shown below. As you proceed with the further simulation test, the settings can be adjusted to more appropriate values.
7. Adding drag
a. Adding the air resistance of when the particle collision isn’t occurring. This means when the particles are in the space. (Node List menu > Particle tab > DragParticle)
b. Connect the DragParticle node in between the EmitParticleFromLevelSet emitter node and the VARSolver.
(Connect the outParticle output port of the EmitParticleFromLevelSet node with the inParticle input port of the DragParticle node)
(Connect the outParticle output port of the DargParticle node with the inParticle input port of the VARSolver node)
Reconnect the DT port with the DT input port of the ComputeTimeStap node.
c. Double click on the DragParticle node to activate the parameter window, and then change the value of Drag as around 0.2.
8. Setting up the solver in detail.
a. Double click on the VARSolver node to activate the parameter window.
b. Adjust the value of SolidVelocityScale as 1.6 to increase the interaction with the subway. The particles will be bounced back in greater speed than the normal speed when collision occurs.
c. Adjust the value of ParticleDrag and DensityDependentDrag to reduce the particles to be excessively scattered.
d. If the cell size of the Global node is 1, VolumeTruncation is the variable about considering the area smaller than the cell size of 1 in detail. If the value is 0.1, the inside of one cell (1) is calculated as dividing in 0.1 units. If the value is too small, the simulation time will increase so set an appropriate value for it.
9. Save and test the simulation with a small number of particles to determine the outcome by adjusting each parameter in detail.
Down Subway Totorial Sample File