Civil Engineer's Forum-FORUM8
Set this page as your homepage QR

Facebook - FORUM8

Twitter - FORUM8

instagram - FORUM8

YouTube - FORUM8

 Sitemap | Terms of Service | Inquiries | English translation site | Japanese | English | Korean | Vietnam | Francais

10
xpswmm, microsimulation
The xpswmm plugin uses OpenGL to display the analysis results of xpswmm, which performs outflow and flood simulation analyses, step by step in time series. Additionally, the micro-simulation player assigns UC-win/Road 3D models and 3D characters as elements in the simulation, displays the movement of each element, and visualizes the analysis results. This section describes how these components are integrated.
 xpswmm plugin

 This plugin tool imports outflow and flood analysis results from xpswmm into UC-win/Road, allowing for the visualization of flood flow, sewer networks, and internal pipe flows. It enables simulations based on time series data to be displayed within UC-win/Road. While the main xpswmm software includes animation and viewer functions, utilizing UC-win/Road's VR functionality allows for the visualization of calculation results in a virtual reality environment.

■ Figure 1: Mechanism for reproducing character movement

 The following describes how to import the calculation results from xpswmm and use them for drawing in UC-win/Road.

■ Depiction of flooded areas and water depths caused by overflowing rivers
 The system automatically generates maps of flooded areas and water depths based on time series data, covering the entire sequence of hydrological phenomena from the initial flooding (e.g., overflow from sewers) to surface inundation caused by the floodwater, and finally, the return of the floodwater into the sewer system.

 In XPSWMM, the analysis is performed by dividing the analysis area into fine meshes. The software reads files containing water level data at each mesh grid point within the analysis area and displays them with different colors for each water level. If time-series data exists, you can use the toolbar to check the state at each step.

Clicking on an image will display a larger version of the image.
■ Figure 2: Mechanism for reproducing character movement

■ Drawing velocity vectors caused by overflow flow
 It is possible to display the flow velocity and direction of floodwater using a time-series based vector representation [Figure 04]. This allows for a more visually clear understanding of the flow patterns. The time-series analysis results for each grid cell in xpswmm can be read into UC-win/Road, and the average flow velocity at the four corners of each grid is used as the flow velocity at that location. This value is then displayed with an arrow indicating the direction, along with information about the surface flow.

Clicking on an image will display a larger version of the image.
■ Figure 3 shows an example of how flow velocity vectors are depicted in a flood surge

■ Drawing of the sewer network
 It is possible to visualize the layout of the sewer network, which consists of underground pipes and manholes, in a 3D or VR environment [Figure 05]. Using the output function of xpswmm, the manhole (node information) and pipe (link information) data used in the sewer network are read into UC-win/Road, and then displayed using OpenGL's cylinder drawing function.

■ Figure 4: Illustration of flow within the tube

■ Drawing of flow within the pipe
 For the sewer network, it is possible to display time-dependent water surface elevations and flow velocity vectors within the pipes [Figure 06]. The 1D results from xpswmm can be read into UC-win/Road, and water levels corresponding to each section of the sewer network are displayed for each time step. In addition to the water level, the flow velocity within the pipe is optionally represented by arrows whose length corresponds to the set speed.

Clicking on an image will display a larger version of the image.
■ Figure 5: Illustration of flow within the tube


 Key features of XPSWMM

 The plugin includes screens for the XPSWMM toolbar, data import, flood flow options, and sewer network drawing options. Based on these options, the toolbar allows control of time, and each piece of data is displayed on the UCwin/Road platform.

■ Toolbar
 When the plugin is loaded, a toolbar for XPSWMM appears on the main screen [Figure 07]. This toolbar allows you to load analysis result files generated by XPSWMM and control simulations (including setting time parameters, running animations, and stopping).

■ Figure 6: Toolbar

■ Analysis Result Import Screen
Select the corresponding surface flow, sewer network, and pipe flow data and load it into the current UC-win/Road project [Figure 08]. Simultaneously with loading, the coordinate information of xpswmm is linked to the coordinate information of UC-win/Road.

Clicking on an image will display a larger version of the image.
■ Figure 7: Analysis Result Import Screen

■ Flood Flow Drawing Options Screen
 This section allows you to configure settings for displaying analysis results related to surface flow within UC-win/Road, including methods for visualizing the data.

Clicking on an image will display a larger version of the image.
■ Figure 8: Flood flow drawing options screen

■ Internal Flow Visualization Options
 This section allows you to configure settings such as how to display water flow within manholes and pipes using UC-win/Road.

Clicking on an image will display a larger version of the image.
■ Figure 9: Flow visualization options screen


 Key points for plugin development

 Here, we will introduce some key points to consider when developing the XPSWMM plugin.

■ Adding and removing toolbars
 To add a toolbar to the main screen, use IF8Application.mianForm.AddToolbar(). Define a TForm that includes a TToolbar, and then use the interface above to add the toolbar as a plugin to the main screen. Toolbars added by plugins can be removed using IF8Application.mianForm.RemoveToolbar() when they are no longer needed, such as when the plugin is uninstalled
I will do it.

