Comments (2)
Hi @VijayN10,
apologies for the delayed response! This is a very interesting setup and I wanted to give a very detailed response, but my schedule was too busy until now. I hope this helps you, and please let me know if there is still something unclear.
The size
parameter in lbm.voxelize_stl(...)
must be a scalar (float
) value, not a float3
vector. It's value describes the longest side of the bounding box of the geometry in LBM units, in your case 30.0f
cells.
You want to place the geometry such that it is sitting flush on the bottom (-z) and right (+y) walls of the simulation box, also taking into account the one grid layer for the simulation box walls.. Here it is easiest to split the stl voxelization into 2 parts:
- loading the stl geometry into a
Mesh*
and scaling it to the desired size (30.0f
), and - translating it to the correct position.
The loading step puts it in the center of the simulation box, and then we need to translate it from the center by mesh_translation
:
Mesh* mesh = read_stl(get_exe_path()+"../stl/kyoto.stl", lbm.size(), lbm.center(), 30.0f);
const float3 mesh_size = mesh->pmax-mesh->pmin;
const float3 mesh_translation = float3(0.0f, -1.0f+0.5f*lbm.size().y-0.5f*mesh_size.y, 1.0f-0.5f*lbm.size().z+0.5f*mesh_size.z); // "+-1.0f" to account for simulation box boundary
mesh->translate(mesh_translation);
lbm.voxelize_mesh_on_device(mesh);
To your specific questions:
- There is no local refinement on the lattice. If you need a finer grid at one region in the box, you have to make it finer everywhere. This is admittedly rather unfortunate; since a lot of users have requested this already, I'm planning to find a solution for local mesh refinement in the future.
- The size parameter (scalar
float
) in thelbm.voxelize_stl(...)
orread_stl(...)
functions sets the largest length of the bounding box of the geometry. If you setsize=0.0f
, the geometry is scaled such that it fits in the simulation box exactly at largest possible inflation. You can also assign thesize
parameter a negative value; then it becomes a scaling factor relative to the original coordinates in the.stl
file, such that no auto-scaling is applied. - The center parameter (vector
float3
) defines the center of the bounding box of the stl geometry in the simulation box.(0,0,0)
here is the back left bottom corner of the simulation box, and(0.5f*(float)Nx-0.5f, 0.5f*(float)Ny-0.5f, 0.5f*(float)Nz-0.5f)
orlbm.center()
is the middle of the simulation box. - Your box is
4m
high and fluid should be< 0.75m
. The simulation box in LBM units has a hight of40
cells, so the water level in LBM units must be< 0.75m/4m * 40 = 7.5
.
Note that you also need to set a volume force in the LBM cionstructor such that the water stays at the bottom and does not start to float around in zero-g. Have a look at the "raindrop" sample setup, and also how the unit conversion is done there with the aid of the units
struct.
Thank you for using FluidX3D, have fun with it!
from fluidx3d.
@ProjectPhysX , thank you so much for the detailed explanation!
I will definitely try this out and will update you sooner.
from fluidx3d.
Related Issues (20)
- 'class LBM' has no member named 'graphics' HOT 1
- Arc GPU Not rendering to Display HOT 7
- Mouse control problem with Remote Desktop Connection (windows) HOT 4
- Cannot run after compilation (Error: Memory size is too large) HOT 1
- Trouble testing any set ups that are not BENCHMARK HOT 2
- Issue with Force Vector Positions in FluidX3D Simulation HOT 1
- Issue with interactive graphics mode on Linux with multi-monitor setup HOT 1
- The problem with calculating the lift of the propellers HOT 2
- Example setup for Urban Wind CFD analysis
- On exporting data, read_from_device_3d and VTK HOT 5
- How to Increase VRAM Using Shared GPU Memory HOT 3
- make.sh fails on some systems due to nonstandard interpreter path HOT 3
- Intel OpenCL CPU Runtime Usage HOT 1
- Resolution of voxels HOT 1
- Fast memcpy, or similar of flags/u/phi buffers HOT 1
- The model becomes rough HOT 1
- compilation error HOT 2
- Little Bit irritating new version message with 1.4? Not 2.14? HOT 1
- Question about performance HOT 1
- Turbulence details are not displayed clearly after enabling FORCE_FIELD HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluidx3d.