modelbound_lbc_data_procedures Submodule

Contains module procedures associated with the modelbound logical boundary condition data class


Uses


Functions

function fixedPll(maxL) result(res)

Calculate fixed component of Pll tensor

Arguments

Type IntentOptional Attributes Name
integer(kind=ik), intent(in) :: maxL

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


Module Functions

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)

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)

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(:)

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)

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(:,:)

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)

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)

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)


Module Subroutines

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.

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

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

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

module subroutine calculateInterps(this)

Calculate interpolation quantities based on modelbound data

Arguments

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

module subroutine calculateCutOff(this, ionCurrent, totalCurrent)

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

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