Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Problem with Conditional Statement
Posted 27 sept. 2010, 23:52 UTC−4 2 Replies
Please login with a confirmed email address before reporting spam
I am working on a dissolution and multiple precipitation problem. I am using Diffusion and Moving Mesh (ALE) application modes in COMSOL 3.4 v. I have to set a conditional statement on one of the boundary in such way that it should stop moving after it reaches a value.
for example,
if r<1.5 then v=dr/dt=k*c
if r >1.5 then v=dr/dt=0
So, I am using a conditional statement like this: if((r<1.5),k*c,0). But the problem is it is stopping the whole simulation when it reaches the value of 1.5.
What i expected is :It should stop moving that boundary and it should take 0 and have to run the simulation for later times but it's not doing that. I have no answer.
I tried using the smooth function "flch1s" (like this: flch1s(1.5-r,1e-8)*k*c) instead of if, and it's working but there is a slight variation in my solution due to smoothing. if increase the error from 1e-8 to 1e-20, then it is behaving just like if statement.
I would greatly appreciate, if some one come up with an answer.
Thanks,
Manohar
Hello Manohar Gottapu
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.