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 relevant 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.
| 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() |
| Type | Intent | Optional | 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 |
Skew-symmetric form of convection-diffusion terms in the species equation. Inputs from velocity grid and outputs to velocity grid.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(solver_t) | :: | self | ||||
| type(flist_t), | intent(inout) | :: | rhs(:) | |||
| type(flist_t), | intent(in) | :: | variables(:) |
Apply the explicit low-pass filter to the velocity, as Incompact3d does for wall-modelled ABL runs (ifilter=1, C_filter).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(solver_t), | intent(inout) | :: | self |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(solver_t) | :: | self | ||||
| class(field_t), | intent(inout) | :: | u | |||
| class(field_t), | intent(inout) | :: | v | |||
| class(field_t), | intent(inout) | :: | 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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(solver_t) | :: | self | ||||
| class(field_t), | intent(inout) | :: | u | |||
| class(field_t), | intent(inout) | :: | v | |||
| class(field_t), | intent(inout) | :: | w |
Wrapper for gradient_p2v
| Type | Intent | Optional | 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 |
Wrapper for curl
| Type | Intent | Optional | 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 |