<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">
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Dear Nicolas,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">It looks like you need to declare eltot to be an integer -</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Paul</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Nek5000-users <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> Wednesday, May 9, 2018 3:15:11 PM<br>
<b>To:</b> nek5000-users@lists.mcs.anl.gov<br>
<b>Subject:</b> [Nek5000-users] Separate temperature perturbation field</font>
<div> </div>
</div>
<meta content="text/html; charset=utf-8">
<div>
<div dir="ltr">
<div>Hello,<br>
<br>
I'm working with teh effects of a local temperature perturbation in a natural convection problem. To define the perturbations I intend to create a separate field that will be added to the regular temperature field when calculating the buoyancy force (<span style="font-family:monospace,monospace">ffz=Pr*(temp+temp_perturb)</span>),
but I'm having troubles initializating and setting the values.<br>
<br>
To build the field I added a common block in <span style="font-family:monospace,monospace">
usric()</span>, <span style="font-family:monospace,monospace">usrchk()</span> and
<span style="font-family:monospace,monospace">usrf()</span><br>
<br>
<span style="font-family:monospace,monospace"> common /perturb/ temp_perturb(lx1,ly1,lz1,lelt,ldimt)</span><br>
<br>
To initialize I tried to use <span style="font-family:monospace,monospace">rzero()</span> as is used in
<span style="font-family:monospace,monospace">avg_all()</span>:<br>
<span style="font-family:monospace,monospace"><br>
subroutine useric(ix,iy,iz,eg)<br>
<br>
integer ix,iy,iz,eg,eltot<br>
<br>
include 'SIZE'<br>
include 'TOTAL'<br>
include 'NEKUSE'<br>
<br>
common /perturb/ temp_perturb(lx1,ly1,lz1,lelt,ldimt)<br>
<br>
ux = 0.0<br>
uy = 0.0<br>
uz = 0.0<br>
t = 0.0<br>
<br>
eltot = lx1*ly1*lz1*nelt<br>
<br>
do i = 1,ldimt<br>
call rzero(temp_perturb(1,1,1,1,i),eltot)<br>
enddo<br>
<br>
return<br>
end</span><br>
<br>
</div>
To generate the files, in <span style="font-family:monospace,monospace">usrchk()<br>
<br>
</span>
<div><span style="font-family:monospace,monospace"> subroutine userchk()<br>
<br>
include 'SIZE'<br>
include 'TOTAL'<br>
<br>
integer e,eg<br>
<br>
common /perturb/ temp_perturb(lx1,ly1,lz1,lelt,ldimt)<br>
<br>
call outpost(vx,vy,vz,pr,temp_perturb,'pt1') <br>
call outpost2(vx,vy,vz,pr,temp_perturb,ldimt,'pt2')<br>
<br>
return<br>
end</span><br>
<br>
But after running the simulation the temperature perturbation field is a mess of NaNs and numbers of order 1e+38. Also, there's no other operation with 'temp_perturb' in the .usr file.<br>
<br>
Thanks in advance,<br>
<br clear="all">
<div>
<div class="x_gmail_signature">
<div dir="ltr"><b>Nicolás Andrés Órdenes Leiva</b>
<div><b><br>
</b>
<div>
<div>Estudiante de Ingeniería Civil Mecánica</div>
<div>Universidad Técnica Federico Santa María</div>
<div>Tel: +56 9 7619 2857</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>