spherical_1d_solver Derived Type

type, public :: spherical_1d_solver

encapsulate all grid data


Contents

Source Code


Components

TypeVisibility AttributesNameInitial
real(kind=r8k), private, allocatable:: cp(:)

density and specific heat (size = nr)

real(kind=r8k), private, allocatable:: rho(:)

density and specific heat (size = nr)

real(kind=r8k), private, allocatable:: t_analytical(:)

expected solution (size = nr)

real(kind=r8k), private, allocatable:: v(:,:)

v(:,1) = r, v(:,2) = T, shape = [nr,2]


Type-Bound Procedures

procedure, public :: set_cp

procedure, public :: set_expected_solution_size

procedure, public :: set_material_properties_size

  • interface

    private module subroutine set_material_properties_size(this)

    Arguments

    Type IntentOptional AttributesName
    class(spherical_1d_solver), intent(inout) :: this

procedure, public :: set_rho

procedure, public :: set_v

  • interface

    private module subroutine set_v(this, nr, constants)

    Arguments

    Type IntentOptional AttributesName
    class(spherical_1d_solver), intent(inout) :: this
    integer, intent(in) :: nr
    real(kind=r8k), intent(in) :: constants(:)

procedure, public :: time_advance_heat_equation

  • interface

    private module subroutine time_advance_heat_equation(this, duration)

    Arguments

    Type IntentOptional AttributesName
    class(spherical_1d_solver), intent(inout) :: this
    real(kind=r8k), intent(in) :: duration

Source Code

  type spherical_1D_solver
    !! encapsulate all grid data
    private
    real(r8k), allocatable :: v(:,:)          !! v(:,1) = r, v(:,2) = T, shape = [nr,2]
    real(r8k), allocatable :: rho(:), cp(:)   !! density and specific heat (size = nr)
    real(r8k), allocatable :: T_analytical(:) !! expected solution (size = nr)
  contains
    procedure :: set_v
    procedure :: set_material_properties_size
    procedure :: set_expected_solution_size
    procedure :: set_rho
    procedure :: set_cp
    procedure :: time_advance_heat_equation
  end type spherical_1D_solver