Skip to content

XGR8 commands

The following commands will be interpreted by XGR8 if found in the input file between the SHIPFLOW module delimiter commands XGR8 and END. XGR8 only uses the first four characters of a command or a keyword.

At the moment XGR8 is a surface mesh generator for the hull surface. This mesh is then read in by XGRID and a volume grid is created.

XGRID uses transfinite interpolation to create a starting guess for the volume grid, but if XGR8 has been used to mesh the hull surface then it can also create a starting guess for the XGRID volume grid. The command IGUESS (XGR8:IGUE) controls the starting guess grid generation in XGR8.

In order to make your grid generation as efficient as possible, it is crucial to have a rough understanding of how XGR8 works:

  • The hull is rotated into position. The unused parts of the hull geometries are cut away. For double models this is at z=0 and for VOF this is at z=FRBO.
  • The hull is initially in one STRIP, but can be subdivided into two or more strips by defining additional SPLITs. Each split defines the upper side of one strip and the lower side of the next strip (see the illustration below). The splits cut every station from the most upstream position to the most downstream position.

    Side view of the XGR8 surface mesh at the aft end of KVLCC2 and the trailing symmetry plane, with four splits dividing the stations into three strips

    Side view of the aft of KVLCC2 and the trailing symmetry plane. In this example there are 4 splits and therefore 3 strips. The first split defines the keel singularity position. The second split follows the upper contour of the boss. The third split follows the contour of the aft overhang. The fourth split does not do anything since there is no waterline singularity defined.

  • Each strip contains a user controlled number of cells in the girthwise direction. This means that by adjusting where a split cuts through the stations or by adding more splits, the user gains control of the girthwise cell-distribution.

  • You can have as many splitting lines as you want, just make sure they are ordered from keel to deck. (It is not the order in the config file that matters, but the identifying number XGR8:SPLIT:NUMB.) Between split number 1 and split number 2 is strip number 1, between split number 2 and split number 3 is strip number 2, and so on.
  • The path of each individual split can be controlled in some different ways:

    1. XGR8:SPLIT:LFOLLOW – make the split follow a straight line between two points as closely as possible.
    2. XGR8:SPLIT:ZFOLLOW – follow a z-coordinate in computational space.
    3. XGR8:SPLIT:FOLLOW – follow another splitting line at a certain distance.
    4. XGR8:SPLIT:CFOLLOW – follow the hull contour (the beginning or end of stations) between two points.
    5. XGR8:SPLIT:SING – create a singularity line from a certain point.
    6. XGR8:RANGE & XGR8:RPOS – define a range distribution of the splitting line on a certain station.

    The above order is also the priority order if there are multiple SPLIT commands in the same region for the same splitting line (LFOLLOW has the highest priority and RANGE the lowest priority).

Multiple XGR8 modules

In SHIPFLOW offset files for TWINSKEGs are split into a forward part, an aft outer part and an aft inner part. XGR8 uses these offset groups and because of that TWINSKEGs require three XGR8 modules. However, the surface mesh and the starting guess exported from XGR8 are always in one block.

XGR8 DEFAULTS

The strips will be set up using a DEFAULTS program, which accesses the offset file, identifies points of interest and applies appropriate controls to achieve a uniform girthwise distribution of the cells. DEFAULTS are automatically triggered when XGRID8 is used. The number of cells girthwise is computed from the ETAMAX value in XGRI:SIZE (the XGRID SIZE command). It will also inherit values from XGRI:SIZE for IETA, OETA, UETA, AETA, and JMAX.

The strips and controls that DEFAULTS sets up are written to the configuration file inside RUN_DIR, which can be used to run with manual control of the strips (see MSTR in CONTROL). DEFAULTS will read sinkage and trim from XFLOW:IPOS (IPOSITION), and these will be corrected after the XPAN computation.

CONTROL

This command is used for specifying the overall hull shape; for instance mono vs twinskeg or wet transom vs dry transom.

