<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<div style="">
<p><span style="font-size:12.0pt; color:black"> </span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US">Hi Everyone,</span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US"> </span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US">my name is Torben Prill and I work for the German Aerospace Center (DLR) at their site in Stuttgart. Mostly I work on reactive flow/transport problems in porous media.<br>
</span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US">I have been using the dune-fem python bindings since last year in two of my projects with great success, so thank you for providing such a versatile and ,still, performant library.</span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US"> </span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US">Right now, I am using dune-fem/-fem-dg for developing a simulator for granular flow. More specifically, I am using dune-fem and dune-fem-dg at version 2.8.0.dev20210318 from pip.</span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US">The problem consists of a convection equation and an equation for the convection velocity, which is computed from an equation using a strain rate dependent stress tensor:</span></p>
<p><span style="font-size:12.0pt; color:black">d \<span style="">rho</span> /<span style="">dt</span> = \<span style="">nabla</span> \<span style="">rho</span>(<span style="">x,t</span>) \<span style="">cdot</span> v(<span style="">x,t</span>)</span></p>
<p><span style="font-size:12.0pt; color:black">0 = \<span style="">sigma</span> ( \<span style="">epsilon</span>(v), \<span style="">rho</span>) (<span style="">x,t</span>)</span></p>
<p><span style="font-size:12.0pt; color:black"> </span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US">The spatial discretization of \rho is using first order DG, the mechanical problem is solved with first order FE.</span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US"> </span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US">As \rho must be in certain limits to be physical (say \rho \in [0,1]), I was looking at using the scaling limiter. However, the limiter seems to have no effect when applied to a function. I attached
a small example where a function undershoots into the negatives, which should be "scaled away", but isn't.</span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US"> </span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US">Some help (or an explanation if I am getting something wrong) would be greatly appreciated.</span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US"> </span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US">Many thanks and best regards,</span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US"> </span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US">Torben</span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US"> </span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US">Example:</span></p>
<p><span style="font-size:12.0pt; color:black" lang="EN-US"> </span></p>
<div>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="font-size:12.0pt; color:black" lang="EN-US">from <span style="">dune.grid</span> import
<span style="">onedGrid</span>, <span style="">cartesianDomain</span><br>
from <span style="">dune.fem.space</span> import <span style="">dgonb</span> as <span style="">
dgSpace</span><br>
from <span style="">dune.femdg</span> import <span style="">createLimiter</span><br>
<br>
import <span style="">numpy</span> as np<br>
import <span style="">matplotlib.pyplot</span> as <span style="">pyplot</span><br>
<br>
<br>
<span style="">numCells</span> = 20<br>
<span style="">cellSize</span>=1/20<br>
v = [<span style="">cellSize</span>*<span style="">i</span> for <span style="">i</span> in range(int(<span style="">numCells</span>)+1)]<br>
e = [(i,i+1) for <span style="">i</span> in range(1,len(v))]<br>
<span style="">gridView</span> = <span style="">onedGrid</span>(constructor={"<span style="">vertices":v</span>, "<span style="">simplices":e</span>})<br>
<br>
<span style="">spaceRho</span> = <span style="">dgSpace</span>(<span style="">gridView</span>, order=1,storage="fem")<br>
rho = <span style="">spaceRho.interpolate</span>(0.0,name="rho")<br>
<br>
a = <span style="">np.array</span>([ 9.66522837e-01, -3.53578012e-03, 9.55669630e-01, -1.08714750e-02, 9.26611586e-01, -1.83159778e-02, 7.20361930e-01, -1.34572790e-01, 1.73962463e-01, -1.61475760e-01, 5.55255520e-03, -8.51611320e-03, 8.34673602e-04, -4.74279488e-04,
2.63059452e-04, -9.00403039e-05, 1.26471902e-04, -1.98571619e-05, 9.47407424e-05, -1.97633785e-14, 9.47407401e-05, 1.97633341e-14, 1.26471900e-04, 1.98571621e-05, 2.63059451e-04, 9.00403041e-05, 8.34673602e-04, 4.74279489e-04, 5.55255520e-03, 8.51611320e-03,
1.73962463e-01, 1.61475760e-01, 7.20361930e-01, 1.34572790e-01, 9.26611586e-01, 1.83159778e-02, 9.55669630e-01, 1.08714750e-02, 9.66522837e-01, 3.53578012e-03])<br>
for <span style="">i</span> in range(<span style="">len</span>(a)):<br>
<span style="">rho.dofVector</span>[<span style="">i</span>] = a[<span style="">i</span>]<br>
<br>
<span style="">pyplot.plot</span>(<span style="">gridView.tesselate</span>()[0], <span style="">
rho.pointData</span>(), '-')</span></p>
<div>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style=""><span style="font-size:12.0pt; color:black" lang="EN-US">tmp</span></span><span style="font-size:12.0pt; color:black" lang="EN-US"> =
<span style="">rho.copy</span>()<br>
<span style="">limiterOp</span> = <span style="">createLimiter</span>(<span style="">spaceRho</span>)</span></p>
</div>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="font-size:12.0pt; color:black" lang="EN-US"><br>
<span style="">limiterOp</span>(<span style="">rho,tmp</span>)<br>
<br>
<span style="">pyplot.plot</span>(<span style="">gridView.tesselate</span>()[0], <span style="">
tmp.pointData</span>(), '-')</span></p>
</div>
</div>
</div>
</body>
</html>