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

Contains module m_ibm. More...

Go to the source code of this file.

Modules

module  m_ibm
 Ghost-node immersed boundary method: locates ghost/image points, computes interpolation coefficients, and corrects the flow state.

Functions/Subroutines

impure subroutine, public m_ibm::s_initialize_ibm_module ()
 Allocates memory for the variables in the IBM module.
impure subroutine, public m_ibm::s_ibm_setup ()
 Initializes the values of various IBM variables, such as ghost points and image points.
subroutine, private m_ibm::s_compute_ghost_point_pressure (gp, gp_patch_id, rho, pres_ip, pres_gp)
 Pressure correction for a moving IB, accounting for the acceleration of the boundary surface. Clamped both ways: the linearization it comes from holds only while the correction is order one, and an unbounded one drives the ghost state to vacuum.
subroutine, private m_ibm::s_compute_ghost_point_velocity (gp, gp_patch_id, radial_vector, vel_ip, pres_ip, vel_gp)
subroutine, public m_ibm::s_ibm_correct_state (q_cons_vf, q_prim_vf, pb_in, mv_in)
 Update the conservative variables at the ghost points.
impure subroutine, public m_ibm::s_report_ibm_surface
 One line at the end of a run if the reacting surface ever failed to solve. Silence means every ghost point on every step reached the surface-balance tolerance, i.e. the surface chemistry was actually applied everywhere it was asked for.
impure subroutine, private m_ibm::s_compute_image_points ()
 Compute the image points for each ghost point.
subroutine, private m_ibm::s_find_num_ghost_points (num_gps_out)
 Count the number of ghost points for memory allocation.
subroutine, private m_ibm::s_find_ghost_points ()
 Locate all ghost points in the domain.
subroutine, private m_ibm::s_compute_interpolation_coeffs ()
 Compute the interpolation coefficients for image points.
subroutine, private m_ibm::s_interpolate_image_point (q_prim_vf, gp, alpha_rho_ip, alpha_ip, pres_ip, vel_ip, c_ip, r_ip, v_ip, pb_ip, mv_ip, nmom_ip, pb_in, mv_in, presb_ip, massv_ip, ys_ip)
 Interpolate primitive variables to a ghost point's image point using bilinear or trilinear interpolation.
impure subroutine m_ibm::s_update_mib (num_ibs)
 Resets the current indexes of immersed boundaries and replaces them after updating the position of each moving immersed boundary.
pure real(wp) function m_ibm::f_log_cosh (x)
 log(cosh(x)) without overflow for large |x|
