Skip to content

XPAN commands

XPAN is the flow solver for the potential flow around three-dimensional bodies, based on a surface singularity panel method. It solves the flow, with or without a free surface, on the panels generated by XMESH, and computes for example the wave resistance, the wave pattern and wave profiles, sinkage and trim, and lift and induced drag. XPAN creates the database file id_XPDB, which is used by XBOUND, XGRID and XCHAP. The XPAN keyword on the PROGRAM command runs both XMESH and XPAN.

XPAN commands are placed in the command file between the module delimiter commands XPAN and END. For example, the following section lets the ship sink and trim freely, uses the non-linear free-surface boundary condition and allows at most 10 iterations (command and keyword names are abbreviated, see Command Syntax Rules):

xpan
    cont ( free, nonl )
    iter ( maxi=10 )
end

The following commands are available:

  • CONTROL — type of execution, and values of some numerical parameters
  • CONVERGENCE — convergence criteria for sinkage and trim and for non-linear computations
  • EXFORCE — external forces acting on the ship
  • EXMOMENT — towing point position and position of external forces
  • ITERATION — maximum number of iterations, and the iterations in which the geometry is updated
  • PARALLEL — number of threads for parallel execution
  • RELAXATION — relaxation factors
  • TWCUT — wave resistance from multiple transverse wave cuts; required when FSFAR is used in XMESH
  • WAVECUT — wave profiles along longitudinal and transverse wave cuts

Each command section below gives a description, the general form of the command, its default values and a keyword table. A number in the Note column of a keyword table refers to the numbered note below the table. The notation is explained in Manual Conventions.

CONTROL

This command is used to specify the type of execution to be performed in XPAN. The command is also used to overwrite the default values of some numerical parameters.

General form of command

CONTROL ( SAVE        , LINEAR     , FIXED      ,
          NOSAVE        NONLINEAR    FREE
                        BERNOU
                        ITSOLV     , DISKSAVE   ,
                        GESOLV       NODISKSAVE
          EQSING = v  , EQAVFA = v , EQCONV = v ,
          SHALLOW = v , ZRAISE = v , XSHIFT = v ,
          ZFACT = v   ,
          DOUBLE      , AFSSHIFT   , TWO
          NEUMAN        UFSSHIFT     THREE
          SINGLE                     FOUR
                                     ANALYT
          NOLAST      , CWPI                    )
          LAST

Default values

CONTROL ( SAVE, FIXED or FREE, LINEAR or NONLINEAR, ITSOLV, NODISKSAVE,
          EQSING=1.0e-5, EQAVFA=5.0e-3, EQCONV=1.0e-3, DOUBLE, FOUR,
          ZRAISE=FZR, ZFACT = 0.75 or 0.0, XSHIFT=0.3, AFSS, NOLAST)

Keywords

