Possibilities of increasing speed? Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » Possibilities of increasing speed? « Previous Next »

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

Gustav Carlson (gurra_g)
New member
Username: gurra_g

Post Number: 1
Registered: 06-2006
Posted on Thursday, June 29, 2006 - 08:40 pm:   

Dr. Nelson,

First of all, thanks and congratulations to PDEsolutions for making this fantastic product.

I'm working with a time-dependent system of four convective-diffusive-reactive equations with an oscillating convective field. Using nothing under SELECT, one of the concentrations becomes negative during part of the cycle. (This happened in the steady-state case too, but was resolved with a smaller ERRLIM.)

Two questions:

1 Nondimensionalizing the equations yields pretty large coefficients. Does it matter which derivative has the largest coefficient? (Now I've chosen div(D*grad(C)) to have coefficient 1, would it be better to do this with the time derivative?)

2 The system takes several hours to solve, is there any good way to speed things up, such as the possibility to force concentrations to be positive at all times and still keep the default ERRLIM?

Thank you very much

Gustav Carlson
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 642
Registered: 06-2003
Posted on Friday, June 30, 2006 - 02:12 pm:   

1.
FlexPDE automatically scales the coupling matrix, so it doesn't really matter what the size of the coefficients is (except that there is some question of how it might interact with CONSTRAINT equation scaling).

A more important question is whether there is significantly different scaling of the coordinates. If one dimension is scaled dramatically differently than another it might distort the resolution of artifacts in the solution.

2.
There are many things you can do to cause FlexPDE to struggle (parameters discontinuous in time, wild variations in parameters, parameters containing sign-erasing functions of the variables, elaborate computations for each parameter, inconsistent equations, etc.) Removing such blockages can speed up the computation significantly. But I don't have an exhaustive list of these things, or a blanket resolution for them. We need to look at it case-by-case. If you send me the script, I'll take a look at it.


General diagnosis:

1) Plot distributions and histories of variables and parameters, to see if there are odd behaviors that can be correlated to changes of parameters.

Negative concentrations:

1) The finite element method approximates the solution by a patchwork of continuous low-order polynomials. If the solution goes through steep changes of value and there are not enough cells to model the shape, you can get undershoots to negative values in some cells. These negatives do not extend over multiple cells, and usually can be ignored. Denser gridding can help, unless the shape of the solution is discontinuous (as in initial values).

2) If your equations are inconsistent, so that there really is no simultaneous solution of all of them, FlexPDE may compute a compromise that drives some values negative. Check that your equations are really compatible. Plot various kinds of validation functions to see that the system is behaving correctly.

3) Non-linear terms like C*C lose the sign of the solution, and so FlexPDE can't tell the difference between positive and negative solutions. Use C*abs(C) instead.

Expensive Parameters:

1) Construct an auxilliary script to construct tables of the parameter. Then use table lookups in the computation.

2) Use SAVE(..) to build an interpolation of the parameter on each update. This can save repetitive computation inside of each cell.

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