<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">Hi Nicolas,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">OK. You probably don't want to do that every time step (I'm just guessing...), but in any case, you would do it as written below.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Best, Paul</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;"> do i=1,n</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;"> x=xm1(i,1,1,1)</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;"> y=ym1(i,1,1,1)</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;"> z=zm1(i,1,1,1)</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;">
<br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;"> if(x.ge.px1.and.x.le.px2)then</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;"> if(z.ge.pz1.and.z.le.pz2)then</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;"> t(i,1,1,1,1) = t(i,1,1,1,1) + perturb</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;"> endif</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;"> endif</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 15px;"> end do</span><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> Monday, May 14, 2018 8:21:28 PM<br>
<b>To:</b> nek5000-users@lists.mcs.anl.gov<br>
<b>Subject:</b> Re: [Nek5000-users] Temperature Perturbation Zone</font>
<div> </div>
</div>
<meta content="text/html; charset=utf-8">
<div>
<div dir="ltr">
<div>Hi Paul,<br>
<br>
</div>
<div>It's not the boundary temperature what I'm trying to modify but a arbitrary zone inside the fluid domain. Boundary condition are 6 walls, 4 isolated and 2 with constant temperature, but that is already settled up.</div>
<div><br>
</div>
<div>After reading some entries on the mailing list I tried this</div>
<div><br>
</div>
<div>-----------------------------------------------------------------<br>
</div>
<div> subroutine userchk()<br>
<br>
include 'SIZE'<br>
include 'TOTAL'<br>
<br>
real period,amplitude,perturb<br>
real px1,px2,py1,py2<br>
integer n<br>
</div>
<div><br>
</div>
<div> amplitude = 1.2<br>
</div>
<div> period = 0.75<br>
perturb = amplitude * sin( (2.0*pi/period)*time )<br>
<br>
px1 = 0.25/2.0-0.05<br>
px2 = 0.25/2.0+0.05<br>
pz1 = 0.5-0.1<br>
pz2 = 0.5+0.1<br>
<br>
n = lx1*ly1*lz1*nelt<br>
<br>
do i=1,n<br>
x=xm1(i,1,1,1)<br>
y=ym1(i,1,1,1)<br>
z=zm1(i,1,1,1)<br>
<br>
if(x.ge.px1.and.x.le.px2)then<br>
if(z.ge.pz1.and.z.le.pz2)then<br>
(1) temp = temp + perturb ! Nothing happens<br>
(2) t = t + perturb ! WARNING: DIV(V)-QTL too large!<br>
endif<br>
endif<br>
end do<br>
<br>
return<br>
end</div>
<div>-----------------------------------------------------------------<br>
</div>
<div><br>
</div>
<div>After running the simulations, with (1) I get the same results that without it; with (2) the solver indicates "WARNING: DIV(V)-QTL too large!" in every timestep, makes some really small timesteps (1e-5 sec. vs 1e-2) and doesn't seem to converge.</div>
<div><br>
</div>
<div>I guess that the addition of the perturbation is bad defined.</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Nicolás<br>
</div>
<div></div>
</div>
<div class="x_gmail_extra"><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>
<br>
<div class="x_gmail_quote">2018-05-14 19:15 GMT-04:00 <span dir="ltr"><<a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.gov</a>></span>:<br>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div id="x_m_5052566157451557509divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<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">For time-dependent boundary conditions, you could</p>
<p style="margin-top:0; margin-bottom:0">use something like the expression you have in your email.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">You would need "t " ( "tee" space space) for the thermal</p>
<p style="margin-top:0; margin-bottom:0">boundary conditions in your .rea or .box file.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Please let me know if this solves your problem.</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%">
<div id="x_m_5052566157451557509divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Nek5000-users <<a href="mailto:nek5000-users-bounces@lists.mcs.anl.gov" target="_blank">nek5000-users-bounces@lists.<wbr>mcs.anl.gov</a>>
on behalf of <a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.<wbr>gov</a> <<a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.<wbr>gov</a>><br>
<b>Sent:</b> Monday, May 14, 2018 5:26:23 PM<br>
<b>To:</b> <a href="mailto:nek5000-users@lists.mcs.anl.gov" target="_blank">nek5000-users@lists.mcs.anl.<wbr>gov</a><br>
<b>Subject:</b> [Nek5000-users] Temperature Perturbation Zone</font>
<div> </div>
</div>
<div>
<div class="x_h5">
<div>
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div>I'm setting a 3D box to perform natural convection problems in a closed cavity. After trying several method i can't manage to define a zone with a variable temperature perturbation in the usrchk() routine.<br>
</div>
<div><br>
</div>
<div>Let's say, that temp = temp + A*sin(w*time) in a square of boundaries [x_min, x_max] x [y_min, y_max] x [z_min, z_max] for x, y, z.</div>
<div><br>
</div>
<div>Any advice for implementing this?<br>
</div>
<div><br>
</div>
<div>Regards,<br>
</div>
<div><br>
</div>
<div>
<div>
<div class="x_m_5052566157451557509x_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>
</div>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
Nek5000-users mailing list<br>
<a href="mailto:Nek5000-users@lists.mcs.anl.gov">Nek5000-users@lists.mcs.anl.<wbr>gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users" rel="noreferrer" target="_blank">https://lists.mcs.anl.gov/<wbr>mailman/listinfo/nek5000-users</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>