Ruud Borger
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
24 lug 2010, 02:44 GMT-4
Hello Cheol,
You can implement this by using two ingredients:
-A maximum operator
-an IF statement
I will first explain how to use them in general, and then how to apply them to your model.
For the maximum operator: Right click "Definitions", then go to "Model Couplings", and go for.... you guessed it, "Maximum". Add your domain. Give it a name like "max_con"
Now you've made an operator that calculates the maximum value of any expression in your domain. The expression you want to evaluate should be given as argument to the operator. For concentration, use it as: max_con(c).
Now, for the if-statement: it needs 3 arguments: a condition, expression 1, expression 2. If the condition is true, then the first expression is used. If not, the second expression is used. Easy enough!
What you can now do is set your influx to the following value:
if(max_con(c)<c_max, my_flux,0)
What this does is give your influx a value of my_flux as long as the maximum concentration is lower than c_max. There might be a more delicate approach, but this is the first thing that springs to mind, and I think it will work quite well.
Hello Cheol,
You can implement this by using two ingredients:
-A maximum operator
-an IF statement
I will first explain how to use them in general, and then how to apply them to your model.
For the maximum operator: Right click "Definitions", then go to "Model Couplings", and go for.... you guessed it, "Maximum". Add your domain. Give it a name like "max_con"
Now you've made an operator that calculates the maximum value of any expression in your domain. The expression you want to evaluate should be given as argument to the operator. For concentration, use it as: max_con(c).
Now, for the if-statement: it needs 3 arguments: a condition, expression 1, expression 2. If the condition is true, then the first expression is used. If not, the second expression is used. Easy enough!
What you can now do is set your influx to the following value:
if(max_con(c)