Connector.IBM: immersed boundary method grid connectivity module

List of functions

– IBM Connectivity

Connector.IBM.dist2wallIBM

Compute the wall distance for IBM pre-processing.

Connector.IBM.blankingIBM

Blank the computational tree by IBC bodies for IBM pre-processing.

Connector.IBM.buildFrontIBM

Build the IBM front for IBM pre-processing.

Connector.IBM.setInterpDataIBM

Compute the transfer coefficients and data for IBM pre-processing.

Connector.IBM.initializeIBM

Initialize the computational and connectivity trees for IBM pre-processing.

Contents

Main functions

Connector.IBM.dist2wallIBM(t, tb, dimPb=3, frontType=1, Reynolds=1.e6, yplus=100, Lref=1., correctionMultiCorpsF42=False, heightMaxF42=-1.)

Compute the wall distance for IBM pre-processing. Exists also as in-place (_dist2wallIBM).

The Reynolds number, yplus and Lref are used to calculate a custom modeling height when using frontType 42.

Parameters:
  • t (tree) – computational tree

  • tb (tree) – geometry tree

  • dimPb (2 or 3) – problem dimension

  • frontType (0, 1, 2 or 42) – type of IBM front

  • Reynolds (float) – Reynolds number (frontType 42)

  • yplus (float) – estimated yplus at the first computed cells (frontType 42)

  • Lref (float) – characteristic length of the geometry (frontType 42)

  • correctionMultiCorpsF42 (boolean) – if True, computes the wall distance w.r.t each body that is not a symmetry plane (frontType 42)

  • heightMaxF42 (float) – if heightMaxF42 > 0: uses a maximum modeling height to speed up individual wall distance calculations when correctionMultiCorpsF42 is active (frontType 42)

Example of use:

# - dist2wallIBM (pyTree) -
import Generator.PyTree as G
import Geom.IBM as DIBM
import Connector.IBM as XIBM
import Converter.PyTree as C
import Converter.Internal as Internal
import Geom.PyTree as D

N = 50; h = 1./(N-1)
tb = D.sphere((0.,0.,0.),0.2,2*N); tb[0] = 'sphere'
DIBM._setIBCType(tb, 'Musker')

t = G.cart((-1,-1,-1), (h,h,h), (2*N,2*N,2*N)); t[0] = 'cart'
C._fillEmptyBCWith(t, 'farfield', 'BCFarfield')
XIBM._dist2wallIBM(t, tb, dimPb=3)
C.convertPyTree2File(t, 'out.cgns')

Connector.IBM.blankingIBM(t, tb, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, yplus=100, Lref=1., twoFronts=False, correctionMultiCorpsF42=False, blankingF42=False, wallAdaptF42=None, heightMaxF42=-1.)

Blank the computational tree by IBC bodies for IBM pre-processing. Exists also as in-place (_blankingIBM).

The Reynolds number, yplus and Lref are used to calculate a custom modeling height when using frontType 42.

The wallAdaptF42 file must be obtained with Connector.IBM.createWallAdapt().

Parameters:
  • t (tree) – computational tree

  • tb (tree) – geometry tree

  • dimPb (2 or 3) – problem dimension

  • frontType (0, 1, 2 or 42) – type of IBM front

  • IBCType (-1 or 1) – type of IBM, -1: IB target points are located inside the solid, 1: IB target points are located in the fluid

  • depth (int) – depth of overlapping regions

  • Reynolds (float) – Reynolds number (frontType 42)

  • yplus (float) – estimated yplus at the first computed cells (frontType 42)

  • Lref (float) – characteristic length of the geometry (frontType 42)

  • twoFronts (boolean) – if True, performs the IBM pre-processing for an additional image point positioned farther away

  • correctionMultiCorpsF42 (boolean) – if True, ensures that there are calculated points between the immersed bodies by using individual wall distances (frontType 42)

  • blankingF42 (boolean) – if True, reduces as much as possible the number of IB target points inside the boundary layer (frontType 42)

  • wallAdaptF42 (cloud of IB target points with yplus information) – use a previous computation to adapt the positioning of IB target points around the geometry according to a target yplus (frontType 42)

  • heightMaxF42 (float) – if heightMaxF42 > 0: maximum modeling height for the location of IB target points around the geometry (frontType 42)

Example of use:

# - blankingIBM (pyTree) -
import Generator.PyTree as G
import Geom.IBM as DIBM
import Connector.IBM as XIBM
import Converter.PyTree as C
import Converter.Internal as Internal
import Geom.PyTree as D
import Transform.PyTree as T

N = 50; h = 1./(N-1)
s = D.sphere((0.,0.,0.),0.2,2*N); s[0] = 'sphere'
DIBM._setIBCType(s, 'Musker')
tb = C.newPyTree(['SPH',Internal.getZones(s)])

a = G.cart((-1,-1,-1), (h,h,h), (2*N,2*N,2*N)); a[0] = 'cart'
t = C.newPyTree(['CART',Internal.getZones(a)])
C._fillEmptyBCWith(t, 'farfield', 'BCFarfield')

XIBM._dist2wallIBM(t, tb, dimPb=3)
XIBM._blankingIBM(t, tb, dimPb=3)
C.convertPyTree2File(t, 'out.cgns')

