MFC: Pre-Process
High-fidelity multiphase flow simulation
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_sf)
 The circular patch is a 2D geometry that may be used, for example, in creating a bubble or a droplet. The geometry of the patch is well-defined when its centroid and radius are provided. Note that the circular patch DOES allow for the smoothing of its boundary.
 
subroutine s_ib_airfoil (patch_id, ib_markers_sf)
 
subroutine s_ib_3d_airfoil (patch_id, ib_markers_sf)
 
subroutine s_ib_rectangle (patch_id, ib_markers_sf)
 The rectangular patch is a 2D geometry that may be used, for example, in creating a solid boundary, or pre-/post- shock region, in alignment with the axes of the Cartesian coordinate system. The geometry of such a patch is well- defined when its centroid and lengths in the x- and y- coordinate directions are provided. Please note that the rectangular patch DOES NOT allow for the smoothing of its boundaries.
 
subroutine s_ib_sphere (patch_id, ib_markers_sf)
 The spherical patch is a 3D geometry that may be used, for example, in creating a bubble or a droplet. The patch geometry is well-defined when its centroid and radius are provided. Please note that the spherical patch DOES allow for the smoothing of its boundary.
 
subroutine s_ib_cuboid (patch_id, ib_markers_sf)
 The cuboidal patch is a 3D geometry that may be used, for example, in creating a solid boundary, or pre-/post-shock region, which is aligned with the axes of the Cartesian coordinate system. The geometry of such a patch is well- defined when its centroid and lengths in the x-, y- and z-coordinate directions are provided. Please notice that the cuboidal patch DOES NOT allow for the smearing of its boundaries.
 
subroutine s_ib_cylinder (patch_id, ib_markers_sf)
 The cylindrical patch is a 3D geometry that may be used, for example, in setting up a cylindrical solid boundary confinement, like a blood vessel. The geometry of this patch is well-defined when the centroid, the radius and the length along the cylinder's axis, parallel to the x-, y- or z-coordinate direction, are provided. Please note that the cylindrical patch DOES allow for the smoothing of its lateral boundary.
 
subroutine s_ib_model (patch_id, ib_markers_sf, stl_levelset, stl_levelset_norm)
 The STL patch is a 2/3D geometry that is imported from an STL file.
 
subroutine, public s_update_ib_rotation_matrix (patch_id)
 Subroutine that computes a rotation matrix for converting to the rotating frame of the boundary.
 
subroutine s_convert_cylindrical_to_cartesian_coord (cyl_y, cyl_z)
 
pure real(wp) function, dimension(1:3) f_convert_cyl_to_cart (cyl)
 
subroutine s_convert_cylindrical_to_spherical_coord (cyl_x, cyl_y)
 
pure elemental real(wp) function f_r (myth, offset, a)
 Archimedes spiral function.
 
impure subroutine, public s_apply_ib_patches (ib_markers_sf, levelset, levelset_norm)
 

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(wpeta
 
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
 

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.

Function/Subroutine Documentation

◆ f_convert_cyl_to_cart()

pure real(wp) function, dimension(1:3) m_ib_patches::f_convert_cyl_to_cart ( real(wp), dimension(1:3), intent(in) cyl)
Here is the caller graph for this function:

◆ 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.

Parameters
mythAngle
offsetThickness
aStarting position
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_apply_ib_patches()

impure subroutine, public m_ib_patches::s_apply_ib_patches ( integer, dimension(:, :, :), intent(inout), optional ib_markers_sf,
type(levelset_field), intent(inout), optional levelset,
type(levelset_norm_field), intent(inout), optional levelset_norm )
Parameters
[in,out]levelsetLevelset determined by models
[in,out]levelset_normLevelset_norm determined by models

IB Patches

IB Patches

Here is the call graph for this function:
Here is the caller 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 )
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 )

◆ s_ib_3d_airfoil()

subroutine m_ib_patches::s_ib_3d_airfoil ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) ib_markers_sf )
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,
integer, dimension(0:m, 0:n, 0:p), intent(inout) ib_markers_sf )
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,
integer, dimension(0:m, 0:n, 0:p), intent(inout) ib_markers_sf )

The circular patch is a 2D geometry that may be used, for example, in creating a bubble or a droplet. The geometry of the patch is well-defined when its centroid and radius are provided. Note that the circular patch DOES allow for the smoothing of its boundary.

Parameters
patch_idis the patch identifier
ib_markers_sfArray to track patch ids
ibTrue if this patch is an immersed boundary
Here is the caller graph for this function:

◆ s_ib_cuboid()

subroutine m_ib_patches::s_ib_cuboid ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) ib_markers_sf )

The cuboidal patch is a 3D geometry that may be used, for example, in creating a solid boundary, or pre-/post-shock region, which is aligned with the axes of the Cartesian coordinate system. The geometry of such a patch is well- defined when its centroid and lengths in the x-, y- and z-coordinate directions are provided. Please notice that the cuboidal patch DOES NOT allow for the smearing of its boundaries.

Parameters
patch_idis the patch identifier
ib_markers_sfArray to track patch ids
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,
integer, dimension(0:m, 0:n, 0:p), intent(inout) ib_markers_sf )

The cylindrical patch is a 3D geometry that may be used, for example, in setting up a cylindrical solid boundary confinement, like a blood vessel. The geometry of this patch is well-defined when the centroid, the radius and the length along the cylinder's axis, parallel to the x-, y- or z-coordinate direction, are provided. Please note that the cylindrical patch DOES allow for the smoothing of its lateral boundary.

Parameters
patch_idis the patch identifier
ib_markers_sfArray to track patch ids
ibTrue if this patch is an immersed boundary
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,
integer, dimension(0:m, 0:n, 0:p), intent(inout) ib_markers_sf,
type(levelset_field), intent(inout), optional stl_levelset,
type(levelset_norm_field), intent(inout), optional stl_levelset_norm )

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

Parameters
patch_idis the patch identifier
ib_markers_sfArray to track patch ids
STL_levelsetSTL levelset
STL_levelset_normSTL levelset normals
[in,out]stl_levelsetLevelset determined by models
[in,out]stl_levelset_normLevelset_norm determined by models
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,
integer, dimension(0:m, 0:n, 0:p), intent(inout) ib_markers_sf )

The rectangular patch is a 2D geometry that may be used, for example, in creating a solid boundary, or pre-/post- shock region, in alignment with the axes of the Cartesian coordinate system. The geometry of such a patch is well- defined when its centroid and lengths in the x- and y- coordinate directions are provided. Please note that the rectangular patch DOES NOT allow for the smoothing of its boundaries.

Parameters
patch_idis the patch identifier
ib_markers_sfArray to track patch ids
ibTrue if this patch is an immersed boundary
Here is the caller graph for this function:

◆ s_ib_sphere()

subroutine m_ib_patches::s_ib_sphere ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) ib_markers_sf )

The spherical patch is a 3D geometry that may be used, for example, in creating a bubble or a droplet. The patch geometry is well-defined when its centroid and radius are provided. Please note that the spherical patch DOES allow for the smoothing of its boundary.

Parameters
patch_idis the patch identifier
ib_markers_sfArray to track patch ids
ibTrue if this patch is an immersed boundary
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)

Subroutine that computes a rotation matrix for converting to the rotating frame of the boundary.

Here is the caller graph for this function:

Variable Documentation

◆ cart_x

real(wp) m_ib_patches::cart_x

◆ cart_y

real(wp) m_ib_patches::cart_y

◆ cart_z

real(wp) m_ib_patches::cart_z

◆ eta

real(wp) m_ib_patches::eta

◆ istr

character(len=5) m_ib_patches::istr

◆ length_x

real(wp) m_ib_patches::length_x

◆ length_y

real(wp) m_ib_patches::length_y

◆ length_z

real(wp) m_ib_patches::length_z

◆ smooth_coeff

real(wp) m_ib_patches::smooth_coeff

◆ smooth_patch_id

integer m_ib_patches::smooth_patch_id

◆ sph_phi

real(wp) m_ib_patches::sph_phi

◆ x_boundary

type(bounds_info) m_ib_patches::x_boundary

◆ x_centroid

real(wp) m_ib_patches::x_centroid

◆ y_boundary

type(bounds_info) m_ib_patches::y_boundary

◆ y_centroid

real(wp) m_ib_patches::y_centroid

◆ z_boundary

type(bounds_info) m_ib_patches::z_boundary

◆ z_centroid

real(wp) m_ib_patches::z_centroid