Note Note Keyword Description
(1) NOSAVE [XPDB] The database file XPDB will not be created.
(1) SAVE [XPDB] XPAN will save all the solution quantities that XBOUND and XCHAP need on the id_XPDB file.
(2) FIXED [MODEL] The ship is kept in a fixed position during the computation. Default for double model flow computations.
(2) FREE [MODEL] The ship is allowed to sink and trim during the computation. Default for free surface flow computations.
SHALLOW Shallow water effects are taken into account. The distance from the undisturbed free-surface to the bottom is specified by the SHALLOW keyword. The distance is input in the offset scale.
(3) ZRAISE The raised panel method is used as default. The distance from the free-surface to the source panels is specified by the ZRAISE keyword. ZRAISE must be specified as a factor (FZR), which is then multiplied internally in the program by a typical panel size to give the distance.
(12) ZFACT The BODY groups are panelized up to a distance ZFACT*ZRAISE above the wavy free-surface. See also the keyword EXPANEL on the BODY command.
(13) BERNOU [BC] The Bernoulli (double-model) wave is computed. No free-surface boundary conditions are applied.
(4) LINEAR [BC] A linearized free-surface boundary condition is used. Default for double model flow computations.
(5) NONLINEAR [BC] The non-linear free-surface boundary condition is used. Default for free surface flow computations.
(6) DOUBLE [BMMOD] A double model is used as the first basic model solution. The xy-plane is automatically treated as a symmetry plane for the body groups.
(6) NEUMAN [BMMOD] An undisturbed flow is used as the first basic model flow for the free-surface computation.
(6) SINGLE [BMMOD] A single model is used as the first basic model solution.
(7) TWO [OPERATOR] A two-point operator is used to compute the velocity derivative in the streamwise direction on the free surface.
(7) THREE [OPERATOR] A three-point operator is used to compute the velocity derivative in the streamwise direction on the free surface.
(7) FOUR [OPERATOR] A four-point operator is used to compute the velocity derivative in the streamwise direction on the free surface.
(7) ANALYT The velocity derivatives are computed from analytical expressions and the collocation points are shifted one panel length upstream.
(8) XSHIFT The free-surface collocation points are shifted a distance XSHIFT times a typical panel size in the x-direction. XSHIFT must be specified as a positive factor.
(8) AFSSHIFT [SHIFT] All collocation points on the free surface are shifted a distance XSHIFT times a typical panel size.
(8) UFSSHIFT [SHIFT] Only collocation points upstream of FP are shifted a distance XSHIFT times a typical panel size.
(9) ITSOLV [SOLVER] An iterative solution procedure is used to solve the system of equations.
(9) GESOLV [SOLVER] Gauss elimination is used to solve the system of equations.
(10) DISKSAVE [DISK] The influence coefficients are stored on temporary disk during the execution.
(10) NODISKSAVE [DISK] The influence coefficients are re-computed during the execution. No temporary disk is used for the influence coefficients during the execution.
EQSING Parameter used to determine whether the system of equations is singular when the iterative solver is used.
(11) EQAVFA Parameter that governs the pre-conditioning step before the iterative solver.
EQCONV Convergence criterion for the iterative solver.
NOLAST [CGIT] Save all iterations to the CGNS file.
LAST [CGIT] Save only the last iteration to the CGNS file.
CWPI Print CW based on the pressure integration to the id_OUTPUT file.

Notes

  1. Once the XPDB file has been created, there is no need to perform a new potential flow computation for each new run of XBOUND or XCHAP. (XPAN can thus be removed from the PROGRAM command.)
  2. The program integrates the hydrodynamic forces and adjusts the sinkage and trim to balance these forces if FREE is specified. The number of sinkage and trim iterations to be performed is controlled by the ITERATION and CONVERGENCE commands. Some cases show an oscillatory or divergent behaviour. It is then necessary to introduce an under-relaxation for the sinkage, trim and/or wave height change. The under-relaxation is introduced on the RELAXATION command.
  3. The raised panel method is used as default for both linear and non-linear computations. The distance between the free-surface and the source panels is computed as FZR*(1/(STAM-1)). The default value of FZR is 1.0 - 1.25*Fn and the minimum value of FZR is 0.2. The default value can be used in most cases, but if the panel aspect ratio (dx/dy) is large, as often occurs for high-speed transom stern cases, it may be necessary to reduce FZR to values smaller than 0.2. The value of FZR is then specified by the ZRAISE keyword.
  4. The non-linear terms in the boundary conditions are assumed to be small and can therefore be neglected. In this case the free-surface boundary conditions are applied on the flat free surface. The basic model solution is used as the known solution in the linearization.
  5. A linear solution is first performed and the free-surface boundary conditions are then moved to the computed wavy free surface. The linear solution is used as the known base solution in the next iteration. This procedure is repeated until convergence is achieved. It is sometimes difficult to get a converged solution if there is a large change in the water-plane area between the iterations or if the computation is performed for a high speed. Under-relaxation must be introduced if the solution shows a divergent behaviour. The iterative process is controlled with the commands ITERATION, CONVERGENCE and RELAXATION.

    The program automatically finds the intersection between the hull and the new wavy free surface. The non-linear boundary conditions are exactly satisfied on the wavy free-surface when convergence is achieved.

  6. The computations can be performed with or without a free surface. A flow without a free surface is called a "basic model flow". A flow with a free surface is called a "free surface flow". The basic-model solution is also used for the first linearization of the free-surface boundary conditions. There are three types of basic model computations: double-model, single-model and Neumann-Kelvin.

    Double-model: the hull and its mirror image about the water plane. Single-model: the hull with a panelled region of the water plane. Both sketches show the x, y and z axes at the bow

    In the double-model computation a mirror image of the hull is taken into account to ensure zero flow through the water plane. The zero-flow condition is exactly fulfilled for the double-model. The double-model solution is used for cases without a free surface and if the linear free-surface boundary condition is used.

    In the single-model computation a region of the water plane is covered with panels. A Neumann boundary condition is applied on these panels to prevent a flow through the water plane. The zero-flow condition is only approximately fulfilled for the single-model. The single-model is used for the non-linear, the shallow water and the submarine option.

  7. The operator FOUR works well in most cases and should not be changed unless there are very strong reasons to do so. The operators TWO, THREE and FOUR all have a central-difference operator in the transverse direction. The analytical method ANALYT requires an aspect ratio (dx/dy) smaller than one for the free-surface panels.

  8. A collocation point shift in the x-direction on the free-surface can be introduced to further enforce the radiation condition. The collocation points are shifted a distance XSHIFT*(1/(STAM-1)) in the x-direction. This type of shift is used together with the numerical operators TWO, THREE and FOUR. There are two possibilities to apply the collocation point shift. AFSSHIFT (All Free Surface Shift) specifies that all collocation points on the free surface are shifted. UFSSHIFT (Upstream Free Surface Shift) specifies that only collocation points upstream of the ship are shifted. The program default option is to use the FOUR point operator, AFSSHIFT and XSHIFT=0.3. The default should not be changed unless there are very strong reasons to do so.
  9. The iterative solver is normally much faster than the Gauss-elimination solver, but it requires that the system matrix is stored in core. An estimate of the memory size required is printed in the OUTPUT file when XMESH is executed. The Gauss-elimination solver is a block solver and it can be used with a much smaller memory size available. The system matrix is on the other hand stored on temporary disk. An estimate of the disk space required is printed in the OUTPUT file when XMESH is executed.
  10. There are two possibilities to handle the influence coefficients. They are either computed once and stored on temporary disk, or they are computed two times without being stored on disk. The computing time for the two options is similar for non-linear computations, while linear computations are faster if writing to disk is allowed. The disk space required for storing the influence coefficients is 24*N*N, where N is the total number of panels.
  11. It is sometimes necessary to reduce the value of EQAVFA for "difficult" cases like very high Froude numbers or complicated geometries like a ship in a canal. A better but more time-consuming pre-conditioning will then be performed before the iterative solver.
  12. The BODY groups may be modelled to a distance above the free-surface or they may be cut at the intersection between the group and the free-surface. The BODY groups are modelled to a distance ZFACT*ZRAISE above the free-surface. The default value for ZFACT is 0.75. The BODY groups will be cut at the free-surface level if ZFACT*ZRAISE is smaller than 0.001. The number of panels in the girthwise direction above the free-surface is specified by EXPANEL on the BODY command in XMESH.
  13. A FREE group must be defined in order to plot the Bernoulli wave in the post-processor.

