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.

Enforcing variables to be greater than or equal to zero

Hello,

I'm modelling diffusion through a porous medium with adsorption. The main dependent variable for mass concentration tends to go below zero which is not true in reality. Is there a way to enforce my variables to be >=0 at all times?

I would also like to apply this condition to other concentrations that I specify in my additional variables.

Any suggestions would be greatly appreciated.

3 Replies Last Post Feb 9, 2014, 12:45 PM EST
Sergei Yushanov Certified Consultant
Posted: 5 years ago Dec 3, 2012, 10:13 AM EST
Alistair,

To enforce variables to be >=0 at all times, use Segregated solver. Then, right-click Segregated 1 node and add Lower Limit node. In the Settings window for Lower limit, you can define lower limits for your field variables.


Good luck,

Sergei Yushanov
Alistair, To enforce variables to be >=0 at all times, use Segregated solver. Then, right-click Segregated 1 node and add Lower Limit node. In the Settings window for Lower limit, you can define lower limits for your field variables. Good luck, Sergei Yushanov

Posted: 5 years ago Dec 3, 2012, 10:19 AM EST
Hi

normally it's far better to understand why you get "non physical values"
Mostly it's because of non physical initial conditions or inappropriate meshing densities around steep dependent variable values, once these are corrected the solution is far more robust

--
Good luck
Ivar
Hi normally it's far better to understand why you get "non physical values" Mostly it's because of non physical initial conditions or inappropriate meshing densities around steep dependent variable values, once these are corrected the solution is far more robust -- Good luck Ivar

Peyman Dordizadeh
Posted: 4 years ago Feb 9, 2014, 12:45 PM EST
Hi guys,

I have the same problem with modelling continuity equation . I have two modules coupled with each other; electrostatics (responsible for electric field) and PDE module (responsible for charge transport equation).
Even though I put restriction for number density of charge in space by using the "lower limit" feature, it still becomes negative.
Does anyone have any suggestion?
Hi guys, I have the same problem with modelling continuity equation . I have two modules coupled with each other; electrostatics (responsible for electric field) and PDE module (responsible for charge transport equation). Even though I put restriction for number density of charge in space by using the "lower limit" feature, it still becomes negative. Does anyone have any suggestion?

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.