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

Please login with a confirmed email address before reporting spam

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 31 mars 2011, 10:02 UTC−4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 23 janv. 2011, 23:35 UTC−5
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.
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.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 24 janv. 2011, 01:21 UTC−5
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
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

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 31 mars 2011, 10:02 UTC−4
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
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 http://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.