<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
 <channel>
  <atom:link href="http://www.comsol.com/community/forums/general/rss/thread/3946.rss" rel="self" type="application/rss+xml"/>
  <title>COMSOL Forums: how to avoid negative concentration</title>
  <link>http://www.comsol.com/community/forums/general/thread/3946/</link>
  <description>Most recent forum messages</description>
  <pubDate>Fri, 25 Jun 2010 18:15:52 +0000</pubDate>
  <image>
   <title>COMSOL Forums: how to avoid negative concentration</title>
   <url>http://www.comsol.com/shared/images/logos/comsol_logo.gif</url>
   <link>http://www.comsol.com/community/forums/general/thread/3946/</link>
  </image>
  <item>
   <title>Re: how to avoid negative concentration</title>
   <link>http://www.comsol.com/community/forums/general/thread/3946/#p18095</link>
   <description>To rephrase my question from above (I have looked all over tutorials, model files and such and could not find this): What is the proper syntax to define a Flux Discontinuity at a fluid/solid (or solid/solid) interface in the form: N = k*(c_surface - c_flow) ?&lt;br /&gt;&#13;
Thank you for any help on this.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Franz</description>
   <pubDate>Fri, 25 Jun 2010 18:15:52 +0000</pubDate>
   <guid isPermaLink="false">3946.1277489752.18095</guid>
  </item>
  <item>
   <title>Re: how to avoid negative concentration</title>
   <link>http://www.comsol.com/community/forums/general/thread/3946/#p18086</link>
   <description>&lt;div class=&quot;quote&quot;&gt;&lt;br /&gt;&#13;
the boundary condition is:&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
  N = kc*(Csurface-Cair)&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
&lt;/div&gt;&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Hi Xin,&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I am currently setting up my very first coupled convection/diffusion and fluid flow testcase in COMSOL and thus I have an extremely basic question, but I just don't see how it is done. How do you specify this flux in a case where you have convection and diffusion? Or rather how do you address the variable &amp;quot;C on the boundary&amp;quot; and &amp;quot;C in the flow&amp;quot;? Thank you very much for your help.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Franz</description>
   <pubDate>Fri, 25 Jun 2010 16:42:41 +0000</pubDate>
   <guid isPermaLink="false">3946.1277484161.18086</guid>
  </item>
  <item>
   <title>Re: how to avoid negative concentration</title>
   <link>http://www.comsol.com/community/forums/general/thread/3946/#p12395</link>
   <description>If the dependent variable is something like mass or particle density that must always be a positive quantity, another solution is to rewrite the original DE in terms of the logarithm of the variable. This would then require using the equation form to set up the model, and the terms might be complicated, but at least you would automatically be guaranteed that the results would be positive, regardless of whatever instability that there might be because of a too-course meshing. </description>
   <pubDate>Mon, 19 Apr 2010 07:45:14 +0000</pubDate>
   <guid isPermaLink="false">3946.1271663114.12395</guid>
  </item>
  <item>
   <title>Re: how to avoid negative concentration</title>
   <link>http://www.comsol.com/community/forums/general/thread/3946/#p10762</link>
   <description>first, you need to make sure where you want to have this smooth function. &lt;br /&gt;&#13;
&lt;br /&gt;&#13;
my example is just my case, for yours, you must think about where you want this? at boundary condition or some other expressions. then you can just put the smooth function in front of your equation. &lt;br /&gt;&#13;
&lt;br /&gt;&#13;
flc2hs(a,dC)*your equation.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
the equation can be at boundaries or at any global expression. &lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I hope it is clear now</description>
   <pubDate>Thu, 25 Mar 2010 10:25:20 +0000</pubDate>
   <guid isPermaLink="false">3946.1269512720.10762</guid>
  </item>
  <item>
   <title>Re: how to avoid negative concentration</title>
   <link>http://www.comsol.com/community/forums/general/thread/3946/#p10753</link>
   <description>Hi.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I am very new to Comsol, and I cannot find where to write this equation.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Is it in the NS model or in the CD one ? Can you more specific please ?&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Thank you so much.</description>
   <pubDate>Thu, 25 Mar 2010 09:45:10 +0000</pubDate>
   <guid isPermaLink="false">3946.1269510310.10753</guid>
  </item>
  <item>
   <title>Re: how to avoid negative concentration</title>
   <link>http://www.comsol.com/community/forums/general/thread/3946/#p10693</link>
   <description>for my case, because I have a negative concentration which I guess it is because of the boundary conditions.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
the boundary condition is:&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
  N = kc*(Csurface-Cair)&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
with smoothing function&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
  N = flc2hs(Cair-Csurface,dC)*kc*(Csurface-Cair)&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
where the variable dC is a constant that defines the smoothing interval width. Define this variable on the Options&amp;gt;Constants menu. It will take some experimenting to find a good value; start with a large value (large enough so that negative values do not occur), then decrease it as far as possible while keeping the solution positive.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I hope it helps.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Good luck,&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Xin</description>
   <pubDate>Wed, 24 Mar 2010 09:30:18 +0000</pubDate>
   <guid isPermaLink="false">3946.1269423018.10693</guid>
  </item>
  <item>
   <title>Re: how to avoid negative concentration</title>
   <link>http://www.comsol.com/community/forums/general/thread/3946/#p10666</link>
   <description>Hello.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I have a similar problem. Could you explain me how to use the smoothing function introduced in the KnowledgeBase?&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Thanks a lot.</description>
   <pubDate>Tue, 23 Mar 2010 15:20:45 +0000</pubDate>
   <guid isPermaLink="false">3946.1269357645.10666</guid>
  </item>
  <item>
   <title>Re: how to avoid negative concentration</title>
   <link>http://www.comsol.com/community/forums/general/thread/3946/#p10415</link>
   <description>Thanks for everyone's help. The problem is finally solved by using smoothing step function as introduced in the knowledge base.</description>
   <pubDate>Fri, 19 Mar 2010 15:12:51 +0000</pubDate>
   <guid isPermaLink="false">3946.1269011571.10415</guid>
  </item>
  <item>
   <title>Re: how to avoid negative concentration</title>
   <link>http://www.comsol.com/community/forums/general/thread/3946/#p10358</link>
   <description>It is possible that you have instability problems, which are common with high convection PDEs.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Try using &amp;quot;artificial diffusion&amp;quot;. This way you will not get overshoots and undershoots around c=0. Also try refining the mesh where the element has high C.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
There is a KnowledgeBase dedicated to this kind of problems. please search negative concentration.</description>
   <pubDate>Thu, 18 Mar 2010 16:35:27 +0000</pubDate>
   <guid isPermaLink="false">3946.1268930127.10358</guid>
  </item>
  <item>
   <title>Re: how to avoid negative concentration</title>
   <link>http://www.comsol.com/community/forums/general/thread/3946/#p10324</link>
   <description>Hi Arsen,&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Thanks for your suggestions. But it was not suitable for my problem...do you have any other suggestions? Thanks a lot.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Xin</description>
   <pubDate>Thu, 18 Mar 2010 08:06:58 +0000</pubDate>
   <guid isPermaLink="false">3946.1268899618.10324</guid>
  </item>
  <item>
   <title>Re: how to avoid negative concentration</title>
   <link>http://www.comsol.com/community/forums/general/thread/3946/#p10279</link>
   <description>I had the same problem. Seems that it results from too rude mesh.&lt;br /&gt;&#13;
Using &amp;quot;Refine Mesh&amp;quot; command always helped me,&lt;br /&gt;&#13;
though at first I have not expected that I need such a refined mesh to eliminate&lt;br /&gt;&#13;
large variations of concentration and its negative values.&lt;br /&gt;&#13;
 &lt;br /&gt;&#13;
 Good luck,&lt;br /&gt;&#13;
Arsen </description>
   <pubDate>Wed, 17 Mar 2010 20:49:51 +0000</pubDate>
   <guid isPermaLink="false">3946.1268858991.10279</guid>
  </item>
  <item>
   <title>Re: how to avoid negative concentration</title>
   <link>http://www.comsol.com/community/forums/general/thread/3946/#p10258</link>
   <description>Is there anyone could help me? This problem is really strange...&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I have checked...at some point I already got a zero flux at boundary which means the concentration will remain the same but it was not...The concentration still decrease...I am confused by this results because the boundary flux was already zero how can I get decreased concentration even minus concentration?&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I read from the  Knowledge Base that we could use smooth step function to avoid this but I did not really get how to do it...&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I will appreciate if some could help me to work this out.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Thanks!&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Xin</description>
   <pubDate>Wed, 17 Mar 2010 16:12:30 +0000</pubDate>
   <guid isPermaLink="false">3946.1268842350.10258</guid>
  </item>
  <item>
   <title>how to avoid negative concentration</title>
   <link>http://www.comsol.com/community/forums/general/thread/3946/#p10252</link>
   <description>Hi,&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I have a dynamic diffusion problem. I do not know why after running some time, I can get some negative values...I have checked the boundary conditions and they are correct...The concentration can not go for minus values...but actually I got negative values and I could not explain why...&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Is there someone could hlep me to solve this problem or give me some suggestions? &lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Thanks in advance.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Xin</description>
   <pubDate>Wed, 17 Mar 2010 14:35:34 +0000</pubDate>
   <guid isPermaLink="false">3946.1268836534.10252</guid>
  </item>
 </channel>
</rss>

