WindLab Tutorial GeorgeDeodatis 1996 Example SimulationPoints: Difference between revisions

From LabRPS Documentation
Jump to navigation Jump to search
(Created page with "{{TutorialInfo |Topic=Wind Simulation Points (George Deodatis, 1996) |Level=Beginner |Time=10 minutes |Author=[https://wiki.labrps.com/User:LabRPS Koffi Daniel] |RPSVersion=0.1.0 or above }} == Introduction == Deodatis (1996) provides a comprehensive method for simulating ergodic wind velocity time histories by modeling the wind as a stationary random process with well-defined statistical properties. His approach is particularly focused on multivariate wind simulation...")
 
 
(6 intermediate revisions by the same user not shown)
Line 9: Line 9:
== Introduction ==  
== Introduction ==  


Deodatis (1996) provides a comprehensive method for simulating ergodic wind velocity time histories by modeling the wind as a stationary random process with well-defined statistical properties. His approach is particularly focused on multivariate wind simulations (i.e., for multiple correlated wind components at different locations in space. These locations where the wind velocity components are considered in space are called '''Simulation Point''' in WindLab. This example is meant to show how a wind simulation points in LabRPS's [[WindLab_Workbench|WindLab Workbench]] looks like in the LabRPS interface and how their coordinates can be visualized. Every computation in LabRPS needs a RPS Feature. Here we rather need a WindLab Feature (RPS Feature) which is should be provided by a plugin.  
Deodatis (1996) provides a comprehensive method for simulating ergodic wind velocity time histories by modeling the wind as a stationary random process with well-defined statistical properties. His approach is particularly focused on multivariate wind simulations (i.e., for multiple correlated wind components at different locations in space. These locations where the wind velocity components are considered in space are called '''Simulation Point''' in WindLab. This example is meant to show how a wind simulation points in LabRPS's [[WindLab_Workbench|WindLab Workbench]] looks like in the LabRPS interface and how their coordinates can be visualized. Every computation in LabRPS needs a RPS Feature. Here we rather need a WindLab Feature (RPS Feature) which should be provided by a plugin.  


== Requirements ==  
== Requirements ==  
Line 24: Line 24:
[[Image:WindLab_Tutorial001_Pic001_WindLab_Activated.png]]
[[Image:WindLab_Tutorial001_Pic001_WindLab_Activated.png]]


According to Deodatis (1996), the simulation points are three in total and their distribution in space does not follow any particular distribution in space. To compute such simulation distribution, the feature [[WindLabPlugin_GeneralDistribution_kfdani|General Distribution]] from the [[WindLab_Plugin|WindLab Plugin]]. Let's install the feature first.
According to Deodatis (1996), the simulation points are three in total and their distribution in space does not follow any particular distribution in space. To compute such simulation distribution, the [[Plugin_WindLab#General_Distribution|General Distribution]] feature from the [[Plugin_WindLab|WindLab Plugin]] can be used. Let's install the feature first.
Go to {{MenuCommand|Tools → [[Image:Std_DlgRPSFeatures.svg|16px]] Feature Manager...}}, select the '''WindLabPlugin''' in the list and click '''Install''' as shown in the following picture.
Go to {{MenuCommand|Tools → [[Image:Std_DlgRPSFeatures.svg|16px]] [[Std_DlgRPSFeatures|RPS Features...]]}}, select the '''WindLabPlugin''' in the list and click '''Install''' as shown in the following picture.


[[Image:WindLab_Tutorial001_Pic002_WindLab_Features_Loaded.png|700px]]
[[Image:WindLab_Tutorial001_Pic002_WindLab_Features_Loaded.png|500px]]


The Feature installation wizard will be launched. Please install the feautre by following the steps as shown in the following pictures:
The Feature installation wizard will be launched. Please install the feautre by following the steps as shown in the following pictures:
Line 35: Line 35:
[[Image:WindLab_Tutorial001_Pic003_WindLab_Wizard_3.png|600px]] [[Image:WindLab_Tutorial001_Pic003_WindLab_Wizard_4.png|600px]]
[[Image:WindLab_Tutorial001_Pic003_WindLab_Wizard_3.png|600px]] [[Image:WindLab_Tutorial001_Pic003_WindLab_Wizard_4.png|600px]]


=== Load the example file ===  
== Create New Feature ==  


* Start LabRPS.
Please follow the following steps to create new WindLab simulation and add new Location distribution feature to it.
* If the Start Workbench is not activated, load it and open the start page.
* Open the example "FemCalculixCantilever3D.FcStd".


[[Image:WindLab_example01_pic11.png|700px]]
# Press the {{Button|[[Image:Std_New.svg|16px]] [[Std_New|New]]}} button to create new document or
#* Select the {{MenuCommand|File → [[Image:Std_New.svg|16px]] New}} option from the menu or
#* Use the keyboard shortcut: {{KEY|Ctrl}}+{{KEY|N}}.
# Press the {{Button|[[Image:WindLab_CreateSimulation.svg|16px]] [[WindLab_CreateSimulation|New Simulation]]}} button to create new WindLab simulation or
#* Select the {{MenuCommand|WindLab → [[Image:WindLab_CreateSimulation.svg|16px]] New Simulation}} option from the menu.
#* This will display the WindLab simulation creation task dialog as follows:


=== Activate the analysis container ===
[[Image:WindLab_Tutorial001_Pic004_WindLab_Sim_Creation_1.png|400px]] [[Image:WindLab_Tutorial001_Pic004_WindLab_Sim_Creation_2.png|400px]] [[Image:WindLab_Tutorial001_Pic004_WindLab_Sim_Creation_3.png|400px]]


* To work with an analysis the analysis has to be activated.
# Press the {{Button|[[Image:WindLab_CreateFeature.svg|16px]] [[WindLab_CreateFeature|Create Feature]]}} button to create new Location Distribution feature or
* In the [[Tree_view|tree view]], double click on the [[Image:WindLab_Analysis.svg|24px]] {{Button|Analysis}},
#* Select the {{MenuCommand|WindLab → [[Image:WindLab_CreateFeature.svg|16px]] Create Feature}} option from the menu.
* or right click on the [[Image:WindLab_Analysis.svg|24px]] {{Button|Analysis}} and choose {{Button|Activate analysis}}.


[[Image:WindLab_example01_pic12.png|700px]]
[[Image:WindLab_Tutorial001_Pic004_WindLab_Sim_Creation_3.png|400px]] [[Image:WindLab_Tutorial001_Pic004_WindLab_Feat_Creation_1.png|400px]] [[Image:WindLab_Tutorial001_Pic004_WindLab_Feat_Creation_2.png|400px]]


=== Analysis container and its objects ===  
== Input Points Coordinates ==  


* If the analysis is activated, LabRPS itself will change the current workbench to WindLab.
We have created a locations distribution (simulation points) feature of type '''General Distribution'''. Now, we have to use the created feature to compute the coordinates of the simulation points. In the [[Tree_view|tree view]], click on the simulationPoints feature, all the properties of this feature will be shown in the [[Property_editor|property editor]]. In the property editor scroll down and find a property named '''Locations'''. Click the {{Button|...}} near that property value to show a the vectors dialog that will allow you to input the coordinates of the three points: Point1(0,0,35), Point2(0,0,40) and Point3(0,0,140). Before inputting the points coordinates, you should first click the {{Button|Table}} button to expand the points list. Note that value input in the LabRPS has default unit depending on the unit system you are using. Here, we are using the default unit system which is the Standard(mm/kg/s/degree). However, the coordinates are kept in metre because the vector dialog does not convert the values. That is why we keep the coordinates in metre as points coordinates outputs are expected in metre in LabRPS.  
* There are at least 5 objects needed to make a static mechanical analysis.
* [[Image:WindLab_Analysis.svg|24px]] analysis container
# [[Image:WindLab_SolverCalculixCxxtools.svg|24px]] a solver
# [[Image:WindLab_MaterialSolid.svg|24px]] a material
# [[Image:WindLab_ConstraintFixed.svg|24px]] a fixed boundary condition
# [[Image:WindLab_ConstraintForce.svg|24px]] a force load
# [[Image:WindLab_WindLabMesh.svg|24px]] a WindLab mesh
* In this example, results [[Image:WindLab_ResultShow.svg|24px|link=WindLab_ResultShow]] are already included as well.


=== Visualizing Results ===
[[Image:WindLab_Tutorial001_Pic005_WindLab_Feat_Locations_1.png|400px]] [[Image:WindLab_Tutorial001_Pic005_WindLab_Feat_Locations_2.png|400px]]


# Be sure the analysis is activated.
==  Showing Results ==
# Be sure the analysis still contains the result object, if not just reload the example file.
# Double click the result object [[Image:WindLab_ResultShow.svg|24px]], or select it and click the [[Image:WindLab_ResultShow.svg|24px]] [[WindLab_ResultShow|Show result]] button in the WindLab toolbar.
# In the task window, choose {{incode|z-Displacement}}. It shows {{incode|-86.93 mm}} in negative z-direction. This makes sense since the force is in negative z-direction as well.
# Activate the check box besides the bottom slider of displacement show.
# The slider can be used to alter the mesh to view the deformation in a simplified manner.
# Choose among the different Result types to view all in the GUI available result types.


[[Image:WindLab_example01_pic13.png|400px]]
Now that everything is ready, you can display the simulation points in table form. Right click on the feature in the [[Tree_view|tree view]] and choose '''Compute Location Array''' in the context menu. The points will be shown as follows.


=== Purging Results ===
[[Image:Deodatis1996WindSimulationPoints.png|1024px]]


# Be sure the analysis is activated.
==  Scripting ==
# To remove the results: select in the icon toolbar the [[Image:WindLab_ResultsPurge.svg|24px]] [[WindLab_ResultsPurge|Purge results]] button.
you can manipulate the created object easily through scripting as follows:
{{Code|code=
# -*- coding: utf-8 -*-
# (c) Koffi Daniel 2024


===  Running the FEA ===
import WindLab
import GeneralToolsGui
import WindLabObjects
from LabRPS import Vector as vec
import LabRPS
import numpy
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D


* In the [[Tree_view|tree view]] double click on the solver object [[Image:WindLab_SolverCalculixCxxtools.svg|24px]].
def compute():
* In the [[Task_panel|task panel]] of the solver object make sure static analysis is selected.
    installResuslt = WindLab.installPlugin("WindLabPlugin")
* Click on {{Button|Write .inp file}} in the same task window. Watch the log window until it prints "write completed."
* Click on {{Button|Run CalculiX}}. Since this is a very small analysis it should take less than a second to run.
* In the text window it should print in green letters "CalculiX done without error!" and in the next line "loading result sets ..."
* You just have finished your first FEA in LabRPS if there has not been any error message.
* Click on {{Button|Close}} in the task window.
* A new result object should be created. You know how to visualize the results already.
* If you get an error message no solver binary or similar when triggering the analysis check [[WindLab_Install|WindLab Install]].


[[Image:WindLab_example01_pic14.png|400px]]
    doc = LabRPS.ActiveDocument
    if not doc:
      doc = LabRPS.newDocument()


=== Running the FEA the fast Way ===  
    # create WindLab simulation called "Simulation"
    sim = WindLabObjects.makeSimulation(doc, "Simulation")
   
    # check if the simulation does really exist
    if not sim:
      LabRPS.Console.PrintError("The simulation does not exist.\n")
      return None
 
    featureType = "General Distribution"
    featureGroup = "Location Distribution"
 
    # create the feature and add it to the existing simulation (you may refer to the WindLab Workbench page in
    # case you don't understand the next line)
    genSimPoints= WindLabObjects.makeFeature("MyNewFeature", sim.Name, featureType, featureGroup)
   
    # check if the created feature is good
    if not genSimPoints:
      LabRPS.Console.PrintError("Error on creating the uniform points feature.\n")
      return None


* In tree view select the solver object [[Image:WindLab_SolverCalculixCxxtools.svg|24px]] of the analysis [[Image:WindLab_Analysis.svg|24px]].
    # create the simulation points by their coordinates
* In the icon toolbar click on [[Image:WindLab_SolverRun.svg|24px]] [[WindLab_SolverRun|Run solver calculations]].
    v1 = vec(0, 0, 35)
* The Calculix input file will be written, CalculiX will be triggered and the result object should be created.
    v2 = vec(0, 0, 40)
    v3 = vec(0, 0, 140)


===  Changing Load Direction and Load Value ===
    # add the points to the locations
    genSimPoints.Locations = [v1, v2, v3]


* In the [[Tree_view|tree view]] expand [[Image:WindLab_ResultShow.svg|24px]] CCX_Results and select the [[Image:WindLab_MeshResult.svg|24px]] ResultMesh object and press the {{KEY|Space}} key.
    # compute the simulation points coordinates. WindLab will internally use the "genSimPoints" feature
** '''Result:''' The visibility of the WindLab mesh will be turned off. The geometrical model is still visible.
    simPoints = sim.computeLocationCoordinateMatrixP3()
* In the [[Tree_view|tree view]] double click on the [[Image:WindLab_ConstraintForce.svg|24px]] WindLabConstraintForce object to open its [[Task_panel|task panel]]
* In the task window change the load value to '''500000000 N = 500 MN''' ('''Note:''' force unit in task window has to be in N)
* On the geometrical model click on one of the long edges in x-direction.
* Click on the {{Button|Direction}} button.
** '''Result:''' The red arrows that illustrate force will change their direction in x-direction. They indicate the force direction.
* Since tension should be applied to the box the Reverse Direction needs to be triggered by clicking on it.
* The red arrows of the force will change their direction.
* Click on {{Button|OK}} in task window.


[[Image:WindLab_example01_pic15.png|700px]]
    # now you can convert the coordinate matrix to numpy array and use it for any other purposes
    arr = numpy.asarray(simPoints)


* You know how to trigger an analysis and how to visualize results already.
    # Example 3D points
* The deformation in x-direction should be 18.95 mm.
    x = arr[:,1]
    y = arr[:,2]
    z = arr[:,3]


[[Image:WindLab_example01_pic16.png|400px]]
    # you can also show the result in a table, pass False as last argument to the function to ask
    # LabRPS to only show the data without plotting them
    GeneralToolsGui.GeneralToolsPyTool.showArray(sim.getSimulationData().numberOfSpatialPosition, 4, simPoints, False)
 
    # Create a figure
    fig = plt.figure()
 
    # Add 3D axes
    ax = fig.add_subplot(111, projection='3d')
 
    # Plot points
    ax.scatter(x, y, z, color='blue')
 
    # Hide all axes and labels
    ax.set_axis_off()
 
    # Set the title
    ax.set_title('3D Plotting of Points')
 
    # Show the plot
    plt.show()
 
compute()
 
}}
 
you can find the entire scripting for this tutorial [[Macro_Deodatis_1996_Wind_Simulation_Points|here]].


==  What next? ==  
==  What next? ==  


* We are now finished with the basic workflow for the [[WindLab_Workbench|WindLab Workbench]].
* We are now finished with the basic workflow for the [[WindLab_Workbench|WindLab Workbench]] feature creation.
* You are now prepared to do the second [[WindLab_tutorial|WindLab tutorial]].
* You are now prepared to do the second [[WindLab_Tutorial_GeorgeDeodatis_1996_Example_MeanWindProfile|WindLab tutorial]].
* We will create the CalculiX cantilever by ourselves and compare the results with the beam theory.
* We will create mean wind profile that will use the simulation points coordinates created in this tutorial.


{{WindLab Tools navi}}
{{WindLab Tools navi}}
{{Userdocnavi}}
{{Userdocnavi}}

Latest revision as of 20:20, 17 January 2025

Labrps.svg Tutorial
Topic
Wind Simulation Points (George Deodatis, 1996)
Level
Beginner
Time to complete
10 minutes
Authors
Koffi Daniel
LabRPS version
0.1.0 or above
Example files
None
See also
None

Introduction

Deodatis (1996) provides a comprehensive method for simulating ergodic wind velocity time histories by modeling the wind as a stationary random process with well-defined statistical properties. His approach is particularly focused on multivariate wind simulations (i.e., for multiple correlated wind components at different locations in space. These locations where the wind velocity components are considered in space are called Simulation Point in WindLab. This example is meant to show how a wind simulation points in LabRPS's WindLab Workbench looks like in the LabRPS interface and how their coordinates can be visualized. Every computation in LabRPS needs a RPS Feature. Here we rather need a WindLab Feature (RPS Feature) which should be provided by a plugin.

Requirements

  • A compatible version of LabRPS designated in the tutorial overview.
    Use the Help → About LabRPS to see the version of LabRPS installed.
  • No external software is needed for the computation of the locations coordinates as well as for visualizing the results.
  • Install the plugin that will provide the feature for the computation of the locations coordinates.

Plugin Installation

The first step is to start LabRPS by double-cliking its icon. Then active the WindLab workbench as shown in the following picture. Note that plugins are loaded according to the active workbench. If you do not activate the WindLab workbench, no wind velocity related plugin will be loaded.

WindLab Tutorial001 Pic001 WindLab Activated.png

According to Deodatis (1996), the simulation points are three in total and their distribution in space does not follow any particular distribution in space. To compute such simulation distribution, the General Distribution feature from the WindLab Plugin can be used. Let's install the feature first. Go to Tools → Std DlgRPSFeatures.svg RPS Features..., select the WindLabPlugin in the list and click Install as shown in the following picture.

WindLab Tutorial001 Pic002 WindLab Features Loaded.png

The Feature installation wizard will be launched. Please install the feautre by following the steps as shown in the following pictures:

WindLab Tutorial001 Pic003 WindLab Wizard 1.png WindLab Tutorial001 Pic003 WindLab Wizard 2.png

WindLab Tutorial001 Pic003 WindLab Wizard 3.png WindLab Tutorial001 Pic003 WindLab Wizard 4.png

Create New Feature

Please follow the following steps to create new WindLab simulation and add new Location distribution feature to it.

  1. Press the Std New.svg New button to create new document or
    • Select the File → Std New.svg New option from the menu or
    • Use the keyboard shortcut: Ctrl+N.
  2. Press the WindLab CreateSimulation.svg New Simulation button to create new WindLab simulation or
    • Select the WindLab → WindLab CreateSimulation.svg New Simulation option from the menu.
    • This will display the WindLab simulation creation task dialog as follows:

WindLab Tutorial001 Pic004 WindLab Sim Creation 1.png WindLab Tutorial001 Pic004 WindLab Sim Creation 2.png WindLab Tutorial001 Pic004 WindLab Sim Creation 3.png

  1. Press the WindLab CreateFeature.svg Create Feature button to create new Location Distribution feature or
    • Select the WindLab → WindLab CreateFeature.svg Create Feature option from the menu.

WindLab Tutorial001 Pic004 WindLab Sim Creation 3.png WindLab Tutorial001 Pic004 WindLab Feat Creation 1.png WindLab Tutorial001 Pic004 WindLab Feat Creation 2.png

Input Points Coordinates

We have created a locations distribution (simulation points) feature of type General Distribution. Now, we have to use the created feature to compute the coordinates of the simulation points. In the tree view, click on the simulationPoints feature, all the properties of this feature will be shown in the property editor. In the property editor scroll down and find a property named Locations. Click the ... near that property value to show a the vectors dialog that will allow you to input the coordinates of the three points: Point1(0,0,35), Point2(0,0,40) and Point3(0,0,140). Before inputting the points coordinates, you should first click the Table button to expand the points list. Note that value input in the LabRPS has default unit depending on the unit system you are using. Here, we are using the default unit system which is the Standard(mm/kg/s/degree). However, the coordinates are kept in metre because the vector dialog does not convert the values. That is why we keep the coordinates in metre as points coordinates outputs are expected in metre in LabRPS.

WindLab Tutorial001 Pic005 WindLab Feat Locations 1.png WindLab Tutorial001 Pic005 WindLab Feat Locations 2.png

Showing Results

Now that everything is ready, you can display the simulation points in table form. Right click on the feature in the tree view and choose Compute Location Array in the context menu. The points will be shown as follows.

Deodatis1996WindSimulationPoints.png

Scripting

you can manipulate the created object easily through scripting as follows:

# -*- coding: utf-8 -*-
# (c) Koffi Daniel 2024

import WindLab
import GeneralToolsGui
import WindLabObjects
from LabRPS import Vector as vec
import LabRPS
import numpy
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

def compute():
    installResuslt = WindLab.installPlugin("WindLabPlugin")

    doc = LabRPS.ActiveDocument
    if not doc:
       doc = LabRPS.newDocument()

    # create WindLab simulation called "Simulation"
    sim = WindLabObjects.makeSimulation(doc, "Simulation")
    
    # check if the simulation does really exist
    if not sim:
       LabRPS.Console.PrintError("The simulation does not exist.\n")
       return None 
  
    featureType = "General Distribution"
    featureGroup = "Location Distribution"
  
    # create the feature and add it to the existing simulation (you may refer to the WindLab Workbench page in 
    # case you don't understand the next line)
    genSimPoints= WindLabObjects.makeFeature("MyNewFeature", sim.Name, featureType, featureGroup)
    
    # check if the created feature is good
    if not genSimPoints:
       LabRPS.Console.PrintError("Error on creating the uniform points feature.\n")
       return None

    # create the simulation points by their coordinates
    v1 = vec(0, 0, 35)
    v2 = vec(0, 0, 40)
    v3 = vec(0, 0, 140)

    # add the points to the locations
    genSimPoints.Locations = [v1, v2, v3]

    # compute the simulation points coordinates. WindLab will internally use the "genSimPoints" feature
    simPoints = sim.computeLocationCoordinateMatrixP3()

    # now you can convert the coordinate matrix to numpy array and use it for any other purposes
    arr = numpy.asarray(simPoints)

    # Example 3D points
    x = arr[:,1]
    y = arr[:,2]
    z = arr[:,3]

    # you can also show the result in a table, pass False as last argument to the function to ask 
    # LabRPS to only show the data without plotting them
    GeneralToolsGui.GeneralToolsPyTool.showArray(sim.getSimulationData().numberOfSpatialPosition, 4, simPoints, False)

    # Create a figure
    fig = plt.figure()

    # Add 3D axes
    ax = fig.add_subplot(111, projection='3d')

    # Plot points
    ax.scatter(x, y, z, color='blue')

    # Hide all axes and labels
    ax.set_axis_off()

    # Set the title
    ax.set_title('3D Plotting of Points')

    # Show the plot
    plt.show()

compute()

you can find the entire scripting for this tutorial here.

What next?

  • We are now finished with the basic workflow for the WindLab Workbench feature creation.
  • You are now prepared to do the second WindLab tutorial.
  • We will create mean wind profile that will use the simulation points coordinates created in this tutorial.