coriolis_block_mod Module

Provides a derived type which representes the operator acting on velocity and its derivative with the Coriolis force. This can be used for preconditioning in the plume solver.


Uses

  • module~~coriolis_block_mod~~UsesGraph module~coriolis_block_mod coriolis_block_mod logger_mod logger_mod module~coriolis_block_mod->logger_mod factual_mod factual_mod module~coriolis_block_mod->factual_mod f95_lapack f95_lapack module~coriolis_block_mod->f95_lapack iso_fortran_env iso_fortran_env module~coriolis_block_mod->iso_fortran_env module~pseudospectral_block_mod pseudospectral_block_mod module~coriolis_block_mod->module~pseudospectral_block_mod penf penf module~coriolis_block_mod->penf module~pseudospectral_block_mod->logger_mod module~pseudospectral_block_mod->factual_mod module~pseudospectral_block_mod->iso_fortran_env module~pseudospectral_block_mod->penf chebyshev_mod chebyshev_mod module~pseudospectral_block_mod->chebyshev_mod

Used by

  • module~~coriolis_block_mod~~UsedByGraph module~coriolis_block_mod coriolis_block_mod module~asymmetric_plume_mod asymmetric_plume_mod module~asymmetric_plume_mod->module~coriolis_block_mod

Contents


Variables

TypeVisibility AttributesNameInitial
character(len=1), private, parameter:: trans ='N'

The LAPACK parameter indicating not to operate on the transpose of the matrix when solving for boundary conditions.

type(uniform_scalar_field), private :: zero

Interfaces

public interface coriolis_block

  • private function constructor(phi, nu, velbound, dvelbound, integrate_bound, template) result(this)

    Author
    Chris MacMackin
    Date
    January 2018

    Builds a Coriolis block which can be used to solve the inverse problem for the linear components of the plume momentum equations. The result can only be used with fields having the same grid as the template.

    Arguments

    Type IntentOptional AttributesName
    real(kind=r8), intent(in) :: phi

    The dimensionless coriolis parameter

    real(kind=r8), intent(in) :: nu

    The dimensionless eddy diffusivity

    integer, intent(in) :: velbound

    Location code for the velocity's boundary condition. 1 indicates upper boundary, -1 indicates lower boundary.

    integer, intent(in) :: dvelbound

    Location code for the velocity's boundary condition. 1 indicates upper boundary, -1 indicates lower boundary.

    integer, intent(in) :: integrate_bound

    Location code for the boundary to perform integrations from. This should be the opposite boundary from where boundary data is stored.

    class(abstract_field), intent(in) :: template

    A scalar field with the same grid as any fields passed as arguments to the solve_for method.

    Return Value type(coriolis_block)


Derived Types

type, public :: coriolis_block

A data type representing a matrix operator for the momentum components of the linear parts plume equations, with the Coriolis force. It can be useful when preconditioning a the plume solver. It is inherently 1-D in its implementation, but has a transverse velocity component.

Read more…

Components

TypeVisibility AttributesNameInitial
real(kind=r8), private, dimension(4):: D_r

Real component of the diagonal matrix, , with only diagonal values stored

real(kind=r8), private, dimension(4):: D_i

Imaginary component of the diagonal matrix, , with only diagonal values stored

type(cheb1d_scalar_field), private, dimension(4,4):: emDxVinv_r

Real component of

type(cheb1d_scalar_field), private, dimension(4,4):: emDxVinv_i

Imaginary component of

type(cheb1d_scalar_field), private, dimension(4):: eDx_r

Real component of , with only diagonal values stored

type(cheb1d_scalar_field), private, dimension(4):: eDx_i

Imaginary component of , with only diagonal values stored

real(kind=r8), private, dimension(4,4):: V_r

Real component of the change of basis matrix,

real(kind=r8), private, dimension(4,4):: V_i

Imaginary component of the change of basis matrix,

type(pseudospec_block), private :: integrator

A pseudospectral differentiation block which can be used to perform integration

integer, private :: vel_bound_loc

Location code for the velocity's boundary condition

integer, private :: dvel_bound_loc

Location code for the velocity derivative's boundary condition

integer, private :: integrate_bound

Location from which to perform the integration

real(kind=r8), private, dimension(4):: xbounds

Boundary location for each component of the solution vector

complex(kind=r8), private, dimension(4,4):: bound_matrix

Matrix for the system to solve in order to satisfy the boundary conditions

complex(kind=r8), private, dimension(4,4):: bound_matrix_scaled

Matrix for the system to solve in order to satisfy the boundary conditions, which has been scaled by LAPACK95 to improve conditioning.

complex(kind=r8), private, dimension(4,4):: factored_matrix

Factored matrix for the system to solve in order to satisfy the boundary conditions

integer, private, dimension(4):: pivots

The pivots used in the factorisation of the matrix used to satisfy boundary conditions

real(kind=r8), private, dimension(4):: r_scales

Row scale factors from equilibrating the bound_matrix

real(kind=r8), private, dimension(4):: c_scales

Column scale factors from equilibrating the bound_matrix

character(len=1), private :: equed

The method used to equilibrate bound_matrix

integer, private :: int

Constructor

private function constructor(phi, nu, velbound, dvelbound, integrate_bound, template)

Builds a Coriolis block which can be used to solve the inverse problem for the linear components of the plume momentum equations. The result can only be used with fields having the same grid as the template.

Type-Bound Procedures

procedure, public :: solve_for
procedure, private :: assign
generic, public :: assignment(=) => assign

Functions

private function constructor(phi, nu, velbound, dvelbound, integrate_bound, template) result(this)

Author
Chris MacMackin
Date
January 2018

Builds a Coriolis block which can be used to solve the inverse problem for the linear components of the plume momentum equations. The result can only be used with fields having the same grid as the template.

Arguments

Type IntentOptional AttributesName
real(kind=r8), intent(in) :: phi

The dimensionless coriolis parameter

real(kind=r8), intent(in) :: nu

The dimensionless eddy diffusivity

integer, intent(in) :: velbound

Location code for the velocity's boundary condition. 1 indicates upper boundary, -1 indicates lower boundary.

integer, intent(in) :: dvelbound

Location code for the velocity's boundary condition. 1 indicates upper boundary, -1 indicates lower boundary.

integer, intent(in) :: integrate_bound

Location code for the boundary to perform integrations from. This should be the opposite boundary from where boundary data is stored.

class(abstract_field), intent(in) :: template

A scalar field with the same grid as any fields passed as arguments to the solve_for method.

Return Value type(coriolis_block)


Subroutines

private subroutine solve_for(this, velocity, velocity_dx)

Author
Chris MacMackin
Date
January 2018

Inverts the linear portions of the plume momentum equation with the provided data. This is done by solving the linear ODE described in the documentation for the coriolis_block type. The block object must first have been initialised using the constructor.

Read more…

Arguments

Type IntentOptional AttributesName
class(coriolis_block), intent(inout) :: this
class(vector_field), intent(inout) :: velocity

On input, the velocity value being preconditioned. On output, the preconditioned velocity.

class(vector_field), intent(inout) :: velocity_dx

On input, the velocity derivative being preconditioned. On output, the preconditioned velocity derivative.

private subroutine assign(this, rhs)

Author
Chris MacMackin
Date
January 2017

Safely assigns the value of one coriolis block to another.

Arguments

Type IntentOptional AttributesName
class(coriolis_block), intent(inout) :: this
class(coriolis_block), intent(in) :: rhs

The value being assigned