31. Current profiles

The identification tag for this tutorial is PDS-AAV. Pregenerated input files for this tutorial are found in the folder named PDS-AAV in the provided tutorial input files.

31.1. Tutorial overview

This tutorial covers:

  • Using built-in current profiles
  • Using custom current profiles
  • Using current probes to extract current data

31.2. Setup simulation with current probes

  • Open up a new project window in PST.
  • Set the simulation time to 10 seconds.
  • In the environment properties, set the water depth to 50.
  • Insert a current profile probe by adding $CurrentProfileProbe 0 0 50 to the environment input file. The current profile probe will output the current velocity at 50 equally spaced positions through the water column (at x = 0, y = 0).

31.3. Uniform current profile

Note

  • The uniform current profile requires a current speed and a current heading. The current velocity throughout the entire fluid domain will be set to the input speed and heading.
  • In the environment properties, set $CurrentProfile 1 for a uniform current profile. With the text cursor on the same line, use Ctrl+r to resolve the follower properties for the uniform current profile. Set $CurrentHeading 0 and $CurrentSpeed 2 to set a 2 m/s uniform current at a heading of 0 deg.
  • Run the simulation. Open the currentProfileProbes.dat file in the results folder to view the output of the current profile probes.

Note

  • The format of the current profile probes file is as follows: time(s) V1X(m/s) V1Y(m/s) V1Z(m/s) z(m)…VNX(m/s) VNY(m/s) VNZ(m/s) z(m).
  • This data can be plotted to visualize the current profile, as seen in Fig. 31.1.
alternate text

Fig. 31.1 Uniform current

31.4. Linear shear current profile

Note

  • The linear shear current profile has a specified current velocity at the water surface, and decreases linearly to zero velocity at the sea floor.
  • In the environment properties, set $CurrentProfile 4. Resolve the follower properties and set $CurrentHeading 0 (deg) and $CurrentSpeed 3 (m/s).
  • Rerun the simulation and view the results (Fig. 31.2)
alternate text

Fig. 31.2 Linear shear current

31.5. Power law current profile

Note

  • The power law current profile is commonly used to model developed currents in tidal channels and shallow coastal areas.
  • The power law profile is typically defined over the entire water column as:
\(U(z) = U_{surface} \left(\frac{d-z}{d}\right)^{\beta} \qquad 0\leq z <0 \leq d\)
  • \(U(z)\) is the current speed at a water depth of \(z\), \(U_{surface}\) is the current speed at the water surface (i.e. z = 0) [1], \(d\) is the water depth, and lastly the exponent \(\beta\) is the dimensionless constant that is typically set to be: 1/7th, 1/10th, 1/15th, etc.
  • To use the power law profile set $CurrentProfile to 8 and resolve the follower properties.
  • Set the $CurrentHeading and $CurrentSpeed properties. The $CurrentSpeed property sets \(U_{surface}\).
  • Check the default $CurrentPowerLawExponent property, which is \(\beta\) in the equation above. The default value of \(\beta\) is 0.143 (i.e. the common 1/7th power law profile).

Note

  • A power law profile can be used for the bottom of the water column, and a uniform current for the top of the water column. The $CurrentPowerLawPercentDepth property specifies the percentage of the water column that the power law shape is applied to. For example, if 50% is used for $CurrentPowerLawPercentDepth then the following is applied:

\(U(z) = U_{surface} \qquad 0\leq z <0.5d\)

\(U(z) = U_{surface} \left(\frac{d-z}{d}\right)^{\beta} \qquad 0.5d \leq z \leq d\)

  • Run a simulation with a boundary layer current profile and multiple water velocity probes above the seabed.
  • Plot the probe output files to view the boundary layer current profile.

Note

  • A power law current profile with a surface speed of 3 m/s in 50 m of water, with $CurrentPowerLawPercentDepth set to 50% is shown in Fig. 31.3.
alternate text

Fig. 31.3 Power law current

31.6. Creating a custom current profile

