<!-- source-page: 581 -->

# naquaconst

The number of fluid property constants in the fluid variable definition.

# nwindconst

The number of constants included in the wind velocity profile.

# nstatevar

The number of state variables for the user-defined wave, which is specified using the DEPVAR parameter.

# nfieldvar

The number of field variables available on the element set on which the load is applied. At the first call the field variables will be available at nodes, and at the second call they will be available at the load integration points.

# iElemType

An integer indicating the type of element these points belong to: 1 for line elements, 2 for surface elements, and 3 for solid elements. This integer is used to interpret the value of the direction vector (DirVec) provided at each point.

# iLoadType

An integer indicating the type of Abaqus/Aqua load for which the wave kinematics are calculated. The parameters j\_lcr\_PB to j\_ccr\_TSI indicate the values by which the load types can be identified.

# sname

The name of the element set on which the load is applied.

# lUpdFluidVar

This integer flag is used to update different fluid variables. The flag acquires known values as declared in the list of parameters. This flag provides information regarding which variables are to be updated on each call. When the subroutine is called with lUpdFluidVar having a value of j\_upd\_FreeSurf, only the free surface elevation at each point is updated; otherwise, different sets of fluid variables are updated depending on different values of lUpdFluidVar, as explained in the subroutine structure above.

# Coord(nblock,ndim)

This array contains the global coordinates of all points in their current configuration at the start of the time increment.

# Velocity(nblock,ndim)

This array contains the structural velocities of all points at the mid-increment time level of the previous increment.

<!-- source-page: 582 -->

# StateVar(nblock,nstatevar)

This array contains the user-defined solution-dependent state variables at all points. The state variables can optionally be updated during the first call, when the flag lUpdFluidVar has a value of j\_upd\_FreeSurf. At the second call the incoming values are interpolated values at the integration points and are read-only.

# FieldVar(nblock,nfieldvar)

This array contains the field variables at the load integration points at the start of the time increment.

# DirVec(nblock,ndim)

This array contains the direction vectors at the load integration points at the start of the time increment. For points lying on line elements, it is the tangent vector in the current configuration. For points lying on surface elements or solid faces, it is the surface-normal vector, pointing outward in the current configuration. The type of elements with which the points are associated can be found using the integer variable iElemType. The magnitude of this vector is the outer diameter for line elements under distributed loads (PB, FDD, WDD, FDT, FI), transitional section area for line elements under transitional distributed loads (FD1, FD2, WD1, WD2, FI1, FI2), and the nodal surface area for points under concentrated loads (TSB, TFD, TWD, TSI) or points lying on surface elements or solid faces.

# fSteadyVel(nblock,ndim)

The incoming array contains the steady fluid velocity.

# AquaSteadyConstants(naquaconst)

The user-specified fluid property constants in the fluid variable definition.

# WindConstants(nwindconst)

The user-specified constants in the wind profile definition. In the absence of a wind profile, all values are zeros.

# Props(nprops)

This real array contains properties for the user-defined wave, as listed on the data lines.

# dt

The time increment.

# timeTotal

The total time at the beginning of the increment over all steps.

# timeStep

The step time at the beginning of the increment within the step.

<!-- source-page: 583 -->

# 1.3 Abaqus/CFD subroutines

• “SMACfdUserPressureBC,” Section 1.3.1   
• “SMACfdUserVelocityBC,” Section 1.3.2

<!-- source-page: 584 -->

<!-- source-page: 585 -->

# 1.3.1 SMACfdUserPressureBC: User subroutine to specify prescribed pressure boundary conditions.

Product: Abaqus/CFD

# Reference

• \*FLUID BOUNDARY

# Overview

User subroutine SMACfdUserPressureBC can be used to define element face pressures.

# Time incrementation

During the analysis user subroutine SMACfdUserPressureBC is called a number of times to update the pressure and change in pressure. The returned variable should be set equal to the pressure at stepTime, where stepTime is the current step time.

# User subroutine interface

```c
void SMACfdUserPressureBC(int nfacets, const int* labels, const int* sides, const int* instances, char** instanceNames, const double* xc, const double* yc, const double* zc, double amp, double totalTime, double stepTime, const char* surfaceName, double* bcvals); 
```

# Variable to be defined

bcvals

Values of the prescribed pressure at the element faces.

# Variables passed in for information

nfacets

Number of element facets to be processed in this call to SMACfdUserPressureBC.

labels

User labels for the elements attached to the facets in the boundary condition.

sides

Side numbers for the facets in the boundary condition.

<!-- source-page: 586 -->

# instances

Instance numbers of the elements in the boundary condition.

# instanceNames

Array of instance names in the model. Instance numbers provided for the elements are used to look up instance names in this array.

xc

Global X-coordinates for the centroid of the facets.

yc

Global Y-coordinates for the centroid of the facets.

zc

Global Z-coordinates for the centroid of the facets.

amp

Amplitude value corresponding to the associated amplitude function. This value is passed in for information only and will not contribute to the value of the prescribed variable automatically.

# totalTime

Value of total time. The time at the beginning of the step is given by totalTime-stepTime.

# stepTime

Current step time.

# surfaceName

Name of the surface used to define the boundary condition.

<!-- source-page: 587 -->

# 1.3.2 SMACfdUserVelocityBC: User subroutine to specify prescribed velocity boundary conditions.

Product: Abaqus/CFD

# Reference

• \*FLUID BOUNDARY

# Overview

User subroutine SMACfdUserVelocityBC:

