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

203 lines
13 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: Problem definition</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('md_tutorials_sphereGranFlow_binarySystemOfParticles_README.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">Problem definition </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>A rotating drum with two particle sizes is randomly filled and let it rotate to see the segregation of particles. The focus of this tutorial is to show how to use the pre-processing tool, <code>particlesPhasicFlow</code>, to create the initial mixture of small and large particles.</p>
<p><b>Note:</b> It is supposed that you have reviewed <a href="https://github.com/PhasicFlow/phasicFlow/wiki/Simulating-a-rotating-drum">simulating a rotating drum</a> tutorial before starting this tutorial.</p>
<div align="center"><b> a view of the rotating drum with small and large particles after 7 seconds of rotation</b> </div> <div align="center"> <img src="https://github.com/PhasicFlow/phasicFlow/blob/media/media/rotating-drum-binary-system.png" alt="" width="400" class="inline"/> </div><hr />
<h1>Case setup</h1>
<p>PhasicFlow simulation case setup is based on the text-based files that we provide in two folders located in the simulation case folder: <code>settings</code> and <code>caseSetup</code>. Here we will have a look at some important files and the rest can be found in the tutorial folder of this case setup.</p>
<p><a href="https://github.com/PhasicFlow/phasicFlow/tree/main/tutorials/sphereGranFlow/binarySystemOfParticles">Simulation case setup files can be found in tutorials/sphereGranFlow folder.</a> </p><h3>Shape definition</h3>
<p>In file <code>caseSetup/sphereShape</code>, two particle types with names <code>smallSphere</code> and <code>largeSphere</code> and diameters 3 and 5 mm are defined.</p>
<div align="center"> in <b>caseSetup/sphereShape</b> file </div><div class="fragment"><div class="line"> {C++}</div>
<div class="line">names (smallSphere largeSphere); // names of shapes </div>
<div class="line">diameters (0.003 0.005); // diameter of shapes (m)</div>
<div class="line">materials (prop1 prop1); // material names for shapes </div>
</div><!-- fragment --><h3>Positioning and initial mixture</h3>
<p>In dictionary <code>positionParticles</code> located in file <code>settings/particlesDict</code>, 30000 particles are located in a cylindrical region. These particles are positioned in order along <code>z</code>, <code>x</code> and then <code>y</code> axis with 0.005 m distance between their centers.</p>
<div align="center"> in <b>settings/particlesDict</b> file </div><div class="fragment"><div class="line"> {C++}</div>
<div class="line">// positions particles </div>
<div class="line">positionParticles</div>
<div class="line">{</div>
<div class="line"> method positionOrdered; // ordered positioning</div>
<div class="line"> </div>
<div class="line"> maxNumberOfParticles 30001; // 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"> cylinder // cylinder region for positioning particles </div>
<div class="line"> {</div>
<div class="line"> p1 (0.0 0.0 0.003); // begin point of cylinder axis (m m m)</div>
<div class="line"> p2 (0.0 0.0 0.097); // end point of cylinder axis (m m m)</div>
<div class="line"> radius 0.117; // radius of cylinder (m)</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> positionOrderedInfo</div>
<div class="line"> { </div>
<div class="line"> diameter 0.005; // minimum space between centers of particles</div>
<div class="line"> numPoints 30000; // number of particles in the simulation </div>
<div class="line"> axisOrder (z x y); // 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> located in file <code>settings/particlesDict</code>, you define the initial <code>velocity</code>, <code>acceleration</code>, <code>rotVelocity</code>, and <code>shapeName</code> fields for all 30000 particles in the simulation. In <code>selectors</code> dictionary, you can select subsets of particles and set the field value for these subsets. In <code>shapeAssigne</code> sub-dictionary, the <code>selectRange</code> selector is defined. It defines a range with <code>begin</code> (begin index), <code>end</code> (end index) and <code>stride</code> to select particles. And in <code>fieldValue</code> sub-dictionary, the fields values for selected particles are set (any number of field values can be set here).</p>
<p><b>Note:</b> Other selectors are: <code>selectBox</code> that selects particles inside a box and <code>randomSelect</code> that selects particles randomly from a given index range.</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"> /*</div>
<div class="line"> Default value for fields defined for particles</div>
<div class="line"> These fields should always be defined for simulations with </div>
<div class="line"> spherical particles.*/</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 smallSphere; // name of the particle shape </div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> selectors</div>
<div class="line"> {</div>
<div class="line"> shapeAssigne</div>
<div class="line"> {</div>
<div class="line"> selector selectRange; // type of point selector</div>
<div class="line"> selectRangeInfo</div>
<div class="line"> {</div>
<div class="line"> begin 0; // begin index of points</div>
<div class="line"> end 30000; // end index of points </div>
<div class="line"> stride 3; // stride for selector </div>
<div class="line"> }</div>
<div class="line"> fieldValue // fields that the selector is applied to </div>
<div class="line"> {</div>
<div class="line"> /*</div>
<div class="line"> sets shapeName of the selected points to largeSphere*/</div>
<div class="line"> shapeName word largeSphere;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> }</div>
<div class="line">}</div>
</div><!-- fragment --><h1>Running the simulation</h1>
<p>Enter the following command in terminal:</p>
<p><code>&gt; geometryPhasicFlow</code></p>
<p><code>&gt; particlesPhasicFlow</code></p>
<p><code>&gt; sphereGranFlow</code></p>
<h3>Note on using particlesPhasicFlow</h3>
<p>Each executable in PhasicFlow comes with some command line options that you can see them by using flag <code>-h</code> in front of that command.</p>
<p><code>&gt; particlesPhasicFlow -h</code> prints out the following output:</p>
<div class="fragment"><div class="line">Usage: particlesPhasicFlow [OPTIONS]</div>
<div class="line"> </div>
<div class="line">Options:</div>
<div class="line"> -h,--help Help for using createParticles of phasicFlow v-0.1</div>
<div class="line"> -v,--version Program version information</div>
<div class="line"> --discription What does this app do?</div>
<div class="line"> --positionParticles-only Exectue the positionParticles part only and store the created pointStructure in the time folder.</div>
<div class="line"> --setFields-only Exectue the setFields part only. Read the pointStructure from time folder and setFields and save the result in the same time folder.</div>
</div><!-- fragment --><p>so, with flag <code>--setFields-only</code>, you can execute the <code>setFields</code> part of <code>particlesDict</code>. Now suppose that you have a simulation case which proceeded up to 2 seconds and for any reason you want to change some field value at time 3 s and continue the simulation from 3 s. To this end, you need to change <code>startTime</code> in settings dictionary to 3, execute <code>particlesPhasicFlow --setFields-only</code>, and start the simulation. </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>