Skip to content

Using Particle Transport in CE-QUAL-W2

There are no switches in the w2_con.npt or w2_con.csv control file to turn on particle transport. The particle transport algorithm in CE-QUAL-W2 (the U.S. Army Corps of Engineers' two-dimensional hydrodynamic and water quality model) is activated by placing the input file w2_particle.csv in the default model directory of the executable. This chapter describes the w2_particle.csv input file and the output files generated by the particle transport algorithm.

Input File: w2_particle.csv

The input file w2_particle.csv must be present in the model directory for the particle transport algorithm to be activated. A template for this file is included in the Excel input file under the tab w2_particle.csv.

The file is divided into three sections:

  1. Particle control and global settings (line 3)
  2. Particle deposition definitions (one line per particle group)
  3. Histogram and monitoring location settings

Note

The first two lines of w2_particle.csv are headers and are skipped by the model. The model reads data starting at line 3. All model inputs are comma delimited.

Section 1: Particle Control

The first data line (line 3) contains the global particle transport settings.

Particle Input File  S.Wells PSU based on Andy Goodwin Fish Migration Program
PART CONTROL, NSEG, #PARTICLES SEGMENT, LINE, DXTHEORY, OUTFREQ (days), LINEAR, HTST BOTTOM, HTST SIDE, IDEBUG
ON, 10, 5, ON, ON, 1, 1, 0, 0, 0
Variable Description
PART CONTROL ON or OFF. Turns particle transport on or off.
NSEG Number of segments where particles are added. In the example above, 10 segment entries are defined in Section 2.
#PART/SEG Number of particles added per segment. In the example above, 5 particles are added per model cell.
LINE Distributes particles in a line from top to bottom at a segment. When ON, the top and bottom layers are defined in Section 2 for each segment.
DXTHEORY When ON, ignores the value of DX in the control file for longitudinal dispersion and uses a theoretically computed value based on the segment length: DISPX = 5.84×10⁻⁴ × DLX¹·¹, where DLX is the segment length in m and DISPX is the longitudinal dispersion coefficient in m² s⁻¹. The random movement in x is very sensitive to the value of DX. Adjusting values of DX in the control file with DXTHEORY set to OFF will affect the random component significantly.
OUTFREQ Output frequency of model files in days.
ILINEAR When set to 1, uses linear interpolation rather than a 3rd-order Newton interpolating polynomial for computing the velocity field for the particles.
HTSTBOTTOM When set to 0, particles are reflected off the bottom upon contact. When set to 1, particles are removed from the system upon bottom contact.
HTSTSIDE When set to 0, particles are reflected off the side upon contact. When set to 1, particles are removed from the system upon side contact.
IDEBUG When set to 1, extensive debug information is written to the output. Set to 0 to disable.

Section 2: Particle Deposition Segments

This section defines the segments where particles are deposited. The first line is a text header ignored by the model. For the number of segments defined above in NSEG, there will be separate lines for each segment number where particles will be deposited.

Part#, PARTSEG, TOPK, BOTTOMK, FXLOC(m), FZLOC(m), SEDVEL(m/d), DATE
1, 61, 100, 120, 0, 0, 0, 4384.5
2, 62, 100, 120, 0, 0, 0, 4384.5
3, 63, 100, 120, 0, 0, 0, 4384.5
4, 61, 100, 120, 0, 0, 0, 4394.5
5, 61, 100, 120, 0, 0, 0, 4394.5
6, 61, 100, 120, 0, 0, 0, 4394.5
7, 61, 100, 120, 0, 0, 0, 4400.5
8, 61, 100, 120, 0, 0, 0, 4400.5
9, 61, 100, 120, 0, 0, 0, 4400.5
10, 61, 177, 177, 0, 0.5, 0, 4384.5
Variable Description
PARTSEG Segment number where particles are deposited.
TOPK Top layer for particle distribution.
BOTTOMK Bottom layer for particle distribution.
FXLOC Distance in m from the upstream edge of the segment for particle placement.
FZLOC Distance in m from the top of the cell for particle placement. Not used when particles are distributed as a LINE in each layer.
SEDVEL Sedimentation velocity in m d⁻¹, for particles that are not neutrally buoyant.
DATE Julian day for particle release. If this value is less than the simulation start date, the particles are released at the first time step.

Tip

When LINE is ON for particle group 1 in the example above, 5 particles are added to each layer (K) from K = 100 to K = 120 at segment 61, evenly spaced in a line. When LINE is OFF, 5 particles start at the FZLOC position of 0.0 m for each layer from 100 to 120, distributed with a spacing equal to the layer height divided by the number of particles.

Section 3: Histogram Output and Monitoring Locations

This section defines the histogram output for particle time histories. A time history of the temperature, velocity, and depth is recorded for every time step and every particle released. Results are written to three output files:

  • envrprf_v_particle.csv
  • envrprf_t_particle.csv
  • envrprf_depth_particle.csv

Number of Histogram Bins

The first variable is the number of histogram bins (or intervals) for each variable.

NUMCLASS OR INTERVALS
30

Histogram Bin Parameters

The next section defines the histogram bins or intervals for velocity, temperature, and depth.

VINCR, VTOP, TINCR, TTOP, DINCR, DTOP
0.05, 0.5, 1, 30, 0.5, 10
Variable Description
VINCR Velocity bin interval in m s⁻¹.
VTOP Maximum velocity in m s⁻¹.
TINCR Temperature bin interval in °C.
TTOP Maximum temperature in °C.
DINCR Depth bin interval in m.
DTOP Maximum depth in m.

Monitoring Locations

The next set of parameters defines monitoring of particles as they pass different locations.

#MONITORING LOCATIONS
2
Monitoring segments
30, 60
Monitoring x shift in m within a segment starting from upstream edge
10, 5

The number of monitoring locations specifies how many sensors are placed in the system to record when a particle passes. The monitoring segments are the segment numbers where sensors are located. The monitoring x-shift is the distance in m from the upstream edge of the segment, positioning the sensor within that segment.

Reference System for Particles in Grid

The location of particles in the grid is identified by segment (I) and layer (K) location as well as X, Y, and Z coordinates within each layer. These are described in Part 2 of the User Manual where the particle algorithm is discussed.

Output Files

The model generates output files for viewing particle transport in Tecplot. The two primary file types are BranchX.dat and PartX.npt, where X is the branch number.

  • BranchX.dat contains branch characteristics such as velocity, temperature, and dissolved oxygen (DO).
  • PartX.npt contains the particle locations in each branch for particles currently within that branch.

BranchX.dat

This file contains the following variables for each output time interval: X, Z, Water (1 if in the water, -1 if above the water surface or in the bottom), horizontal velocity (U), vertical velocity (W), temperature, dissolved oxygen (DO), layer index (KLayer), and segment index (ISegment). This file is typically used as the background layer over which particle positions are overlaid.

TITLE = "GRID NODE INFO for Branch       1"
VARIABLES = "X", "Z", "WATER", "HorizVel", "VertVel", "Temp", "DO", "KLayer", "ISegment"
ZONE T="JDAY    4384.00", N=     9351, E=     9109, F=FEPOINT, ET=QUADRILATERAL
         0.0     300.04       -1     0.00E+00       0.00E+00    25.00     5.64     2     2
       503.3     300.02       -1     0.00E+00       0.00E+00    25.00     5.64     2     3
      1006.7     300.01       -1     0.00E+00       0.00E+00    25.00     5.64     2     4
      1510.0     300.01       -1     0.00E+00       0.00E+00    25.00     5.64     2     5
      2013.4     300.00       -1     0.00E+00       0.00E+00    25.00     5.64     2     6
      2516.7     300.00       -1     0.00E+00       0.00E+00    25.00     5.64     2     7

PartX.npt

This file contains the location of all particles as a function of time. The format is shown below.

TITLE = "FISH INFO for Branch       1"
VARIABLES = "X", "Z", "FSIZE", "FAGE", "WATER"
ZONE T="JDAY    4384.00", I=      631, F=POINT
         0.01       0.01     0.00     0.00    -1
     29697.06     298.00     0.00     0.00     1
     29697.06     298.00     0.00     0.00     1
     29697.06     298.00     0.00     0.00     1
     29697.06     298.00     0.00     0.00     1
     29697.06     298.00     0.00     0.00     1
     29697.06     298.00     0.00     0.00     1
     29697.06     298.00     0.00     0.00     1
     29697.06     298.00     0.00     0.00     1
     29697.06     298.00     0.00     0.00     1
     29697.06     298.00     0.00     0.00     1
     29705.55     298.00     0.00     0.00     1
...
TEXT X=47, Y=90, F=HELV-BOLD, HU=FRAME, AN=MIDCENTER,C=RED, H=3, T="   January  1, 2012
12am    (JDAY4384.000)", ZN=      1
TEXT X=30.0, Y=21.0, F=HELV-BOLD, HU=FRAME,AN=MIDRIGHT, C=BLACK, H=2.1, T="   630", ZN=
1
TEXT X=25.0, Y=25.0, F=HELV-BOLD, HU=FRAME,AN=MIDCENTER, C=BLACK, H=2.1, T="# of Parti-
cles"

Finalparticle.csv

This file contains the final state of all particles released in the model. The header prints out the information for each particle.

Column Description
Part# Particle number
Seg #I Segment number
X Location within Seg from Upstream Side (m) X location within segment from upstream side
Layer #K Layer number
Vertical Dist from Top (m) Vertical distance from top of layer
Lateral Dist from Left Bank (m) Lateral distance from left bank
Branch# Branch number
Particle In Model (=0) 0 if particle is still in the model
JDAY left system Julian day when the particle left the system
Detention Time (days) Particle detention time in days
Removal Mechanism Code indicating why the particle left the system (see table below)
Sed Velocity (m/d) Sedimentation velocity in m d⁻¹
Date Start Julian day when the particle was released

This file also includes additional columns of time in Julian days when the particle passed a monitoring location.

Removal Mechanism Codes

The removal mechanism column indicates why the particle left the system.

Removal # Reason
1 Particle lateral removal by withdrawal
2 Particle hits bottom and sticks
3 Particle leaves at upstream external head boundary condition (BC)
4 Particle leaves at downstream external head BC
5 Particle leaves at downstream structure (dam or hydraulic structure)
6 Particle leaves by hitting side wall and sticking (left-hand side)
7 Particle leaves by hitting side wall and sticking (right-hand side)

Tip

Plot a histogram of particle detention times from the Finalparticle.csv file to evaluate residence time distributions in the system.

Example of particle detention time histogram plotted using data from the Finalparticle.csv file
Figure 52. Example of particle detention time histogram using the file Finalparticle.csv. For this system the average particle detention time was 9.5 days.

Initialparticle.csv

This file contains the initial state of all particles added or to be added to the system. It is a valuable file for verifying that the input file w2_particle.csv was interpreted properly. The file format is the same as Finalparticle.csv described above.

envrprf_v_particle.csv, envrprf_t_particle.csv, and envrprf_depth_particle.csv

These files contain histograms for each particle released in the model domain, recording velocity, temperature, and depth distributions. The file format matches that of the Environmental Performance Criteria output files. Histograms can be aggregated across all particles to summarize overall exposure conditions.

Example histograms of particles released for velocity and temperature for a particle release experiment
Figure 53. Example histograms of particles released for velocity and temperature for a particle release experiment.

Diagnostics.out

This file provides diagnostic output for the initial state of all particles and records events such as branch transfers and particles leaving the system. The file logs the following event types.

Particle Lost from the Dam or from the End of a Branch

The data is the array containing all the information on each particle. This is the same as the header in the Finalparticle.csv file.

At Dam: Particle Leaves System on JDAY:    4626.88896283064       Data:
   64.0000000000000       503.327892820194       108.000000000000
   1.54366227122847       207.744214026401       1.00000000000000
  0.000000000000000E+000  242.888962830642      0.000000000000000E+000
  0.000000000000000E+000   1.00000000000000
  0.000000000000000E+000  4626.88896283064       242.888962830639
  0.000000000000000E+000

Particle Lost by a Withdrawal

The data array contains all the information on each particle, in the same format as Finalparticle.csv.

Withdrawal: Particle Leaves System on JDAY:    4629.66818200118       Data:
   84.0000000000000        62.4260124317897       103.000000000000
   1.76838386998323        3.53317756466032       2.00000000000000
  0.000000000000000E+000  245.668182001177      0.000000000000000E+000
  0.000000000000000E+000   1.00000000000000
  0.000000000000000E+000  4629.66818200118       245.668182001185
   1.00000000000000

Particle Moves into a Branch

There are several cases: moving into a right-hand side branch, a left-hand side branch, or into a downstream hydraulic structure (DHS) branch.

LateralLEFT: Particle move to new branch on JDAY:    4629.70252382608       FYVEL
 = -1.17916233446832E-002 OLD I:         43 NEW I:         94  OLD branch:
         1  NEW branch:         2

DHS: Particle move to new branch on JDAY:    4629.61918428981       FXVEL=
  4.94579872878073E-003 OLD I:         94 NEW I:         43  OLD branch:
         2

LateralRIGHT: Particle move to new branch on JDAY:    4629.64614344996
 FYVEL=  3.10853674784659E-002 OLD I:         43 NEW I:        112
  OLD branch:         1  NEW branch:         3

Using Tecplot to Plot Particle Movement

The basic approach is to load branch data with temperature contours and velocity vectors, then overlay the particle positions in a second frame.

  1. Load the BranchX.dat file into Tecplot as Frame 1. Set up temperature contours and velocity vectors.
  2. Create a new frame (Frame 2) overlaying Frame 1.
  3. Load the PartX.npt data into Frame 2 and activate a scatter plot.
  4. Change the scatter symbol from the default rectangle to a circle and reduce its size.
  5. Link the frame styles between Frame 1 and Frame 2.
  6. Set the background of Frame 2 to transparent.
  7. Animate particle movement by stepping through the particle zones (the temperature and velocity zones remain fixed).
  8. To export an animation, write a Tecplot script that activates Frame 1 with Zone 1, then activates Frame 2 with Zone 1, and exports the image. Loop over all zones and write the output to a video file (e.g., mp4, avi, wmv).
Branch temperature, velocity, and particles in Tecplot frame
Figure 54. Branch temperature, velocity, and particles in Tecplot frame.