modelbound_lbc_data_class Module

Houses modelbound data for kinetic logical boundary condition


Used by


Interfaces

interface

  • private module function getDataDimLBC(this, name) result(dim)

    Get data dimensionality - will return 0 for scalars

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(in) :: this
    character(len=*), intent(in) :: name

    Name of data

    Return Value integer(kind=ik)

interface

  • private module function interpMom(this, order, f) result(res)

    Calculate moment of single local harmonic with interpolated grid points near cut-off

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(inout) :: this
    integer(kind=ik), intent(in) :: order
    real(kind=rk), intent(in), dimension(:) :: f

    Return Value real(kind=rk)

interface

  • private module function boundaryHarmonic(this, lNum) result(res)

    Calculate lNum harmonic at boundary (assuming m=0) using Pll tensor and interpolation

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(inout) :: this
    integer(kind=ik), intent(in) :: lNum

    Return Value real(kind=rk), allocatable, dimension(:)

interface

  • private pure module function getCoCell(this) result(res)

    Getter for the cut-off cell coordinate

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(in) :: this

    Return Value integer(kind=ik)

interface

  • private pure module function getPll(this, lNum) result(res)

    Getter for the cut-off (lNum,:,:) decomposition tensor

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(in) :: this
    integer(kind=ik), intent(in) :: lNum

    Return Value real(kind=rk), allocatable, dimension(:,:)

interface

  • private pure module function getInterpCoords(this) result(res)

    Getter for the interpolated cut-off cell coordinates

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(in) :: this

    Return Value real(kind=rk), dimension(2)

interface

  • private pure module function getInterpWidths(this) result(res)

    Getter for the interpolated cut-off cell widths

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(in) :: this

    Return Value real(kind=rk), dimension(2)

interface

  • private pure module function getInterpCoeffs(this) result(res)

    Getter for the interpolation coefficients

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(in) :: this

    Return Value real(kind=rk), dimension(2)

interface

  • private module subroutine initMBLBC(this, vSpaceObj, distExtDerivation, distExtReqVarIndices, ionCurrentVarIndex, isActive, totalCurrentVarIndex, bisTol, isLeftBoundary)

    Varlike modelbound data initialization routine

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(inout) :: this
    type(VSpace), intent(in) :: vSpaceObj

    Velocity space object used to get grid data

    class(MatDerivation), intent(in) :: distExtDerivation

    Extrapolated distribution derivation object

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

    Required variable indices for the distribution derivation

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

    Scalar variable index representing ion current at boundary

    logical, intent(in) :: isActive

    True if the modelbound data should be updated (use to avoid updates on processors with no boundary)

    integer(kind=ik), intent(in), optional :: totalCurrentVarIndex

    Scalar variable index representing total current through boundary. Defaults to 0 current.

    real(kind=rk), intent(in), optional :: bisTol

    Bisection tolerance for false position method used to calculate cut-off velocity. Defaults to 1e-12

    logical, intent(in), optional :: isLeftBoundary

    True if boundary this data refers to is the left boundary. Defaults to false.

interface

  • private module subroutine updateDataLBC(this, hostModel, inputVars, updatePriority)

    Update modelbound data based on input variable container

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(inout) :: this
    class(ModelSurrogate), intent(in) :: hostModel

    Host model - unused

    class(VariableContainer), intent(in) :: inputVars

    Variable container used to calculate modelbound data

    integer(kind=ik), intent(in), optional :: updatePriority

    Priority for this update call (determines which variables are updated) - unused here

interface

  • private module subroutine copyDataLBC(this, name, container)

    Copy named modelbound data to passed container.

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(in) :: this
    character(len=*), intent(in) :: name

    Name of data

    real(kind=rk), intent(inout), allocatable, dimension(..) :: container

    Container to copy into

interface

  • private module subroutine calculatePll(this, rowsToUpdate)

    Calculate full Pll tensor based on modelbound data

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(inout) :: this
    integer(kind=ik), intent(in), optional, dimension(:) :: rowsToUpdate

interface

  • private module subroutine calculateInterps(this)

    Calculate interpolation quantities based on modelbound data

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(inout) :: this

interface

  • private module subroutine calculateCutOff(this, ionCurrent, totalCurrent)

    Calculate cut-off cell and velocity based on modelbound data and currentd

    Arguments

    Type IntentOptional Attributes Name
    class(ModelboundLBCData), intent(inout) :: this
    real(kind=rk), intent(in) :: ionCurrent

    ion current into sheath

    real(kind=rk), intent(in) :: totalCurrent

    total current into sheath to be matched


Derived Types

type, public, extends(ModelboundData) ::  ModelboundLBCData

Modelbound data object containing data used to construct kinetic logical boundary condition. Assumes no m>0 harmonics. Assumes standard normalization. Data accessible through standard data copy routine: "gamma" - sheath heat transmission coefficient "potential" - potential drop at sheath normalized to boundary temperature "coVel" - cut-off velocity "shTemp" - sheath temperature obtained using the cut-off distribution

Components

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

True only if user explicitly sets it to true

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

Fixed Pll tensor component

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

Total Pll tensor (for each harmonic combination and velocity cell)

integer(kind=ik), private :: coCell

Index of cell containing cut-off

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

Cell widths of new cells around cut-off

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

Cell centre coordinates of new cells around cut-off

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

Interpolation coefficients around cut-off

real(kind=rk), private :: coVel

Cut-off velocity value

real(kind=rk), private :: gamma

Sheath heat transmission coeffient

real(kind=rk), private :: potential

Sheath potential normalized to boundary temperature

real(kind=rk), private :: shTemp

Sheath entrance temperature

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

Extrapolated distribution function at cell edge

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

Local copy of velocity grid

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

Local copy of velocity cell widths

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

Velocity values at left cell boundaries

logical, private :: isLeftBoundary

True if this data is associated with the left boundary

real(kind=rk), private :: bisTol

False position bisection tolerance

class(MatDerivation), private, allocatable :: fextDeriv

Derivation of the extrapolated distribution function

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

Indices of variables required for fext derivation

integer(kind=ik), private :: ionCurrentVarIndex

Ion current variable index

integer(kind=ik), private, allocatable :: totalCurrentVarIndex

Total current variable index. Defaults to 0 current.

integer(kind=ik), private :: maxL

Max l harmonic in decomposition

logical, private :: isActive

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: init => initMBLBC
procedure, public :: update => updateDataLBC
procedure, public :: copyData => copyDataLBC
procedure, public :: getDataDim => getDataDimLBC
procedure, public :: getPll
procedure, public :: getCoCell
procedure, public :: getInterpCoords
procedure, public :: getInterpWidths
procedure, public :: getInterpCoeffs
procedure, private :: calculatePll
procedure, private :: calculateInterps
procedure, private :: boundaryHarmonic
procedure, private :: interpMom
procedure, private :: calculateCutOff