Note

  • Custom current profiles are used to represent current profiles with complex variation through the water column.
  • Time varying current profiles and depths can be specified.
  • Data must be provided indicating the current magnitude at discrete time and depth points. The current values are interpolated linearly over depth and time for a smooth transition.
  • Custom current profile data files are formatted as: [Time(s), Depth(m), Velocity(m/s), Heading(deg)].
  • Custom current profiles are created in separate .dat files, which are referenced in the environment input file.
  • Create a new file and name it CustomProfile.dat.
  • Run the simulation and view the results.
  • Add the following to CustomProfile.dat:
0 50 1.0 50
0 45 1.0 50
0 40 1.0 50
0 35 1.0 50
0 30 1.1 50
0 25 1.1 50
0 20 1.1 50
0 15 1.2 50
0 10 1.2 50
0 5 1.2 50
0 0 1.2 50
10 50 3 100
10 45 3 100
10 40 3 100
10 35 3 100
10 30 3 100
10 25 3 100
10 20 3 100
10 15 3 100
10 10 3 100
10 5 3 100
10 0 3 100

Note

  • This custom current profile specifies one current profile at a time of 0 s with a heading of 50 deg and a free stream velocity of 1.2 m/s tapering down to 1 m/s at depth. The current profile transitions such that at 10 s it will have a heading of 100 deg and a uniform free stream velocity of 3 m/s.
  • Save this file in the project directory.
  • In PST, in the environment input file, change the $CurrentProfile property value to 9.
  • Set the property $CurrentCustomProfileFile CustomProfile.dat to use the custom profile data generated. Run the simulation and view the results.

Note

  • Fig. 31.4 shows the custom current profile plotted at different time steps. Although current information is only specified at finite depth intervals and at 0 and 10 seconds, the solver interpolates both spatially and temporally for a smooth transition between specified values.
alternate text

Fig. 31.4 Current profiles

31.7. 3D spatially varying current profile

Note

  • The 3D spatially varying current profile is used to specify current data in the fluid domain at different locations in space and time.
  • The fluid domain of interest is discretized into a finite number of three-dimensional hexahedronal cells, each defined by 8 corner vertices.
  • Each vertex has a defined location in space, to which current data is applied at different instances in time. ProteusDS utilizes a three-dimensional interpolation scheme within each cell to determine intermediate velocity values between defined vertices.
  • This tutorial will simulate a single 1 m x 1 m x 1 m cube as the fluid domain, specifying current velocity at each corner vertex. For greater spatial resolution in more complex flow conditions, multiple cells can be defined.
  • Open a new project in PST.
  • In the environment properties, set $CurrentProfile 6 for the 3D spatially varying current profile. Press Ctrl+r to resolve follower properties.

Note

  • The 3D spatially varying current profile requires an input file, which is used specifying options for loading mesh and current data.
  • Multiple meshes may loaded at different times in the simulation, each with unique current velocity data.
  • Data may also be loaded on the fly in specified chunks to allow for reduced memory requirements.
  • Raw mesh and current velocity data is stored in separate data files, and is referenced by the input file.
  • To create the raw data file, open a black text file and save it in the simulation folder as FluidDomainData.dat.
  • To define a 1 m x 1 m x 1 m cube, insert the following lines into the file:
<mesh1>
// Format : x y z
$Vertex 0.0 0.0 1.0
$Vertex 0.0 1.0 1.0
$Vertex 0.0 0.0 0.0
$Vertex 0.0 1.0 0.0
$Vertex 1.0 0.0 1.0
$Vertex 1.0 1.0 1.0
$Vertex 1.0 0.0 0.0
$Vertex 1.0 1.0 0.0

$Face Quad 0 1 3 2
$Face Quad 4 6 7 5
$Face Quad 0 2 6 4
$Face Quad 1 5 7 3
$Face Quad 0 4 5 1
$Face Quad 2 3 7 6

$CellData 0 1 2 3 4 5

$StartTime 0
</mesh1>

Note

  • The section labeled mesh1 defines vertices, faces, and cells of the mesh.
  • Current velocity data will be later defined at vertex locations in the mesh. Vertices are defined by adding $Vertex # # #, where each column represents the x, y and z position, respectively.
  • The ordering of the defined vertices determines the vertex ID number, which is used for defining cell faces. For this tutorial, the vertices are defined as seen in Fig. 31.5.
