MFC: Pre-Process
High-fidelity multiphase flow simulation
Loading...
Searching...
No Matches
m_icpp_patches Module Reference

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

Functions/Subroutines

subroutine s_icpp_line_segment (patch_id, patch_id_fp, q_prim_vf)
 The line segment patch is a 1D geometry that may be used, for example, in creating a Riemann problem. The geometry of the patch is well-defined when its centroid and length in the x-coordinate direction are provided. Note that the line segment patch DOES NOT allow for the smearing of its boundaries.
 
impure subroutine s_icpp_spiral (patch_id, patch_id_fp, q_prim_vf)
 The spiral patch is a 2D geometry that may be used, 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_icpp_circle (patch_id, patch_id_fp, q_prim_vf)
 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_icpp_varcircle (patch_id, patch_id_fp, q_prim_vf)
 The varcircle patch is a 2D geometry that may be used . It generatres an annulus.
 
subroutine s_icpp_3dvarcircle (patch_id, patch_id_fp, q_prim_vf)
 
subroutine s_icpp_ellipse (patch_id, patch_id_fp, q_prim_vf)
 The elliptical patch is a 2D geometry. The geometry of the patch is well-defined when its centroid and radii are provided. Note that the elliptical patch DOES allow for the smoothing of its boundary.
 
subroutine s_icpp_ellipsoid (patch_id, patch_id_fp, q_prim_vf)
 The ellipsoidal patch is a 3D geometry. The geometry of the patch is well-defined when its centroid and radii are provided. Note that the ellipsoidal patch DOES allow for the smoothing of its boundary.
 
subroutine s_icpp_rectangle (patch_id, patch_id_fp, q_prim_vf)
 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_icpp_sweep_line (patch_id, patch_id_fp, q_prim_vf)
 The swept line patch is a 2D geometry that may be used, for example, in creating a solid boundary, or pre-/post- shock region, at an angle with respect to the axes of the Cartesian coordinate system. The geometry of the patch is well-defined when its centroid and normal vector, aimed in the sweep direction, are provided. Note that the sweep line patch DOES allow the smoothing of its boundary.
 
subroutine s_icpp_2d_taylorgreen_vortex (patch_id, patch_id_fp, q_prim_vf)
 The Taylor Green vortex is 2D decaying vortex that may be used, for example, to verify the effects of viscous attenuation. Geometry of the patch is well-defined when its centroid are provided.
 
subroutine s_icpp_1d_bubble_pulse (patch_id, patch_id_fp, q_prim_vf)
 
subroutine s_icpp_spherical_harmonic (patch_id, patch_id_fp, q_prim_vf)
 This patch generates the shape of the spherical harmonics as a perturbation to a perfect sphere.
 
subroutine s_icpp_sphere (patch_id, patch_id_fp, q_prim_vf)
 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_icpp_cuboid (patch_id, patch_id_fp, q_prim_vf)
 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_icpp_cylinder (patch_id, patch_id_fp, q_prim_vf)
 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_icpp_sweep_plane (patch_id, patch_id_fp, q_prim_vf)
 The swept plane patch is a 3D geometry that may be used, for example, in creating a solid boundary, or pre-/post- shock region, at an angle with respect to the axes of the Cartesian coordinate system. The geometry of the patch is well-defined when its centroid and normal vector, aimed in the sweep direction, are provided. Note that the sweep plane patch DOES allow the smoothing of its boundary.
 
subroutine s_icpp_model (patch_id, patch_id_fp, q_prim_vf)
 The STL patch is a 2/3D geometry that is imported from an STL file.
 
subroutine s_convert_cylindrical_to_cartesian_coord (cyl_y, cyl_z)
 
real(wp) function, dimension(1:3) f_convert_cyl_to_cart (cyl)
 
subroutine s_convert_cylindrical_to_spherical_coord (cyl_x, cyl_y)
 
elemental real(wp) function f_r (myth, offset, a)
 Archimedes spiral function.
 
impure subroutine, public s_apply_icpp_patches (patch_id_fp, q_prim_vf)
 

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
 These variables are analogous in both meaning and use to the similarly named components in the ic_patch_parameters type (see m_derived_types.f90 for additional details). They are employed as a means to more concisely perform the actions necessary to lay out a particular patch on the grid.
 