Connector.IBM.buildFrontIBM(t, tc, dimPb=3, frontType=1, cartesian=False, twoFronts=False, check=False)

Build the IBM front for IBM pre-processing.

Parameters:
  • t (tree) – computational tree

  • tc (tree) – connectivity tree

  • dimPb (2 or 3) – problem dimension

  • frontType (0, 1, 2 or 42) – type of IBM front

  • cartesian (boolean) – if True, activates optimized algorithms for Cartesian meshes

  • twoFronts (boolean) – if True, performs the IBM pre-processing for an additional image point positioned farther away

  • check (boolean) – if True, saves front.cgns (and front2.cgns if twoFronts is active)

Example of use:

# - buildFrontIBM (pyTree) -
import Generator.PyTree as G
import Geom.IBM as DIBM
import Connector.IBM as XIBM
import Converter.PyTree as C
import Converter.Internal as Internal
import Geom.PyTree as D
import Transform.PyTree as T

N = 50; h = 1./(N-1)
s = D.sphere((0.,0.,0.),0.2,2*N); s[0] = 'sphere'
DIBM._setIBCType(s, 'Musker')
tb = C.newPyTree(['SPH',Internal.getZones(s)])

a = G.cart((-1,-1,-1), (h,h,h), (2*N,2*N,2*N)); a[0] = 'cart'
t = C.newPyTree(['CART', Internal.getZones(a)])
C._fillEmptyBCWith(t, 'farfield', 'BCFarfield')

XIBM._dist2wallIBM(t, tb, dimPb=3)
XIBM._blankingIBM(t, tb, dimPb=3)
tc = C.node2Center(t)
t, tc, front, front2 = XIBM.buildFrontIBM(t, tc, dimPb=3, frontType=42, check=True)
C.convertPyTree2File(t, 'out.cgns')

Connector.IBM.setInterpDataIBM(t, tc, tb, front, front2=None, dimPb=3, frontType=1, IBCType=1, depth=2, Reynolds=1.e6, yplus=100, Lref=1., cartesian=False, twoFronts=False)

Compute the transfer coefficients and data for IBM pre-processing. The information are stored in the connectivity tree (IBCD* zones). Exists also as in-place (_setInterpDataIBM).

The Reynolds number, yplus and Lref are used to calculate a custom modeling height when using frontType 42.

front and front2 must be obtained with Connector.IBM.buildFrontIBM().

Parameters:
  • t (tree) – computational tree

  • tc (tree) – connectivity tree

  • front (tree) – front of image points

  • front2 (tree) – front of second image points (optional)

  • dimPb (2 or 3) – problem dimension

  • frontType (0, 1, 2 or 42) – type of IBM front

  • IBCType (-1 or 1) – type of IBM, -1: IB target points are located inside the solid, 1: IB target points are located in the fluid

  • depth (int) – depth of overlapping regions

  • Reynolds (float) – Reynolds number (frontType 42)

  • yplus (float) – estimated yplus at the first computed cells (frontType 42)

  • Lref (float) – characteristic length of the geometry (frontType 42)

  • cartesian (boolean) – if True, activates optimized algorithms for Cartesian meshes

  • twoFronts (boolean) – if True, performs the IBM pre-processing for an additional image point positioned farther away

Example of use:

# - setInterpDataIBM (pyTree) -
import Generator.PyTree as G
import Geom.IBM as DIBM
import Connector.IBM as XIBM
import Converter.PyTree as C
import Converter.Internal as Internal
import Geom.PyTree as D
import Transform.PyTree as T

N = 50; h = 1./(N-1)
s = D.sphere((0.,0.,0.),0.2,2*N); s[0] = 'sphere'
DIBM._setIBCType(s, 'Musker')
tb = C.newPyTree(['SPH', Internal.getZones(s)])
C._addState(tb, 'GoverningEquations', 'NSTurbulent')

a = G.cart((-1,-1,-1), (h,h,h), (2*N,2*N,2*N)); a[0] = 'cart'
t = C.newPyTree(['CART', Internal.getZones(a)])
C._fillEmptyBCWith(t, 'farfield', 'BCFarfield')

XIBM._dist2wallIBM(t, tb, dimPb=3)
XIBM._blankingIBM(t, tb, dimPb=3)
tc = C.node2Center(t)
t, tc, front, front2 = XIBM.buildFrontIBM(t, tc, dimPb=3, frontType=42, check=True)
XIBM._setInterpDataIBM(t, tc, tb, front, frontType=42, dimPb=3)

C.convertPyTree2File(t, 'out.cgns')

Connector.IBM.initializeIBM(t, tc, tb, tinit=None, dimPb=3, twoFronts=False)

Initialize the computational and connectivity trees for IBM pre-processing.

tinit might be used to initialize the flow solution in t.

Parameters:
  • t (tree) – computational tree

  • tc (tree) – connectivity tree

  • tb (tree) – geometry tree

  • tinit (tree) – computational tree from previous computation

  • dimPb (2 or 3) – problem dimension

  • twoFronts (boolean) – if True, creates a new connectivity tree that contains second image points information