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.

flux boundary condition in transport of diluted species

Please login with a confirmed email address before reporting spam

Dear all
I am quite new to COMSOL although I am not new in developing codes. I am trying to understand the boundary conditions (flux) in transport of diluted species, as my goal is to make a time dependent charge transport model.
I made a simple 1D code, linking Poisson equation (variable V) with transport of diluted species. I want to add a specific condition for the flux at a boundary.
+ First of all, I checked the value of this flux when the 'no flux' option is chosen. And, from what I understood, the result is not zero (which is a bit surprising to me) but depends on the tolerance you chose. But what is more surprising is that if I run the same simulation several times, I always find different values of this boundary flux tds.bndFlux-xxx (one to two orders of magnitude, different sign). I would like to know why?
+ then I want to specify a value for this flux (option 'Flux' with a constant value first). What is the direction of the inward flux? is it always directed from outside to inside?
+ the boundary flux that I want to add is very small compared to the other values of potential or species density. This value is more or less of the same order of magnitude that the error that COMSOL makes when calculating it. As this is not a dependent variable of the model, can I apply a 'tolerance 'on it?
Thank you in advance.
Séverine

1 Reply Last Post Oct 11, 2016, 1:58 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Oct 11, 2016, 1:58 a.m. EDT
I + First of all, I checked the value of this flux when the 'no flux' option is chosen. And, from what I understood, the result is not zero (which is a bit surprising to me) but depends on the tolerance you chose. But what is more surprising is that if I run the same simulation several times, I always find different values of this boundary flux tds.bndFlux-xxx (one to two orders of magnitude, different sign). I would like to know why?

I cannot say why you get different values with consecutive simulations, but I believe that your accuracy is improved by making a denser mesh close to the surface. I use "always" a non-uniform mesh, mostly predefined geometrical distribution with the element ratio of 10. The calculation of flux is a real challenge in numerical simulations because the derivative is very prone to discretization errors.

+ then I want to specify a value for this flux (option 'Flux' with a constant value first). What is the direction of the inward flux? is it always directed from outside to inside?

The flux is defined as the scalar product of the flux vector and the surface normal. Hence, positive flux means inflow to the simulation domain and negative flux outflow from the domain.

+ the boundary flux that I want to add is very small compared to the other values of potential or species density. This value is more or less of the same order of magnitude that the error that COMSOL makes when calculating it. As this is not a dependent variable of the model, can I apply a 'tolerance 'on it?

In my opinion, you cannot compare the values of flux, potential or species density with each other, as they are of different dimension. Of course you can define a smaller tolerance in the Study node. But using a very dense mesh close to the surface should help a lot.

BR
Lasse

I + First of all, I checked the value of this flux when the 'no flux' option is chosen. And, from what I understood, the result is not zero (which is a bit surprising to me) but depends on the tolerance you chose. But what is more surprising is that if I run the same simulation several times, I always find different values of this boundary flux tds.bndFlux-xxx (one to two orders of magnitude, different sign). I would like to know why? I cannot say why you get different values with consecutive simulations, but I believe that your accuracy is improved by making a denser mesh close to the surface. I use "always" a non-uniform mesh, mostly predefined geometrical distribution with the element ratio of 10. The calculation of flux is a real challenge in numerical simulations because the derivative is very prone to discretization errors. + then I want to specify a value for this flux (option 'Flux' with a constant value first). What is the direction of the inward flux? is it always directed from outside to inside? The flux is defined as the scalar product of the flux vector and the surface normal. Hence, positive flux means inflow to the simulation domain and negative flux outflow from the domain. + the boundary flux that I want to add is very small compared to the other values of potential or species density. This value is more or less of the same order of magnitude that the error that COMSOL makes when calculating it. As this is not a dependent variable of the model, can I apply a 'tolerance 'on it? In my opinion, you cannot compare the values of flux, potential or species density with each other, as they are of different dimension. Of course you can define a smaller tolerance in the Study node. But using a very dense mesh close to the surface should help a lot. BR Lasse

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.