alternate text

Fig. 31.5 Example fluid domain for 3D spatially varying current profile

Note

  • Cell faces must be defined to associate vertices to a cell volume. This is done to efficiently determine if an arbitrary point in space is within a cell volume. Every cell has six faces, with each face requiring an outward facing normal.
  • A cell face is defined with the command $Face Quad # # # #. The Quad command defines the geometry of the face (four vertices) and each following column represents the four vertex ID integers. Vertex IDs must be defined in the correct order to ensure an outward facing normal, according to the right-hand rule.
  • The ordering of faces defined above determines the face ID number, used for defining a cell volume.
  • Cell volumes are defined by associating exterior faces of the volume, with the command $CellData # # # # # #, where each column represents the face ID integer. The order of the faces does not matter when defining the cell volume.
  • The $StartTime property defines when an individual mesh is activated in the simulation. This is useful for using different meshes at different points in a simulation.
  • Now that the mesh information has been defined, insert the following lines to the file to add current velocity data.

<current1>
$TimeStamps 0 10.0

// Format : TimeID VertID VelocityVector (x,y,z)
$CurrentData 0 0 1.0 0.0 0.0
$CurrentData 0 1 2.0 0.0 0.0
$CurrentData 0 2 2.0 0.0 0.0
$CurrentData 0 3 1.0 0.0 0.0
$CurrentData 0 4 2.0 0.0 0.0
$CurrentData 0 5 3.0 0.0 0.0
$CurrentData 0 6 3.0 0.0 0.0
$CurrentData 0 7 2.0 0.0 0.0
$CurrentData 1 0 0.0 0.0 0.0
$CurrentData 1 1 0.0 0.0 0.0
$CurrentData 1 2 0.0 0.0 0.0
$CurrentData 1 3 0.0 0.0 0.0
$CurrentData 1 4 0.0 0.0 0.0
$CurrentData 1 5 0.0 0.0 0.0
$CurrentData 1 6 0.0 0.0 0.0
$CurrentData 1 7 0.0 0.0 0.0
</current1>

Note

  • The time stamps are defined with the command $TimeStamps. Each time stamp has an ID integer, which is used in the current data definition.
  • Current velocity data is defined for each vertex and time stamp using the command $CurrentData # # # # #. The columns represent the time ID integer, vertex ID integer, x direction velocity magnitude, y direction velocity magnitude, and z direction velocity magnitude, respectively.
  • X-direction velocity has been defined at each vertex at t = 0 seconds, then decreases to zero at t = 10.0 seconds. ProteusDS will interpolate within the defined cell volume and at intermediate time steps between defined time values to ensure smooth transitions of current velocity in both space and time.
  • Now that mesh and current velocity data has been defined, the input file must be created to define options for loading mesh and current sections.
  • Open a new blank text file. Save the file in the simulation folder as FluidDomain.ini
  • Add the following lines to the file:
$MeshSection FluidDomainData.dat mesh1 -1
$CurrentSection FluidDomainData.dat current1 -1
$CurrentDataLoadChunkSize 10
  • Save the file.

Note

  • $MeshSection defines the mesh data to use from the defined data file FluidDomainData.dat, labeled as mesh1.
  • $CurrentSection defines the current data to use from the defined data file FluidDomainData.dat, labeled as current1.
  • $CurrentDataLoadChunkSize specifies the size (in seconds) of each data chunk to load on the fly in simulation. Since this is set to 10, the entire data file will be loaded at the start of the simulation.
  • In PST, go to the the environment input file and define $CurrentSpatiallyVaryingProfileFile FluidDomain.ini.

Note

  • Current profile probes can be added at desired locations in the fluid domain to view the results.
  • Run the simulation.

Note

  • A 3D plot of the fluid velocity on the outside faces of the cube at t = 0 seconds can be seen in Fig. 31.6. Velocity was sampled at 0.1 m intervals in all directions to show results of interpolation.
alternate text

Fig. 31.6 Velocity on outside faces of fluid domain at t = 0 seconds

[1]This equation assumes a mean water level of 0 is being used in ProteusDS.