resnorm Module

This module contains subroutine that 1. check if time for resnorm dump is arrived 2. calculate resnorm 3. send those resnorm to processor number 0 4. Recalulate resnorm based on information availble from all processors 5. Append the data to resnorm file


Uses

  • module~~resnorm~~UsesGraph module~resnorm resnorm module~utils utils module~resnorm->module~utils module~vartypes vartypes module~resnorm->module~vartypes mpi mpi module~resnorm->mpi iso_fortran_env iso_fortran_env module~vartypes->iso_fortran_env

Used by

  • module~~resnorm~~UsedByGraph module~resnorm resnorm module~solver solver module~solver->module~resnorm module~convergence convergence module~convergence->module~resnorm program~main main program~main->module~solver program~main->module~convergence

Contents


Variables

TypeVisibility AttributesNameInitial
real(kind=wp), private :: merror

mass error

real(kind=wp), private, dimension(:), allocatable:: buffer

Buffer for mpi communication

integer, private, parameter:: Res_itr =3

Iteration after which Res_save is stores

real(kind=wp), public, dimension(:), allocatable:: Res_abs

Absolute value of residual norm

real(kind=wp), public, dimension(:), allocatable:: Res_rel

Relative value of residual norm

real(kind=wp), private, dimension(:), allocatable:: Res_save

Saved iteration for relative values

real(kind=wp), private, dimension(:), allocatable:: Res_scale

Scaling factor for normalization


Subroutines

public subroutine setup_resnorm(files, control, scheme, flow)

Allocate memory, setup scale and file to write

Arguments

Type IntentOptional AttributesName
type(filetype), intent(in) :: files

Files' name and handler

type(controltype), intent(in) :: control

Control parameters

type(schemetype), intent(in) :: scheme

finite-volume Schemes

type(flowtype), intent(in) :: flow

Information about fluid flow: freestream-{u,v,rho,p}, etc.

public subroutine find_resnorm(file_handler, residue, F, G, H, control, scheme, dims)

Find the normalized residual for each processor

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: file_handler

residual file handler

real(kind=wp), intent(in), dimension(:, :, :, :):: residue

Store residue at each cell-center

real(kind=wp), intent(in), dimension(:, :, :, :):: F

Store fluxes throught the I faces

real(kind=wp), intent(in), dimension(:, :, :, :):: G

Store fluxes throught the J faces

real(kind=wp), intent(in), dimension(:, :, :, :):: H

Store fluxes throught the K faces

type(controltype), intent(inout) :: control

Control parameters

type(schemetype), intent(in) :: scheme

finite-volume Schemes

type(extent), intent(in) :: dims

Extent of the domain:imx,jmx,kmx

private subroutine setup_file(files, control)

Open the residual file to write

Arguments

Type IntentOptional AttributesName
type(filetype), intent(in) :: files

Files' name and handler

type(controltype), intent(in) :: control

Control parameters

private subroutine allocate_memory(control)

Allocate memory to MPI Communication

Arguments

Type IntentOptional AttributesName
type(controltype), intent(in) :: control

private subroutine setup_scale(scheme, flow)

Setup scale required for relative and absolute residual for writing in the file.

Arguments

Type IntentOptional AttributesName
type(schemetype), intent(in) :: scheme

finite-volume Schemes

type(flowtype), intent(in) :: flow

Information about fluid flow: freestream-speed, ref-viscosity,etc.

private subroutine get_absolute_resnorm(residue, F, G, H, control, dims)

Get absolute residual for current process

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:, :, :, :):: residue

Store residue at each cell-center

real(kind=wp), intent(in), dimension(:, :, :, :):: F

Store fluxes throught the I faces

real(kind=wp), intent(in), dimension(:, :, :, :):: G

Store fluxes throught the J faces

real(kind=wp), intent(in), dimension(:, :, :, :):: H

Store fluxes throught the K faces

type(controltype), intent(in) :: control

Control parameters: number of variables

type(extent), intent(in) :: dims

extent of the 3D domain

private subroutine collect_resnorm_from_all_blocks(control)

MPI Communication to gather residual from all processes

Arguments

Type IntentOptional AttributesName
type(controltype), intent(in) :: control

Control parameters: number of variables

private subroutine assemble_resnom_at_each_process(control)

Sum residual obtained from all the processes after MPI_Communication

Arguments

Type IntentOptional AttributesName
type(controltype), intent(in) :: control

Control parameters: number of variables and total mpi processes

private subroutine get_relative_resnorm(control)

Get relative residual with respect to first iteration residual

Arguments

Type IntentOptional AttributesName
type(controltype), intent(inout) :: control

Control parameters: iterations

private subroutine write_resnorm(RESNORM_FILE_UNIT, control, scheme)

Writing the residual in the file to save.

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: RESNORM_FILE_UNIT

Resnorm file handler unit

type(controltype), intent(in) :: control

Control parameters

type(schemetype), intent(in) :: scheme

turbulenca and transition schemes