m_solver Module


Uses

  • module~~m_solver~~UsesGraph module~m_solver m_solver module~m_allocator m_allocator module~m_solver->module~m_allocator module~m_base_backend m_base_backend module~m_solver->module~m_base_backend module~m_common m_common module~m_solver->module~m_common module~m_config m_config module~m_solver->module~m_config module~m_field m_field module~m_solver->module~m_field module~m_ibm m_ibm module~m_solver->module~m_ibm module~m_les m_les module~m_solver->module~m_les module~m_logger m_logger module~m_solver->module~m_logger module~m_mesh m_mesh module~m_solver->module~m_mesh module~m_tdsops m_tdsops module~m_solver->module~m_tdsops module~m_time_integrator m_time_integrator module~m_solver->module~m_time_integrator module~m_vector_calculus m_vector_calculus module~m_solver->module~m_vector_calculus module~m_allocator->module~m_common module~m_allocator->module~m_field module~m_base_backend->module~m_allocator module~m_base_backend->module~m_common module~m_base_backend->module~m_field module~m_base_backend->module~m_logger module~m_base_backend->module~m_mesh module~m_base_backend->module~m_tdsops iso_c_binding iso_c_binding module~m_base_backend->iso_c_binding module~m_poisson_fft m_poisson_fft module~m_base_backend->module~m_poisson_fft module~m_common->module~m_logger m_mpi m_mpi module~m_common->m_mpi module~m_config->module~m_common module~m_config->module~m_logger module~m_field->module~m_common module~m_field->iso_c_binding module~m_ibm->module~m_allocator module~m_ibm->module~m_base_backend module~m_ibm->module~m_common module~m_ibm->module~m_field module~m_ibm->module~m_logger module~m_ibm->module~m_mesh module~m_ibm->m_mpi module~m_io_session m_io_session module~m_ibm->module~m_io_session module~m_les->module~m_base_backend module~m_les->module~m_common module~m_les->module~m_config module~m_les->module~m_field module~m_les->module~m_logger module~m_les->module~m_mesh module~m_les->module~m_tdsops iso_fortran_env iso_fortran_env module~m_logger->iso_fortran_env module~m_logger->m_mpi module~m_mesh->module~m_common module~m_mesh->module~m_field module~m_mesh->module~m_logger module~m_mesh->m_mpi module~m_mesh_content m_mesh_content module~m_mesh->module~m_mesh_content module~m_tdsops->module~m_common module~m_tdsops->module~m_logger module~m_time_integrator->module~m_allocator module~m_time_integrator->module~m_base_backend module~m_time_integrator->module~m_common module~m_time_integrator->module~m_field module~m_time_integrator->module~m_logger module~m_vector_calculus->module~m_allocator module~m_vector_calculus->module~m_base_backend module~m_vector_calculus->module~m_common module~m_vector_calculus->module~m_field module~m_vector_calculus->module~m_logger module~m_vector_calculus->module~m_tdsops module~m_io_session->module~m_base_backend module~m_io_session->module~m_common module~m_io_session->module~m_field module~m_io_session->module~m_logger module~m_io_backend~2 m_io_backend module~m_io_session->module~m_io_backend~2 module~m_io_base m_io_base module~m_io_session->module~m_io_base module~m_mesh_content->module~m_common module~m_mesh_content->module~m_logger module~m_poisson_fft->module~m_common module~m_poisson_fft->module~m_field module~m_poisson_fft->module~m_logger module~m_poisson_fft->module~m_mesh module~m_poisson_fft->module~m_tdsops module~m_io_backend~2->module~m_base_backend module~m_io_backend~2->module~m_common module~m_io_backend~2->module~m_field module~m_io_backend~2->module~m_logger module~m_io_backend~2->module~m_io_base module~m_io_base->module~m_base_backend module~m_io_base->module~m_common module~m_io_base->module~m_field

