MatlabTransportPack
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

KrylovMG Class Reference

Krylov multigroup solver. More...

Inheritance diagram for KrylovMG:
Inheritance graph
[legend]
Collaboration diagram for KrylovMG:
Collaboration graph
[legend]

List of all members.

Public Member Functions

function KrylovMG (in input, in)
 Class constructor.
function set_keff (in this, in k)
function solve (in this)
 Solve the multigroup fixed source problem.
function reset_convergence (in this, in max_iters, in tolerance)
 Solve the within-group problem.
function display_me (in this)

Public Attributes

Property d_keff

Protected Member Functions

function print_iteration (in this, in iteration, in flux_error, in total_inners)
function build_fission_source (in this, in g, in phi)
 Build the fission source.
function apply (in x, in this)
 Apply the multigroup transport operator.
function setup_base (in this, in)
 Setup the base solver.
function initialize_scatter (in this)
 Prebuild scattering matrix for each cell.
function build_scatter_source (in this, in g, in phi)
 Build the within-group scattering source.
function build_all_scatter_source (in this, in g, in phi)
 Build all the scattering sources.
function build_fixed_source (in this, in g)
 Build source for this group excluding within-group scatter.
function build_external_source (in this, in g)
function check_convergence (in this, in iteration, in flux_error)
function print_iteration (in this, in it, in e0, in e1, in e2)

Protected Attributes

Property d_input
 User input.
Property d_state
 State vectors.
Property d_boundary
 Boundary fluxes.
Property d_mesh
 Problem mesh (either Cartesian mesh or MOC tracking)
Property d_mat
 Materials definitions.
Property d_quadrature
 Angular mesh.
Property d_equation
 Spatial discretization.
Property d_sweeper
 Sweeper over the space-angle domain.
Property d_external_source
 User-defined external source.
Property d_fission_source
 Fission source, if used.
Property d_fixed_source
 Any source that remains "fixed" within the group solve.
Property d_scatter_source
 The within group scattering source.
Property d_sigma_s
 Scattering cross-section vector for faster source computation.
Property d_max_iters
Property d_tolerance
Property d_g
Property d_M
 Moments to discrete operator.

Detailed Description

Krylov multigroup solver.

Traditionally, the Gauss-Seidel method has been used for multigroup problems. For each group, the within-group equation is solved, and the the fluxes are updated for use in the next group. However, for problems with significant upscatter, Gauss-Seidel can be quite expensive, even when GMRES (or some better-than-source-iteration) is used for the within group solve. As an alternativel, we can apply GMRES (or other Krylov solvers) to the multigroup problem directly. The linear system is then

