Recon1d_PCM module reference

1D reconstructions using the Piecewise Constant Method (PCM)

Data Types

PCM

PCM (piecewise constant) reconstruction

Functions/Subroutines

init

Initialize a 1D PCM reconstruction for n cells

reconstruct

Calculate a 1D PCM reconstructions based on h(:) and u(:)

f

Value of PCM reconstruction at a point in cell k [A]

dfdx

Derivative of PCM reconstruction at a point in cell k [A]

x

Solver for x: f(x)=t

average

Average between xa and xb for cell k of a 1D PCM reconstruction [A]

destroy

Deallocate the PCM reconstruction

check_reconstruction

Checks the PCM reconstruction for consistency

unit_tests

Runs PCM reconstruction unit tests and returns True for any fails, False otherwise

Detailed Description

Type Documentation

type, extends(Recon1d) :: PCM

PCM (piecewise constant) reconstruction

The source for the methods ultimately used by this class are: init() *locally defined reconstruct() *locally defined average() *locally defined f() *locally defined dfdx() *locally defined

  • x() *locally defined check_reconstruction() *locally defined unit_tests() *locally defined destroy() *locally defined remap_to_sub_grid() -> Recon1d%remap_to_sub_grid() init_parent() -> init() reconstruct_parent() -> parent()

Functions/Subroutine Documentation

subroutine init(this, n, h_neglect, check)

Initialize a 1D PCM reconstruction for n cells

Parameters
  • this [out]

    This reconstruction

  • n [in]

    Number of cells in this column

  • h_neglect [in]

    A negligibly small width used in cell reconstructions [H]. Not used by PCM.

  • check [in]

    If true, enable some consistency checking

subroutine reconstruct(this, h, u)

Calculate a 1D PCM reconstructions based on h(:) and u(:)

Parameters
  • this [inout]

    This reconstruction

  • h [in]

    Grid spacing (thickness) [typically H]

  • u [in]

    Cell mean values [A]

real function f(this, k, x)

Value of PCM reconstruction at a point in cell k [A]

Parameters
  • this [in]

    This reconstruction

  • k [in]

    Cell number

  • x [in]

    Non-dimensional position within element [nondim]

real function dfdx(this, k, x)

Derivative of PCM reconstruction at a point in cell k [A]

Parameters
  • this [in]

    This reconstruction

  • k [in]

    Cell number

  • x [in]

    Non-dimensional position within element [nondim]

real function x(this, k, t)

Solver for x: f(x)=t

Parameters
  • this [in]

    This reconstruction

  • k [in]

    Cell number

  • t [in]

    Value to solve for [A]

real function average(this, k, xa, xb)

Average between xa and xb for cell k of a 1D PCM reconstruction [A]

Parameters
  • this [in]

    This reconstruction

  • k [in]

    Cell number

  • xa [in]

    Start of averaging interval on element (0 to 1)

  • xb [in]

    End of averaging interval on element (0 to 1)

subroutine destroy(this)

Deallocate the PCM reconstruction

Parameters
  • this [inout]

    This reconstruction

logical function check_reconstruction(this, h, u)

Checks the PCM reconstruction for consistency

Parameters
  • this [in]

    This reconstruction

  • h [in]

    Grid spacing (thickness) [typically H]

  • u [in]

    Cell mean values [A]

logical function unit_tests(this, verbose, stdout, stderr)

Runs PCM reconstruction unit tests and returns True for any fails, False otherwise

Parameters
  • this [inout]

    This reconstruction

  • verbose [in]

    True, if verbose

  • stdout [in]

    I/O channel for stdout

  • stderr [in]

    I/O channel for stderr

API generated with Flint · Rendered from reStructuredText