Recon1d_PLM_hybgen module reference

Piecewise Linear Method 1D reconstruction ported from "hybgen" module in Hycom.

This implementation of PLM follows Colella and Woodward, 1984, with cells resorting to PCM for extrema including first and last cells in column. The cell-wise reconstructions are limited so that the edge values (which are also the extrema in a cell) are bounded by the neighbors. The limiter yields monotonicity for the CFL<1 transport problem where parts of a cell can only move to a neighboring cell, but does not yield monotonic profiles for the general remapping problem. The first and last cells are always limited to PCM.

The mom_hybgen_remap.hybgen_plm_coefs() function calculates PLM coefficients numerically equiavalent to the recon1d_plm_hybgen module (this implementation).

Data Types

PLM_hybgen

PLM reconstruction following "hybgen".

Functions/Subroutines

init

Initialize a 1D PLM reconstruction for n cells

reconstruct

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

f

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

dfdx

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

average

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

destroy

Deallocate the PLM reconstruction

check_reconstruction

Checks the PLM_hybgen reconstruction for consistency

unit_tests

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

Detailed Description

Type Documentation

type, extends(Recon1d) :: PLM_hybgen

PLM reconstruction following "hybgen".

This implementation is a refactor of hybgen_plm_coefs() from mom_hybgen_remap.

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() -> recon1d_plm_cw.x()

  • check_reconstruction() *locally defined

  • unit_tests() *locally defined

  • destroy() *locally defined

  • remap_to_sub_grid() -> recon1d_type.remap_to_sub_grid()

  • init_parent() -> init()

  • reconstruct_parent() -> reconstruct()

Parameters
  • ul

    Left edge value [A]

  • ur

    Right edge value [A]

  • slp

    Right minus left edge values [A]

Functions/Subroutine Documentation

subroutine init(this, n, h_neglect, check)

Initialize a 1D PLM 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]

  • check [in]

    If true, enable some consistency checking

subroutine reconstruct(this, h, u)

Calculate a 1D PLM 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 PLM_hybgen 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 PLM_hybgen 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 average(this, k, xa, xb)

Average between xa and xb for cell k of a 1D PLM 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 PLM reconstruction

Parameters
  • this [inout]

    This reconstruction

logical function check_reconstruction(this, h, u)

Checks the PLM_hybgen 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 PLM 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