real(wpeta
 In the case that smoothing of patch boundaries is enabled and the boundary between two adjacent patches is to be smeared out, this variable's purpose is to act as a pseudo volume fraction to indicate the contribution of each patch toward the composition of a cell's fluid state.
 
real(wpcart_x
 
real(wpcart_y
 
real(wpcart_z
 
real(wpsph_phi
 Variables to be used to hold cell locations in Cartesian coordinates if 3D simulation is using cylindrical coordinates.
 
type(bounds_infox_boundary
 
type(bounds_infoy_boundary
 
type(bounds_infoz_boundary
 These variables combine the centroid and length parameters associated with a particular patch to yield the locations of the patch boundaries in the x-, y- and z-coordinate directions. They are used as a means to concisely perform the actions necessary to lay out a particular patch on the grid.
 
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()

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

◆ f_r()

elemental real(wp) function m_icpp_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_icpp_patches()

impure subroutine, public m_icpp_patches::s_apply_icpp_patches ( integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

ICPP Patches

ICPP 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_icpp_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_icpp_patches::s_convert_cylindrical_to_spherical_coord ( real(wp), intent(in) cyl_x,
real(wp), intent(in) cyl_y )

◆ s_icpp_1d_bubble_pulse()

subroutine m_icpp_patches::s_icpp_1d_bubble_pulse ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )
Here is the caller graph for this function:

◆ s_icpp_2d_taylorgreen_vortex()

subroutine m_icpp_patches::s_icpp_2d_taylorgreen_vortex ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

The Taylor Green vortex is 2D decaying vortex that may be used, for example, to verify the effects of viscous attenuation. Geometry of the patch is well-defined when its centroid are provided.

Parameters
patch_idis the patch identifier
patch_id_fpArray to track patch ids
q_prim_vfArray of primitive variables
Here is the caller graph for this function:

◆ s_icpp_3dvarcircle()

subroutine m_icpp_patches::s_icpp_3dvarcircle ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )
Here is the caller graph for this function:

◆ s_icpp_circle()

subroutine m_icpp_patches::s_icpp_circle ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

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
patch_id_fpArray to track patch ids
q_prim_vfArray of primitive variables
Here is the caller graph for this function:

◆ s_icpp_cuboid()

subroutine m_icpp_patches::s_icpp_cuboid ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

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
patch_id_fpArray to track patch ids
q_prim_vfArray of primitive variables
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_icpp_cylinder()

subroutine m_icpp_patches::s_icpp_cylinder ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

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
patch_id_fpArray to track patch ids
q_prim_vfArray of primitive variables
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_icpp_ellipse()

subroutine m_icpp_patches::s_icpp_ellipse ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

The elliptical patch is a 2D geometry. The geometry of the patch is well-defined when its centroid and radii are provided. Note that the elliptical patch DOES allow for the smoothing of its boundary.

Parameters
patch_idis the patch identifier
patch_id_fpArray to track patch ids
q_prim_vfArray of primitive variables
Here is the caller graph for this function:

◆ s_icpp_ellipsoid()

subroutine m_icpp_patches::s_icpp_ellipsoid ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

The ellipsoidal patch is a 3D geometry. The geometry of the patch is well-defined when its centroid and radii are provided. Note that the ellipsoidal patch DOES allow for the smoothing of its boundary.

Parameters
patch_idis the patch identifier
patch_id_fpArray to track patch ids
q_prim_vfArray of primitive variables
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_icpp_line_segment()

subroutine m_icpp_patches::s_icpp_line_segment ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

The line segment patch is a 1D geometry that may be used, for example, in creating a Riemann problem. The geometry of the patch is well-defined when its centroid and length in the x-coordinate direction are provided. Note that the line segment patch DOES NOT allow for the smearing of its boundaries.

Parameters
patch_idpatch identifier
patch_id_fpArray to track patch ids
q_prim_vfArray of primitive variables
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_icpp_model()

subroutine m_icpp_patches::s_icpp_model ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

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

Parameters
patch_idis the patch identifier
patch_id_fpArray to track patch ids
q_prim_vfPrimitive variables
STL_levelsetSTL levelset
STL_levelset_normSTL levelset normals
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_icpp_rectangle()

subroutine m_icpp_patches::s_icpp_rectangle ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

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
patch_id_fpArray to track patch ids
q_prim_vfArray of primitive variables
Here is the caller graph for this function:

◆ s_icpp_sphere()

subroutine m_icpp_patches::s_icpp_sphere ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

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
patch_id_fpArray to track patch ids
q_prim_vfArray of primitive variables
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_icpp_spherical_harmonic()

subroutine m_icpp_patches::s_icpp_spherical_harmonic ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

This patch generates the shape of the spherical harmonics as a perturbation to a perfect sphere.

Parameters
patch_idis the patch identifier
patch_id_fpArray to track patch ids
q_prim_vfArray of primitive variables
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_icpp_spiral()

impure subroutine m_icpp_patches::s_icpp_spiral ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

The spiral patch is a 2D geometry that may be used, 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_idpatch identifier
patch_id_fpArray to track patch ids
q_prim_vfArray of primitive variables
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_icpp_sweep_line()

subroutine m_icpp_patches::s_icpp_sweep_line ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

The swept line patch is a 2D geometry that may be used, for example, in creating a solid boundary, or pre-/post- shock region, at an angle with respect to the axes of the Cartesian coordinate system. The geometry of the patch is well-defined when its centroid and normal vector, aimed in the sweep direction, are provided. Note that the sweep line patch DOES allow the smoothing of its boundary.

Parameters
patch_idis the patch identifier
patch_id_fpArray to track patch ids
q_prim_vfArray of primitive variables
Here is the caller graph for this function:

◆ s_icpp_sweep_plane()

subroutine m_icpp_patches::s_icpp_sweep_plane ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

The swept plane patch is a 3D geometry that may be used, for example, in creating a solid boundary, or pre-/post- shock region, at an angle with respect to the axes of the Cartesian coordinate system. The geometry of the patch is well-defined when its centroid and normal vector, aimed in the sweep direction, are provided. Note that the sweep plane patch DOES allow the smoothing of its boundary.

Parameters
patch_idis the patch identifier
patch_id_fpArray to track patch ids
q_prim_vfPrimitive variables
Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_icpp_varcircle()

subroutine m_icpp_patches::s_icpp_varcircle ( integer, intent(in) patch_id,
integer, dimension(0:m, 0:n, 0:p), intent(inout) patch_id_fp,
type(scalar_field), dimension(1:sys_size), intent(inout) q_prim_vf )

The varcircle patch is a 2D geometry that may be used . It generatres an annulus.

Parameters
patch_idis the patch identifier
patch_id_fpArray to track patch ids
q_prim_vfArray of primitive variables
Here is the caller graph for this function:

Variable Documentation

◆ cart_x

real(wp) m_icpp_patches::cart_x

◆ cart_y

real(wp) m_icpp_patches::cart_y

◆ cart_z

real(wp) m_icpp_patches::cart_z

◆ eta

real(wp) m_icpp_patches::eta

In the case that smoothing of patch boundaries is enabled and the boundary between two adjacent patches is to be smeared out, this variable's purpose is to act as a pseudo volume fraction to indicate the contribution of each patch toward the composition of a cell's fluid state.

◆ istr

character(len=5) m_icpp_patches::istr

◆ length_x

real(wp) m_icpp_patches::length_x

◆ length_y

real(wp) m_icpp_patches::length_y

◆ length_z

real(wp) m_icpp_patches::length_z

◆ smooth_coeff

real(wp) m_icpp_patches::smooth_coeff

These variables are analogous in both meaning and use to the similarly named components in the ic_patch_parameters type (see m_derived_types.f90 for additional details). They are employed as a means to more concisely perform the actions necessary to lay out a particular patch on the grid.

◆ smooth_patch_id

integer m_icpp_patches::smooth_patch_id

◆ sph_phi

real(wp) m_icpp_patches::sph_phi

Variables to be used to hold cell locations in Cartesian coordinates if 3D simulation is using cylindrical coordinates.

◆ x_boundary

type(bounds_info) m_icpp_patches::x_boundary

◆ x_centroid

real(wp) m_icpp_patches::x_centroid

◆ y_boundary

type(bounds_info) m_icpp_patches::y_boundary

◆ y_centroid

real(wp) m_icpp_patches::y_centroid

◆ z_boundary

type(bounds_info) m_icpp_patches::z_boundary

These variables combine the centroid and length parameters associated with a particular patch to yield the locations of the patch boundaries in the x-, y- and z-coordinate directions. They are used as a means to concisely perform the actions necessary to lay out a particular patch on the grid.

◆ z_centroid

real(wp) m_icpp_patches::z_centroid