Discussion Forum

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.

Logarithmic transform in a time dependent diffusion equation

Hi all

I have been trying to avoid negative concentration by incorporating logarithmic transform of concentration. The knowledge base tells us how to do this in a stationary problem ( www.comsol.com/support/knowledgebase/952/ ). However when there is a time dependent equation, the term dc/dt in the log transformed state becomes exp(C) dC/dt, where C=log(c) . How do i incorporate exp(C) as the coefficient to dc/dt. I tried using general form pde and input the coefficient of dC/dt as exp(C), but it says failed to find consistent initial values. Is there a way around this or a better way to incorporate log transform?

Thanks

3 Replies Last Post Mar 31, 2011, 10:02 AM EDT
Posted: 7 years ago
I realized the problem is more specific. When I have a zero initial condition, because in the log coordinate log(0) would be infinite i define the initial condition as C=log(eps). When i give a non zero value say log(10) it works fine.

Posted: 7 years ago
Hi

indeed such limits are delicate to handle, if you look at the equations in COMSOL, there are often booleans or if() statements. The trick is to set these such that the "formula analyzer" or "discretization" part of the solver (this is my understanding, needs COMSOL developers confirmation though) catches these and sort them out to avoid tests during the number crunching section.

playing with eps or a few times eps is one way, another is definitively to avoid the "0" default initial conditions (these are often OK, but for certain physics it's not the case) by using some better guesses

--
Good luck
Ivar

Posted: 6 years ago
Dear all,
I'm working with a Convection and Diffusion problem, for a 1-D geometry in transient conditions. I have also negative concentration problems, probably due to the pulsing schedule that I use as boundary condition.

In order to verify the applicability of the logarithmic transform of concentration, I implemented this solution (as reported in the example www.comsol.com/support/knowledgebase/952/ ) to a simple problem, which didn't have these negative concentration problems. However I obtained different results...how is this possible?

Thanks a lot for your help

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.