General form of command

CONTROL ( ALL   , WTRAN   , FRBO = v , PORT      ,
          INNER   DRYTRAN              STAR
          OUTER   NOTRAN
          FWD
          POFF  , DUCK    , MSTR     , BSING = v ,
          BCF=v , ACF=v   , WSAN=v   , WSIN=v    ,
          BLUFF , BALA    )
                  NOBA

Default values

CONTROL ( FRBO = 0.0, PORT,BSING=10.0,BCF=170.0,ACF=155.0,WSAN=45.0 )

Keywords

Keyword Description
ALL The entire hull geometry will be given in this XGR8 module. Used for mono hulls.
INNER The inner stern hull geometry will be given in this XGR8 module. Used for twinskeg hulls and used together with other XGR8 modules that specify the rest of the hull geometry.
OUTER The outer stern hull geometry will be given in this XGR8 module. Used for twinskeg hulls and used together with other XGR8 modules that specify the rest of the hull geometry.
FWD The bow hull geometry will be given in this XGR8 module. Used for twinskeg hulls and used together with other XGR8 modules that specify the rest of the hull geometry.
WTRAN The hull has a wet transom. The last hull station is copied backwards all the way to the outlet boundary and the hole is filled with a transom block grid.
DRYTRAN The hull has a dry transom. The grid lines at the end of the overhang snap to z = 0 (DM) or z = FRBO (VOF).
NOTRAN The hull has no transom. The grid lines at the end of the overhang snap to y = 0.
FRBO The freeboard height in the offset scale. Used for VOF.
PORT The geometry is on the port side.
STAR The geometry is on the starboard side.
POFF Print intermediate offset files for debugging.
DUCK WTRAN has a duck tail shape.
MSTR Run with manually set up strips, will not run the DEFAULTS for XGRID8.
BSING Angle control for the bow singularity line for the DEFAULTS.
BCF Angle control for the contour follow above the bulb for the DEFAULTS.
ACF Angle control for the contour follow on the aft overhang for the DEFAULTS.
WSAN Angle control for the water-line singularity line for the DEFAULTS.
WSIN Beam controlled water-line singularity for the DEFAULTS. WSIN is a fraction of the maximum half beam. The water-line singularity is controlled by angle by default.
BLUFF Bluff bow correction – post correction on XGR8 to improve skewed cells on the bow, works on the bottom parts of the bow. Can be an option for wide bows.
BALA (MONO only) Running the DEFAULTS with special treatment of the free surface refinement for VOF cases for ballast drafts. Without this ballast treatment the free surface refinement band will continue towards the transom, this will rather make the band continue at constant horizontal plane. DEFAULTS will detect ballast drafts automatically when the aft overhang is significantly above the free surface, this BALA keyword forces it to be treated as a ballast draft.
NOBA (MONO only) for DEFAULTS - Overrides ballast treatment of VOF cases to no ballast.

OFFSET

This command can be used to specify the names of the offset groups in the offset file that will be used in the construction of the grid. The OFFSET command imports one offset group. To import multiple offset groups, one needs to have multiple OFFSET commands.

Note that one of the offset groups has to be defined as the MAIN group.

General form of command

OFFSET ( GRNA = "c" , MAIN , EXTEND     )
                      BOSS   NOEXTEND
                      AFT
                      BULB
                      FWD
                      KEXT

Default values

OFFSET ( EXTEND (For MAIN, AFT and FWD) | NOEXTEND (Otherwise) )

Keywords

Keyword Description
GRNA Name of the offset group.
MAIN The main hull group. This group is mandatory.
BOSS The boss group.
AFT The aft overhang group.
BULB The bulb group.
FWD The bow overhang group.
KEXT The aft keel extension group.
EXTEND Extend all stations that do not reach the cutting line.
NOEXTEND Do nothing.

Notes

Right now XGR8 does not use the hull geometry defined in XFLOW, so all the hull geometry has to be defined by XGR8:OFFSET commands.

