pbe Derived Type

type, public, extends(pbeterm) :: pbe

1D PBE class.


Inherits

type~~pbe~~InheritsGraph type~pbe pbe type~aggterm aggterm type~pbe->type~aggterm agg type~breakterm breakterm type~pbe->type~breakterm break type~flowterm flowterm type~pbe->type~flowterm flow type~growthterm growthterm type~pbe->type~growthterm growth type~pbeterm pbeterm type~pbe->type~pbeterm type~combarray combarray type~aggterm->type~combarray array_comb type~particleterm particleterm type~aggterm->type~particleterm type~spmatrix spmatrix type~aggterm->type~spmatrix a type~breakterm->type~particleterm type~flowterm->type~pbeterm type~growthterm->type~pbeterm weno weno type~growthterm->weno wenorec grid1 grid1 type~pbeterm->grid1 grid type~base base type~pbeterm->type~base type~particleterm->type~pbeterm

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: name

object name

character(len=:), public, allocatable :: msg

error message

integer, public :: ierr = 0

error code

logical, public :: inited = .false.

initialization flag

type(grid1), public, pointer :: grid => null()

pointer to grid object

real(kind=rk), public, allocatable :: udot(:)

net rate of change,

type(aggterm), public :: agg

aggregation object

type(breakterm), public :: break

breakage object

type(growthterm), public :: growth

growth object

type(flowterm), public :: flow

flow object


Constructor

public interface pbe

  • private function pbe_init(grid, g, a, b, d, moment, update_a, update_b, update_d, name) result(self)

    Initialize pbe object.

    Arguments

    Type IntentOptional Attributes Name
    type(grid1), intent(in), target :: grid

    grid1 object

    procedure(gfnc_t), optional :: g

    growth rate function,

    procedure(afnc_t), optional :: a

    aggregation frequency function,

    procedure(bfnc_t), optional :: b

    breakage frequency function,

    procedure(dfnc_t), optional :: d

    daughter distribution function,

    integer, intent(in), optional :: moment

    moment of conserved during aggregation/breakage (default=1)

    logical, intent(in), optional :: update_a

    if true, is reevaluated at each step (default=true)

    logical, intent(in), optional :: update_b

    if true, is reevaluated at each step (default=true)

    logical, intent(in), optional :: update_d

    if true, is reevaluated at each step (default=true)

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

    name (default="pbe")

    Return Value type(pbe)


Type-Bound Procedures

procedure, public, pass(self) :: set_name

  • private pure subroutine set_name(self, name, default)

    Setter method for name.

    Arguments

    Type IntentOptional Attributes Name
    class(base), intent(inout) :: self

    object

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

    name

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

    default name

procedure, public, pass(self) :: error_msg

  • private pure subroutine error_msg(self, msg)

    Error method.

    Arguments

    Type IntentOptional Attributes Name
    class(base), intent(inout) :: self

    object

    character(len=*), intent(in) :: msg

    message

procedure, public, pass(self) :: check_inited

  • private pure subroutine check_inited(self)

    Check initialization method.

    Arguments

    Type IntentOptional Attributes Name
    class(base), intent(inout) :: self

    object

procedure, public, pass(self) :: set_grid

  • private subroutine set_grid(self, grid)

    Setter method for grid.

    Arguments

    Type IntentOptional Attributes Name
    class(pbeterm), intent(inout) :: self

    object

    type(grid1), intent(in), target :: grid

    grid1 object

procedure, public, pass(self) :: pbeterm_allocations

  • private pure subroutine pbeterm_allocations(self)

    Allocator for arrays of pbeterm class.

    Arguments

    Type IntentOptional Attributes Name
    class(pbeterm), intent(inout) :: self

    object

procedure, public, pass(self) :: eval => pbe_eval

  • private pure subroutine pbe_eval(self, u, y, uin, qin, qout, v, vdot, udot)

    Evaluate total rate of change at a given instant.

    Arguments

    Type IntentOptional Attributes Name
    class(pbe), intent(inout) :: self

    object

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

    cell-average number density,

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

    environment vector,

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

    inlet cell-average number density,

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

    inlet flowrate,

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

    outlet flowrate,

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

    system volume,

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

    volume derivative,

    real(kind=rk), intent(out), optional :: udot(:)

    total rate of change,

procedure, public, pass(self) :: integrate => pbe_integrate

  • private function pbe_integrate(self, times, u0fnc, y0, ydotfnc, atol, rtol, verbose) result(res)

    Integrate PBE using LSODA as ODE solver.

    Arguments

    Type IntentOptional Attributes Name
    class(pbe), intent(inout) :: self

    object

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

    time sequence for which output is wanted; the first value of times must be the initial time

    procedure(u0fnc_t) :: u0fnc

    initial condition of number density,

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

    initial condition of environment vector,

    procedure(ydotfnc_t), optional :: ydotfnc

    derivative of environment vector,

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

    absolute tolerance (default=1e-15)

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

    relative tolerance (default=1e-5)

    logical, intent(in), optional :: verbose

    verbose flag (default=false)

    Return Value type(pbesol)

Source Code

   type, extends(pbeterm) :: pbe
   !! 1D PBE class.
      type(aggterm) :: agg
         !! aggregation object
      type(breakterm) :: break
         !! breakage object
      type(growthterm) :: growth
         !! growth object
      type(flowterm) :: flow
         !! flow object
   contains
      procedure, pass(self), public :: eval => pbe_eval
      procedure, pass(self), public :: integrate => pbe_integrate
   end type pbe