v_diffusion_stencil_gen_class Module

Stencil generator for d(Ad/dv)/dv type terms


Used by


Interfaces

interface

  • private module subroutine initVDiffValGen(this, partitionObj, vspaceObj, procRank, activeXCoords, fixedA, mbA, adfAtZero)

    d(Ad/dv)/dv stencil value generator initialization routine

    Arguments

    Type IntentOptional Attributes Name
    class(VDiffStencilGen), intent(inout) :: this
    type(Partition), intent(in) :: partitionObj

    Partition object used to determine local number of rows

    type(VSpace), intent(in) :: vspaceObj

    VSpace object used to get interpolation object

    integer(kind=ik), intent(in) :: procRank

    Current processor rank

    integer(kind=ik), intent(in), dimension(:) :: activeXCoords

    List of active global x coords

    real(kind=rk), intent(in), optional, dimension(:) :: fixedA

    Fixed A values (size numV). Defaults to ones.

    character(len=*), intent(in), optional :: mbA

    Optional modelbound value for A (single harmonic variable). Overrides fixed values.

    real(kind=rk), intent(in), optional, dimension(2) :: adfAtZero

    Optional extrapolation of Adf/dv at zero in the form A1f(v1)+A2*f(v2) where all A's are fixed. Defaults to 0.

interface

  • private module subroutine calcVDiffVals(this, varCont, res, mbData, hostModel)

    Calculate d(Ad/dv)/dv stencil values in place (does not depend on varCont)

    Arguments

    Type IntentOptional Attributes Name
    class(VDiffStencilGen), intent(inout) :: this
    type(VariableContainer), intent(in) :: varCont
    type(RealArray), intent(inout), allocatable, dimension(:) :: res
    class(ModelboundData), intent(in), optional :: mbData
    class(ModelSurrogate), intent(in), optional :: hostModel

Derived Types

type, public, extends(JaggedArrayGenerator) ::  VDiffStencilGen

JaggedArrayGenerator for calculating d(Ad/dv)/dv type stencils. Formally a d/dv term where the flux is A*df/dv where df/dv at cell edge n+1/2 is (f_{n+1}-f_{n})/(v_{n+1}-v_{n}). A is assumed to be defined on right velocity cell boundaries. Assumes that the velocity stencil is [-1,0,1]

Components

Type Visibility Attributes Name Initial
logical, public :: userDefined = .false.

True only if user explicitly sets it to true

integer(kind=ik), private, allocatable, dimension(:) :: usedXCoords

List of local x coordinates for which this stencil generator creates values

real(kind=rk), private, allocatable, dimension(:) :: bufferA

Buffer for diffusion coefficient (with or without spatial dependence). Defaults to 1.

character(len=:), private, allocatable :: modelboundA

Optional modelbound value for A (single harmonic dist)

real(kind=rk), private, dimension(2) :: adfAtZero

Extrapolation of Adf/dv at zero in the form A1f(v1)+A2*f(v2) where all A's are fixed (default = 0)

integer(kind=ik), private :: numV

Local copy of vGrid size

integer(kind=ik), private :: locNumX

Local x grid size

real(kind=rk), private, allocatable, dimension(:) :: vGridWidths

Copy of v grid widths

real(kind=rk), private, allocatable, dimension(:) :: dvPlus

v_{n+1}-v_{n} used to calculate cell edge derivatives

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: calculate
procedure, public :: init => initVDiffValGen
procedure, public :: calculateInPlace => calcVDiffVals