Skip to content

Latest commit

 

History

History
115 lines (86 loc) · 3.94 KB

fluidsOutside.md

File metadata and controls

115 lines (86 loc) · 3.94 KB

Fluid outside an object

1 - Preparation in Blender

HR mesh

alt text

Checking LR mesh with 3D print toolbox

Using check all to compute the quality, and clicking on intersect faces and non manifold to get the intersections and holes alt text

Closing the model

With the "F" shortcut, after selecting loops with Shift + Alt + Right click for instance alt text

Adding a computational domain

Exporting to .mesh

Checking in medit

medit suzanne.mesh
  • Z to zoom in
  • Shift + Z to zoom out
  • F1 to toogle clip
  • e to display references
  • b to change background
  • l to toggle wireframe

Running tetgen

tetgen -pgaA suzanne.mesh

Writes to suzanne.1.mesh

You can get the reference of a tetrahedra with Shift + click, and looking in the terminal (blue = 0, red = 1, green = 2)

Removing the green domain (reference 2)

python pythonMesh/src/removeReference.py suzanne.1.mesh 2

Remeshing with mmg3d

mmg3d suzanne.1.d.mesh

Writes in + "suzanne.1.d.o.mesh"

Parameter file

Save as DEFAULT.nstokes in the same directory that your remeshed object

Dirichlet # Type of boundary condition
3 # 3 different regions for boundary conditions
1 triangle v 0. 0. 0. # The region of reference has a null velocity
2 triangle v 0. 1. 0. # The region of reference 2 is the input : v = (0,-1,0)
4 triangle v 0. 0. 0. # 4 also has a null velocity

Domain
1 #The number of domains in which we are computing the flow
1 1. 1. # reference one (red tetrahedras), nu and rho

Running the simulation

nstokes -r 0.005 suzanne.1.d.o.mesh

Looking at results

The original file has been modified, and should now contain the vector and scalar fields.

medit suzanne.1.d.o.mesh

Converting to paraview

We have to write a file compatible with paraview in order

python pythonMesh/src/convertToParaview.py suzanne.1.d.o.mesh

A file called suzanne.1.d.o.vtk has been created (hopefully)

Visualizations in Paraview

A whole new tool...

Import the vtk file in paraview, and apply your filters.

When you are satisfied, go to File -> Export Scene and choose .x3d format. You will be able to open that file in blender.

Importing back in blender

You can now import back the x3d file in blender, to visualize the results.

File -> import -> .x3d

However, you will see that the axis are not aligned. To fix this, you must rotate your results in blender:

  • R + x + 90
  • R + z + 180 Be sure to rotate around the origin of the scene!