STRIP

This command gives the user control of the girthwise cell distribution within each strip. Since there is no default value for NCELL, the STRIP command is mandatory for each strip.

General form of command

STRIP ( NUMBER = n , NCELL = n , UNIFORM  , DF1L = v ,
        DF1H = v   , DFNL = v  , DFNH = v , NS2I     ,
        BSYM       , SSYM                            )
        BFOLD        SFOLD
        BINTERIOR    SINTERIOR
        BWPL         SWPL

Default values

STRIP ( DF1L = 0.95, DF1H = 1.05, DFNL = 0.95, DFNH = 1.05 )

Keywords

Keyword Description
NUMBER Strip number. Ordered from keel to deck.
NCELL Number of cells in the girthwise direction on this strip.
UNIFORM This strip gets a uniform cell distribution in girthwise direction.
DF1L The lowest allowed cell size at the low side of the strip.*
DF1H The highest allowed cell size at the low side of the strip.*
DFNL The lowest allowed cell size at the high side of the strip.*
DFNH The highest allowed cell size at the high side of the strip.*
NS2I Change BC from NOSLIP to INTERIOR.
BSYM Upstream of the bow this strip is snapped to y=0. BC is SLIP or INTERIOR.
BFOLD Upstream of the bow the nodes are snapped together from both sides of the fold.
BINTERIOR Upstream of the bow the BC's will be INTERIOR.
BWPL Upstream of the bow this strip is snapped to z=0. BC is SLIP.
SSYM Downstream of the stern this strip is snapped to y=0. BC is SLIP or INTERIOR.
SFOLD Downstream of the stern the nodes are snapped together from both sides of the fold.
SINTERIOR Downstream of the stern the BC's will be INTERIOR.
SWPL Downstream of the stern this strip is snapped to z=0. BC is SLIP.

Notes

* When UNIFORM is not set for a strip, then the girthwise cell distribution is stretched to get a smooth variation of the cell sizes. This is done for each station individually:

  1. First an average cell size ( \( \Delta s_{ave,i} \) ) for the sub-station of each strip (i) is computed.
  2. At the intersection between strips i and i+1 these averages are combined into new averages ( \( \Delta s_{ave,i+1/2} = (\Delta s_{ave,i} + \Delta s_{ave,i+1})/2 \) )
  3. The first cell size in girthwise direction for strip i is then calculated according to

    \[ \Delta s_{first,i} = \min(DF1L \ast \Delta s_{ave,i-1/2} \,,\, \Delta s_{ave,i}) \quad \text{if } \Delta s_{ave,i} > \Delta s_{ave,i-1/2} \]
    \[ \Delta s_{first,i} = \max(DF1H \ast \Delta s_{ave,i-1/2} \,,\, \Delta s_{ave,i}) \quad \text{if } \Delta s_{ave,i} < \Delta s_{ave,i-1/2} \]
  4. The last cell size in girthwise direction for strip i is then calculated according to

    \[ \Delta s_{last,i} = \min(DFNL \ast \Delta s_{ave,i+1/2} \,,\, \Delta s_{ave,i}) \quad \text{if } \Delta s_{ave,i} > \Delta s_{ave,i+1/2} \]
    \[ \Delta s_{last,i} = \max(DFNH \ast \Delta s_{ave,i+1/2} \,,\, \Delta s_{ave,i}) \quad \text{if } \Delta s_{ave,i} < \Delta s_{ave,i+1/2} \]
  5. \( \Delta s_{first,i} \) and \( \Delta s_{last,i} \) are then used as boundary values for stretching number 5 described in XMESH:BODY.

SPLIT

The lower and upper bounds of STRIPS in girthwise direction are defined by SPLITS. There are 5 different ways to control the position of a SPLIT with the SPLIT command:

  1. SPLIT:LFOLLOW – make the split follow a straight line between two points as closely as possible.
  2. SPLIT:ZFOLLOW – follow a z-coordinate in computational space.
  3. SPLIT:FOLLOW – follow another splitting line at a certain distance.
  4. SPLIT:CFOLLOW – follow the hull contour (the beginning or end of stations) between two points.
  5. SPLIT:SING – create a singularity line from a certain point.

