Quantcast
Channel: COMSOL Forums: How to solve the problem of negative concentration
Viewing all articles
Browse latest Browse all 64

Re: How to solve the problem of negative concentration

$
0
0
Hello.
I return to work. i had tried your suggestion. But it still did not pass the problem of negative concentration. It showed that 'Attempt to evaluate real logarithm of negative number.
- Function: log
'

How can I use comsol physcis well? So far I do not get the right results. It seems that they is very few parameters that can be controlled. Just mesh and solvers can be controlled............ Maybe I am wrong.....

I also attach my simulation as following:








Hi,


For stationary you have (ignore my tensorial mistakes),

- u . grad(c) = - grad . [D . grad(c)]

where c is the primary variable defined in comsol.

In comsol model builder, define a variable

c1=log(c)

Therefore,

c = exp(c1) and
grad(c) = exp(c1)*grad(c1)

So, your transformed equation is:

u . exp(c1)*grad(c1) = grad (D*exp(c1)*grad(c1))

Now go to "transport in dilute species" and click on convection and diffusion equation.

In the velocity field, u, feed
velocity in x = exp(c1)*ux
velocity in y = exp(c1)*uy

ux and uy are the velocities you get from your flow solution.

Now, go to the diffusion field, and feed:

D*exp(c1)

where D is the effective diff coeff.

Finally, if you are solving with initial conc = 0, then put a very small number say 10^-20 so that the variable c1 does not have a problem (log(0)).

This is roughly the derivation, but I have never tried this. If there is a mistake let me know.

You could switch on adaptive meshing with a reasonable initial meshing as a starting point.


Suresh



Viewing all articles
Browse latest Browse all 64

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>