subroutine m_ibm::s_prescribed_kinematics (i, t)
 Prescribed kinematics for patch i at time t: hinged flapping (kin_model = 1) or the Eldredge pitch ramp (kin_model = 2). Flapping rolls phi about the lab x axis through the hinge and pitches theta about the body spanwise (y) axis through it; the ramp holds phi at zero and drives theta alone. Both compose as R = Rx(phi) Ry(theta) (MFC's angle convention) and set the angles, centroid, velocity and lab-frame angular velocity; nothing is integrated, so restarts are exact.
subroutine m_ibm::s_compute_ib_forces (q_prim_vf, fluid_pp)
 Compute pressure and viscous forces and torques on immersed bodies via volume integration.
subroutine m_ibm::s_compute_centroid_offset (gid, ib_marker)
 Computes the center of mass for IB patch types where we are unable to determine their center of mass analytically. These patches include things like NACA airfoils and STL models Move a moving airfoil/STL patch's centroid to its centre of mass, keeping the difference in centroid_offset. Collective: every rank calls it for every global id, contributing zeros for patches it does not hold.
pure logical function m_ibm::f_needs_centroid_offset (patch)
 A moving airfoil or STL (geometries 4, 5, 11, 12) moves its centroid to the centre of mass and keeps a centroid_offset.
impure subroutine m_ibm::s_restore_centroid_offsets (t_init)
 On restart, replace the re-measured centroid offsets with the ones the run was using (restart_data/ib_offset_<step>.dat, written with each checkpoint), and re-place kinematics-driven bodies about them. No file: the measured offsets stand.
subroutine m_ibm::s_compute_moment_of_inertia (patch, axis, moment)
 Computes the moment of inertia for an immersed boundary.
subroutine m_ibm::s_wrap_periodic_ibs ()
 Wrap immersed boundary positions across periodic domain boundaries.
impure subroutine m_ibm::s_setup_ib_force_comm ()
 Builds the ascending list of distinct neighborhood ranks used by s_communicate_ib_forces and allocates its buffers once. The ascending order is the fixed order in which an owner adds its neighbors' contributions.
integer function m_ibm::f_ib_nbr_slot (rank)
 Position of rank in ib_nbrs.
subroutine m_ibm::s_communicate_ib_forces (forces, torques)
 Reduces forces and torques so every rank holding an IB ends with bit-identical values. Each IB has one owner, the rank whose subdomain holds its centroid (patch_ibowner_rank, stamped at handoff). Phase 1: each rank sends its nonzero partials to the owner, which adds them to its own partial in ascending source-rank order once all have arrived. Phase 2: each owner sends its totals to every neighborhood rank, which overwrite their partials. One nonblocking message per neighbor per phase.
subroutine m_ibm::s_handoff_ib_ownership ()
 Swaps ownership of IBs and passes ownership of IBs to neighbor processors.
impure subroutine m_ibm::s_check_every_patch_marked ()
 Abort if any namelist immersed boundary marks no cell anywhere. The owning rank is chosen by the patch centroid, so an STL placed with model_translate while its centroid is left elsewhere is handed to ranks that do not hold it, and it vanishes silently. Cloud particles are skipped: a particle's centroid is its body, so it cannot vanish this way.
impure subroutine, public m_ibm::s_finalize_ibm_module ()
 Finalize the IBM module.
subroutine m_ibm::s_surface_species_residual (pres, t_s, d, ys_ip, ys_s, w_species, r_species, omega_s, mdot_s)
 Species flux residual at a heterogeneous reacting surface.
subroutine m_ibm::s_surface_energy_residual (pres, t_ip, t_s, d, ys_s, r_energy)
 Surface energy residual: gas-side conduction balances heterogeneous reaction heat. Radiation and solid-side conduction are omitted.
subroutine m_ibm::s_surface_residual (pres, t_ip, t_s, d, ys_ip, ys_s, w_species, k_bath, solve_temperature, flux_scale, energy_scale, r, r_species, omega_s, mdot_s)
 Assemble the Newton residual for Ns species, with temperature appended only when it is solved. k_bath selects which species balance the sum constraint displaces; see s_solve_surface for why it must be the most abundant one.
subroutine m_ibm::s_blend_ghost_state (t_ip, t_s, ys_ip, ys_s, t_g, ys_g)
 Ghost state for an immersed surface, from the image-point state and the surface state.
subroutine m_ibm::s_pick_bath_species (ys_s, k_bath)
 Index of the most abundant species, i.e. the balance the sum constraint displaces.
subroutine m_ibm::s_solve_surface (pres, t_ip, t_wall, d, ys_ip, w_species, thermal_bc, ys_s, t_s, mdot_s, converged)
 Newton solve for a reacting surface. thermal_bc=0: zero-normal-gradient T; 1: prescribed T; 2: energy balance.
subroutine m_ibm::s_solve_surface_linear_system (a, b, x, nsolve, success)
 Small dense linear solve with partial pivoting for the local surface Newton system.

Variables

integer m_ibm::n_surface_not_converged = 0
 Ghost points at which the reacting-surface Newton solve did not reach its tolerance, so the point fell back to a chemically inert wall (keeping a prescribed Twall). Counted because that fallback is otherwise indistinguishable from a surface mechanism that simply does nothing, and a run can look converged while the surface chemistry never engaged.
integer m_ibm::n_surface_ill_posed = 0
 Ghost points whose levelset distance was not positive, leaving the surface gradient (X_IP - X_s)/d undefined. Separate from the counter above because this is a grid/geometry degeneracy, not a kinetics failure.
type(integer_field), public m_ibm::ib_markers
type(integer_field) m_ibm::corrected_gps
 1 at ghost points whose image point reaches the fluid, 0 elsewhere. Ghost points with a buried image point average over these neighbors, and never over each other.
type(ghost_point), dimension(:), allocatable m_ibm::ghost_points
integer m_ibm::num_gps
 Number of ghost points.
logical m_ibm::moving_immersed_boundary_flag
logical m_ibm::centroid_offsets_active = .false.
 some patch is a moving airfoil or STL, which carries a centroid_offset
integer, parameter, private m_ibm::ib_rec_len = 7
 gbl_patch_id, force(1:3), torque(1:3)
integer, private m_ibm::n_ib_nbrs = 0
integer, dimension(:), allocatable, private m_ibm::ib_nbrs
integer, dimension(:), allocatable, private m_ibm::ib_send_counts
integer, dimension(:), allocatable, private m_ibm::ib_reqs
integer, dimension(:,:), allocatable, private m_ibm::ib_stats
real(wp), dimension(:,:), allocatable, private m_ibm::ib_send_bufs
real(wp), dimension(:,:), allocatable, private m_ibm::ib_recv_bufs

Detailed Description

Contains module m_ibm.

Definition in file m_ibm.fpp.f90.