• can be used to define element face velocities; and   
• defines the magnitude of the associated boundary condition in the global directions.

# Time incrementation

During the analysis user subroutine SMACfdUserVelocityBC is called a number of times to update the velocity and change in velocity. The returned variable should be set equal to the velocity at stepTime, where stepTime is the current step time.

# User subroutine interface

```txt
void SMACfdUserVelocityBC(int nfacets, int direction, const int* labels, const int* sides, const int* instances, char** instanceNames, const double* xc, const double* yc, const double* zc, double amp, double totalTime, double stepTime, const char* surfaceName, double* bcvals); 
```

# Variable to be defined

bcvals

Values of the prescribed velocity at the element faces in the indicated direction.

# Variables passed in for information

nfacets

Number of element facets to be processed in this call to SMACfdUserVelocityBC.

direction

Global direction in which the velocity component is being defined.

<!-- source-page: 588 -->

# labels

User labels for the elements attached to the facets in the boundary condition.

# sides

Side numbers for the facets in the boundary condition.

# instances

Instance numbers of the elements in the boundary condition.

# instanceNames

Array of instance names in the model. Instance numbers provided for the elements are used to look up instance names in this array.

# xc

Global X-coordinates for the centroid of the facets.

#

Global Y-coordinates for the centroid of the facets.

# zc

Global Z-coordinates for the centroid of the facets.

# amp

Amplitude value corresponding to the associated amplitude function. This value is passed in for information only and will not contribute to the value of the prescribed variable automatically.

# totalTime

Value of total time. The time at the beginning of the step is given by totalTime-stepTime.

# stepTime

Current step time.

# surfaceName

Name of the surface used to define the boundary condition.

# Example: Imposition of a parabolic inlet flow velocity

In this example a parabolic inlet flow velocity is imposed on a channel. User subroutine SMACfdUserVelocityBC given below illustrates how the return value array is to be computed.

# Input file

```txt
*HEADING
Test Abaqus/CFD velocity boundary condition user subroutine
*NODE 
```

1, -10.0, 0.0, 0.0

21, 10.0, 0.0, 0.0

<!-- source-page: 589 -->

```csv
211, -10.0, 10.0, 0.0
231, 10.0, 10.0, 0.0
*NGEN, NSET=INLET
1, 21, 1
*NGEN, NSET=OUTLET
211, 231, 1
*NFILL, NSET=LOW
INLET, OUTLET, 10, 21
*NCOPY, CHANGE NUMBER=231, OLD SET=LOW, NEW SET=HIGH, SHIFT 0.0, 0.0, -1.0
*NSET, NSET=NALL
LOW, HIGH
*ELEMENT, TYPE=FC3D8
1, 1, 2, 233, 232, 22, 23, 254, 253
*ELGEN, ELSET=EALL
1, 20, 1, 1, 10, 21, 20
*ELSET, GENERATE, ELSET=INLET
1, 20, 1
*ELSET, GENERATE, ELSET=OUTLET
181, 200, 1
*ELSET, GENERATE, ELSET=LEFT
1, 181, 20
*ELSET, GENERATE, ELSET=RIGHT
20, 200, 20
*SURFACE, TYPE=ELEMENT, NAME=INLET
INLET, S1
*SURFACE, TYPE=ELEMENT, NAME=OUTLET
OUTLET, S2
*SURFACE, TYPE=ELEMENT, NAME=TOPFACE
EALL, S3
*SURFACE, TYPE=ELEMENT, NAME=BOTFACE
EALL, S5
*SURFACE, TYPE=ELEMENT, NAME=LEFT
LEFT, S6
*SURFACE, TYPE=ELEMENT, NAME=RIGHT
RIGHT, S4
*MATERIAL, NAME=FLUID
*DENSITY
1.0,
*VISCOSITY
1.0E-3
*CONDUCTIVITY 
```

<!-- source-page: 590 -->

```csv
1.0E-3
*SPECIFIC HEAT, TYPE=CONSTANT PRESSURE
1.0,
*EXPANSION, ZERO=0.0
1.0
*FLUID SECTION, TYPE=SINGLE FLUID, ELSET=EALL
FLUID
*INITIAL CONDITIONS, TYPE=VELOCITY, ELEMENT AVERAGE
EALL, 1, 0.0
EALL, 2, 0.0
EALL, 3, 0.0
*STEP, NAME=PARABOLIC
*CFD, INCOMPRESSIBLE NAVIER STOKES, INCREMENTATION=FIXED CFL
0.01, 100.0, 0.025, 0.40, 1
1.0E-10, 1.0, 0.0, 0.0, 1.0
*FLUID BOUNDARY, TYPE=SURFACE
INLET, VELY, 0.0
INLET, VELZ, 0.0
OUTLET, P, 0.0
TOPFACE, VELZ, 0.0
BOTFACE, VELZ, 0.0
LEFT, VELX, 0.0
LEFT, VELY, 0.0
LEFT, VELZ, 0.0
RIGHT, VELX, 0.0
RIGHT, VELY, 0.0
RIGHT, VELZ, 0.0
*FLUID BOUNDARY, TYPE=SURFACE
INLET, VELYNU
*OUTPUT, FIELD, TIME INTERVAL=0.10
*ELEMENT OUTPUT, ELSET=EALL
V, PRESSURE
*END STEP 
```

# User subroutine

```c
/* User defined velocity example */
#include "SMACfdUserSubroutines.h"

void SMACfdUserVelocityBC
(int nfacets, int direction, const int* labels,
const int* sides, const int* instances, char** instanceNames, 
```