Used by

  • module~~m_solver~~UsedByGraph module~m_solver m_solver module~m_base_case m_base_case module~m_base_case->module~m_solver module~m_io_manager m_io_manager module~m_base_case->module~m_io_manager module~m_monitoring m_monitoring module~m_base_case->module~m_monitoring module~m_postprocess m_postprocess module~m_base_case->module~m_postprocess module~m_case_channel m_case_channel module~m_case_channel->module~m_solver module~m_case_channel->module~m_base_case module~m_case_cylinder m_case_cylinder module~m_case_cylinder->module~m_solver module~m_case_cylinder->module~m_base_case module~m_case_generic m_case_generic module~m_case_generic->module~m_solver module~m_case_generic->module~m_base_case module~m_case_tgv m_case_tgv module~m_case_tgv->module~m_solver module~m_case_tgv->module~m_base_case module~m_case_wind_turbine m_case_wind_turbine module~m_case_wind_turbine->module~m_solver module~m_case_wind_turbine->module~m_base_case module~m_checkpoint_manager m_checkpoint_manager module~m_checkpoint_manager->module~m_solver module~m_io_field_utils m_io_field_utils module~m_checkpoint_manager->module~m_io_field_utils module~m_stats m_stats module~m_checkpoint_manager->module~m_stats module~m_io_field_utils->module~m_solver module~m_io_manager->module~m_solver module~m_io_manager->module~m_checkpoint_manager module~m_snapshot_manager m_snapshot_manager module~m_io_manager->module~m_snapshot_manager module~m_io_manager->module~m_stats module~m_monitoring->module~m_solver module~m_postprocess->module~m_solver module~m_snapshot_manager->module~m_solver module~m_snapshot_manager->module~m_io_field_utils module~m_stats->module~m_solver module~m_case_abl m_case_abl module~m_case_abl->module~m_base_case program~xcompact xcompact program~xcompact->module~m_base_case program~xcompact->module~m_case_channel program~xcompact->module~m_case_cylinder program~xcompact->module~m_case_generic program~xcompact->module~m_case_tgv program~xcompact->module~m_case_wind_turbine program~xcompact->module~m_case_abl

Interfaces

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)


Abstract Interfaces

abstract interface

  • public subroutine poisson_solver(self, pressure, div_u)

    Arguments

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

abstract interface

  • public subroutine transport_equation(self, rhs, variables)

    Arguments

    Type IntentOptional Attributes Name
    class(solver_t) :: self
    type(flist_t), intent(inout) :: rhs(:)
    type(flist_t), intent(inout) :: variables(:)

Derived Types

type, public ::  solver_t

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

Read more…

Components

Type Visibility Attributes Name Initial
real(kind=dp), public :: dt
real(kind=dp), public :: nu
real(kind=dp), public, dimension(:), allocatable :: nu_species
integer, public :: n_iters
integer, public :: n_output
integer, public :: current_iter = 0
integer, public :: ngrid
integer, public :: nvars = 3
integer, public :: nspecies = 0
class(field_t), public, pointer :: u
class(field_t), public, pointer :: v
class(field_t), public, pointer :: w
class(field_t), public, pointer :: pressure => null()

Pressure on CELL grid (DIR_Z)

class(field_t), public, pointer :: pressure_vert => null()

Pressure on VERT grid (DIR_X)

logical, public :: keep_pressure = .false.

If true, persist pressure for output

logical, public :: keep_wall_correction = .false.

If true, persist the last pressure gradient for precorrect_walls

class(field_t), public, pointer :: dpdx_last => null()

Last projection's velocity correction, kept when the mesh has a Dirichlet face so precorrect_walls can reuse it. Only kept when keep_wall_correction is set, as it costs three extra fields.

class(field_t), public, pointer :: dpdy_last => null()
class(field_t), public, pointer :: dpdz_last => null()
real(kind=dp), public :: dp_last_dt = 0._dp

Substep timestep (time_intg_t%stage_dt) the kept correction was made with, so precorrect_walls can rescale it to the current substep.

class(field_t), public, pointer :: vort => null()

Vorticity magnitude on VERT grid

class(field_t), public, pointer :: qcrit => null()

Q-criterion on VERT grid

type(flist_t), public, dimension(:), pointer :: species => null()
class(base_backend_t), public, pointer :: backend
type(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
type(ibm_t), public :: ibm
type(les_t), public :: les
logical, public :: ibm_on
logical, public :: spatial_filter = .false.

explicit low-pass filter on velocity

procedure(poisson_solver), public, pointer :: poisson => null()
procedure(transport_equation), public, pointer :: transeq => null()

Constructor

public function init (backend, mesh, host_allocator)

Type-Bound Procedures

procedure, public :: transeq_species
procedure, public :: apply_les
procedure, public :: apply_spatial_filter
procedure, public :: finalise
procedure, public :: pressure_correction
procedure, public :: precorrect_walls
procedure, public :: divergence_v2p
procedure, public :: gradient_p2v
procedure, public :: curl

Functions

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)


Subroutines

public subroutine allocate_tdsops(dirps, backend, mesh, der1st_scheme, der2nd_scheme, interpl_scheme, stagder_scheme, c_nu, nu0_nu, filter_alpha)

