<< Click to Display Table of Contents >> ## Sequencing of Equations |

FlexPDE has the ability to sequence sets of equations.

The sets are defined using the THEN and FINALLY sections following the EQUATIONS section.

EQUATIONS

<set A>

THEN

<set B>

{ THEN

<set C> ... }

{ FINALLY

<set D> }

Any number of THEN equation sets may be designated and these sets along with the main EQUATIONS section will be run sequentially and repetitively (including regrids) until the solution meets the normal error criteria. Once the EQUATIONS and THEN sets are finished, the last set defined in the FINALLY section will be solved.

Each set of equations is solved for the variables defined by the equations of that set, with the other variables held constant at their current values. Solutions of the EQUATIONS set will be held constant during the solution of the first THEN set, etc.

Each VARIABLE may be defined only once in the complete list of equations.

In time-dependent problems, the full set of equations is solved once during each timestep. The FINALLY clause is ignored in time-dependent problems.

Note: This facility finds its greatest utility in steady-state problems and time-dependent problems with one-way coupling. In time-dependent problems with two-way coupling, use of sequenced equations may falsify propagation speeds, or lead to instability.

Example:

EQUATIONS

u: div(grad(u)) + s = 0

THEN

v: div(grad(v)) + u = 0

Examples:

Samples | Usage | Sequenced_Equations | Theneq.pde

Samples | Usage | Sequenced_Equations | Theneq+time.pde

FlexPDE has the ability to iterate sets of equations until convergence.

The equation set to iterate is identified using START_ITERATION and END_ITERATION :

EQUATIONS

START_ITERATION

<set A>

THEN

<set B>

END_ITERATION

Example:

EQUATIONS

START_ITERATION

u: div(grad(u)) = v

r: div(grad(r)) = s

THEN

v: div(grad(v)) = u

s: div(grad(s)) = r

END_ITERATION

Examples:

Samples | Usage | Sequenced_Equations | Equation_Iteration.pde