MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_ib_patches Module Reference

Allocate memory and read initial condition data for IC extrusion. More...

Functions/Subroutines

subroutine s_ib_circle (patch_id, ib_markers, xp, yp)
 Mark cells inside a circular immersed boundary.
subroutine s_ib_airfoil (patch_id, ib_markers, xp, yp)
 Mark cells inside a 2D NACA 4-digit airfoil immersed boundary.
subroutine s_ib_3d_airfoil (patch_id, ib_markers, xp, yp, zp)
 Mark cells inside a 3D extruded NACA 4-digit airfoil immersed boundary with finite span.
subroutine s_ib_rectangle (patch_id, ib_markers, xp, yp)
 Mark cells inside a rectangular immersed boundary.
subroutine s_ib_sphere (patch_id, ib_markers, xp, yp, zp)
 Mark cells inside a spherical immersed boundary.
subroutine s_ib_cuboid (patch_id, ib_markers, xp, yp, zp)
 Mark cells inside a cuboidal immersed boundary.
subroutine s_ib_cylinder (patch_id, ib_markers, xp, yp, zp)
 Mark cells inside a cylindrical immersed boundary.
subroutine s_ib_ellipse (patch_id, ib_markers, xp, yp)
 Mark cells inside a 2D elliptical immersed boundary.
subroutine s_ib_model (patch_id, ib_markers, xp, yp)
 The STL patch is a 2D geometry that is imported from an STL file.
subroutine s_ib_3d_model (patch_id, ib_markers, xp, yp, zp)
 The STL patch is a 3D geometry that is imported from an STL file.
subroutine, public s_update_ib_rotation_matrix (patch_id)
 Compute a rotation matrix for converting to the rotating frame of the boundary.
subroutine s_convert_cylindrical_to_cartesian_coord (cyl_y, cyl_z)
 Convert cylindrical (r, theta) coordinates to Cartesian (y, z).
pure real(wp) function, dimension(1:3), public f_convert_cyl_to_cart (cyl)
 Convert a 3D cylindrical coordinate vector (x, r, theta) to Cartesian (x, y, z).
subroutine s_convert_cylindrical_to_spherical_coord (cyl_x, cyl_y)
 Convert cylindrical coordinates (x, r) to the spherical azimuthal angle phi.
subroutine get_bounding_indices (left_bound, right_bound, cell_centers, left_index, right_index)
subroutine s_encode_patch_periodicity (patch_id, x_periodicity, y_periodicity, z_periodicity, encoded_patch_id)
 Encode the patch ID with a unique offset containing periodicity information.
subroutine, public s_decode_patch_periodicity (encoded_patch_id, patch_id, x_periodicity, y_periodicity, z_periodicity)
 Decode the encoded ID to recover the original patch ID and periodicity.
subroutine s_get_periodicities (xp_lower, xp_upper, yp_lower, yp_upper, zp_lower, zp_upper)
 Determine the periodic wrapping bounds in each direction.
pure elemental real(wp) function f_r (myth, offset, a)
 Archimedes spiral function.
impure subroutine, public s_apply_ib_patches (ib_markers)
 Apply all immersed boundary patch geometries to mark interior cells in the IB marker array.

Variables