Arguments

Type IntentOptional Attributes Name
type(dirps_t), intent(inout) :: dirps
class(base_backend_t), intent(in) :: backend
type(mesh_t), intent(in) :: mesh
character(len=*), intent(in) :: der1st_scheme

hyperviscous (iSVV) der2nd params; only required when der2nd_scheme is 'compact6-hyperviscous'.

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

hyperviscous (iSVV) der2nd params; only required when der2nd_scheme is 'compact6-hyperviscous'.

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

hyperviscous (iSVV) der2nd params; only required when der2nd_scheme is 'compact6-hyperviscous'.

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

hyperviscous (iSVV) der2nd params; only required when der2nd_scheme is 'compact6-hyperviscous'.

real(kind=dp), intent(in), optional :: c_nu

When present, also build the low-pass filter operators for this direction. Absent means the case does not filter.

real(kind=dp), intent(in), optional :: nu0_nu

When present, also build the low-pass filter operators for this direction. Absent means the case does not filter.

real(kind=dp), intent(in), optional :: filter_alpha

public subroutine transeq_default(self, rhs, variables)

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

Arguments

Type IntentOptional Attributes Name
class(solver_t) :: self
type(flist_t), intent(inout) :: rhs(:)
type(flist_t), intent(inout) :: variables(:)

public subroutine transeq_lowmem(self, rhs, variables)

low memory version of the transport equation, roughly %2 slower overall

Arguments

Type IntentOptional Attributes Name
class(solver_t) :: self
type(flist_t), intent(inout) :: rhs(:)
type(flist_t), intent(inout) :: variables(:)

public subroutine apply_spatial_filter(self)

Apply the explicit low-pass filter to the velocity, as Incompact3d does for wall-modelled ABL runs (ifilter=1, C_filter).

Read more…

Arguments

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

public subroutine filter_field(self, f, xdirps, ydirps, zdirps, component)

Filter one velocity component in all three directions, in place.

Read more…

Arguments

Type IntentOptional Attributes Name
class(solver_t), intent(inout) :: self
class(field_t), intent(inout) :: f
type(dirps_t), intent(in) :: xdirps
type(dirps_t), intent(in) :: ydirps
type(dirps_t), intent(in) :: zdirps
integer, intent(in) :: component

public subroutine filter_in_dir(self, f, dirps, is_normal)

Filter a DIR_X field along one direction, in place.

Arguments

Type IntentOptional Attributes Name
class(solver_t), intent(inout) :: self
class(field_t), intent(inout) :: f
type(dirps_t), intent(in), target :: dirps

.true. when f is the component along dirps%dir, which is the odd one across a free-slip boundary.

logical, intent(in) :: is_normal

public subroutine apply_les(self, rhs, variables)

Add the configured explicit SGS closure to the momentum RHS.

Arguments

Type IntentOptional Attributes Name
class(solver_t), intent(inout) :: self
type(flist_t), intent(inout) :: rhs(:)
type(flist_t), intent(in) :: variables(:)

public subroutine finalise(self)

Release resources owned by the solver and its runtime models.

Arguments

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

public subroutine transeq_species(self, rhs, variables)

Skew-symmetric form of convection-diffusion terms in the species equation. Inputs from velocity grid and outputs to velocity grid.

Arguments

Type IntentOptional Attributes Name
class(solver_t) :: self
type(flist_t), intent(inout) :: rhs(:)
type(flist_t), intent(in) :: variables(:)

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

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

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

public subroutine poisson_fft(self, pressure, div_u)

Arguments

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

public subroutine poisson_cg(self, pressure, div_u)

Arguments

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

public subroutine pressure_correction(self, u, v, w)

Arguments

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

public subroutine precorrect_walls(self, u, v, w)

Incompact3d's pre_correc: on each Dirichlet face, add the previous projection's tangential correction to the value set by the case. The projection that follows then leaves the face at its prescribed value plus dt(grad p_old - grad p_new), instead of -dtgrad p_new. The kept correction is dt_last*grad p_old, so it is rescaled by dt_now/dt_last first, as Incompact3d does with gdt(itr). The timestep is time_intg_t%stage_dt, the time the substep has advanced from the divergence-free start of the step, which is what the projection scales its correction by. For AB this ratio is always 1; for RK it changes between stages (1/2, 3/4, 1 for RK3). Before the first projection (or after a restart, as in Incompact3d) there is no correction to add.

Arguments

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