Files
phasicFlow/doc/code-documentation/html/rotatingDrumSmall.html
2023-03-31 10:50:39 -07:00

275 lines
19 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<title>PhasicFlow: Simulating a small rotating drum</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname"><a href="https://cemf.ir">PhasicFlow</a>
&#160;<span id="projectnumber"><a href="https://cemf.ir">v0.1</a></span>
</div>
<div id="projectbrief"><a href="www.github.com/PhasicFlow">www.cemf.ir</a></div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('rotatingDrumSmall.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="PageDoc"><div class="header">
<div class="headertitle">
<div class="title">Simulating a small rotating drum </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1>Problem definition</h1>
<p>The problem is to simulate a rotating drum with the diameter 0.24 m and the length 0.1 m rotating at 11.6 rpm. It is filled with 30,000 4-mm spherical particles. The timestep for integration is 0.00001 s. </p><div align="center"><b> a view of rotating drum</b></div><div align="center"><b><img src="https://github.com/PhasicFlow/phasicFlow/blob/media/media/rotating-drum-s.png" alt="" class="inline"/> </b></div><hr />
<h1>Setting up the case</h1>
<p>PhasicFlow simulation case setup is based on the text-based scripts that we provide in two folders located in the simulation case folder: <code>settings</code> and <code>caseSetup</code> (You can find the case setup files in the above folders. All the commands should be entered in the terminal while the current working directory is the simulation case folder (at the top of the <code>caseSetup</code> and <code>settings</code>).</p>
<h2>Creating particles</h2>
<p>Open the file <code>settings/particlesDict</code>. Two dictionaries, <code>positionParticles</code> and <code>setFields</code> position particles and set the field values for the particles. In dictionary <code>positionParticles</code>, the positioning <code>method</code> is <code>positionOrdered</code>, which position particles in order in the space defined by <code>box</code>. <code>box</code> space is defined by two corner points <code>min</code> and <code>max</code>. In dictionary <code>positionOrderedInfo</code>, <code>numPoints</code> defines number of particles; <code>diameter</code>, the distance between two adjacent particles, and <code>axisOrder</code> defines the axis order for filling the space by particles.</p>
<div align="center"> in <b>settings/particlesDict</b> file </div><div class="fragment"><div class="line"> {C++}</div>
<div class="line">positionParticles</div>
<div class="line">{</div>
<div class="line"> method positionOrdered; // ordered positioning</div>
<div class="line"> maxNumberOfParticles 40000; // maximum number of particles in the simulation</div>
<div class="line"> mortonSorting Yes; // perform initial sorting based on morton code? </div>
<div class="line"> </div>
<div class="line"> box // box for positioning particles </div>
<div class="line"> {</div>
<div class="line"> min (-0.08 -0.08 0.015); // lower corner point of the box </div>
<div class="line"> max ( 0.08 0.08 0.098); // upper corner point of the box </div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> positionOrderedInfo</div>
<div class="line"> {</div>
<div class="line"> diameter 0.004; // minimum space between centers of particles</div>
<div class="line"> numPoints 30000; // number of particles in the simulation </div>
<div class="line"> axisOrder (z y x); // axis order for filling the space with particles</div>
<div class="line"> }</div>
<div class="line">}</div>
</div><!-- fragment --><p>In dictionary <code>setFields</code>, dictionary <code>defaultValue</code> defines the initial value for particle fields (here, <code>velocity</code>, <code>acceleration</code>, <code>rotVelocity</code>, and <code>shapeName</code>). Note that <code>shapeName</code> field should be consistent with the name of shape that you later set for shapes (here one shape with name <code>sphere1</code>).</p>
<div align="center"> in <b>settings/particlesDict</b> file </div><div class="fragment"><div class="line"> {C++}</div>
<div class="line">setFields</div>
<div class="line">{</div>
<div class="line"> defaultValue </div>
<div class="line"> {</div>
<div class="line"> velocity realx3 (0 0 0); // linear velocity (m/s)</div>
<div class="line"> acceleration realx3 (0 0 0); // linear acceleration (m/s2)</div>
<div class="line"> rotVelocity realx3 (0 0 0); // rotational velocity (rad/s)</div>
<div class="line"> shapeName word sphere1; // name of the particle shape </div>
<div class="line"> }</div>
<div class="line"> selectors</div>
<div class="line"> {}</div>
<div class="line">}</div>
</div><!-- fragment --><p>Enter the following command in the terminal to create the particles and store them in <code>0</code> folder.</p>
<p><code>&gt; particlesPhasicFlow</code></p>
<h2>Creating geometry</h2>
<p>In file <code>settings/geometryDict</code> , you can provide information for creating geometry. Each simulation should have a <code>motionModel</code> that defines a model for moving the surfaces in the simulation. <code>rotatingAxisMotion</code> model defines a fixed axis which rotates around itself. The dictionary <code>rotAxis</code> defines an motion component with <code>p1</code> and <code>p2</code> as the end points of the axis and <code>omega</code> as the rotation speed in rad/s. You can define more than one motion component in a simulation.</p>
<div align="center"> in <b>settings/geometryDict</b> file </div><div class="fragment"><div class="line"> {C++}</div>
<div class="line">motionModel rotatingAxisMotion; </div>
<div class="line">.</div>
<div class="line">.</div>
<div class="line">.</div>
<div class="line">rotatingAxisMotionInfo</div>
<div class="line">{</div>
<div class="line"> rotAxis </div>
<div class="line"> {</div>
<div class="line"> p1 (0.0 0.0 0.0); // first point for the axis of rotation </div>
<div class="line"> p2 (0.0 0.0 1.0); // second point for the axis of rotation</div>
<div class="line"> omega 1.214; // rotation speed (rad/s)</div>
<div class="line"> }</div>
<div class="line">}</div>
</div><!-- fragment --><p>In the dictionary <code>surfaces</code> you can define all the surfaces (walls) in the simulation. Two main options are available: built-in geometries in PhasicFlow, and providing surfaces with stl file. Here we use built-in geometries. In <code>cylinder</code> dictionary, a cylindrical shell with end radii, <code>radius1</code> and <code>radius2</code>, axis end points <code>p1</code> and <code>p2</code>, <code>material</code> name <code>prop1</code>, <code>motion</code> component <code>rotAxis</code> is defined. <code>resolution</code> sets number of division for the cylinder shell. <code>wall1</code> and <code>wall2</code> define two plane walls at two ends of cylindrical shell with coplanar corner points <code>p1</code>, <code>p2</code>, <code>p3</code>, and <code>p4</code>, <code>material</code> name <code>prop1</code> and <code>motion</code> component <code>rotAxis</code>. <br />
</p>
<div align="center"> in <b>settings/geometryDict</b> file </div><div class="fragment"><div class="line"> {C++}</div>
<div class="line">surfaces</div>
<div class="line">{</div>
<div class="line"> cylinder</div>
<div class="line"> {</div>
<div class="line"> type cylinderWall; // type of the wall</div>
<div class="line"> p1 (0.0 0.0 0.0); // begin point of cylinder axis</div>
<div class="line"> p2 (0.0 0.0 0.1); // end point of cylinder axis</div>
<div class="line"> radius1 0.12; // radius at p1</div>
<div class="line"> radius2 0.12; // radius at p2</div>
<div class="line"> resolution 24; // number of divisions</div>
<div class="line"> material prop1; // material name of this wall</div>
<div class="line"> motion rotAxis; // motion component name </div>
<div class="line"> }</div>
<div class="line"> wall1</div>
<div class="line"> {</div>
<div class="line"> type planeWall; // type of the wall</div>
<div class="line"> p1 (-0.12 -0.12 0.0); // first point of the wall</div>
<div class="line"> p2 ( 0.12 -0.12 0.0); // second point</div>
<div class="line"> p3 ( 0.12 0.12 0.0); // third point</div>
<div class="line"> p4 (-0.12 0.12 0.0); // fourth point </div>
<div class="line"> material prop1; // material name of the wall </div>
<div class="line"> motion rotAxis; // motion component name </div>
<div class="line"> }</div>
<div class="line"> wall2</div>
<div class="line"> {</div>
<div class="line"> type planeWall;</div>
<div class="line"> p1 (-0.12 -0.12 0.1);</div>
<div class="line"> p2 ( 0.12 -0.12 0.1);</div>
<div class="line"> p3 ( 0.12 0.12 0.1);</div>
<div class="line"> p4 (-0.12 0.12 0.1);</div>
<div class="line"> material prop1;</div>
<div class="line"> motion rotAxis;</div>
<div class="line"> }</div>
<div class="line">}</div>
</div><!-- fragment --><p>Enter the following command in the terminal to create the geometry and store it in <code>0/geometry</code> folder.</p>
<p><code>&gt; geometryPhasicFlow</code></p>
<h2>Defining properties and interactions</h2>
<p>In the file <code>caseSetup/interaction</code> , you find properties of materials. <code>materials</code> defines a list of material names in the simulation and <code>densities</code> sets the corresponding density of each material name. model dictionary defines the interaction model for particle-particle and particle-wall interactions. <code>contactForceModel</code> selects the model for mechanical contacts (here nonlinear model with limited tangential displacement) and <code>rollingFrictionModel</code> selects the model for calculating rolling friction. Other required prosperities should be defined in this dictionary.</p>
<div align="center"> in <b>caseSetup/interaction</b> file </div><div class="fragment"><div class="line"> {C++}</div>
<div class="line">materials (prop1); // a list of materials names</div>
<div class="line">densities (1000.0); // density of materials [kg/m3]</div>
<div class="line">.</div>
<div class="line">.</div>
<div class="line">.</div>
<div class="line">model</div>
<div class="line">{</div>
<div class="line"> contactForceModel nonLinearNonLimited;</div>
<div class="line"> rollingFrictionModel normal;</div>
<div class="line"> </div>
<div class="line"> Yeff (1.0e6); // Young modulus [Pa]</div>
<div class="line"> Geff (0.8e6); // Shear modulus [Pa]</div>
<div class="line"> nu (0.25); // Poisson&#39;s ratio [-]</div>
<div class="line"> en (0.7); // coefficient of normal restitution</div>
<div class="line"> et (1.0); // coefficient of tangential restitution </div>
<div class="line"> mu (0.3); // dynamic friction </div>
<div class="line"> mur (0.1); // rolling friction </div>
<div class="line">}</div>
</div><!-- fragment --><p>Dictionary <code>contactSearch</code> sets the methods for particle-particle and particle-wall contact search. <code>method</code> specifies the algorithm for finding neighbor list for particle-particle contacts and <code>wallMapping</code> shows how particles are mapped onto walls for finding neighbor list for particle-wall contacts. <code>updateFrequency</code> sets the frequency for updating neighbor list and <code>sizeRatio</code> sets the size of enlarged cells (with respect to particle diameter) for finding neighbor list. Larger <code>sizeRatio</code> include more particles in the neighbor list and you require to update it less frequent.</p>
<div align="center"> in <b>caseSetup/interaction</b> file </div><div class="fragment"><div class="line"> {C++}</div>
<div class="line">contactSearch</div>
<div class="line">{</div>
<div class="line"> method NBS; // method for broad search particle-particle</div>
<div class="line"> wallMapping cellsSimple; // method for broad search particle-wall </div>
<div class="line"> </div>
<div class="line"> NBSInfo</div>
<div class="line"> {</div>
<div class="line"> updateFrequency 20; // each 20 timesteps, update neighbor list </div>
<div class="line"> sizeRatio 1.1; // bounding box size to particle diameter (max)</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> cellsSimpleInfo</div>
<div class="line"> {</div>
<div class="line"> updateFrequency 20; // each 20 timesteps, update neighbor list </div>
<div class="line"> cellExtent 0.7; // bounding box for particle-wall search (&gt; 0.5)</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line">}</div>
</div><!-- fragment --><p>In the file <code>caseSetup/sphereShape</code>, you can define a list of <code>names</code> for shapes (<code>shapeName</code> in particle field), a list of diameters for shapes and their <code>properties</code> names.</p>
<div align="center"> in <b>caseSetup/sphereShape</b> file </div><div class="fragment"><div class="line"> {C++}</div>
<div class="line">names (sphere1); // names of shapes </div>
<div class="line">diameters (0.004); // diameter of shapes </div>
<div class="line">materials (prop1); // material names for shapes </div>
</div><!-- fragment --><p>Other settings for the simulation can be set in file <code>settings/settingsDict</code>. The dictionary <code>domain</code> defines the a rectangular bounding box with two corner points for the simulation. Each particle that gets out of this box, will be deleted automatically.</p>
<div align="center"> in <b>settings/settingsDict</b> file </div><div class="fragment"><div class="line"> {C++}</div>
<div class="line">dt 0.00001; // time step for integration (s)</div>
<div class="line">startTime 0; // start time for simulation </div>
<div class="line">endTime 10; // end time for simulation </div>
<div class="line">saveInterval 0.1; // time interval for saving the simulation</div>
<div class="line">timePrecision 6; // maximum number of digits for time folder </div>
<div class="line">g (0 -9.8 0); // gravity vector (m/s2) </div>
<div class="line">domain </div>
<div class="line">{</div>
<div class="line"> min (-0.12 -0.12 0);</div>
<div class="line"> max (0.12 0.12 0.11);</div>
<div class="line">}</div>
<div class="line">integrationMethod AdamsBashforth2; // integration method </div>
</div><!-- fragment --><h1>Running the case</h1>
<p>The solver for this simulation is <code>sphereGranFlow</code>. Enter the following command in the terminal. Depending on the computational power, it may take a few minutes to a few hours to complete.</p>
<p><code>&gt; sphereGranFlow</code></p>
<h1>Post processing</h1>
<p>After finishing the simulation, you can render the results in Paraview. To convert the results to VTK format, just enter the following command in the terminal. This will converts all the results (particles and geometry) to VTK format and store them in folder <code>VTK/</code>.</p>
<p><code>&gt; pFlowToVTK</code> </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
</ul>
</div>
</body>
</html>