<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 12pt;">Hi Sandeep,
<div><br>
</div>
<div>The MHD implementation in Nek5000 works only for constant properties so far but it is possible to generalize it to a case with ifuservp=.true.  Let me know if you want to discuss this offline: obabko@mcs.anl.gov</div>
<div><br>
</div>
<div>Aleks <br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF405506" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> nek5000-users-bounces@lists.mcs.anl.gov [nek5000-users-bounces@lists.mcs.anl.gov] on behalf of nek5000-users@lists.mcs.anl.gov [nek5000-users@lists.mcs.anl.gov]<br>
<b>Sent:</b> Thursday, December 01, 2016 11:31 AM<br>
<b>To:</b> nek5000-users@lists.mcs.anl.gov<br>
<b>Subject:</b> [Nek5000-users] uservp MHD error<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Hello All,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">I want to run MHD case with different magnetic diffusivities in different region of the domain.</div>
<div class="gmail_default" style="font-size:small">Can we run MHD run with different magnetic diffusivities?</div>
<div class="gmail_default" style="font-size:small">Assuming that udiff=magnetic diffusivity (eta), in the uservp file I added the following<br>
</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">
<div class="gmail_default">      1.0000000E+00     p30 > 0 ==> properties set in uservp()</div>
<div><br>
</div>
</div>
<div class="gmail_default">
<div class="gmail_default">
<div class="gmail_default">      subroutine uservp (ix,iy,iz,ieg)</div>
<div class="gmail_default">      include 'SIZE'</div>
<div class="gmail_default">      include 'TOTAL'</div>
<div class="gmail_default">      include 'NEKUSE'</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">      if (ifield.eq.1) then<span class="gmail-Apple-tab-span" style="white-space:pre">
</span>! velocity</div>
<div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre"></span>utrans = param(1)</div>
<div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre"></span>udiff  = param(2)</div>
<div class="gmail_default">      elseif (ifield.eq.ifldmhd) then<span class="gmail-Apple-tab-span" style="white-space:pre">
</span>! B-field</div>
<div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre"></span>utrans = 1.0</div>
<div class="gmail_default">        R1 = sqrt(x*x+y*y); </div>
<div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre"></span>if(R1 .le. 2.0) then</div>
<div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre"></span>udiff= param(29)</div>
<div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre"></span>else</div>
<div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre"></span>udiff= 1000.0D0*param(29)</div>
<div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre"></span>endif</div>
<div class="gmail_default"><span class="gmail-Apple-tab-span" style="white-space:pre"></span> endif<span class="gmail-Apple-tab-span" style="white-space:pre">
</span></div>
<div class="gmail_default">      </div>
<div class="gmail_default">      return</div>
<div class="gmail_default">      end</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">I get an error </div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">
<div class="gmail_default"> done :: set initial conditions</div>
<div class="gmail_default">  </div>
<div class="gmail_default">  ERROR:  Non-positive diffusivity (    0.00    ) specified for field 2, group 0 element</div>
<div class="gmail_default">  ERROR:  Non-positive diffusivity (    0.00    ) specified for field 2, group 0 element</div>
<div><br>
</div>
<div>Attached are the .usr, .rea and the logfile</div>
<div><br>
</div>
<div>When I set the p30=0.000 and just utrans=0.0 udiff=0.0 in the uservp, the simulation is running fine.</div>
<div>Thank you in advance.</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Sandeep</div>
</div>
<div class="gmail_default"><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>