These commands are described separately below.

SPLIT:LFOLLOW

This command sets a line between points FROM and TO, and makes the SPLIT number NUMBER follow that line as closely as possible.

General form of command

SPLIT ( LFOLLOW = n      , NUMBER = n     ,
        FROM = [v, v, v] , TO = [v, v, v] ,
        SMIN = v         , SMAX = v       ,
        DSDZ = v         , DZDX = v       )

Default values

SPLIT ( SMIN = 0.01, SMAX = 0.99, DSDZ = 3.0, DZDX = 3.0 )

Keywords

Keyword Description
LFOLLOW Follow a line defined by two points. If you also want to restrict this split compared to say split number i, then set LFOLLOW=i. If you don't want this functionality, then set LFOLLOW=0
NUMBER This SPLIT command concerns split number NUMBER. Splits are ordered from keel to deck.
FROM The x, y and z coordinate in offset file coordinate system of the point defining the start of the line.
TO The x, y and z coordinate in offset file coordinate system of the point defining the end of the line.
SMIN Minimum distance to the splitting line that is being followed (ratio of the sub-station length to the station length). *
SMAX Maximum distance to the splitting line that is being followed (ratio of the sub-station length to the station length). *
DSDZ Maximum allowed sub-station length, (ds) to dz ratio between this splitting line and the splitting line that is being followed. If the maximum value is exceeded, the sub-station length is set to ds = DSDZ * dz. *
DZDX Maximum allowed dz to dx ratio, where dx and dz is the difference in x-direction and z-direction of splitting line of two consecutive offset stations. If the maximum value is exceeded, the z-position for the split of the downstream station (of these two stations) is set to zdownstream = zupstream + dz where dz = DZDX * dx. *

Notes

* When SMIN, SMAX, DSDZ and DZDX are applied, it is done in the following order: DSDZ, SMIN, SMAX & DZDX.

SPLIT:ZFOLLOW

This command sets a splitting line at z = Z_C in computational space. The command is especially useful for VOF computations.

General form of command

SPLIT ( ZFOLLOW = n , NUMBER = n ,
        XMIN = v    , XMIN = v   ,
        SMIN = v    , SMAX = v   ,
        DSDZ = v    , DZDX = v   ,
        Z_C = v                  )

Default values

SPLIT ( SMIN = 0.01, SMAX = 0.99, DSDZ = 3.0, DZDX = 3.0 )

Keywords

Keyword Description
ZFOLLOW Follow a z-value between XMIN and XMAX. If you also want to restrict this split compared to say split number i, then set ZFOLLOW=i. If you don't want this functionality, then set ZFOLLOW=0
NUMBER This SPLIT command concerns split number NUMBER. Splits are ordered from keel to deck.
XMIN The x coordinate in computational coordinate system of the point defining the start of this ZFOLLOW.
XMAX The x coordinate in computational coordinate system of the point defining the end of this ZFOLLOW.
Z_C The z coordinate in computational coordinate system of the splitting line between XMIN and XMAX.
SMIN Minimum distance to the splitting line that is being followed (ratio of the sub-station length to the station length). *
SMAX Maximum distance to the splitting line that is being followed (ratio of the sub-station length to the station length). *
DSDZ Maximum allowed sub-station length, (ds) to dz ratio between this splitting line and the splitting line that is being followed. If the maximum value is exceeded, the sub-station length is set to ds = DSDZ * dz. *
DZDX Maximum allowed dz to dx ratio, where dx and dz is the difference in x-direction and z-direction of splitting line of two consecutive offset stations. If the maximum value is exceeded, the z-position for the split of the downstream station (of these two stations) is set to zdownstream = zupstream + dz where dz = DZDX * dx. *

