Appearance
adam_nasto_cpu_object
ADAM, Navier-Stokes equations system class definition, CPU backend.
Source: src/app/nasto/cpu/adam_nasto_cpu_object.F90
Dependencies
Contents
- nasto_cpu_object
- assign_omp
- allocate_cpu
- initialize
- amr_update
- compute_phi
- mark_by_geo
- mark_by_grad_var
- move_phi
- refine_uniform
- integrate_eikonal
- load_restart_files
- save_hdf5
- save_residuals
- save_restart_files
- save_simulation_data
- set_boundary_conditions
- set_initial_conditions
- update_ghost
- compute_dt
- compute_q_auxiliary
- compute_residuals
- integrate
- simulate
- assign_omp_R8P_5D
- compute_fluxes_convective
- compute_fluxes_difference
- compute_fluxes_diffusive
- compute_q_gradient
- decompose_fluxes_convective
- decompose_fluxes_convective_llf
Derived Types
nasto_cpu_object
Navier-Stokes equations system class definition, CPU backend.
Inheritance
Extends: nasto_common_object
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
mpih | type(mpih_object) | MPI handler. | |
adam | type(adam_object) | ADAM. | |
field | type(field_object) | pointer | The field. |
grid | type(grid_object) | pointer | The grid. |
amr | type(amr_object) | AMR marker handler. | |
ib | type(ib_object) | Immersed Boundary (IB) handler. | |
slices | type(slices_object) | Slices handler. | |
rk | type(rk_object) | RK integrator. | |
weno | type(weno_object) | WENO reconstructor. | |
io | type(nasto_io_object) | IO handler. | |
physics | type(nasto_physics_object) | Fluids physiscs handler. | |
ic | type(nasto_ic_object) | Initial Conditions (IC) handler. | |
bc | type(nasto_bc_object) | Boundary Conditions (BC) handler. | |
time | type(nasto_time_object) | Time handler. | |
ngc | integer(kind=I4P) | pointer | Number of ghost cells. |
ni | integer(kind=I4P) | pointer | Number of cells in i direction. |
nj | integer(kind=I4P) | pointer | Number of cells in j direction. |
nk | integer(kind=I4P) | pointer | Number of cells in k direction. |
nb | integer(kind=I4P) | pointer | Total blocks number for MPI. |
blocks_number | integer(kind=I4P) | pointer | Actual blocks number. |
ns | integer(kind=I4P) | pointer | Number of fluids specie. |
nv | integer(kind=I4P) | pointer | Number of conservative variables. |
nv_aux | integer(kind=I4P) | pointer | Number of auxiliary variables. |
q | real(kind=R8P) | allocatable | Cell centered variables. |
q_aux | real(kind=R8P) | allocatable | Auxiliary cell centered variables. |
dq | real(kind=R8P) | allocatable | Eikonal right hand side. |
flx | real(kind=R8P) | allocatable | Fluxes along x. |
fly | real(kind=R8P) | allocatable | Fluxes along y. |
flz | real(kind=R8P) | allocatable | Fluxes along z. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
allocate_common | pass(self) | Allocate common data. |
initialize_common | pass(self) | Initialize the equation common data. |
allocate_cpu | pass(self) | Allocate CPU data. |
initialize | pass(self) | Initialize the equation. |
amr_update | pass(self) | Do AMR update. |
compute_phi | pass(self) | Compute phi, distance from IB solid. |
mark_by_geo | pass(self) | Mark blocks to be refined/derefined by a geometric constrain. |
mark_by_grad_var | pass(self) | Mark blocks to be refined/derefined by a grad(var) value. |
move_phi | pass(self) | Move phi. |
refine_uniform | pass(self) | Refine all blocks uniformly. |
integrate_eikonal | pass(self) | Integrate eikonal equation. |
load_restart_files | pass(self) | Load restart files. |
save_hdf5 | pass(self) | Save simulation data in HDF5 format. |
save_residuals | pass(self) | Save residuals history. |
save_restart_files | pass(self) | Save restart files. |
save_simulation_data | pass(self) | Save all simulation data. |
set_boundary_conditions | pass(self) | Set boundary conditions of equation. |
set_initial_conditions | pass(self) | Set initial conditions of equation. |
update_ghost | pass(self) | Update ghost cells and set boundary conditions. |
compute_dt | pass(self) | Compute time step. |
compute_q_auxiliary | pass(self) | Compute auxiliary variables. |
compute_residuals | pass(self) | Compute residuals. |
integrate | pass(self) | Perform one step integration. |
simulate | pass(self) | Perform the simulation. |
Interfaces
assign_omp
Assign array to scalar value with OpenMP threads.
Module procedures: assign_omp_R8P_5D
Subroutines
allocate_cpu
Allocate CPU data.
fortran
subroutine allocate_cpu(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. |
Call graph
initialize
Initialize the equation.
fortran
subroutine initialize(self, filename)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. | |
filename | character(len=*) | in | Input file name. |
Call graph
amr_update
Do AMR update.
fortran
subroutine amr_update(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. |
Call graph
compute_phi
Compute phi, distance from IB solid.
fortran
subroutine compute_phi(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. |
Call graph
mark_by_geo
Mark blocks to be refined/derefined by a geometric constrain.
fortran
subroutine mark_by_geo(self, delta_fine, delta_coarse, threshold, do_init)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. | |
delta_fine | real(kind=R8P) | in | Maximum cell delta in fine grids. | |
delta_coarse | real(kind=R8P) | in | Minimum cell delta in coarse grids. | |
threshold | real(kind=R8P) | in | optional | Threshold for sphere proximity. |
do_init | logical | in | optional |
Call graph
mark_by_grad_var
Mark blocks to be refined/derefined by a grad(var) value.
fortran
subroutine mark_by_grad_var(self, grad_tol, delta_type, delta_fine, delta_coarse, ivar, threshold, do_init)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. | |
grad_tol | real(kind=R8P) | in | Gradiend tolerance value. | |
delta_type | character(len=*) | in | Delta criterion type. | |
delta_fine | real(kind=R8P) | in | Maximum cell delta in fine grids. | |
delta_coarse | real(kind=R8P) | in | Minimum cell delta in coarse grids. | |
ivar | integer(kind=I4P) | in | optional | Variable for marking. |
threshold | real(kind=R8P) | in | optional | Threshold for sphere proximity. |
do_init | logical | in | optional | Re-initialize refinements queries. |
Call graph
move_phi
Move phi and the actual tree representation.
fortran
subroutine move_phi(self, velocity, s)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. | |
velocity | real(kind=R8P) | in | Velocity of the movement. | |
s | integer(kind=I4P) | in | Solid index. |
Call graph
refine_uniform
Refine all blocks uniformly.
fortran
subroutine refine_uniform(self, refinement_levels)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. | |
refinement_levels | integer(kind=I4P) | in | Number of refinement to be performed. |
Call graph
integrate_eikonal
Integrate eikonal equation.
fortran
subroutine integrate_eikonal(self, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. | |
q | real(kind=R8P) | inout | Conservative variables. |
Call graph
load_restart_files
Save restart files.
fortran
subroutine load_restart_files(self, t, time)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. | |
t | integer(kind=I4P) | out | Time iteration. | |
time | real(kind=R8P) | out | Time. |
Call graph
save_hdf5
Save simulation data in HDF5 format.
fortran
subroutine save_hdf5(self, output_basename)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. | |
output_basename | character(len=*) | in | optional | Output basename. |
Call graph
save_residuals
Save residuals history.
fortran
subroutine save_residuals(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. |
Call graph
save_restart_files
Save restart files.
fortran
subroutine save_restart_files(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. |
Call graph
save_simulation_data
Save all simulation data.
fortran
subroutine save_simulation_data(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. |
Call graph
set_boundary_conditions
Set boundary conditions of equation.
fortran
subroutine set_boundary_conditions(self, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | in | The equation. | |
q | real(kind=R8P) | inout | Conservative variables. |
Call graph
set_initial_conditions
Set initial conditions of field.
fortran
subroutine set_initial_conditions(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. |
Call graph
update_ghost
Update ghost cells. If not specified all steps are perfermod, syncronous computation
fortran
subroutine update_ghost(self, q, step)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. | |
q | real(kind=R8P) | inout | Conservative variables. | |
step | integer(kind=I4P) | in | optional | Step to be perfordmed in asyncronous comp. |
Call graph
compute_dt
Compute maximum time step accordingly to CFL stabilty criterion.
fortran
subroutine compute_dt(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. |
Call graph
compute_q_auxiliary
Compute auxiliary variables.
fortran
subroutine compute_q_auxiliary(self, q, q_aux)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | in | The equation. | |
q | real(kind=R8P) | in | Conservative variables. | |
q_aux | real(kind=R8P) | out | Auxiliary variables. |
Call graph
compute_residuals
Compute residuals of equation.
fortran
subroutine compute_residuals(self, q, dq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. | |
q | real(kind=R8P) | inout | Conservative variables. | |
dq | real(kind=R8P) | inout | Residuals. |
Call graph
integrate
Perform one step integration.
fortran
subroutine integrate(self, do_ghost_syncro)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. | |
do_ghost_syncro | logical | in | optional | Flag to do syncrous ghost update. |
Call graph
simulate
Perform the simulation.
fortran
subroutine simulate(self, filename)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(nasto_cpu_object) | inout | The equation. | |
filename | character(len=*) | in | Input file name. |
Call graph
assign_omp_R8P_5D
Assign array to scalar value with OpenMP threads (kind R8P, rank 5)
fortran
subroutine assign_omp_R8P_5D(blocks_number, ngc, lhs, rhs)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
blocks_number | integer(kind=I4P) | in | Number of blocks. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
lhs | real(kind=R8P) | inout | Lest hand side. | |
rhs | real(kind=R8P) | in | Right hand side. |
compute_fluxes_convective
Compute convective fluxes along direction dir.
fortran
subroutine compute_fluxes_convective(dir, blocks_number, ni, nj, nk, ngc, nv, weno_s, weno_a, weno_p, weno_d, weno_zeps, g, q_aux, fluxes)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
dir | integer(kind=I4P) | in | Direction, 1=X, 2=Y, 3=Z. | |
blocks_number | integer(kind=I4P) | in | Number of blocks. | |
ni | integer(kind=I4P) | in | Grid cells number in I direction. | |
nj | integer(kind=I4P) | in | Grid cells number in J direction. | |
nk | integer(kind=I4P) | in | Grid cells number in K direction. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
nv | integer(kind=I4P) | in | Number of conservative varibales. | |
weno_s | integer(kind=I4P) | in | Weno stencils number/dimension. | |
weno_a | real(kind=R8P) | in | Optimal weights. | |
weno_p | real(kind=R8P) | in | Polinomials coefficients. | |
weno_d | real(kind=R8P) | in | Smoothness indicators coefficients. | |
weno_zeps | real(kind=R8P) | in | Parameter for avoiding division by zero in computing IS. | |
g | real(kind=R8P) | in | Specific heats ratio. | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
fluxes | real(kind=R8P) | inout | Fluxes. |
Call graph
compute_fluxes_difference
Compute fluxes difference.
fortran
subroutine compute_fluxes_difference(null_xyz, blocks_number, ni, nj, nk, ngc, nv, ib_eps, dx, dy, dz, flx, fly, flz, phi, dq)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
null_xyz | logical | in | Nullified directions tags. | |
blocks_number | integer(kind=I4P) | in | Number of blocks. | |
ni | integer(kind=I4P) | in | Grid cells number in I direction. | |
nj | integer(kind=I4P) | in | Grid cells number in J direction. | |
nk | integer(kind=I4P) | in | Grid cells number in K direction. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
nv | integer(kind=I4P) | in | Number of conservative varibales. | |
ib_eps | real(kind=R8P) | in | Tolerance IB delta ratio. | |
dx | real(kind=R8P) | in | Space steps. | |
dy | real(kind=R8P) | in | Space steps. | |
dz | real(kind=R8P) | in | Space steps. | |
flx | real(kind=R8P) | in | X direction fluxes. | |
fly | real(kind=R8P) | in | Y direction fluxes. | |
flz | real(kind=R8P) | in | Z direction fluxes. | |
phi | real(kind=R8P) | in | optional | IB distance function. |
dq | real(kind=R8P) | inout | Fluxes differences. |
Call graph
compute_fluxes_diffusive
Compute diffusive fluxes.
fortran
subroutine compute_fluxes_diffusive(null_xyz, blocks_number, ni, nj, nk, ngc, mu, kd, q_aux, dx, dy, dz, flx, fly, flz)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
null_xyz | logical | in | Nullified directions tags. | |
blocks_number | integer(kind=I4P) | in | Blocks number. | |
ni | integer(kind=I4P) | in | Grid dimensionns. | |
nj | integer(kind=I4P) | in | Grid dimensionns. | |
nk | integer(kind=I4P) | in | Grid dimensionns. | |
ngc | integer(kind=I4P) | in | Number of ghost cells. | |
mu | real(kind=R8P) | in | Viscosity. | |
kd | real(kind=R8P) | in | Thermal diffusivity. | |
q_aux | real(kind=R8P) | in | Auxiliary varibales | |
dx | real(kind=R8P) | in | Space steps. | |
dy | real(kind=R8P) | in | Space steps. | |
dz | real(kind=R8P) | in | Space steps. | |
flx | real(kind=R8P) | inout | Fluxes along x. | |
fly | real(kind=R8P) | inout | Fluxes along y. | |
flz | real(kind=R8P) | inout | Fluxes along z. |
Call graph
compute_q_gradient
Compute gradient of q(ivar).
fortran
subroutine compute_q_gradient(b, ni, nj, nk, ngc, dx, dy, dz, q, ivar, gradient)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
b | integer(kind=I4P) | in | Block index. | |
ni | integer(kind=I4P) | in | Grid cells number in I direction. | |
nj | integer(kind=I4P) | in | Grid cells number in J direction. | |
nk | integer(kind=I4P) | in | Grid cells number in K direction. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
dx | real(kind=R8P) | in | X space step. | |
dy | real(kind=R8P) | in | Y space step. | |
dz | real(kind=R8P) | in | Z space step. | |
q | real(kind=R8P) | in | Field component to which apply gradient. | |
ivar | integer(kind=I4P) | in | Index of variable for computing the gradient. | |
gradient | real(kind=R8P) | out | Maximum gradient of q. |
Call graph
decompose_fluxes_convective
Decompose convective fluxes. Flux vector splitting by local-Lax-Friedrics (Rusanov) with projection in pseudo-characteristics psace.
Attributes: pure
fortran
subroutine decompose_fluxes_convective(si, sir, el, weno_s, b, i, j, k, ngc, nv, g, q_aux, fmpc)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
si | integer(kind=I4P) | in | Stencil increment. | |
sir | real(kind=R8P) | in | Stencil increment, real cast. | |
el | real(kind=R8P) | in | Left eigeinvectors. | |
weno_s | integer(kind=I4P) | in | Weno stencils number/dimension. | |
b | integer(kind=I4P) | in | Counter. | |
i | integer(kind=I4P) | in | Counter. | |
j | integer(kind=I4P) | in | Counter. | |
k | integer(kind=I4P) | in | Counter. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
nv | integer(kind=I4P) | in | Number of conservative varibales. | |
g | real(kind=R8P) | in | Specific heats ratio. | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
fmpc | real(kind=R8P) | inout | Fluxes -+ decomposition in characteristics space. |
Call graph
decompose_fluxes_convective_llf
Decompose convective fluxes using the Local-Lax-Friedrichs (LLF, Rusanov) approximation
Attributes: pure
fortran
subroutine decompose_fluxes_convective_llf(sir, nv, q_aux, evmax, fmp)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
sir | real(kind=R8P) | in | Directional (1=x,2=y,3=z) increment. | |
nv | integer(kind=I4P) | in | Number of conservative varibales. | |
q_aux | real(kind=R8P) | in | Auxiliary variables. | |
evmax | real(kind=R8P) | in | Maximum waves speeds estimation. | |
fmp | real(kind=R8P) | inout | Fluxes, negative/positive terms [1:2,1:nv]. |
Call graph