<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="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>