\[ \left( ( \mathbf{I} - \left(\begin{array}{ccc} T_1 & \cdots & 0 \\ 0 & \ddots & 0 \\ 0 & 0 & T_G \end{array}\right) \cdot \left(\begin{array}{ccc} M & \cdots & 0 \\ 0 & \ddots & 0 \\ 0 & 0 & M \end{array}\right) \cdot \left(\begin{array}{ccc} \mathbf{S}_{11} & \cdots & \mathbf{S}_{1G} \\ \vdots & \ddots & \vdots \\ \mathbf{S}_{G1} & 0 & \mathbf{S}_{GG} \end{array}\right) \right ) \cdot \left[ \begin{array}{c} \phi_1 \\ \vdots \\ \phi_G \end{array} \right] = \left[ \begin{array}{c} \mathbf{T}_1 q_1 \\ \vdots \\ \mathbf{T}_G q_G \end{array} \right] \, . \]

Of course, this can be written succinctly the same way we did the within- group equation:

\[ (\mathbf{I}-\mathbf{TMS})\phi = \mathbf{T}q \, , \]

where $ \mathbf{T} = D\mathbf{L}^{-1} $ is the sweeping operator with moment contributions added implicitly, and where the Krylov vectors are energy-dependent.

Reference: Evans, T., Davidson, G. and Mosher, S. "Parallel Algorithms for Fixed-Source and Eigenvalue Problems", NSTD Seminar (ORNL), May 27, 2010.


Constructor & Destructor Documentation

function KrylovMG ( in  input,
in   
)

Class constructor.

Parameters:
inputUser input.
stateState vectors.
boundaryBoundary flux container.
meshGeometry.
matMaterial database.
quadratureAngular mesh.
external_sourceFixed source.
fission_sourceFission source.
Returns:
Instance of the KrylovMG class.

Member Function Documentation

function apply ( in  x,
in  this 
) [protected]

Apply the multigroup transport operator.

Returns:
Matrix-vector
function build_all_scatter_source ( in  this,
in  g,
in  phi 
) [protected, inherited]

Build all the scattering sources.

Parameters:
gGroup for this problem. (I.e. row in MG).
phiCurrent MG flux.
function build_external_source ( in  this,
in  g 
) [protected, inherited]
function build_fission_source ( in  this,
in  g,
in  phi 
) [protected]

Build the fission source.

This is intended for fixed source problems with multiplication.

Parameters:
gGroup for this problem. (I.e. row in MG).
phiCurrent MG flux.
function build_fixed_source ( in  this,
in  g 
) [protected, inherited]

Build source for this group excluding within-group scatter.

Parameters:
gGroup for this problem.
function build_scatter_source ( in  this,
in  g,
in  phi 
) [protected, inherited]

Build the within-group scattering source.

Parameters:
gGroup for this problem.
phiCurrent group flux.
function check_convergence ( in  this,
in  iteration,
in  flux_error 
) [protected, inherited]
function display_me ( in  this) [inherited]
function initialize_scatter ( in  this) [protected, inherited]

Prebuild scattering matrix for each cell.

While not the most *memory* efficient, this saves *time* by eliminate lots of loops.

function print_iteration ( in  this,
in  it,
in  e0,
in  e1,
in  e2 
) [protected, inherited]
function print_iteration ( in  this,
in  iteration,
in  flux_error,
in  total_inners 
) [protected]
function reset_convergence ( in  this,
in  max_iters,
in  tolerance 
) [inherited]

Solve the within-group problem.

Parameters:
gGroup of the problem to be solved.
Returns:
Flux residual (L-inf norm) and iteration count. Reset convergence criteria. It can be useful to use a dynamically changing convergence criteria, especially for eigenproblems. For regular power iteration, it is wasteful to use tight tolerances on the inners when the source is not as tightly known.
Parameters:
max_itersMaximum number of iterations.
toleranceMaximum point-wise error in flux
function set_keff ( in  this,
in  k 
)
function setup_base ( in  this,
in   
) [protected, inherited]

Setup the base solver.

By keeping everything out of the constructor, we can avoid having to copy the signature for all derived classes, both in their definitions and whereever thisects are instantiated. However, derived classes have other setup issues that need to be done, and so this serves as a general setup function that must be called before other setup stuff.

Parameters:
inputInput database.
stateState vectors, etc.
boundaryBoundary fluxes.
meshProblem mesh.
matMaterial definitions.
quadratureAngular mesh..
external_sourceUser-defined external source.
fission_sourceFission source.
function solve ( in  this)

Solve the multigroup fixed source problem.

Currently, I'm not adding much flexibility. In the future, it would be great to add a multigroup preconditioner, other solvers, etc. Of course, reflective conditions are still on the to-do list; but response functions don't need them!

Returns:
Output, including error and iteration count.

Member Data Documentation

Property d_boundary [protected, inherited]

Boundary fluxes.

Property d_equation [protected, inherited]

Spatial discretization.

Property d_external_source [protected, inherited]

User-defined external source.

Property d_fission_source [protected, inherited]

Fission source, if used.

Property d_fixed_source [protected, inherited]

Any source that remains "fixed" within the group solve.

Property d_g [protected, inherited]
Property d_input [protected, inherited]

User input.

Property d_keff
Property d_M [protected, inherited]

Moments to discrete operator.

Property d_mat [protected, inherited]

Materials definitions.

Property d_max_iters [protected, inherited]
Property d_mesh [protected, inherited]

Problem mesh (either Cartesian mesh or MOC tracking)

Property d_quadrature [protected, inherited]

Angular mesh.

Property d_scatter_source [protected, inherited]

The within group scattering source.

Property d_sigma_s [protected, inherited]

Scattering cross-section vector for faster source computation.

Property d_state [protected, inherited]

State vectors.

Property d_sweeper [protected, inherited]

Sweeper over the space-angle domain.

Property d_tolerance [protected, inherited]

The documentation for this class was generated from the following file: