enforce positivity Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » enforce positivity « Previous Next »

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

Andrea Schnepf (andrea)
New member
Username: andrea

Post Number: 1
Registered: 02-2004
Posted on Tuesday, December 12, 2006 - 05:49 am:   

I am currently testing the new FlexPDE version; I am solving a convection-dispersion equation with zero initial condition, a flux boundary condition where a constant solute influx into the domain is prescribed and a concentration dependent sink term. In the FlexPDE results, I have seen that the concentration is negative in some part of the domain. Is there any possibility to enforce positivity of concentrations?
Thanks,
Andrea Schnepf
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 711
Registered: 06-2003
Posted on Tuesday, December 12, 2006 - 08:53 pm:   

The finite element method approximates the solution in each mesh cell as a low-order polynomial (the default in FlexPDE is quadratic).

Some shapes of solutions, particularly very sharp dropoffs (or worse, square waves) cannot be exactly fit by a quadratic, so the approximation develops overshoots or undershoots.

This may be what you are seeing. If it is, you will notice that the negative portion is contained within a single cell.

You can improve the modeling of very steep dropoffs by increasing the mesh density. Either decrease ERRLIM (or XERRLIM), or use a FRONT command to densify the mesh at the front.

Notice that discontinuities cannot be modeled at any scale, so denser mesh will only decrease the physical extent of the undershoot, not eliminate it. In this case, you should use a smooth shape instead of the discontinuity.

The finite element equations are based on integrals of the equations over the mesh cells and flux integrals over the cell walls, so the kind of undershoots I have described will cause no loss of energy conservation. If you arbitrarily clip the solution, you will lose energy.

If this discussion does not describe your problem, then you will have to send a script or describe the system in more detail.

It may be that you have posed inconsistent equations. This can also cause negative solutions.
Top of pagePrevious messageNext messageBottom of page Link to this message

Andrea Schnepf (andrea)
New member
Username: andrea

Post Number: 2
Registered: 02-2004
Posted on Thursday, December 14, 2006 - 05:36 am:   

Thanks, your suggestion to set smaller errlim and xerrlim values helped!

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