Clicking on an image will display a larger version of the image.
■ Figure 10: An example of a TForm

// Adding toolbars
var
   toobarForm: TForm; // This refers to the form where the TToolbar control is placed.
begin
ApplicationService.mainForm.AddToolBar(toolbarForm.toolbar,'ToolbarName');
end;
// Remove toolbar
var
   toobarForm: TForm; // This refers to the form where the TToolbar control is placed.
begin
ApplicationService.mainForm.RemoveToolbar(toolbarForm.toolbar);
end;

■ Drawing Meshes
 The drawing of meshes, such as surface flow, is performed using IF8OpenGL.PaintScene. Because there are thousands or even tens of thousands of grid points, all the information is pre-compiled into an array, and it is drawn using glDrawElement (see note 3), which utilizes OpenGL's vertex arrays. The following is a snippet of the source code; for more details, please refer to separate OpenGL documentation.

var
   color_array : array of GLPointType;
   vertex_array : array of GLPointType;
begin
// Setting the array for vertex colors
SetLength(color_array, numberOfPoint);
color_array[0] := ….
color_array[1] := ….
...
color_array[n] := ….
// Setting the array of vertex coordinates
SetLength(vertex_array,numberOfPoint);
vertex_array[0] := …
vertex_array[1] := …
...
vertex_array[n] := …
// Add vertex array colors
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(3,GL_FLOAT, 0, @(color_array[0]));
// Add vertex array coordinates
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, @(vertex_array[0]);
// Calling drawing functions
glDrawElements(GL_QUADS, HIGH(vertex_array)*4, GL_
UNSIGNED_INT, @(vertex_array[0]));
end;

■ Contact Drawing
 When you set colors for the vertices of a polygon, it becomes possible to display color gradients within the polygon.


 The OpenGL source code related to this figure is as follows:

glClear(GL_COLOR_BUUFER_LIST);
glShadeModel(GL_SMOOTH);
glDisable(GL_CULL_FACE);
glDisable(GL_LIGHTING);
glBegin(GL_TRIANGLES);
   glNormal3f(0,0,1);
   glColor3f(1.0,0,0);
   // Set the color of the bottom-left vertex to red
   glVertex3f(-10,0,0);
   glColor3f(0,1.0,0);
   // Set the color of the bottom-right vertex to green
   glVertex3f(10,0,0);
   glColor3f(0,1.0,0);
   // Set the color of the top vertex to blue
   glVertex3f(0,10,0);
glEnd;
glEnable(GL_LIGHTING);
glEnable(GL_CULL_FACE);

 This plugin uses vertex arrays, and by using `glColorpointer()` to color-code based on water level elevation, it enables the display of a gradient representing the overall water level difference across the analysis area. The color settings for the water level differences are configured in the options screen.


 Integration with micro-simulation results

 UC-win/Road includes a micro-simulation player, which is a tool for visualizing the results of micro-simulations. It visualizes analysis results by assigning 3D models and 3D characters from UC-win/Road to simulation elements and displaying the movement of each element. To easily link with these analysis results, an OpenMicroSim file format based on XML is provided. This chapter introduces examples of algorithms for converting data to the OpenMicroSim format.

■OpenMicroSim
 OpenMicroSim allows the main program to handle the conversion of simulation results between software programs. For example, OpenMicroSim can be used to convert data from one simulation software "A" to another simulation software "B," where the results from "A" need to be considered in "B." Additionally, it enables applications that export simulation results as visualization tools.

 OpenMicroSim specifies a data structure for recording entity expansions. This data structure aims to maintain a flexible data format that can record all types of simulations. 

 OpenMicroSim provides a data structure that allows for the storage of multiple attributes for each element. In particular, the "type" attribute of an element is essential information when assigning a 3D model in the microsimulation player. The information for each element is associated with time, and essentially, the time history of the state of each element is stored. It is possible to store position, orientation, and free attributes as the state of an element. Since simulation results are expressed over time, time and location information are essential pieces of data. Several tags and attributes within OpenMicroSim can be used in the microsimulation player. Please pay attention to the following items when creating files.

● Simulation
Units: Defines each unit used within the simulation data. Length, time, and angle units can be selected using the metric system.

• Element State
Time (time attribute): The time attribute is used to define the state during playback. (Location tag): Location tags are used for positioning and updating the location of objects.
(Direction tag): Direction tags define 3 angles that indicate the orientation of an object within a scene. In UC-win/Road, 0 is the default value. The yaw angle corresponds to the Y-axis.
Transition (position interpolation method tag): Defines the method used to interpolate the position based on the preceding and subsequent states when the state of an element is not defined at a specific time during playback.

● The concept of frames
 OpenMicroSim files contain a tag called "frame."
In a single frame, simulation results from 1 time to another are saved. It is possible to save the entire simulation in a single frame, or to divide it into several frames. For example, if you have a simulation that calculates data every 0.5 seconds and save it with frames of 0.5-second intervals, the data will be stored chronologically within the file.
 Within a single frame, data is arranged element by element. Therefore, when saving a simulation in a single frame, all information for each element must be held in memory, and the file should be saved after the simulation is complete. Using multiple frames allows you to save intermediate results of the simulation to a file, so for long simulations, using multiple frames can reduce the required memory capacity.

// XML header
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Simulations> 
// List of simulations; in this example, there is 1 simulation
   <Simulation Name="UC-win/Road Micro Simulation Sample" Length="120">
     // Simulation header
   <Units AngularUnit="Radian" LengthUnit="Meter"TimeUnit="Second" />
     // Definitions of units used in the simulation
   <Frames>
     // A list of simulation frames. Frames are saved every 10 seconds
    <Frame Time="0" Length="10"> // Header for the first frame
      <FixedElmt ID="8403" Type="Traffic Light"Description="Traffic Light with Pole">
         // Definition of static elements; in this case, traffic lights.

   <St T="0.02" Val="Green">
        // Definition of the initial state: the color of the signal is blue.
       7661.93 2232.91 130.34 // Location information
       0. 82 0 0 // Direction
   </St>

   <St T="9.36" Val="Yellow">
        // The next state (state update) indicates that the traffic light color is yellow.
      7661.93 2232.91 130.34 // Location information
      0. 82 0 0 // Direction
   </St>
  </FixedElmt>
   <MovingElmt Mesh3D="Coupe.rm" ID="1963903"Type="Coupe" Description="Coupe">
      // Definition of the moving element; in this case, it's a car called "Coupe."
   <St T="0.07">
      // Defines the initial state, starting at 0.07 seconds.
    8412.27 1576.78 139.83 // Location information
    -2.52 0.01 -0.00 // Direction
   </St>

   <St T="0.60">
      // Update the state; here, we only update the attitude information.
   8411.69 1575.92 139.82 // Location information
   -2.53 0.00 -0.00 // Direction
  </St>

  // Update the state
   8411.10 1575.04 139.81 // Location information
   -2.53 0.00 -0.00 // Direction
  </St>

  <...省略...>
</MovingElmt>
</Frame>
<Frame Time="10" Length="10">

<...省略...>
</Frame>

<...省略...>
</Frames>
</Simulation>
</Simulations>


Announcement of paid seminars
 UC-win/Road SDK seminar
• Date and time November 6, 2012 (Tuesday), 9:30 AM to 2:30 PM
• Course fees For 1 person: ¥18,000 (excluding tax)
• This venue FORUM8 Tokyo headquarters, GT Tower seminar room
※TV conferencing systemThe event will be held simultaneously in Tokyo, Osaka, Nagoya, Fukuoka, and Sendai

     
Previous page    Index    Next page
(Featured in the Autumn issue of Up&Coming '12)
Go back
Up&Coming

FORUM8


Contact information




■ [User Introductions]
sugiko Corporation, Technical Sales Department
Scaffolding Safety Consulting Department

Mie University, Graduate School of Engineering
Seika Digital Image Co., Ltd.
Infranet Co., Ltd.






>> Product comprehensive catalog


>> Premium membership services
>> Financial support

Recently released products
■ Electrical Media Delivery Support Tool Version 19
■ Retaining wall design, 3D reinforcement detailing, Version 26
■ Bridge Maintenance Plan System Version 7
■ Calculation for concrete slab placement (compliant with R7/H29 road standards), Version 2

Campaign in progress
■ Within 2 years of release, enjoy a 30% discount plus 30,000 FPB points back
■ Smart download
■ Design Festival 2026, exclusive for visitors
■ Drone school discount

Seminar and event calendar
Upcoming seminars
11/26  Metavernia F8 VPS experience
11/27  Introduction to Structural Analysis
12/2  Engineer programming
  Introduction to yoga experience
12/3  DesignBuilder experience
12/4  Reinforced concrete foundation

Software/Support Services
VR software(Virtual reality)
《UC-win series》
Road simulator
• Driving simulator
• Micro-simulation
Evacuation analysis and simulation
>> Other VR software
FEM analysis software
・3-dimensional plate dynamic nonlinear analysis
・2-dimensional dynamic nonlinear analysis
・A comprehensive finite element analysis system
>> Other FEM analysis software
Civil engineering, architecture, and design software
《UC-1 Series》
・Structural analysis/cross-section
Bridge superstructure
・Bridge substructure components
Foundation work
Temporary construction
Road construction and earthworks
・Harbors
・Hydraulic engineering
・Subsurface investigation and analysis
・CAD/CIM systems, construction accounting
• Maintenance and management, earthquake risk
Architecture
・Ships/Evacuation
>> Other civil engineering, construction, and design software
Cloud
《Supercomputer Cloud®》
・Supercomputer cloud services
《VR-Cloud®》
・Real-time VR system
Analytical support services/support
・UC-win/Road support system
・Design verification support service
・Engineer's Studio® analysis support
・Ground investigation analysis support services
・EXODUS/SMARTFIRE analysis support
・XPSWMM analysis support services
Building energy simulation
• 3D laser scanning and modeling
・3D modeling services
• 3D report and drawing services
>> Other support services
Various solutions
Seismic resistance assessment/analysis
・Design of steel bridges
・New bridge construction methods
Architectural design
・Local governments
・Medical VR systems
・Parking solutions
・ECO solutions
>> Other solutions