Notes

* When SMIN, SMAX, DSDZ and DZDX are applied, it is done in the following order: DSDZ, SMIN, SMAX & DZDX.

SPLIT:FOLLOW

If you do not want to follow a line (SPLIT:LFOLLOW) or a z-coordinate (SPLIT:ZFOLLOW), but you still want to restrict the route this splitting line takes, you can use this command.

General form of command

SPLIT ( FOLLOW = n , NUMBER = n ,
        XMIN = v   , XMIN = v   ,
        SMIN = v   , SMAX = v   ,
        DSDZ = v   , DZDX = v   )

Default values

SPLIT ( SMIN = 0.01, SMAX = 0.99, DSDZ = 3.0, DZDX = 3.0 )

Keywords

Keyword Description
FOLLOW If you also want to restrict this split compared to say split number i, then set FOLLOW=i.
NUMBER This SPLIT command concerns split number NUMBER. Splits are ordered from keel to deck.
XMIN The x coordinate in computational coordinate system of the point defining the start of this FOLLOW.
XMAX The x coordinate in computational coordinate system of the point defining the end of this FOLLOW.
SMIN Minimum distance to the splitting line that is being followed (ratio of the sub-station length to the station length). *
SMAX Maximum distance to the splitting line that is being followed (ratio of the sub-station length to the station length). *
DSDZ Maximum allowed sub-station length, (ds) to dz ratio between this splitting line and the splitting line that is being followed. If the maximum value is exceeded, the sub-station length is set to ds = DSDZ * dz. *
DZDX Maximum allowed dz to dx ratio, where dx and dz is the difference in x-direction and z-direction of splitting line of two consecutive offset stations. If the maximum value is exceeded, the z-position for the split of the downstream station (of these two stations) is set to zdownstream = zupstream + dz where dz = DZDX * dx. *

Notes

* When SMIN, SMAX, DSDZ and DZDX are applied, it is done in the following order: DSDZ, SMIN, SMAX & DZDX.

SPLIT:CFOLLOW

This command sets a hull contour line for SPLIT number NUMBER to follow.

General form of command

SPLIT ( CFOLLOW          , NUMBER = n     ,
        FROM = [V, V, V] , TO = [V, V, V] )

Default values

SPLIT ( )

Keywords

Keyword Description
CFOLLOW This splitting line follows the hull contour between FROM and TO.
NUMBER This SPLIT command concerns split number NUMBER. Splits are ordered from keel to deck.
FROM The x, y and z coordinate in offset file coordinate system of the point where the contour line starts following the hull contour. The point closest to FROM on a beginning or end of a station will be used.
TO The x, y and z coordinate in offset file coordinate system of the point where the contour line stops following the hull contour. The point closest to TO on a beginning or end of a station will be used.

SPLIT:SING

This command sets a line from the hull, upstream or downstream, for SPLIT number NUMBER.

General form of command

SPLIT ( SING   , NUMBER = n , FROM = [V, V, V] ,
        BOW    , YSNAP = v  , ZSNAP = v        )
        STERN

Default values

SPLIT ( )

Keywords

Keyword Description
SING A “singularity” line exits the hull.
NUMBER This SPLIT command concerns split number NUMBER. Splits are ordered from keel to deck.
FROM The x, y and z coordinate in offset file coordinate system of the point where the singularity line leaves the hull. The point closest to FROM on a beginning or end of a station will be used.
BOW Bow singularity line.
STERN Stern singularity line.
YSNAP Snap singularity line to this y-value in comp coord.
ZSNAP Snap singularity line to this z-value in comp coord.

RANGE

This command defines a range that can be applied at a station with the command XGR8:RPOS.

General form of command

RANGE ( ID = "c" , RNGS = [v_1, ..., v_n] )

Default values

RANGE ( )

Keywords

