Avoiding Negative Values Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » Avoiding Negative Values « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Yasuo Hira (jun)
Member
Username: jun

Post Number: 7
Registered: 12-2007
Posted on Wednesday, April 23, 2008 - 10:45 pm:   

Dear Dr. Nelson

I'm calculating a kind of diffusion problem, and
some valuables should avoid negative values, such as chemical concentration of certain chemical species.

Would you teach me how to make constraints or how to solve such problem?
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 1111
Registered: 06-2003
Posted on Thursday, April 24, 2008 - 02:19 pm:   

1.
The finite element method uses a patchwork of low-order polymomials to approximate the solution to the PDE system. If the true solution goes through rapid changes (steep fronts), and if the mesh density is not sufficient to resolve the shape of the solution, you may see overshoots or undershoots in the interpolation of the solution shape. This artifact will disappear when the shape smooths sufficiently to be resolved adequately by the mesh structure.

In FlexPDE, the discretized equations are constructed to conserve energy (or concentrations) by enforcing flux continuity across cell boundaries. So the ringing is not in itself a symptom of malfunction, merely of inadequate mesh density.

This behavior is similar to Gibbs phenomena in Fourier analysis. In that realm, a sharp step requires a large number of Fourier components to resolve. If you truncate the Fourier series with too few terms, you will see ringing at the step.

If you are starting your calculation with a discontinuous initial distribution, you will get this ringing no matter how dense you make the mesh. A discontinuous distribution means an infinite gradient and an infinite flux. These are physically unrealistic circumstances. You cannot in reality start a system with a mathematical discontinuity in a distribution. Sources require finite time to turn on, etc.

So, you can cure the negative values by modeling a physically realizable configuration: turn on the sources over a reaonable time, use a flux input instead of an instantaneous value jump, etc. Or you can just ignore the interpolation overshoots at early time and watch the later time solutions.

If your problem is not just a discontinuous initial condition but a steep propagating front, you can use the FRONT() statement to enhance mesh refinement activity at the front (see FRONT in the Help Index).

If you try to patch the equations to respond to negative values with some kind of cutoff or limitation, you will be introducing a fictitious source and violating mass conservation.

2.
Another source of negative values is the improper statement of the equations. If your parameters are inconsistent, equations are specified wrong, etc.

Top of pagePrevious messageNext messageBottom of page Link to this message

Yasuo Hira (jun)
Member
Username: jun

Post Number: 8
Registered: 12-2007
Posted on Monday, April 28, 2008 - 02:24 am:   

Dear Dr. Nelson

Thank you for your quick and detailed reply.

I want to discuss further about the boundary condition.

I appreciate your kindness.

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action:

Topics | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration