Image of chaos behind a stalled sail

Discussion in 'Hydrodynamics and Aerodynamics' started by jlconger, Aug 26, 2014.

  1. jlconger
    Joined: Aug 2014
    Posts: 38
    Likes: 2, Points: 0, Legacy Rep: 24
    Location: USA/California

    jlconger Junior Member

    I thought people might enjoy this image. This is a simulation of a J/32 on a broad reach. The simulated eddies behind the sails are pretty remarkable. Colorization of the surfaces is based on pressure. Colorization of the streamlines based on velocity.

    The CFD code is OpenFOAM. The visualization tool is ParaView. Both of these are open source. Details of this model, and preliminary data validating the model against real boat data are at: https://sites.google.com/site/sailcfd/
     

    Attached Files:

    2 people like this.
  2. Doug Lord
    Joined: May 2009
    Posts: 16,679
    Likes: 349, Points: 93, Legacy Rep: 1362
    Location: Cocoa, Florida

    Doug Lord Flight Ready

    Chaos

    Welcome to the forum! That's a pretty cool image-thanks!
     
  3. johnhazel
    Joined: Jun 2008
    Posts: 250
    Likes: 5, Points: 18, Legacy Rep: 60
    Location: Michigan

    johnhazel Senior Member

    Thanks for posting here. Could you give us some details about the hardware and computation times for this work? I am currently shopping for parts to build an OpenFOAM workstation.

    For now I am working with single threaded configuration with the tutorials. My recently built learning machine is a dual core Pentium G3258 3.2Ghz with 16Gb memory using the on-chip video adapter. This is relatively cheap hardware except for the 16Gb memory. Next year this system will get upgrades to CPU and a discreet video adapter. (maybe Xenon E3-1220 v3 and Quadro K2000)
     
  4. jlconger
    Joined: Aug 2014
    Posts: 38
    Likes: 2, Points: 0, Legacy Rep: 24
    Location: USA/California

    jlconger Junior Member

    When I went from 2D to 3D I upgraded to a four core laptop i7-4810MQ at 2.8 Ghz. I bought the laptop from System76, which ships with Ubuntu Linux installed. This one has 16 GB of RAM, but I only use a fraction of that. O/S and software on a solid state drive. I store the results on a second internal 1TB conventional hard drive.

    Execution times for a single case tend to be in the 15-20 minute range. This model has about 650,000 cells. Grid resolution study showed that I could get away with less resolution, but I did not like the way details of the mast and boom were rendered. I run the grid generation on a single CPU, but split the CFD solution into four sections (one per core) which is simple to do with OpenFOAM. All four cores end up at 100% utilization for the run, so the CPU fan is on all the time. I think an eight core machine would cut the time in half as the problem is completely CPU bound.

    Video performance does not seem to be too important as it just influences how smoothly things scroll when you examine the results in ParaView. I don't think there is any use of the GPU for CFD in OpenFOAM yet, but it will probably happen at some point. If you have a choice, NVidia always seems to have the best GPU support when and if that becomes a factor.
     
  5. johnhazel
    Joined: Jun 2008
    Posts: 250
    Likes: 5, Points: 18, Legacy Rep: 60
    Location: Michigan

    johnhazel Senior Member

    How long did the 1,680,000 cell case take to run?

    Did you try running the 650,000 cell case in single thread mode? How long did it take?

    I did some experiments with increasing cell count and reducing time step on the lid driven cavity example using a Toshiba i7-4700MQ machine. It gave a speedup of less than 2 vs the theroretical 4x. The machine has a single thread turbo mode of 3.4Ghz vs the multi core 2.4Ghz. It also got very hot in multi thread runs which was alleviated by running it in my unheated garage (test done in Feburary). A third factor is that there is some overhead needed to divide the job up for each core and then weave results back together.
     
  6. jlconger
    Joined: Aug 2014
    Posts: 38
    Likes: 2, Points: 0, Legacy Rep: 24
    Location: USA/California

    jlconger Junior Member

    Timing on CFD runs

    It has been a number of months since I did the resolution study, so I don't have exact times vs. cell count. To first order it was linear to cell count. The one time I checked I was getting about a factor of 3.5 speedup going to 4x parallel vs single core. The larger internal cache for this batch of Intel chips is probably helping.

    One of the reasons I went with a laptop is that the laptop CPUs are less power hungry. I had a six core Dell desktop at work that functioned as an office heater and made a lot of noise. The laptop CPU fan does run full time during these solutions, but it puts out less much heat than the full-on desktop machines and has a tolerable noise level.

    One other factor is that I am running a native Ubuntu machine, not running via VBox. I did the VBox approach for about a year, but it was pretty miserable for full time work. I now find that I don't have any Windows applications that I use, so it made sense to just live in the Linux world. Amazing how things change...
     
  7. UNCIVILIZED
    Joined: Jun 2014
    Posts: 166
    Likes: 1, Points: 18, Legacy Rep: 31
    Location: Land O' the Great Lakes

    UNCIVILIZED DIY Junkyard MadScientist

    Thanks for sharing this, as well as filling us in as to the availability of that software.
     
  8. Nick_Sinev
    Joined: Aug 2014
    Posts: 63
    Likes: 0, Points: 0, Legacy Rep: 10
    Location: Sydney

    Nick_Sinev Junior Member

    Dear Jim

    It's great project!!! Sorry, I didn't get at he first moment that you are the author of the mentioned above site.
    Really interesting!
     
  9. Leo Lazauskas
    Joined: Jan 2002
    Posts: 2,696
    Likes: 155, Points: 63, Legacy Rep: 2229
    Location: Adelaide, South Australia

    Leo Lazauskas Senior Member

    Beautiful work, Jim!
    Have you tried modelling the free-surface around the hull?
     
  10. jlconger
    Joined: Aug 2014
    Posts: 38
    Likes: 2, Points: 0, Legacy Rep: 24
    Location: USA/California

    jlconger Junior Member

    Not yet. I want to complete sail trim optimization before moving on to the hull. I'm a bit more motivated to better understand sail trim, as that is something over which I have some control. Hull shape - not so much. Still, it would be nice to get a better understanding of how the keel and rudder interact, a solid method to estimate leeway, and so on. I'm going to ask if I can get the original CFD model for the hull. If not, I plan to scan the hull surface using a Kinect sensor on this winter's haul out.
     
  11. DCockey
    Joined: Oct 2009
    Posts: 5,229
    Likes: 634, Points: 113, Legacy Rep: 1485
    Location: Midcoast Maine

    DCockey Senior Member

    If not, I plan to scan the hull surface using a Kinect sensor on this winter's haul out.

    If you scan the hull with a Kinect sensor I'll be very interested in how well it works for you.

    Another option for "scanning" the hull is photogrammetry. Take a good set of photos of the hull with sufficient overlap and then process the photos with photogrammetry software to obtain a dense cloud of points on the hull surface. Recent software does need any targets on the hull but does require sufficient visual "texture"; similar to what's needed for the Kinect unit. My experience has been that most painted surfaces work well, particularly if a little dirty; clean glossy fiberglass does not.

    I've been using Photoscan software www.agisoft.ru and continue to be amazed on how well it works with very little visual texture. Standard version is $179.
     
  12. Erwan
    Joined: Oct 2005
    Posts: 460
    Likes: 28, Points: 28, Legacy Rep: 97
    Location: France

    Erwan Senior Member

    Hi Everybody,

    Interesting remarks about OpenFOAM in your posts trigger a dummy question,

    I have to change my laptop soon, I d be happy if anybody could tell me which would be a smart configuration to have in order to play with OpenFOAM for a few years.

    I guess that "native Ubuntu " machine means Ubuntun/Linux is already installed ?

    Is it a pre-requisite for Open FOAM?

    Thanks in advance

    EK
     
  13. Leo Lazauskas
    Joined: Jan 2002
    Posts: 2,696
    Likes: 155, Points: 63, Legacy Rep: 2229
    Location: Adelaide, South Australia

    Leo Lazauskas Senior Member

    It depends on what you want to do.

    Some "simple" applications like sails might work Ok on a laptop. For
    free-surface calculations you might be looking at very long runs. For
    example, Wortley found it took about 300 to 650 CPU hours for calculations
    of the squat and resistance of a container ship. See:

    Wortley, Shaun.
    "CFD Analysis of Container Ship Sinkage, Trim and Resistance",
    https://cmst.curtin.edu.au/local/docs/pubs/wortley_2013_cfd_Analysis_of_container_ship_sinkage.pdf

    You might be able to get away with shorter runs if accuracy is not a concern.

    Good luck!
     
  14. jlconger
    Joined: Aug 2014
    Posts: 38
    Likes: 2, Points: 0, Legacy Rep: 24
    Location: USA/California

    jlconger Junior Member

    Running OpenFOAM

    OpenFOAM runs on Linux, and Ubuntu is the most common flavor of Linux in use today. There are a couple of ways to go:

    1) Install Linux on a PC as its only operating system. That is what I do. You can buy machines with Ubuntu already installed (System76), or you can install Linux on essentially any Intel architecture machine (and a lot of other architectures too.) Installation is simple.

    2) You can install more than one O/S on a machine and then boot to either one at start up (so called 'dual boot'). The only cost is the disk space of the duplicate O/S. Otherwise, either instance is running 'native'. Works fine.

    3) You can install one O/S and then create one or more virtual machines under O/S #1 to run other operating systems. A common case is to have a Windows machine run Oracle VBox, and then install Ubuntu within the virtual machine. I have done this more than once, and do not recommend it for more than just occasional use. The graphical tools, particularly ParaView, do not work at all well in a virtual environment.

    4) There are now timeshare Linux supercomputers available at reasonable prices. Penguin Computing is a good example, and their base installation has OpenFOAM on it. If you need 1000 CPU cores, this is the way to go.

    The amount of computer power you need is driven primarily by the number of cells in the simulation. I'm using about 650,000 cells in a 3D model of a sailboat, and the results appear to represent the real boat pretty well. I've just gotten the data acquisition system going on the boat, so I don't have enough data to give hard statistics yet, but it looks promising. This model runs OK on my 4 core Laptop, although I often set up batch jobs that run for hours.

    One thing that drives the cell count way up is extraneous detail in the starting model. If you start with a CAD model that has every cleat and toggle included, and then build up a mesh that will track the air around each of these minute features, you are going to end up with one big mesh. This might be necessary to answer some questions (what?), but it typically is not required. A grid resolution study is always a good idea to determine how little detail you can get away with and still get reliable results.

    I've put an example OpenFOAM model ready to run on the sailCFD Google site. It is a 2D simulation of a sloop rig. You can download it from the bottom of this page:

    https://sites.google.com/site/sailcfd/home/openfoam-notes
     

  15. Erwan
    Joined: Oct 2005
    Posts: 460
    Likes: 28, Points: 28, Legacy Rep: 97
    Location: France

    Erwan Senior Member

    Thank you very much,

    I don't think I will use OpenFOAM for "free surfaces calculations" as for hulls I would rely on Michlet, because of simplicity, and if a foiling boat, hulls would be specialized for pre-foiling speeds.

    I guess Open FOAM could add some value for hydrofoils and rigs induced drags, or at least that's my idea, but could be wrong, and no idea regarding the "marginal efficiency of this extra complexity". Anyway, it will remain a hobby, I m not professional like you.

    Thanks again &

    Best Regards

    EK
     
Forum posts represent the experience, opinion, and view of individual users. Boat Design Net does not necessarily endorse nor share the view of each individual post.
When making potentially dangerous or financial decisions, always employ and consult appropriate professionals. Your circumstances or experience may be different.