real(wpx_centroid
real(wpy_centroid
real(wpz_centroid
real(wplength_x
real(wplength_y
real(wplength_z
integer smooth_patch_id
real(wpsmooth_coeff
real(wpcart_x
real(wpcart_y
real(wpcart_z
real(wpsph_phi
type(bounds_infox_boundary
type(bounds_infoy_boundary
type(bounds_infoz_boundary
character(len=5) istr
 string to store int to string result for error checking

Detailed Description

Allocate memory and read initial condition data for IC extrusion.

This macro handles the complete initialization process for IC extrusion by:

Memory Allocation:

  • stored_values(xRows, yRows, sys_size) - stores primitive variable data from files
  • x_coords(nrows) - stores x-coordinates from input files
  • y_coords(nrows) - stores y-coordinates from input files (3D case only)

File Reading Operations:

  • Reads primitive variable data from multiple files with pattern: prim.<file_number>.00.<timestep>.dat where timestep uses zeros_default padding
  • Files are read from directory specified by init_dir parameter
  • Supports 1D, 2D, and 3D computational domains

Grid Structure Detection:

  • 1D/2D: Counts lines in first file to determine xRows
  • 3D: Analyzes coordinate patterns to determine xRows and yRows structure

MPI Domain Mapping:

  • Calculates global_offset_x and global_offset_y for MPI subdomain positioning
  • Maps file coordinates to local computational grid coordinates

Data Assignment:

  • Populates q_prim_vf primitive variable arrays with file data
  • Handles momentum component indexing with special treatment for momxe
  • Sets momxe component to zero for 2D/3D cases

State Management:

  • Uses files_loaded flag to prevent redundant file operations
  • Preserves data across multiple macro calls within same simulation
Note
File pattern uses zeros_default parameter (default: "000000") for timestep padding
Directory path is hardcoded in init_dir parameter - modify as needed
Warning
Aborts execution if file reading errors occur.

Immersed boundary patch geometry constructors for 2D and 3D shapes

Function/Subroutine Documentation

◆ f_convert_cyl_to_cart()

pure real(wp) function, dimension(1:3), public m_ib_patches::f_convert_cyl_to_cart ( real(wp), dimension(1:3), intent(in) cyl)

Convert a 3D cylindrical coordinate vector (x, r, theta) to Cartesian (x, y, z).

Definition at line 1900 of file m_ib_patches.fpp.f90.

◆ f_r()

pure elemental real(wp) function m_ib_patches::f_r ( real(wp), intent(in) myth,
real(wp), intent(in) offset,
real(wp), intent(in) a )

Archimedes spiral function.

Definition at line 2093 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_bounding_indices()

subroutine m_ib_patches::get_bounding_indices ( real(wp), intent(in) left_bound,
real(wp), intent(in) right_bound,
real(wp), dimension(-buff_size:), intent(in) cell_centers,
integer, intent(inout) left_index,
integer, intent(inout) right_index )

Definition at line 1950 of file m_ib_patches.fpp.f90.

Here is the caller graph for this function:

◆ s_apply_ib_patches()

impure subroutine, public m_ib_patches::s_apply_ib_patches ( type(integer_field), intent(inout) ib_markers)

Apply all immersed boundary patch geometries to mark interior cells in the IB marker array.

IB Patches

IB Patches

Definition at line 479 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:

◆ s_convert_cylindrical_to_cartesian_coord()

subroutine m_ib_patches::s_convert_cylindrical_to_cartesian_coord ( real(wp), intent(in) cyl_y,
real(wp), intent(in) cyl_z )

Convert cylindrical (r, theta) coordinates to Cartesian (y, z).

Definition at line 1874 of file m_ib_patches.fpp.f90.

Here is the caller graph for this function:

◆ s_convert_cylindrical_to_spherical_coord()

subroutine m_ib_patches::s_convert_cylindrical_to_spherical_coord ( real(wp), intent(in) cyl_x,
real(wp), intent(in) cyl_y )

Convert cylindrical coordinates (x, r) to the spherical azimuthal angle phi.

Definition at line 1926 of file m_ib_patches.fpp.f90.

◆ s_decode_patch_periodicity()

subroutine, public m_ib_patches::s_decode_patch_periodicity ( integer, intent(in) encoded_patch_id,
integer, intent(out) patch_id,
integer, intent(out) x_periodicity,
integer, intent(out) y_periodicity,
integer, intent(out) z_periodicity )

Decode the encoded ID to recover the original patch ID and periodicity.

Definition at line 2008 of file m_ib_patches.fpp.f90.

◆ s_encode_patch_periodicity()

subroutine m_ib_patches::s_encode_patch_periodicity ( integer, intent(in) patch_id,
integer, intent(in) x_periodicity,
integer, intent(in) y_periodicity,
integer, intent(in) z_periodicity,
integer, intent(out) encoded_patch_id )

Encode the patch ID with a unique offset containing periodicity information.

Definition at line 1990 of file m_ib_patches.fpp.f90.

Here is the caller graph for this function:

◆ s_get_periodicities()

subroutine m_ib_patches::s_get_periodicities ( integer, intent(out) xp_lower,
integer, intent(out) xp_upper,
integer, intent(out) yp_lower,
integer, intent(out) yp_upper,
integer, intent(out), optional zp_lower,
integer, intent(out), optional zp_upper )

Determine the periodic wrapping bounds in each direction.

Definition at line 2048 of file m_ib_patches.fpp.f90.

Here is the caller graph for this function:

◆ s_ib_3d_airfoil()

subroutine m_ib_patches::s_ib_3d_airfoil ( integer, intent(in) patch_id,
type(integer_field), intent(inout) ib_markers,
integer, intent(in) xp,
integer, intent(in) yp,
integer, intent(in) zp )

Mark cells inside a 3D extruded NACA 4-digit airfoil immersed boundary with finite span.

Parameters
[in]zpintegers containing the periodicity projection information

Definition at line 881 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_ib_3d_model()

subroutine m_ib_patches::s_ib_3d_model ( integer, intent(in) patch_id,
type(integer_field), intent(inout) ib_markers,
integer, intent(in) xp,
integer, intent(in) yp,
integer, intent(in) zp )

The STL patch is a 3D geometry that is imported from an STL file.

Parameters
[in]zpintegers containing the periodicity projection information

Definition at line 1711 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_ib_airfoil()

subroutine m_ib_patches::s_ib_airfoil ( integer, intent(in) patch_id,
type(integer_field), intent(inout) ib_markers,
integer, intent(in) xp,
integer, intent(in) yp )

Mark cells inside a 2D NACA 4-digit airfoil immersed boundary.

Parameters
[in]ypintegers containing the periodicity projection information

Definition at line 612 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_ib_circle()

subroutine m_ib_patches::s_ib_circle ( integer, intent(in) patch_id,
type(integer_field), intent(inout) ib_markers,
integer, intent(in) xp,
integer, intent(in) yp )

Mark cells inside a circular immersed boundary.

Parameters
[in]ypintegers containing the periodicity projection information

Definition at line 540 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_ib_cuboid()

subroutine m_ib_patches::s_ib_cuboid ( integer, intent(in) patch_id,
type(integer_field), intent(inout) ib_markers,
integer, intent(in) xp,
integer, intent(in) yp,
integer, intent(in) zp )

Mark cells inside a cuboidal immersed boundary.

Parameters
[in]zpintegers containing the periodicity projection information

Definition at line 1323 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_ib_cylinder()

subroutine m_ib_patches::s_ib_cylinder ( integer, intent(in) patch_id,
type(integer_field), intent(inout) ib_markers,
integer, intent(in) xp,
integer, intent(in) yp,
integer, intent(in) zp )

Mark cells inside a cylindrical immersed boundary.

Parameters
[in]zpintegers containing the periodicity projection information

Definition at line 1421 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_ib_ellipse()

subroutine m_ib_patches::s_ib_ellipse ( integer, intent(in) patch_id,
type(integer_field), intent(inout) ib_markers,
integer, intent(in) xp,
integer, intent(in) yp )

Mark cells inside a 2D elliptical immersed boundary.

Parameters
[in]ypintegers containing the periodicity projection information

Definition at line 1522 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_ib_model()

subroutine m_ib_patches::s_ib_model ( integer, intent(in) patch_id,
type(integer_field), intent(inout) ib_markers,
integer, intent(in) xp,
integer, intent(in) yp )

The STL patch is a 2D geometry that is imported from an STL file.

Parameters
[in]ypintegers containing the periodicity projection information

Definition at line 1604 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_ib_rectangle()

subroutine m_ib_patches::s_ib_rectangle ( integer, intent(in) patch_id,
type(integer_field), intent(inout) ib_markers,
integer, intent(in) xp,
integer, intent(in) yp )

Mark cells inside a rectangular immersed boundary.

Parameters
[in]ypintegers containing the periodicity projection information

Definition at line 1151 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_ib_sphere()

subroutine m_ib_patches::s_ib_sphere ( integer, intent(in) patch_id,
type(integer_field), intent(inout) ib_markers,
integer, intent(in) xp,
integer, intent(in) yp,
integer, intent(in) zp )

Mark cells inside a spherical immersed boundary.

Parameters
[in]zpintegers containing the periodicity projection information

Definition at line 1234 of file m_ib_patches.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_update_ib_rotation_matrix()

subroutine, public m_ib_patches::s_update_ib_rotation_matrix ( integer, intent(in) patch_id)

Compute a rotation matrix for converting to the rotating frame of the boundary.

Definition at line 1828 of file m_ib_patches.fpp.f90.

Variable Documentation

◆ cart_x

real(wp) m_ib_patches::cart_x

Definition at line 443 of file m_ib_patches.fpp.f90.

◆ cart_y

real(wp) m_ib_patches::cart_y

Definition at line 443 of file m_ib_patches.fpp.f90.

◆ cart_z

real(wp) m_ib_patches::cart_z

Definition at line 443 of file m_ib_patches.fpp.f90.

◆ istr

character(len=5) m_ib_patches::istr

string to store int to string result for error checking

Definition at line 474 of file m_ib_patches.fpp.f90.

◆ length_x

real(wp) m_ib_patches::length_x

Definition at line 402 of file m_ib_patches.fpp.f90.

◆ length_y

real(wp) m_ib_patches::length_y

Definition at line 402 of file m_ib_patches.fpp.f90.

◆ length_z

real(wp) m_ib_patches::length_z

Definition at line 402 of file m_ib_patches.fpp.f90.

◆ smooth_coeff

real(wp) m_ib_patches::smooth_coeff

Definition at line 427 of file m_ib_patches.fpp.f90.

◆ smooth_patch_id

integer m_ib_patches::smooth_patch_id

Definition at line 426 of file m_ib_patches.fpp.f90.

◆ sph_phi

real(wp) m_ib_patches::sph_phi

Definition at line 444 of file m_ib_patches.fpp.f90.

◆ x_boundary

type(bounds_info) m_ib_patches::x_boundary

Definition at line 458 of file m_ib_patches.fpp.f90.

◆ x_centroid

real(wp) m_ib_patches::x_centroid

Definition at line 401 of file m_ib_patches.fpp.f90.

◆ y_boundary

type(bounds_info) m_ib_patches::y_boundary

Definition at line 458 of file m_ib_patches.fpp.f90.

◆ y_centroid

real(wp) m_ib_patches::y_centroid

Definition at line 401 of file m_ib_patches.fpp.f90.

◆ z_boundary

type(bounds_info) m_ib_patches::z_boundary

Definition at line 458 of file m_ib_patches.fpp.f90.

◆ z_centroid

real(wp) m_ib_patches::z_centroid

Definition at line 401 of file m_ib_patches.fpp.f90.