CONVERGENCE

This command is used to specify convergence criteria for sinkage and trim and for non-linear computations.

General form of command

CONVERGENCE ( EPTRIM = v , EPSINK = v , EPWAVE = v ,
              WCHMAX = v )

Default values

CONVERGENCE (EPTRIM = 1.e-2, EPSINK = 1.e-5, EPWAVE = 5.e-5, WCHMAX=1.0)

Keywords

Note Note Keyword Description
(1) EPTRIM Convergence tolerance for the trim angle change in degrees.
(1) EPSINK Convergence tolerance for the sinkage change.
(1) EPWAVE Convergence tolerance for the wave height change in non-linear computations.
(2) WCHMAX Maximum allowed wave height change between two non-linear iterations. The computation is stopped if a larger wave height change is found.

Notes

  1. The iteration procedure is stopped when the convergence criterion is satisfied for both the sinkage and the trim. For non-linear computations, the convergence criterion on the wave height change is added. The solution continues for MAXIT iterations if no converged solution is found. The maximum number of iterations, MAXIT, is specified on the ITERATION command.

    The residuals of the free-surface boundary conditions are printed for each iteration in the OUTPUT file for non-linear computations. The residuals must diminish towards small values for the converged solution.

  2. The non-linear computation is considered to be divergent if the wave height change is larger than WCHMAX. The value of WCHMAX must be non-dimensionalized by Lpp.

EXFORCE

This command is used to specify external forces acting on the hull surface.

General form of command

EXFORCE ( CVFORM = v , CVLIFT = v , CVBODY = v ,
          CVERT = v                            )

Default values

EXFORCE (CVFORM = 0.0, CVLIFT = 0.0, CVBODY = 0.0, CVERT = 0.0)

Keywords

Note Note Keyword Description
(1) CVFORM Form factor for the hull.
(1) CVLIFT Viscous resistance coefficient for the LIFT groups.
(1) CVBODY Viscous resistance coefficient for the BODY groups.
(2) CVERT Force coefficient for a vertical external force.

Notes

  1. The influence of the viscous forces can be included in the sinkage and trim potential-flow computations if the viscous resistance coefficients are known or can be estimated. See also the EXMOMENT command. The viscous resistance coefficients must be computed as

    \[ {CVLIFT} = \frac{Force}{{{0.5 \ast \rho} \ast U_{\infty}^{2}} \ast S_{L}} \]

    where \( S_L \) is the total wetted surface for the LIFT groups, and

    \[ {CVBODY} = \frac{Force}{{{0.5 \ast \rho} \ast U_{\infty}^{2}} \ast S_{H}} \]

    where \( S_H \) is the total wetted surface for the BODY groups.

  2. The influence of a vertical external force can be included in the sinkage and trim potential-flow computations. The force coefficient is defined as:

    \[ {CVERT} = \frac{Force}{{{0.5 \ast \rho} \ast U_{\infty}^{2}} \ast S} \]

    where \( S \) is the total wetted surface of the ship.

EXMOMENT

This command is used to specify the position of external forces.

General form of command

EXMOMENT ( TOWX = v   , TOWZ = v   , TOWAGL = v ,
           ZMLIFT = v , ZMBODY = v , XVERT = v  )

Default values

EXMOMENT ( TOWX = LCB (longitudinal centre of buoyancy as computed
           by the program),
           TOWZ = VPoR (vertical position of the resistance as computed
           by the program),
           TOWAGL = 0.0 )

Keywords

Note Note Keyword Description
(1) TOWX Longitudinal position of the towing force.
(1) TOWZ Vertical position of the towing force.
(1) TOWAGL Angle of the towing force direction with respect to the horizontal plane in degrees.
(1) ZMLIFT Vertical position of the viscous force from the LIFT groups.
(1) ZMBODY Vertical position of the viscous force from the BODY groups.
(2) XVERT Longitudinal position of the external vertical force.

Notes

  1. The influence of the viscous and towing forces can be included in the sinkage and trim potential-flow computations if the positions of these forces are known or can be estimated. See also the EXFORCE command.

    The position of the forces must be specified in the offset coordinate system.

    Towing point position (towx, towz) and direction of the towing force (towagl, measured from the horizontal), shown on a hull profile with the x- and z-axes

  2. The influence of an external vertical force can be included in the sinkage and trim potential-flow computations if the position of the force is known. See also the EXFORCE command. The input is given in the offset coordinate system, but the output is written in the computational coordinate system.

ITERATION

This command is used to specify the maximum number of iterations to be carried out for sinkage and trim and for non-linear computations.

General form of command

ITERATION ( MAXIT = n , IUPD = [n1, n2, ..., nn] )

Default values

ITERATION (MAXIT = 20, IUPD = 100*1)

Keywords

Note Note Keyword Description
(1) MAXIT Maximum number of iterations for sinkage and trim and/or non-linear calculations.
(2) IUPD Specifies when the geometry is updated in a non-linear computation.

Notes

  1. The MAXIT keyword is active for non-linear and for sinkage and trim cases. The sinkage and trim computation is performed in every non-linear iteration if FREE is specified on the CONTROL command.
  2. It is not necessary to update the position of the source panels in each non-linear iteration when the raised panel method is used. The keywords NUMB and IUPD are used to specify whether the position is to be updated or not. NUMB = 8, IUPD = [1, 1, 0, 0, 1, 0, 0, 0] means that the position is updated in the first, second and fifth iteration. The update of the body geometry in non-linear computations is stopped if sinkage and trim have converged and IUPD is 0 for the present iteration.

PARALLEL

This command controls the parallel execution of XPAN. The technique supported in the current version is multithreading. This means that the program still runs in one process with one memory space, but with more than one program pointer. If the hardware supports it, the different threads may be executed concurrently on different processors. The kind of hardware that can support this kind of execution is Shared Memory Processor (SMP) machines. This includes multi-processor machines and multi-core processors. Parallel computers without shared memory, like clusters, cannot use multiple threads.

If other processes are running, the maximum number of threads for a new process is M-N, where M is the maximum number of processes allowed by the license and N is the number in use. Here a process running with n threads counts as n processes.

General form of command

PARALLEL ( NTHREADS = n )

Default values

PARALLEL ( NTHREADS = adapted to your CPU and license )

Keywords

Keyword Description
NTHREADS Requested number of threads in parallel execution.

RELAXATION

