Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wierdly behaving 3D objects / Meshes #184

Open
MGRAFF2006 opened this issue May 23, 2024 · 2 comments
Open

Wierdly behaving 3D objects / Meshes #184

MGRAFF2006 opened this issue May 23, 2024 · 2 comments

Comments

@MGRAFF2006
Copy link

I am pretty much a noob at fluid dynamics, but need to do some quick calculations on the characteristics of some boats for digital prototyping.

After some poking around I started to get a hang of FluidX3D and decided instead of just changing values, reading the docs and understanding the setup.cpp i would try to create my version of one of the scenarios.

In this case i took the f1 car simulation and tried to get one of our Dummy Models in. Which didn't really ended up working:
image

Here is a picture of the original 3D Model in Autodesk Fusion:
image

I know it is probably not recommended having models with multiple non connected parts, but this is the version i have at the moment, also tried other variants (different models in different simulations to try to debug it myself) which I unfortunately don't have anymore.

But a resume of my tests could be, that many of the models i tested were having weird shapes like that, and some would change their shapes while the simulation is running even though i set them as Solid.

Really don't know what is wrong / what i should try anymore. Thanks for any Help / Hint in advance

Here you can find the .stl file and my setup.cpp:
issue.zip

@gitcnd
Copy link

gitcnd commented May 24, 2024

Loads OK for me - you probably need a larger simulation? Try 14000u instead of 4000u

pic_2024-05-24_23 10 30_597

I ran it like this from WSL:-

/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe start "cmd.exe '/c mode con: lines=80 & bin\FluidX3D.exe -f ..\..\cat.stl -r 16000 --SUBGRID --rotz 90 --rotx 180 --roty 180 --try -0.9 -y 1 -z 0.5 -x 0.3 -c 0.15 --aoa 0.0 --slomo 200.0 --fps 60 --SRT --UPDATE_FIELDS --GRAPHICS --EQUILIBRIUM_BOUNDARIES --FP16S --D3Q15 & pause'"

using my branch from here: https://github.com/gitcnd/FluidX3D/tree/inline_things

What are the "some quick calculations on the characteristics" you're trying to work out?

For context - I'm the author of the free Fusion360 "Airfoil Tools" add-in - which might also be able to help.

@ProjectPhysX
Copy link
Owner

ProjectPhysX commented May 24, 2024

Hi @MGRAFF2006,

I'm sorry that the first thing you see is something not working. Let's get to the bottom of it. Thanks for already providing the reproducer! I need some more information: What hardware are you running this on? Maybe it is an issue with the particular drivers.

Running this exact reproducer on my system (tested on 3 OpenCL devices: Arc A750, UHD 630 and i7-8700K), the setup looks fine and I can't observe the artifacting. The mesh looks also fine.
grafik

To place the model in the center, use this:

	Mesh* cat = read_stl(get_exe_path()+"../stl/cat.stl");
	cat->rotate(float3x3(float3(0, 0, 1), radians(-90.0f))); // rotate -90 degrees around z-axis
	const float scale = 0.8f*fmin(fmin(lbm_N.x/cat->get_bounding_box_size().x, lbm_N.y/cat->get_bounding_box_size().y), lbm_N.z/cat->get_bounding_box_size().z); // scale parts
	cat->scale(scale);
	const float3 offset = lbm.center()-cat->get_bounding_box_center();
	cat->translate(offset);
	cat->set_center(cat->get_bounding_box_center()); // set center of meshes to their bounding box center
	lbm.voxelize_mesh_on_device(cat);

grafik

Kind regards,
Moritz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants