Welcome to Nays2DV example manual’s documentation!
Introduction
Nays2DV is 2Dimensional Vertical plane model developed for calculation of vertical movement of fluid (density currents).
The Nays2DV solver is developed by Professor Yasuyuki Shimizu from Hokkaido University.
Density currents occured due to density differences, arise from temperature variations, suspended solids or dissolved materials. Therefore, formation and evolution of density currents are induced by natural conditions such as saline intrusions, oil spills etc. Density flow is important for problems in lakes, reservoirs and estuaries.
This manual explains the step by step guide of several examples in Nays2DV.
Explanations of this manual are based on the assumption that you have already installed iRIC in your computer. If you have not installed the iRIC software, download it from the following URL and install it on your computer.
URL: http://i-ric.org/downloads Software: iRIC version 3.x or later
Overview
Operational procedure
The main steps in using Nays2DV for your calculations are as shown in Figure 1.

: Nays2DV operational procedure
Launch Nays2DV
The following is the procedure to launch Nays2DV in iRIC.
When launching iRIC, the iRIC start page can be seen as Figure 2. Click on [Create New Project] in the [iRIC Start Page] window.

: Create new project_1
Then the [Select Solver] window will open as shown in Figure 3. Select [Nays2DV vertical 2D model] in the [Select Solver] window and click on [OK].

: Create new project_2
A window with the title bar untitled-iRIC 3.0.18.6257 [Nays2DV vertical 2D model] will appear as shown in Figure 4.

: Create new project_3
Nays2DV model is ready to use.
- The basic steps to follow during a simulation in Nays2DV are,
Creation of the grid
Mapping the attributes to the grids
Setting the calculation conditions
Making a simulation
Visualization of results
Creating grids for Nays2DV
Grid generation for Nays2DV should be done using grid generator for Nays2DV.
For that select, [Grid] then, [Select Algorithm to Create Grid] and then [Grid Generator for Nays2DV] in [Select Grid Creating Algorithm] window as shown in Figure 5.

: Grid creation
Using grid generator for Nays2DV, it is possible to generate grids with flat bottom,sloped bottoms, perturbed bottom with a line, cosine curve and dune shape.
Adding additional inlets and outlets in upstream or downstream or both if needed are possible.
Setting the calculation conditions in Nays2DV
In calculation conditions, computational parameters (upstream and downstream conditions and initial conditions), Time and iteration parameters and physical parameters can be set.
After giving all the parameters, save and close. For setting up the calculation conditions, select, [Calculation Condition] and then [Setting].
Then the [Calculation Condition] window will appear. Figure 6 shows the procedure.

: Calculation condition
Simulation of Nays2DV in iRIC
After creating the grid, mapping all the attributes and setting the calculation conditions, save the project as a .ipro or a project.
If save as a .ipro it will be a one single file and requires less space. If save as a project it will be in a folder with several subfolders.
Check the node attributes and cell attributes to see whether the data are properly mapped. It is possible to edit the data there if needed.
After all the modifications save the project one last time and select [Simulation] and [Run] as shown in Figure 7. Before the simulation starts, you will be asked to save again. If so click on [Save] again.

: Simulation
Visualization of results of Nays2DV in iRIC
After the simulation end, select [Calculation Results] and [Open new 2D Post-processing Window] or simply click on the 2D post-processing window icon.
You will be directed to a window as shown in the Figure 8.
Tick on any parameter in the object browser and adjust properties by right clicking on it.
Animation of the variation can be seen with the animation icon.

: Visualization of results
Examples
This chapter describes the step by step guide of vaious kinds of examples.
Example 01: Calculation of density currents in a tank
Purpose
To understand the basic operation of Nays2DV in iRIC by calculating the current field due to the density difference in a closed tank.
Creation of the calculation grid and setting the initial conditions
The grid for the Nays2DV model can be created only by using grid generator for Nays2DV.
Select[Grid] [Select Algorithm to Create Grid] then select [Grid Generator for Nays2DV] as shown in Figure 9.

: Grid creation_1
Now the grid creation dialogue will appear as shown in Figure 10. Since the bottom profile data is not not available, select how to set longitudinal bed profile as automatically. If longitudinal bed profile data available, select manually and give the data for longitudinal bed profile.

: Grid creation_2
Adjust the longitudinal details of the channel such as length and number of grids in x directions as required here. However, there is a maximum limit of the number of grids.
It is possible to adjust the bottom with a slope and perturb or non-perturb. This example a non perturbed bottom is used. See in the example with a cosine shaped bottom for a case with a perturb bottom and water surface.
If you have additional channels at upstream or downstream or both you can add here.
Water surface conditions and the number of grids in vertical direction can be given as shown in Figure 11.

: Grid creation_3
Here you can adjust the water surface slope and shape perturb or non-perturb. If a flat one use non perturb and slope 0 as in this example. If you select perturb you can select either line, cosine or dune.
Background conditions of the creating grid can be given as shown in Figure 12.

: Grid creation_4
Here give the values of the background temperature and concentration. This means the general condition of the calculation.
After setting up all the parameters create the grid. Then you will be asked to map the attributes or not. Select yes, as shown in Figure 13.
However, later if new conditions of temperature, concentration etc are added,should execute the attribute mapping again.

: Grid creation_5
The grid is created as shown in Figure 14.

: Grid creation_6
Now, add a new concentration using a polygon as shown in Figure 15. [Initial Concentration] [Add] [Polygon] when the plus mark appear draw the polygon as required.

: Creating initial concentration polygon_1
After drawing the polygon, edit the values of the initial concentration of the drawn polygon as shown in Figure 16.

: Creating initial concentration polygon_2
In this example initial concentration is set to 0.03.
Now the new concentration needs to be mapped to the grids using, [Grid] [Attributes Mapping] and [Execute].
Then select the components needed to map. Select the parameters which changed the value. In this example it was initial concentration. Therefore, initial concentration is ticked as shown in Figure 17.

: Attributes mapping_1
The confirmation of mapping window will appear as shown in Figure 18.

: Attributes mapping_2
After successful mapping of the attributes, it can be seen from the cell attributes and node attributes.
In this example check it in cell attributes.
In the [Object Browser] [Grid] [Cell Attributes] [Initial Concentration] as shown in Figure 19.

: Attributes mapping check
As shown in the figure, initial concentration is mapped properly.
Setting the calculation conditions and simulation
Next, calculation conditions need to be set.
For that, select [Calculation Conditions] and [Settings].
Then the calculation conditions window will open as shown in Figure 20. Input the values as shown in figure for computational parameters.

: Setting Calculation conditions_1
In this example, upstream and downstream boundary are closed boundary.
Then input parameters for time and iteration parameters as shown in Figure 21.

: Setting Calculation conditions_2
Time and iteration parameters are important for simulation stability.
Computational time step needs to be set considering the CFL condition according to the grid size.
If the computation fails at the initial stage, change the time step to a smaller value and try again.
Then adjust the physical parameters as shown in Figure 22.

: Setting Calculation conditions_3
Physical parameters need to be adjusted according to the fluids used. In this example default values are used.
After setting all the calculation parameters, save and close the window.
Then save the project as density_currents.ipro and run the simulation with [Simulation] [Run] as shown in Figure 23.

: Simulation_1
The simulation will end as shown in Figure 24.

: Simulation_2
Visualization of results
After the computation is stopped, results can be viewed from [Calculation Results] [Open new 2D Post-Processing Window] as shown in Figure 25 or by clicking on 2D post-processing window icon.

: Viewing results_1
The 2D post processing window will appear as shown in Figure 26

: Viewing results_2
In post processing window, the parameters need to be viewed can be selected in object browser. By adjusting the properties to desired scales, results can be visualized nicely. In this exmaple let’s visualize concentration and velocity vectors.
To visualize concentration,tick in object browser [iRIC Zone],[Scale],[Concentration]. Then right click on [Concetration] and select [Property]. The [Scaler Setting] window will appear as shown in Figure 27.

: Viewing results_3
As shown in the above figure, untick the automatic in [Value Range] and give themaximum and minimum values. In this example set minimum to 0 and maximum to 0.03. Tick on fill upper area and fill lower area.
To visualize velocity vectors together, tick on [Arrow] and [Velocity] both and right click on [Arrow], then select [Property].
[Arrow Setting] window will appear as shown in Figure 28.

: Viewing results_4
Adjust the size of velocity vectors as shown in the figure.
Now the concentration and velocity vectors can be viewed as shown in Figure 29.

: Concentration and velocity vector plot
The animation of the movement can be viewed with animation buttons in top of the2D post-processing window.
Example 02: Vertical 2D flow over continuous dunes
Purpose
Calculate the vertical 2D flow over the dunes and the particle movements.
Creation of the calculation grid and setting the initial conditions
Create the grid using [Grid] [Select Algorithm to Create Grid] and then select [Grid Generator for Nays2DV] as shown in Figure 30.

: Grid creation_1
Then, give the channel bottom shape parameters as shown in Figure 31. Since the bottom profile data is not not available, select how to set longitudinal bed profile as automatically. If longitudinal bed profile data available select manually and give the data for longitudinal bed profile.

: Grid creation_2
In this example, Channel length = 0.8 m, No of grids in x direction = 81, Bottom slope =0.00095, Bottom shape is perturb, dune shape, dune height=0.1, Unit of amplitude or dune height is in m.
Wave number of bottom shape =2 and phase lag of bottom shape is 0.3 m.
In this example no additional inlet and outlet channels and no additional nodes in the center of the channel.
After that, give the water surface shape parameters and no of grids in vertical direction as shown in Figure 32.

: Grid creation_3
Water depth and no of grids in vertical directions are given here. Average channel depth = 0.17, No of grids in Z directions = 30.
Water surface shape and slope are adjusted as, Water surface slope=0.00095, Water surface shape = non perturb
Then, background values are given as shown in Figure 33.

: Grid creation_4
Back ground temperature is given as 15 and background concentration is 0.
After selecting [Create Grid], program will ask whether to map attributes to thegrid or not. You can either map the attributes now or can do it again before the simulation.
The created grid is as shown in Figure 34.

: Created grid
After the grid creation and attributes mapping, check the mapped attributes by ticking on [Grid] in [Object Browser] and selecting the mapped attributes in cell attributes drop down list.
If needed, it’s possible to adjust attribute values here. In this example no adjustments are made.
Now save the project from, [File] [Save as file.irpo] or [Save as Project] as shown in Figure 35. If the project is saved as .ipro, all the files are in one file and just by clicking on it, it will open with iRIC automatically.
If the project is saved as a project, there will be several folders and iRIC should open first and then the project xml file has to open in iRIC.

: Saving the project
Setting the calculation conditions and simulation
To set the calculation conditions, Select [Calculation Condition] and then select [Settings]. Calculation condition window will appear as shown in Figure 36. Computational parameters, time and iteration parameters and physical parameters need to set here.

: Calculation condition setting_1
For boundary condition, upstream and downstream boundary are set as open channel flow with periodic boundary.
Averaged velocity=0.3, averaged depth=0.17, grain size of bed material =0.0001, relative length to the depth of the first grid from bottom =0.02, eddy viscosity=constant, coefficient for eddy viscosity=1.
Time and iteration parameters are set as shown in Figure 37.

: Calculation condition setting_2
Time parameters are, output interval=0.01, computation finishing time=5 s, time step of computation = 0.001. Free surface calculation is included.
Discharge adjustment is included.
After that, physical parameters are set as shown in Figure 38.

: Calculation condition setting_3
For the physical parameters default values are used.
After setting the calculation conditions, save the project again.
Then, start the simulation with [Simulation] [Run] as shown in Figure 39.

: Simulation_1
At the end of the simulation, a message box will appear as shown in Figure 40 saying ‘solver finished the calculation’.

: Simulation_2
Visualization of results
After the solver finished the calculation, view the results by, [Calculation Results] [Open 2D Post-Processing Window] as shown in Figure 41 or simply by clicking on Open 2D post-processing window icon.

: Viewing results_1
Tick on [iRIC Zone],[Scalers], [Vorticity] in [Object Browser] and right click on [Vorticity] and select [Property] as shown in Figure 42.
Then it is possible to adjust the legend and the visible range of the data.

: Viewing results_2
Then the scaler setting will appear as shown in Figure 43.
In the scaler setting window, unselect the automatic in value range and give minimum as -20 and maximum as 20. Then adjust the colour map by selecting custom setting.
In custom color map adjust the type to three colors and select the three colours as red, white and blue respectively.

: Viewing results_3
The particles can be added by ticking on [Particles] and [Velocity] in [Object Browser]. The particle can be adjusted with property.
Right click on [Particles] and select [Property]. [Particle Setting] window will appear as shown in Figure 44

: Viewing_results_4
In this example generation time interval is set as 1/4 and others keep as default values.
The resulting figure is as shown in Figure 45

: Vorticity & particle movement
The animation of the movement can be viewed with animation buttons in top of the 2D post-processing window.
Example 03: Heat transport from a heat boundary
Purpose
Calculate the transportation of heat in a closed rectangular tank when a temperature boundary is created.
Creation of the calculation grid and setting the initial conditions
As explained in the other examples and the introduction, create the grid using, [Grid], [Select Algorithm to Create Grid] and then select [Grid Generator for Nays2DV]. Then the grid creation window will appear.
In grid creation window, select the channel bottom shape parameters as shown in Figure 46. Since the bottom profile datails are not not available, select how to set longitudinal bed profile as automatically. If longitudinal bed profile data available select manually and give the data for longitudinal bed profile.

: Grid creation_1
For the water surface shape parameters, and average channel depth and number of girds in vertical direction, select as shown in Figure 47. Since a non purturbed surface and bottom are selected here, no adjustment are needed.

: Grid creation_2
For the background values, select as shown in Figure 48.

: Grid creation_3
For the background values, use the default values of background temperature 15 and background concentration 0.
The grid is created and dialogue box will open asking whether to map the attributes or not. Select yes and it will map the attributes.
The create a temperature boundary, select [Boundary Conditions Setting] in [Object Browser] and [Add T_bound] as shown in Figure 49.

: Add Temperature boundary.
Then a T-bound will be created and a polygon for the T-boundary has to be drawn.The condition of the T_bound can be adjusted by right clicking on [T_bound] and [Edit condition] then editing the [Boundary Condition] window as shown in Figure 50.

: Editting Temperature boundary.
After creating the T_Boundary, map the attribute to the grid.
For the attribute mapping , select [Grid], [Attributes Mapping], [Execute].
Then the attribute mapping window will appear. Tick on [New T-bound] and [OK] as shown in Figure 51.

: Attributes mapping.
The T_Bound attribute is mapped to the grid.
The mapping can be confirmed by checking the object browser.
Tick on [Grid] [Boundary Condition] and the [New T_Bound].
If the mapping is correct the name of the T_Bound, in this example [New T_Bound ] should appear on the grid as shown in Figure 52.

: Check attributes mapping
This shows the correct mapping of the New T_Bound to the grid.
Save the project with [File], [Save as .ipro] or [Save as Project].
Setting the calculation conditions and simulation
Set the calculation conditions with, [Calculation Condition], [Setting].
Calculation condition window will open.
Set computational parameters as shown in Figure 53.

: Setting calculation conditions_1
Set time and iteration parameters as shown in Figure 54.

: Setting calculation conditions_2
Set physical parameters as shown in Figure 55.

: Setting calculation conditions_3
After setting the calculation conditions, save and close the calculation condition window.
Save the project again. Now start the simulation by [Simulation], [Run].
Visualization of results
After calculation solver stopped, go to [Calculation results], [Open new 2D Post-Processing Window].
Tick on [iRIC zone], [Scaler] and [Temperature] in [Object Browser].
Right click on [Temperature] select [Property].
[Scaler Setting] window will appear and adjust the scaler value range for visibility as shown in Figure 56.

: Visualization of results_1
To see the velocity vector movement tick on [Arrow] and [Velocity] in object browser. Arrow properties can be adjusted by right clicking on [Arrow] and selecting [Property].
Arrow setting window will appear and the sizes of the arrow can be adjusted as shown in Figure 57.

: Visualization of results_2
The resulting figure is as shown in Figure 58.

: Temperature & velocity vector plot
Example 04: Gravitational driven density currents
Purpose
To calculate the gravity driven flow when a density difference occurred in vertical direction such as falling a heavy liquid from the top.
Creation of calculation grid and setting initial conditions
Create the calculation grid with, [Grid] [Select Algorithm to Create Grid] and then select [Gird Generator for Nays2DV].
Give channel bottom shape parameters as shown in Figure 59. Since the bottom profile data is not not available, select how to set longitudinal bed profile as automatically. If longitudinal bed profile data available select manually and give the data for longitudinal bed profile.

: Channel shape parameters
Give water surface shape parameters and no of grids in vertical direction as shown in Figure 60.

: Bottom and surface parameters
Give background values as shown in Figure 61.

: Background values
For the background values, use 15 for background temperature and 0 for background concentration.
After giving the parameters for all the three main components, create the grid. After the grid creation, it will ask to map the geographic data to the grids. Select yes and it will map the conditions to the grids. After giving more conditions later you have to map those again.
Now the initial concentration has to be given in the vertical direction.
For that, add a polygon to initial concentration [Initial Concentration] [Add] [Polygon].
Then draw the polygon as shown in Figure 62.

: Creation of initial concentration
Now draw the polygon in the upper middle area as shown in Figure 63.
Then give the value of initial concentration as 0.03 in this example. You can give your own values.

: Creation of initial concentration
After creating the initial concentration polygon, map it to the grids by , [Grids] [ Attributes Mapping] [Execute]. Then [Attribute Mapping] window will appear and tick on [Initial Concentration] and [OK] as shown in Figure 64.

: Attributes mapping
Now the mapping is finished and it can be checked by ticking on [Grid][Cell Attributes][Initial Concentration].
Save the project [File][Save the Project as .ipro].
Setting the calculation conditions and simulation
The calculation conditions are given with, [Calculation Condition] [Setting]. Then the calculation condition window will appear.
Give computational parameters as shown in Figure 65.

: Computational parameters
Give time and iteration parameters as shown in Figure 66.

: Time and iteration parameters
Give physical parameters as shown in Figure 67.

: Physical parameters
After giving the calculation conditions, [Save and close].
Save the whole project one more time with clicking on save icon and start to run the program by, [Simulation] [Run]. Program will start to run.
When the simulation finished, a dialogue box will appear with the message simulation stopped.
Visualization of results
Now go to icon or [Calculation Result][Open new 2D Post-Processing Window]. The 2D post processing window will appear.
You can tick on object browser for any parameter and adjust the properties by right clicking to visualize.
In this example we will see, [iRIC Zone] [Scaler] [Concentration].
Right click on [Concentration] and select [Property].
[Scaler setting] window will appear. Untick on [Automatic] in value range and give the values for minimum and maximum as shown in Figure 68.

: Scaler setting
You can set the color maps as you like by selecting custom setting.
Adjust the color bar setting (i.e. fonts, position, size of the color bar etc) from the color bar setting tab and adjust the region by region setting tab.
To set the currents movements direction, select [Velocity] in object browser by ticking on [iRIC Zone] [Arrow] and [velocity].
Adjust the sizes of velocity vectors by right clicking on [Arrow] and selecting [Property].
The Figure 69 is the result of the above process.

: Concentration & velocity vector plot
Example 05: Density currents with cosine shaped bottom
Purpose
To calculate the density currents in a cosine shaped bottom tank.
Creation of calculation grid and setting initial conditions
Create the calculation grid using [Grid] [Select Algorithm to Create Grid] and then select [Gird Generator for Nays2DV] in select grid creating algorithm window.
Give channel bottom shape parameters as shown in Figure 70. Since the bottom profile data is not not available, select how to set longitudinal bed profile as automatically. If longitudinal bed profile data available select manually and give the data for longitudinal bed profile location.

: Channel shape parameters
For this example, give bottom shape as perturbed and perturbation shape as cosine curve. Amplitude of the bottom perturbation is 0.025. Unit of amplitude or dune height is actual height in meter. Wave number of bottom shape is 1. Phase lag of bottom shape is 0.
Give water surface sape parameters as as shown in Figure 71.

: Bottom and surface parameters
Give background values as shown in Figure 72.

: Background values
For the background values of temperature and initial concentration, background temperature is 15 and initial concentration is 0.
Now create the grid.
A confirmation message will be asked to map geographic data to the grid. Select yes. However, later have to again map the attributes if new polygons are added etc. Now add the initial concentration, that is different to background initial concentration.
Add a polygon to initial concentration by right clicking on [Initial Concentration] and [Add] [Polygon]. Now draw the polygon as shown in Figure 73. Add the initial concentration value of 0.03.

: Setting Initial concentration
Then, map the initial concentration value to the grid using, [Grid] [Attributes mapping] [Execute] and tick on initial concentration on the attribute mapping window as shown in Figure 74.

: Attributes mapping
Now the initial concentration is mapped to the grid. Now save the project with [File] [Save project as .ipro].
Setting the calculation conditions and simulation
Give the calculation conditions with, [Calculation Condition] [Settings]
Give computational parameters as shown in Figure 75.

: Computational parameters
Give time and iteration parameters as shown in Figure 76.

: Time and iteration parameters
Adjust time parameters as output interval=0.02sec Computation finishing time=20s Time step=0.001 Free surface calculation = yes Relaxation coefficient for free surface computation=0.1 Iteration time for water surface=20
Give physical parameters as shown in Figure 77.

: Physical parameters
After setting the calculation conditions, save the project by clicking on save tab. Now start simulation by, [Simulation] [Run]. Simulation will start and after some time it will finish showing the message the solver finished the calculation.
Visualization of results
Open 2D post processing window by selecting, [Calculation Results] [Open new 2D Post-Processing Window].
Select any parameter in [Object Browser], [iRIC Zone].
In this example select, concentration by ticking on [iRIC Zone] [Scaler] and [Concentration]. Properties of visual figure can be adjusted by right clicking on [Concentration] and selecting [Property].
Adjust the scaler settings as shown in Figure 78.

: Scaler setting .
To set the currents movements direction, select [Velocity] in object browser by ticking on [iRIC Zone] [Arrow] and [Velocity].
Adjust the sizes of velocity vectors by right clicking on [Arrow] and selecting [Property] as shown in Figure 79.

: Arrow setting
The Figure 80 is the result of the above process.

: Concentration & velocity vector plot
