Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

constraining dependent variable

Please login with a confirmed email address before reporting spam

Good day:

I am trying to find the most effective method of implementing a constraint on a dependent variable.

I am solving a classical diffusion equation (using Equation based modeling)of concentration 'c' and I do not want my variable 'c' to exceed some value 'cmax' on the entire domain I am modeling on.

What is the most effective way that COMSOL allows this to be done?

Thank you for any help given in advance.

4 Replies Last Post 28.02.2016, 23:53 GMT-5

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 15.08.2014, 05:33 GMT-4
What is the physical reason for this constraint? Will the species be removed from the solution if the concentration becomes too high? Will it diffuse away from highly concentrated regions much quicker than the normal diffusion? How does the concentration increase? Maybe the source of increased concentration simply delivers no more of the species if the concentration becomes too high. All of these physical effects can be implemented in COMSOL I guess.
What is the physical reason for this constraint? Will the species be removed from the solution if the concentration becomes too high? Will it diffuse away from highly concentrated regions much quicker than the normal diffusion? How does the concentration increase? Maybe the source of increased concentration simply delivers no more of the species if the concentration becomes too high. All of these physical effects can be implemented in COMSOL I guess.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 15.08.2014, 07:23 GMT-4
Hello,
There exists the Pointwise Constraint, which you could define in the domain where you want to limit the dependent variable. But it should be compatible with the PDE equation, and perhaps does not work as a threshold.
Also you can do a non-perfect approach, similar to changing the diffusion coefficient to:
if(step1(thres-u),c,c*10),
where 'thres' is the threshold you want to apply to 'u' (dependent vble.), 'step1' is a suitable smooth step function (to be tuned) and c is the normal value of your diffusion coefficient.
With this silly trick you are telling COMSOL: if u is below the threshold, all is normal, but if it's over it, c must raise, what implies that laplacian must lower. Of course, you should tune this expression for you particular PDE, also the number 10 and the function step1.
Perhaps some of those ideas can work for you.
Jesus.
Hello, There exists the Pointwise Constraint, which you could define in the domain where you want to limit the dependent variable. But it should be compatible with the PDE equation, and perhaps does not work as a threshold. Also you can do a non-perfect approach, similar to changing the diffusion coefficient to: if(step1(thres-u),c,c*10), where 'thres' is the threshold you want to apply to 'u' (dependent vble.), 'step1' is a suitable smooth step function (to be tuned) and c is the normal value of your diffusion coefficient. With this silly trick you are telling COMSOL: if u is below the threshold, all is normal, but if it's over it, c must raise, what implies that laplacian must lower. Of course, you should tune this expression for you particular PDE, also the number 10 and the function step1. Perhaps some of those ideas can work for you. Jesus.

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 21.02.2016, 08:32 GMT-5

Good day:

I am trying to find the most effective method of implementing a constraint on a dependent variable.

I am solving a classical diffusion equation (using Equation based modeling)of concentration 'c' and I do not want my variable 'c' to exceed some value 'cmax' on the entire domain I am modeling on.

What is the most effective way that COMSOL allows this to be done?

Thank you for any help given in advance.


Hi Philip,

I am in a same dilemma as you. Have you solved this problem? I'll appreciate it if you instruct me to deal with it. I am looking forward to your reply.

Yuhong
[QUOTE] Good day: I am trying to find the most effective method of implementing a constraint on a dependent variable. I am solving a classical diffusion equation (using Equation based modeling)of concentration 'c' and I do not want my variable 'c' to exceed some value 'cmax' on the entire domain I am modeling on. What is the most effective way that COMSOL allows this to be done? Thank you for any help given in advance. [/QUOTE] Hi Philip, I am in a same dilemma as you. Have you solved this problem? I'll appreciate it if you instruct me to deal with it. I am looking forward to your reply. Yuhong

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 28.02.2016, 23:53 GMT-5
Hi

I am also facing a similar problem. I have defined continuity equation with the help of PDE but there has to be an upper limit on the density term. I used pointwise constraint but that is making the density constant having the maximum value.

Thanks
Hi I am also facing a similar problem. I have defined continuity equation with the help of PDE but there has to be an upper limit on the density term. I used pointwise constraint but that is making the density constant having the maximum value. Thanks

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.