This command is used to specify relaxation factors for sinkage and trim and, for non-linear computations, also for the source strength and the wave height change.

General form of command

RELAXATION ( RFTRIM = v , RFSINK = v , RFSOUR = v ,
             RFWAVE = v                           )

Default values

RELAXATION ( RFTRIM = 1.0, RFSINK = 1.0, RFSOUR = 0.7, RFWAVE = 1.0 )

Keywords

Note Note Keyword Description
(1) RFTRIM Relaxation factor for the trim angle in sinkage and trim calculations.
(1) RFSINK Relaxation factor for the sinkage in sinkage and trim calculations.
(1) RFSOUR Relaxation factor for the source singularity in non-linear computations.
(1) RFWAVE Relaxation factor for the wave height change in non-linear computations.

Notes

  1. A divergent or oscillatory behaviour is sometimes found for sinkage and trim or non-linear computations. The convergence history can be improved if relaxation is introduced. The relaxation forces the solution to move more slowly towards the final solution. In every step, the trim, sinkage, source strength and wave height are updated according to the following formula:

    \[ {var}(k) = {var}(k-1) + {RFvar} \ast \left( {var}(k) - {var}(k-1) \right) \]

    where k is the iteration step and RFvar is the value of RFTRIM, RFSINK, RFSOUR or RFWAVE.

    Relaxation of the wave height, RFWAVE, is normally only used if severe oscillations occur in the shape of the waterline in the non-linear iterations.

TWCUT

A transverse wave cut computation of the wave resistance is added when TWCUT is included. This command must be used if the far-field group FSFAR is included in XMESH. TWCUT can only be used for cases that have a symmetry plane at the centre plane.

General form of command

TWCUT ( ON         , XSTTWC = v , XENTWC = v ,
        STATWC = n , STRTWC = n , DFTWC = v  ,
        DLTWC = v  , NVALTW = n , NWAVNU = n ,
        YTWC = v                             )

Default values

TWCUT( XSTTWC = 1.4, XENTWC = computed by the program, STATWC = 8,
       STRTWC= 1, DFTWC = (XENTWC-XSTTWC)/STATWC/2, NVALTW = 100,
       NWAVNU = 100, YTWC = min(-0.45*XD2, 1.1*Y4SI) )

Keywords

Note Note Keyword Description
(1) ON The wave cut computation is included, using default values for all keywords.
(1) XSTTWC Longitudinal position of the first transverse wave cut.
(1) XENTWC Longitudinal position of the last transverse wave cut.
(1) STATWC Number of transverse wave cuts.
(1) STRTWC Stretch function for distributing the transverse wave cuts between XSTTWC and XENTWC (see the BODY command in XMESH).
(1) DFTWC Distance between the first and second transverse wave cuts.
(1) DLTWC Distance between the last and second-last transverse wave cuts.
(1) NVALTW Number of data points generated on each transverse wave cut.
(1) NWAVNU Number of wave numbers included in the computation.
(1) YTWC Transverse extension of the transverse wave cuts.

Notes

  1. The wave resistance is computed from multiple transverse wave cuts downstream of the ship. The wave cuts are distributed between XSTTWC and XENTWC. By default XENTWC is located one fundamental wave length downstream of XSTTWC. It is therefore important to use a free-surface that is large enough to capture this distance. If the free-surface is too small, XENTWC will be adjusted to stay upstream of the downstream boundary. It is also important to have a free-surface that is wide enough to ensure that the wave system leaves the free-surface at the downstream boundary, not at the side of the free-surface.

    The default values for the keywords should normally not be changed.

    The input must be non-dimensionalized by Lpp.

WAVECUT

This command is used to print the wave profile along longitudinal and transverse wave cuts on the free-surface.

General form of command

WAVECUT ( LWAVEC = [v1,....,vnl] , DXWAVE = v ,
          TWAVEC = [v1,....,vnt] , DYWAVE = v )

Default values

None

Keywords

Note Note Keyword Description
(1) LWAVEC Transverse position(s) of the longitudinal wave cuts.
(1) DXWAVE Distance between data points for longitudinal cuts.
(1) TWAVEC Longitudinal position(s) of the transverse wave cuts.
(1) DYWAVE Distance between data points for transverse cuts.

Notes

  1. The longitudinal wave profiles will be printed in the file id_LWAVECUT and the transverse wave profiles in id_TWAVECUT.

    LWAVEC, DXWAVE, TWAVEC and DYWAVE must be non-dimensionalized by Lpp.