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
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
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 |
Allocate memory, setup scale and file to write
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
Find the normalized residual for each processor
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Open the residual file to write
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(filetype), | intent(in) | :: | files | Files' name and handler |
||
type(controltype), | intent(in) | :: | control | Control parameters |
Allocate memory to MPI Communication
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(controltype), | intent(in) | :: | control |
Setup scale required for relative and absolute residual for writing in the file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(schemetype), | intent(in) | :: | scheme | finite-volume Schemes |
||
type(flowtype), | intent(in) | :: | flow | Information about fluid flow: freestream-speed, ref-viscosity,etc. |
Get absolute residual for current process
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
MPI Communication to gather residual from all processes
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(controltype), | intent(in) | :: | control | Control parameters: number of variables |
Sum residual obtained from all the processes after MPI_Communication
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(controltype), | intent(in) | :: | control | Control parameters: number of variables and total mpi processes |
Get relative residual with respect to first iteration residual
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(controltype), | intent(inout) | :: | control | Control parameters: iterations |
Writing the residual in the file to save.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |