MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_particles_EL.fpp.f90 File Reference

Go to the source code of this file.

Modules

module  m_particles_el
 Real fields of a particle MPI slot, as (names, indices, count) in pack order. Used by both pack and unpack routines to ensure.

Functions/Subroutines

impure subroutine, public m_particles_el::s_initialize_particles_el_module (bc_type, rows, ids, n_loc)
 Allocate the particle and projected-field arrays, load this rank's n_loc particles from rows (input file, with global IDs ids, or restart), project them onto the grid, and precompute the interpolation and finite-difference weights.
impure subroutine m_particles_el::s_load_particles (rows, ids, n_loc)
 Store this rank's n_loc particles: on a fresh start rows hold x, y, z, u, v, w, radius with global IDs ids, on a restart the restart-file columns.
impure subroutine m_particles_el::s_add_particle (inputpart, part_id, glb_part_id)
 Store one particle from the input file: position, velocity, radius, mass from particle_pprho0ref_particle, and its fluctuation-model seed.
impure subroutine m_particles_el::s_restart_particles (io_data, n_loc)
 Store this rank's n_loc particles from the restart file columns io_data.
subroutine, public m_particles_el::s_compute_particles_el_dynamics (q_prim_vf, bc_type, stage)
 Interpolate the fluid state to each particle, compute the drag, pressure-gradient, added-mass and fluctuating forces, and store the particle RHS for this RK stage. With two-way coupling, also project the forces onto the grid. Particles advance in lockstep with the fluid, using the same TVD RK stages (s_update_lagrange_particles_tdv_rk).
impure subroutine m_particles_el::s_abort_nonfinite_force ()
 Report every particle whose force is not finite (position, velocities, fluid state, Re, Ma and the force term that failed first) and abort the run.
subroutine m_particles_el::s_get_drag_viscosity (q_prim_vf, fluid_pres, fluid_rho, pi_inf_mix, alpha, re_mix, mu, i, j, k)
 Fluid viscosity for the drag correlations: from the mixture Reynolds number when viscous, from the mixture model with chemistry, otherwise mu_ref with an optional Sutherland correction.
subroutine m_particles_el::s_smear_field_contributions (bc_type, ind_start, ind_end, recompute_gsum)
 Project the particle quantities ind_start:ind_end onto the grid with the Gaussian kernel (Maeda and Colonius, 2018), exchange them across rank boundaries, and turn the projected particle volume fraction into the fluid volume fraction. recompute_gSum relocates the particles and recomputes the kernel normalization.
subroutine, public m_particles_el::s_compute_particles_el_source (q_cons_vf, q_prim_vf, rhs_vf)
 Add the two-way coupling source terms to the fluid RHS: volume-fraction terms and the projected particle forces (Maeda and Colonius, 2018).
subroutine m_particles_el::s_add_pressure_source (rhs)
 rhs -= (alpha_p/alpha_f)*field_vars(part_field_idxdsrc_tmp).
impure subroutine, public m_particles_el::s_update_lagrange_particles_tdv_rk (bc_type, stage, coef)
 Advance particle positions and velocities by one TVD RK stage with the stage coefficients coef (a row of rk_coef), then apply boundary conditions and rank handover.
impure subroutine m_particles_el::s_enforce_el_particles_boundary_conditions (bc_type)
 Enforce boundary conditions on Lagrangian particles. Phases: (1) GPU->host transfer, (2) MPI particle exchange with neighbors, (3) per-particle BC (clamp at walls, remove outside the domain) and compaction on the host, (4) host->GPU transfer, (5) re-smear onto Eulerian grid.
impure subroutine m_particles_el::s_copy_particle_time_level (dest, src)
 Copy time level src into dest (1: committed u^n, 2: stage value).
subroutine, public m_particles_el::s_compute_particle_gradients (ql, qr, dir)
 Store the particle field gradients along dir (pressure, velocity, and density with added mass) from this sweep's reconstructed face states. Called inside the RHS direction loop, so the face states need no extra copy.
subroutine m_particles_el::s_gradient_field (vl_field, vr_field, dq, dir, fbeg, fend)
 Cell-centered derivative along dir of the sum of components fbeg:fend: the difference of the right and left reconstructed face states over the cell width. The face states are stored in (x, y, z) order for every sweep direction, so dq shares their (i, j, k) indexing.
impure subroutine m_particles_el::s_compute_barycentric_weights (npts)
 Barycentric Lagrange interpolation weights at every cell in each direction, computed once.
impure subroutine, public m_particles_el::s_sync_particles_for_save ()
 Copy the particle state and projected volume fraction to the host before a save, and abort if any particle position or velocity is NaN.
impure subroutine m_particles_el::s_mpi_sendrecv_lag_particles ()
 Send the particles on the transfer list to their new ranks and append the particles received from the neighbors (host data).
impure subroutine m_particles_el::s_pack_lag_particle (k, q)
 Pack particle k into MPI send slot q, in the field order of s_unpack_lag_particle.
impure subroutine m_particles_el::s_unpack_lag_particle (k, q)
 Unpack particle k from MPI receive slot q, in the field order of s_pack_lag_particle.
impure subroutine m_particles_el::s_copy_lag_particle (dest, src)
 Copy particle src's state into slot dest, to compact the particle arrays after removals.
integer function m_particles_el::f_particle_capacity (n)
 Array length for n particles: headroom for arrivals from neighbor ranks, capped at the global count.
impure subroutine m_particles_el::s_allocate_particle_arrays (n)
 Allocate the per-particle arrays (host and device) with room for n particles.
impure subroutine m_particles_el::s_deallocate_particle_arrays ()
 Deallocate the per-particle arrays (host and device).
impure subroutine m_particles_el::s_grow_particle_arrays (n)
 Reallocate the per-particle arrays with room for n particles, keeping the state of the first n_el_particles_loc. Host data: the caller updates the device.
impure subroutine, public m_particles_el::s_finalize_particles_el_module ()
 Deallocate the particle arrays.

Variables

integer m_particles_el::particle_cap
 Allocated length of the per-particle arrays.
integer, dimension(:,:), allocatable, public m_particles_el::lag_part_id
 Global and local IDs.
real(wp), dimension(:), allocatable, public m_particles_el::particle_mass
 Particle Mass.
real(wp), dimension(:), allocatable m_particles_el::p_am
 Particle Added Mass.
integer(seed_kind), dimension(:), allocatable, public m_particles_el::particle_seed
 State of the particle's fluctuation-model RNG.
real(wp), dimension(:), allocatable, public m_particles_el::particle_rad
 Particle radius (constant: particles are rigid).
real(wp), dimension(:,:,:), allocatable, public m_particles_el::particle_pos
 Particle's position.
real(wp), dimension(:,:,:), allocatable, public m_particles_el::particle_posprev
 Particle's previous position.
real(wp), dimension(:,:,:), allocatable, public m_particles_el::particle_vel
 Particle's velocity.
real(wp), dimension(:,:,:), allocatable m_particles_el::particle_s
 Particle's computational cell position in real format.
real(wp), dimension(:,:), allocatable m_particles_el::particle_dposdt
 Time derivative of the particle's position.
real(wp), dimension(:,:), allocatable m_particles_el::particle_dveldt
 Time derivative of the particle's velocity.
type(scalar_field), dimension(:), allocatable, public m_particles_el::q_particles
 Eulerian projection of particle data (volume fraction, momentum, sources).
type(scalar_field), dimension(:), allocatable m_particles_el::kahan_comp_particles
 Kahan compensation for q_particles accumulation.
type(scalar_field), dimension(:), allocatable m_particles_el::field_vars
 Interpolated Eulerian field gradients at particle locations.
type(scalar_field), dimension(:), allocatable m_particles_el::rhs_old
 For previous rhs values.
type(scalar_field), dimension(:), allocatable m_particles_el::weights_x_interp
 For precomputing weights.
type(scalar_field), dimension(:), allocatable m_particles_el::weights_y_interp
 For precomputing weights.
type(scalar_field), dimension(:), allocatable m_particles_el::weights_z_interp
 For precomputing weights.
integer m_particles_el::nweights_interp
real(wp), dimension(:,:), allocatable, public m_particles_el::f_p
 force on each particle
real(wp), dimension(:,:), allocatable, public m_particles_el::fqs_fluct
 QS fluctuation force on each particle.
real(wp), dimension(:), allocatable m_particles_el::gsum
 gaussian sum for each particle
real(wp), dimension(:,:), allocatable, public m_particles_el::fluid_vel_at_particle
 fluid velocity at each particle
real(wp), dimension(:), allocatable, public m_particles_el::density_at_particle
 density at each particle
real(wp), dimension(:), allocatable m_particles_el::pres_at_particle
 fluid pressure at each particle
integer, dimension(:), allocatable m_particles_el::force_status
 First non-finite force term of each particle (0 if none).
real(wp), dimension(:,:), allocatable m_particles_el::force_re_mach
 Particle Reynolds and Mach numbers, reported with force_status.