solver_t Derived Type

type, public :: solver_t

solver class defines the Incompact3D algorithm at a very high level.

Procedures defined here that are part of the Incompact3D algorithm are: transeq, divergence, poisson, and gradient.

The operations these high level procedures require are provided by the relavant backend implementations.

transeq procedure obtains the derivations in x, y, and z directions using the transeq_x, transeq_y, and transeq_z operations provided by the backend. There are two different algorithms available for this operation, a distributed algorithm and the Thomas algorithm. At the solver class level it isn't known which algorithm will be executed, that is decided at run time and therefore backend implementations are responsible for executing the right subroutines.

Allocator is responsible from giving us a field sized array when requested. For example, when the derivations in x direction are completed and we are ready for the y directional derivatives, we need three fields to reorder and store the velocities in y direction. Also, we need three more fields for storing the results, and the get_block method of the allocator is used to arrange all these memory assignments. Later, when a field is no more required, release_block method of the allocator can be used to make this field available for later use.


Components

Type Visibility Attributes Name Initial
real(kind=dp), public :: dt
real(kind=dp), public :: nu
integer, public :: n_iters
integer, public :: n_output
integer, public :: ngrid
class(field_t), public, pointer :: u
class(field_t), public, pointer :: v
class(field_t), public, pointer :: w
class(base_backend_t), public, pointer :: backend
class(mesh_t), public, pointer :: mesh
type(time_intg_t), public :: time_integrator
type(allocator_t), public, pointer :: host_allocator
type(dirps_t), public, pointer :: xdirps
type(dirps_t), public, pointer :: ydirps
type(dirps_t), public, pointer :: zdirps
type(vector_calculus_t), public :: vector_calculus
procedure(poisson_solver), public, pointer :: poisson => null()

Constructor

public interface solver_t

  • public function init(backend, mesh, host_allocator) result(solver)

    Arguments

    Type IntentOptional Attributes Name
    class(base_backend_t), intent(inout), target :: backend
    type(mesh_t), intent(inout), target :: mesh
    type(allocator_t), intent(inout), target :: host_allocator

    Return Value type(solver_t)


Type-Bound Procedures

procedure, public :: transeq

  • public subroutine transeq(self, du, dv, dw, u, v, w)

    Skew-symmetric form of convection-diffusion terms in the incompressible Navier-Stokes momemtum equations, excluding pressure terms. Inputs from velocity grid and outputs to velocity grid.

    Arguments

    Type IntentOptional Attributes Name
    class(solver_t) :: self
    class(field_t), intent(inout) :: du
    class(field_t), intent(inout) :: dv
    class(field_t), intent(inout) :: dw
    class(field_t), intent(in) :: u
    class(field_t), intent(in) :: v
    class(field_t), intent(in) :: w

procedure, public :: divergence_v2p

  • public subroutine divergence_v2p(self, div_u, u, v, w)

    Wrapper for divergence_v2p

    Arguments

    Type IntentOptional Attributes Name
    class(solver_t) :: self
    class(field_t), intent(inout) :: div_u
    class(field_t), intent(in) :: u
    class(field_t), intent(in) :: v
    class(field_t), intent(in) :: w

procedure, public :: gradient_p2v

  • public subroutine gradient_p2v(self, dpdx, dpdy, dpdz, pressure)

    Wrapper for gradient_p2v

    Arguments

    Type IntentOptional Attributes Name
    class(solver_t) :: self
    class(field_t), intent(inout) :: dpdx
    class(field_t), intent(inout) :: dpdy
    class(field_t), intent(inout) :: dpdz
    class(field_t), intent(in) :: pressure

procedure, public :: curl

  • public subroutine curl(self, o_i_hat, o_j_hat, o_k_hat, u, v, w)

    Wrapper for curl

    Arguments

    Type IntentOptional Attributes Name
    class(solver_t) :: self
    class(field_t), intent(inout) :: o_i_hat

    Vector components of the output vector field Omega

    class(field_t), intent(inout) :: o_j_hat

    Vector components of the output vector field Omega

    class(field_t), intent(inout) :: o_k_hat

    Vector components of the output vector field Omega

    class(field_t), intent(in) :: u
    class(field_t), intent(in) :: v
    class(field_t), intent(in) :: w

procedure, public :: output

  • public subroutine output(self, t)

    Arguments

    Type IntentOptional Attributes Name
    class(solver_t), intent(in) :: self
    real(kind=dp), intent(in) :: t

procedure, public :: run

  • public subroutine run(self)

    Arguments

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