External .stl file render into DualSPHysics

edited December 2013 in Old versions
Hi,

I have an issue with the render of external .stl geometry into DualSPHysics. I try to explain my point:

I need to work with complex 3D geometries (ships) given as .stl files.

I succeed in importing the geometry into DualSPHysics and the "real" one corresponds to my initial .stl.

The issue is that the "dp" geometry seems to be a render of the original one, which strongly depends on the number of particles (I mean, if there are few particles the quality of the shape decreases rapidly, e.g. smooth surfaces become kind of stepped surfaces...and I absolutely need to avoid it!).

Moreover, bound particles don't seem to lean exactly on the surface of the body but they are placed at a certain distance from it (...I need to avoid it too...)

Someone may explain me how to overcome these issues and eventually give me the reasons of this apparently strange behavior.

Thanks a lot.
Giuliano

Comments

  • If you use GenCase I think you cannot avoid this.

    I also work on a slope, which should be smooth. However, the resulting slope becomes stepped surfaces. That's because of the method to generate particles used in GenCase. It generates a regular grid first, and pick the particle which is nearest to the given boundary. So if you boundary is inclined or curved, it cannot be represented exactly, due to the nature of GenCase.
  • Hi,

    first, thanks for the explanation.

    Since I need to work with smooth surfaces, I would ask if you have any suggestion to help me to figure out how to face this problem.
    I guess I have to replace GenCase with a new routine. If I'm right, the input file created by GenCase is "CaseName.bi2".

    So,

    - is the source file of GenCase available?
    - do you know what is the format of the input file (.bi2) and which data does it contain (in order to eventually be able to read it and manage its data)?

    Thanks a lot!
  • Hi gvernengo

    I suppose the easiest way is modifying the code of GenCase. But unfortunately the codes of GenCase is not open source, according to the developers. So the format of .bi2 file is unknown to me. I don't know if DualSHPysics can read ASCII data file. If it is, maybe you can write a code yourself to generate your model. For the data contained in .bi2, you can have a look in SPHysics, the fortran code used to generate model is very explicit.
  • Hi gvernengo,

    The "gencase" code is not not open source.
    Fallet is right, on the description given before.

    As you increase the particle resolution (smaller dp) the slopes tend to smooth out.
    What I tend to do is run a "coarse case" to see if my config is ok and then a finer case which obviously takes longer.
    Depending on your problem of course, with sufficient particles, the step like boundaries disappear and will not influence your results too much.

    Unfortunately at this point, there is not much you can do with input files either.
    The *.bi2 format is a binary format that contains all your points and info for DualSPHysics, located and loaded at JSph.cpp.
    The file is being generated with gencase and you can not modify.

    If you feel confident enough, you can always have a look at JSph.cpp-> SaveBinData() and LoadConfig() to see how DualSPhysics loads and writes in ASCII files.
    I can't remember if the headers/format are available there, but you can always run DualSPhysics and output in ASCII instead of *.Bi2 and use that for your input file.
    Then you can load the file in DualSPHysics (see manual for -sv and -partbegin switches).

    I need to warn you though that, since you are dealing with complex geometries and curvatures, the generation of points it is not going to be easy :( I strongly recommend that you use gencase with sufficient particle resolution to "smooth out" the steps because things tend to get hairy easily.


    Thanks,
    George
  • Crystal clear! Thanks, I will check it.
    Giuliano
Sign In or Register to comment.