Keyword Description
ID Id of this RANGE. Use the same id in RPOS to apply it.
RNGS This vector needs to contain the range for each splitting line. The value of element i is the ratio of station length up to split i and the total station length. Thus, element values should be between 0.0 and 1.0. Setting the element i to a negative value, will have the effect that this range will not be applied to split i.

RPOS

This command specifies where a range should be applied.

General form of command

RPOS ( ID = "c" , POS = [v, v, v] )
                  FIRST
                  LAST

Default values

RPOS ( )

Keywords

Keyword Description
ID Id of the range to apply.
POS Station closest to POS (in offset coordinate system) will get this range applied.
FIRST Range will be applied to the most upstream station.
LAST Range will be applied to the most downstream station.

IGUESS

Create a starting guess for the volume grid generator in XGRID.

General form of command

IGUESS ( ON       , FGRO = v , FANG = v ,
         OFF
         FNDI = v , FTAN = v , RAMP = n ,
         NSTE = n , NSKI = n , JFIX = n ,
         YZJF = v , JFS0 = v , JFS1 = v ,
         JFIM = v )

Default values

RPOS ( ON (for TWIN), OFF (for MONO), FGRO = 1.0, FANG = 1.0,
       FNDI = 1.0, FTAN = 1.0, RAMP = 40, NSTE = 8000, NSKI = 100,
       YZJF = 3.0, JFIM=0 )

Keywords

Keyword Description
ON Starting guess for XGRID will come from XGR8.
OFF XGR8 will not produce a starting guess.
FGRO Global growth factor for step size control.
FANG Angle factor to multiply the normal step size control.
FNDI Girthwise node distance factor to multiply the normal step size control.
FTAN Girthwise node distribution equalizer factor.
RAMP Ramp up of girthwise node distribution equalizer factor.
NSTE Number of steps to generate in the normal direction.
NSKI Number of steps to skip when writing to VTK file.
JFIX From plane jfix and upwards in the girthwise direction, create horizontal planes.
YZJF Max ratio dy/dz where JFIX is allowed.
JFS0 Parameter value [0.0-1.0] of the grid radius where the girthwise distribution below jfix is smoothened out. Smoothing factor is 0% below JFS0, increases linearly until 100% at JFS1 and above.
JFS1 Parameter value [0.0-1.0] of the grid radius where the girthwise distribution below jfix is smoothened out. Smoothing factor is 0% below JFS0, increases linearly until 100% at JFS1 and above.
JFIM Grid plane in girth-wise direction below which the girth-wise distribution is not smoothened out.

FTPT

This is an optional way to add more control to the XGR8 DEFAULTS and to run it in a semi-automatic way. Instead of manually adjusting the points in the splits and running from the config file in _RUNDIR, this method provides an easier option to fine tune known points for common hull shapes. DEFAULTS will use the points provided here and will find other required points and adjust cell distributions automatically. Refer to the following figure for the convention on the points; not all points are used for all types of sterns and bows. For TWIN, the same convention applies on the skeg plane, except for TTSC, which is at the center line.

FTPT point convention on the hull profile: KSB where the keel singularity line leaves the bow; at the stern, KSS and KTS at the lower and upper ends of the boss, FIS and FAS at the forward ends of the contour follows (cfol) on the boss and on the aft overhang, and TTS at the end of the aft overhang, with the singularity lines (sing) marked

General form of command

FTPT ( TTS = [v, v, v] , TTSC = [v, v, v] , KSS = [v, v, v] ,
       KTS = [v, v, v] , FIS = [v, v, v]  , FAS = [v, v, v] ,
       KSB = [v, v, v] )

Default values

FTPT ( )

Keywords

Keyword Description
TTS Singularity line from the end of aft overhang
TTSC (TWIN only) Singularity line from the end of aft overhang at the center line
KSS Keel singularity line from the lower end of the boss
KTS Singularity line from the upper end of the boss
FIS Forward end of the cfollow on the upper side of the boss
FAS Forward end of the cfollow on the aft overhang
KSB Keel singularity line from the bow