-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfiguration_file.html
231 lines (209 loc) · 17.1 KB
/
configuration_file.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Configuration file — pymm documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=5929fcd5"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="author" title="About these documents" href="about.html" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Examples" href="examples.html" />
<link rel="prev" title="Installation" href="installation.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" style="background: #aaaaaa" >
<a href="index.html">
<img src="_static/pymm_logo.png" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Configuration file</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#image-related-parameters">Image-related parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="#figure-and-device-related-parameters">Figure- and device-related parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="#mesh-related-parameters">Mesh-related parameters</a></li>
<li class="toctree-l2"><a class="reference internal" href="#remaining-parameters">Remaining parameters</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="api.html">pymm Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="output_folder.html">Output folder</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="related.html">Related</a></li>
<li class="toctree-l1"><a class="reference internal" href="about.html">About pymm</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" style="background: #aaaaaa" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">pymm</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Configuration file</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/configuration_file.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="configuration-file">
<h1>Configuration file<a class="headerlink" href="#configuration-file" title="Link to this heading"></a></h1>
<p>Let us consider the image below (this image and the real dimensions can be
extracted from Fig. 52 in <a class="reference external" href="https://hdl.handle.net/1956/21300">Benali2019</a> and Fig. 1c
in <a class="reference external" href="https://doi.org/10.1016/j.ijggc.2023.103885">Liu2022</a>).</p>
<figure class="align-default" id="id4">
<img alt="_images/microsystem.png" src="_images/microsystem.png" />
<figcaption>
<p><span class="caption-text">Grains and pore space configuration.</span><a class="headerlink" href="#id4" title="Link to this image"></a></p>
</figcaption>
</figure>
<p>This image (2D) consists of 805x252 pixels, and the real dimensions (3D) are 6.74e-3 x 2.5e-3 x 0.03e-3 [m].
We remark that the image of the pattern used in the numerical simulations in <a class="reference external" href="https://doi.org/10.1016/j.ijggc.2023.103885">Liu2022</a>
has a much higher resolution.</p>
<p>The current implementation allows for the following input parameters:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="linenos"> 1</span><span class="c1">#Set the pymm parameters</span>
<span class="linenos"> 2</span><span class="n">lenght</span> <span class="o">=</span> <span class="mf">6.74e-3</span> <span class="c1">#Image-related, length of the microsystem [m]</span>
<span class="linenos"> 3</span><span class="n">width</span> <span class="o">=</span> <span class="mf">2.5e-3</span> <span class="c1">#Image-related, height of the microsystem [m]</span>
<span class="linenos"> 4</span><span class="n">tickness</span> <span class="o">=</span> <span class="mf">0.03e-3</span> <span class="c1">#Image-related, depth of the microsystem [m]</span>
<span class="linenos"> 5</span><span class="n">grainMeaning</span> <span class="o">=</span> <span class="mi">1</span> <span class="c1">#Image-related, 0 if the grains in the image are light colors (e.g., white) or 1 for dark colors (e.g., black)</span>
<span class="linenos"> 6</span><span class="n">threshold</span> <span class="o">=</span> <span class="mf">0.5</span> <span class="c1">#Image-related, threshold for converting the image to binary</span>
<span class="linenos"> 7</span><span class="n">rescale</span> <span class="o">=</span> <span class="mi">1</span> <span class="c1">#Image-related, rescaled factor for the input image</span>
<span class="linenos"> 8</span><span class="n">grainsSize</span> <span class="o">=</span> <span class="mi">0</span> <span class="c1">#Image-related, minimum size of the grain clusters</span>
<span class="linenos"> 9</span><span class="n">borderTol</span> <span class="o">=</span> <span class="mi">0</span> <span class="c1">#Image-related, tolerance to approximate the border as polygon</span>
<span class="linenos">10</span><span class="n">grainsTol</span> <span class="o">=</span> <span class="mi">0</span> <span class="c1">#Image-related, tolerance to approximate the grains as polygon</span>
<span class="linenos">11</span><span class="n">lineWidth</span> <span class="o">=</span> <span class="mi">1</span> <span class="c1">#Figure-related, line width to show the contours in the produced figures</span>
<span class="linenos">12</span><span class="n">channelWidth</span> <span class="o">=</span> <span class="mf">0.2e-3</span> <span class="c1">#Device-related, width of the top and bottom channels in the micromodel device [m]</span>
<span class="linenos">13</span><span class="n">meshSize</span> <span class="o">=</span> <span class="mf">8e-6</span> <span class="c1">#Mesh-related, mesh size [m]</span>
<span class="linenos">14</span><span class="n">viscocity</span> <span class="o">=</span> <span class="mf">1e-6</span> <span class="c1">#Fluid-related, kinematic viscosity [dynamic viscosity/fluid_density, m2/s]</span>
<span class="linenos">15</span><span class="n">diffusion</span> <span class="o">=</span> <span class="mf">1e-12</span> <span class="c1">#Fluid-related, diffusion coefficient for the tracer [m2/s]</span>
<span class="linenos">16</span><span class="n">inletLocation</span> <span class="o">=</span> <span class="s2">"top"</span> <span class="c1">#Simulation-related, inlet bc location (left, top, right, or bottom)</span>
<span class="linenos">17</span><span class="n">inletValue</span> <span class="o">=</span> <span class="mf">5.0e-4</span> <span class="c1">#Simulation-related, inlet bc value (pressure/fluid_density, [Pa/(kg/m3)])</span>
<span class="linenos">18</span><span class="n">tracerTime</span> <span class="o">=</span> <span class="mi">120</span> <span class="c1">#Simulation-related, end time for the tracer simulation [s]</span>
<span class="linenos">19</span><span class="n">tracerWrite</span> <span class="o">=</span> <span class="mi">1</span> <span class="c1">#Simulation-related, time interval to write the tracer results [s]</span>
<span class="linenos">20</span><span class="n">pressureConv</span> <span class="o">=</span> <span class="mf">1e-7</span> <span class="c1">#Solver-related, convergence criterium for the pressure solution in the numerical scheme for the Stokes simulation</span>
<span class="linenos">21</span><span class="n">velocityConv</span> <span class="o">=</span> <span class="mf">1e-8</span> <span class="c1">#Solver-related, convergence criterium for the velocity solution in the numerical scheme for the Stokes simulation</span>
<span class="linenos">22</span><span class="n">iterationsMax</span> <span class="o">=</span> <span class="mi">10000</span> <span class="c1">#Solver-related, maximum number of iterations for the Stokes simulation in case the convergence criteria have not been reached</span>
<span class="linenos">23</span><span class="n">tracerStep</span> <span class="o">=</span> <span class="mi">1</span> <span class="c1">#Solver-related, time step in the numerical scheme for the tracer simulation [s]</span>
</pre></div>
</div>
<section id="image-related-parameters">
<h2>Image-related parameters<a class="headerlink" href="#image-related-parameters" title="Link to this heading"></a></h2>
<p>The three first parameters set the real dimensions of the microsystem. The next parameter sets the meaning of the grains in the image, i.e.,
0 if the grains in the image are light colors (e.g., white) or 1 for dark colors (e.g., black) The following parameter sets the threshold
value to convert the image to binary, which is internally converted to gray scale (valid values from 0 to 1). The rescaled factor parameter reduces the number
of pixels of the image (valid values between 0 and 1, see
<a class="reference external" href="https://scikit-image.org/docs/stable/api/skimage.transform.html#skimage.transform.rescale">skimage.transform.rescale</a>).
The minimum size of the grain clusters controls the number of pixels to consider for the internal grains (valid values are
greater than 0, see <a class="reference external" href="https://porespy.org/modules/generated/porespy.filters.trim_small_clusters.html">porespy.filters.trim_small_clusters</a> ).
The two following parameters, for setting the tolerance to approximate the contours of polygons, reduce the number of points in the extracted border
and internal grains respectively (valid values are 0 or greater than 0, see <a class="reference external" href="https://scikit-image.org/docs/stable/auto_examples/edges/plot_polygon.html">skimage.measure.approximate_polygon</a> ).
The following figure shows the internal grains and border for three decreasing values of the minimum size cluster and tolerances.</p>
<figure class="align-default">
<img alt="_images/size_500_5_5.png" src="_images/size_500_5_5.png" />
</figure>
<figure class="align-default">
<img alt="_images/size_100_1_1.png" src="_images/size_100_1_1.png" />
</figure>
<figure class="align-default" id="id5">
<img alt="_images/size_0_0_0.png" src="_images/size_0_0_0.png" />
<figcaption>
<p><span class="caption-text">Extracted contours for minimum size of the cluster grains and tolerances for the polygon approximation of (top) 500, 5, 5, (middle) 100, 1, 1, and (bottom) 0, 0, 0, respectively.</span><a class="headerlink" href="#id5" title="Link to this image"></a></p>
</figcaption>
</figure>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>The smaller are these numbers, the more detail is included in the mesh; however, this increases the execution
time to create the mesh and to run the simulations.</p>
</div>
</section>
<section id="figure-and-device-related-parameters">
<h2>Figure- and device-related parameters<a class="headerlink" href="#figure-and-device-related-parameters" title="Link to this heading"></a></h2>
<p>The figure parameter controls the line width of the contours on the output images, while the device parameter controls the
width of the channels in the device microsystem (see the following subsection for details about the implemented device).</p>
</section>
<section id="mesh-related-parameters">
<h2>Mesh-related parameters<a class="headerlink" href="#mesh-related-parameters" title="Link to this heading"></a></h2>
<p>Currently the only input parameter (via de configuration file, one can always modify the template files) for the mesh is
the mesh size. The following figure shows the generated mesh for two different mesh sizes.</p>
<figure class="align-default">
<img alt="_images/mesh_1e4.png" src="_images/mesh_1e4.png" />
</figure>
<figure class="align-default" id="id6">
<img alt="_images/mesh_1e5.png" src="_images/mesh_1e5.png" />
<figcaption>
<p><span class="caption-text">Two different generated meshes of sizes (top) 1e-4 and (bottom) 1e-5.</span><a class="headerlink" href="#id6" title="Link to this image"></a></p>
</figcaption>
</figure>
<p>There are currently two template files that define the configuration of the microsystem: image.mako and device.mako.
The template image.mako set the computational grid to the extend of the image, while device.mako creates the micromodel geometry as in
<a class="reference external" href="https://hdl.handle.net/1956/21300">Benali2019</a> and <a class="reference external" href="https://doi.org/10.1016/j.ijggc.2023.103885">Liu2022</a>. On the grains and device walls we consider no-slip conditions. Then one could look at those files to modify the values
(e.g., to create quad elements for the mesh) or to define new micromodel geometries (e.g., a micromodel with a vertical cross-type shape).
The following figure shows the geometry of the device micromodel.</p>
<figure class="align-default" id="id7">
<img alt="_images/device.png" src="_images/device.png" />
<figcaption>
<p><span class="caption-text">Geometry of the device mode.</span><a class="headerlink" href="#id7" title="Link to this image"></a></p>
</figcaption>
</figure>
</section>
<section id="remaining-parameters">
<h2>Remaining parameters<a class="headerlink" href="#remaining-parameters" title="Link to this heading"></a></h2>
<p>The remaining parameters are OpenFOAM related. For example, <strong>inletLocation</strong> sets the side where the fluid is injected, and for the device,
‘top’ corresponds to the left top entry, ‘right’ to the top right entry, etc. Refer to the online OpenFOAM resources for details about
the simulator and <a class="reference external" href="https://www.slideshare.net/ElwardiFadli/permeability-of-soils">this nice presentation</a>
using the OpenFOAM solver simpleFoam in another micromodel application. Details about the solver simpleFoam
and mathematical model can be found <a class="reference external" href="https://openfoamwiki.net/index.php/OpenFOAM_guide/The_SIMPLE_algorithm_in_OpenFOAM">in this link</a>.
Details about the solver scalarTransportFoam and mathematical model can be found <a class="reference external" href="https://openfoamwiki.net/index.php/ScalarTransportFoam">here</a>.</p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="installation.html" class="btn btn-neutral float-left" title="Installation" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="examples.html" class="btn btn-neutral float-right" title="Examples" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2022, NORCE Norwegian Research Centre AS.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>