Not Off topic - Optimization of a finite volume differencing scheme for multispecies transport problem



bouloumag@xxxxxxxxx wrote:
I am working on a 3d finite volume scheme for an advection-diffusion-
reaction problem involving a large number of chemical species (more
than 60) and a large domain (an big lake for example). Since this
scheme will be used on large problem, I want it to be as efficient as
possible. The linear operators are splitted in 2 :

(1) advection-diffusion is solved using a fully implicit finite volume
discretisation with a multigrid method for solving the linear system
of equations
(2) chemistry is solved using a Runge-Kutta-Rosenbrock solver for
stiff ODE.

The transport (1) actually have the following form

do specie=1, nbSpecies
call construct_matrix(specie)
call solve_linear_system(specie)
end do

and takes a lot of time on the computer.

Assuming that diffusion coefficients are the same for all species, the
whole fluid (including all species) should follow the same path during
the transport. I wonder if it really necessairy to loop over all
species and compute the transport several time. It is possible to
compute the transport of the fluid once, and after reuse this
calculation to the different species ?

I would really appreciate suggestion or reference on this.

I have done extensive research on similar problems in the past:
~50 species, Bott difference-based advection, Crank-Nicholson
diffusion, QSSA and EBI chemical solvers. That experience
is behind the MAQSIP-RT model we use for our air-quality
forecast work.

Based on that experience, I can give you this advice:

1) Subscript order is *really* important.

2) Relationship between loop order and subscript order is also
really important.

3) Subroutine-call structure can cost you some performance.

If you put species subscript as "fastest" (leftmost in Fortran), and
code all the processes with species-loop innermost, then you get at
least factor-of-three improvement over the species-subscript
"slowest"/species-loop outermost approach, in my experience. Note also that having both the species and spatial loops visible at the same time
is also important; the structure you describe (where species loop
encloses subroutine calls that contain the spatial loops) prevents many
optimizations, and can easily cost factor-of-five performance. Or even
more-- MAQSIP-RT outperforms an equivalent STEM by a factor of 12 and
CAMx by a factor of 5, for typical problem-sizes...

You can find the notes for a seminar I presented to the US EPA's
Office of Research and Development in 2002 at URL

<http://www.baronams.com/staff/coats/epa2002_seminar.html>

(The examples were deliberately chosen from met model code rather
than atmospheric chemistry-transport code, so as to avoid stepping
on anyone's toes...Sorry)

Carlie J. Coats, Jr.,Ph.D.
Chief Systems Architect
Baron Advanced Meteorological Systems, LLC.



.



Relevant Pages

  • Re: Is there a better way?
    ... species to colors and put together the following table. ... If you want to use lists, ... (loop for species in *color-table* ... (setf (car color-info) ...
    (comp.lang.lisp)
  • Re: Is there a better way?
    ... species to colors and put together the following table. ... (defun map-color (species genus) ... (loop for species in *color-table* ... (setf (car color-info) ...
    (comp.lang.lisp)
  • Re: Cuk converter bizzare control loop
    ... >I expect this is probably a characteristic of the species. ... >just uses output inductor in series with 10 ohm load. ... >Would like to hear a comment on the control loop from someone who has played ...
    (sci.electronics.design)
  • Re: Not even duff science!
    ... species transported by humans in one way or another from what is ... just as it is with all other species. ... transport it back to our homeland, this action is entirely natural and ... It would appear that the JNCC doesn't even have duff science. ...
    (uk.environment.conservation)
  • Re: Native or non-native?
    ... Adopted by governments across the world. ... that if we are attracted to another species and decide to ... transport it back to our homeland, this action is entirely natural and ... activities of humans as outside of nature. ...
    (uk.environment.conservation)

Loading