Skip to content

Commit

Permalink
Merge pull request #117 from JustinBonus/master
Browse files Browse the repository at this point in the history
Update examples, reintroduce standardEDP for simplicity, prep for simple EVT
  • Loading branch information
fmckenna authored May 14, 2024
2 parents d9eeae7 + d425d50 commit 6c45418
Show file tree
Hide file tree
Showing 10 changed files with 199 additions and 97 deletions.
24 changes: 19 additions & 5 deletions EDP/HydroEDP_Selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include <QPushButton>
#include <SectionTitle.h>


#include <StandardEDP.h>
#include <StandardHydroEDP.h>
#include <StandardTsunamiEDP.h>
#include <StandardStormSurgeEDP.h>
Expand All @@ -80,17 +82,18 @@ HydroEDP_Selection::HydroEDP_Selection(QWidget *parent)

edpSelection = new QComboBox();
edpSelection->addItem(tr("Standard Hydro"));
edpSelection->addItem(tr("User Defined"));
edpSelection->addItem(tr("Standard Tsunami"));
edpSelection->addItem(tr("Standard Storm Surge"));
edpSelection->addItem(tr("User Defined"));
edpSelection->addItem(tr("Standard"));
edpSelection->setObjectName("EDPSelectionComboBox");

// edpSelection->setItemData(1, "A Seismic event using Seismic Hazard Analysis and Record Selection/Scaling", Qt::ToolTipRole);
edpSelection->setItemData(0, "A general hydrodynamic event with measurement of common engineering demand parameters (EDPs).", Qt::ToolTipRole);
edpSelection->setItemData(1, "A tsunami event with measurement of established tsunami demand parameters (EDPs) for coastal structures (e.g. residential, commercial).", Qt::ToolTipRole);
edpSelection->setItemData(2, "A hurricane storm surge event with measurement of established hydrodynamic storm surge demand parameters (EDPs) for affected structures (e.g. residential, commercial).", Qt::ToolTipRole);
edpSelection->setItemData(3, "User-defined selection of engineering demand parameters (EDPs) for custom workflows.", Qt::ToolTipRole);

edpSelection->setItemData(4, "A general event with measurement of common (earthquake) engineering demand parameters (EDPs).", Qt::ToolTipRole);
theSelectionLayout->addWidget(label);
theSelectionLayout->addWidget(edpSelection);
theSelectionLayout->addStretch();
Expand All @@ -110,15 +113,18 @@ HydroEDP_Selection::HydroEDP_Selection(QWidget *parent)
theStandardTsunamiEDPs = new StandardTsunamiEDP();
theStandardStormSurgeEDPs = new StandardStormSurgeEDP();
theUserDefinedEDPs = new UserDefinedEDP();
theStandardEDPs = new StandardEDP();

theStackedWidget->addWidget(theStandardHydroEDPs);
theStackedWidget->addWidget(theStandardTsunamiEDPs);
theStackedWidget->addWidget(theStandardStormSurgeEDPs);
theStackedWidget->addWidget(theUserDefinedEDPs);
theStackedWidget->addWidget(theStandardEDPs);
theStackedWidget->setCurrentIndex(4);
layout->addWidget(theStackedWidget);
this->setLayout(layout);

theCurrentEDP=theStandardHydroEDPs;
theCurrentEDP=theStandardEDPs;

connect(edpSelection, SIGNAL(currentIndexChanged(QString)), this,
SLOT(edpSelectionChanged(QString)));
Expand Down Expand Up @@ -169,14 +175,19 @@ void HydroEDP_Selection::edpSelectionChanged(const QString &arg1)
theStackedWidget->setCurrentIndex(2);
theCurrentEDP = theStandardStormSurgeEDPs;
}

else if(arg1 == "User Defined" || arg1 == "UserDefinedEDP") {
theStackedWidget->setCurrentIndex(3);
theCurrentEDP = theUserDefinedEDPs;
}
else if (arg1 == "Standard" || arg1 == "StandardEDP") {
theStackedWidget->setCurrentIndex(4);
theCurrentEDP = theStandardEDPs;
}
else {
qDebug() << "ERROR .. HydroEDP_Selection selection .. type unknown: " << arg1;
}


}

bool
Expand Down Expand Up @@ -217,7 +228,10 @@ HydroEDP_Selection::inputAppDataFromJSON(QJsonObject &jsonObject)
} else if ((type == QString("UserDefinedEDP")) ||
(type == QString("User Defined EDPs"))) {
index = 3;
}
} else if ((type == QString("StandardEDP")) ||
(type == QString("Standard EDPs"))) {
index = 4;
}
else {
errorMessage("HydroEDP_Selection - no valid type found");
return false;
Expand Down
2 changes: 2 additions & 0 deletions EDP/HydroEDP_Selection.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include <QVector>
class QComboBox;
class QStackedWidget;
class StandardEDP;
class UserDefinedApplication;
class StandardHydroEDP;
class StandardTsunamiEDP;
Expand Down Expand Up @@ -75,6 +76,7 @@ public slots:
QStackedWidget *theStackedWidget;
SimCenterAppWidget *theCurrentEDP;

SimCenterAppWidget *theStandardEDPs;
SimCenterAppWidget *theStandardHydroEDPs;
SimCenterAppWidget *theStandardTsunamiEDPs;
SimCenterAppWidget *theStandardStormSurgeEDPs;
Expand Down
Empty file.
Empty file.
46 changes: 29 additions & 17 deletions Examples/hdro-0001/README.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
.. _hdro-0001:

Coupled Digital Twin Example
============================
=============================================================
Multi-Story Shear Building - Coupled CFD-FEM Digital Twin
=============================================================

+---------------+----------------------------------------------------------------+
| Problem files | :github:`HydroUQ Github Repository<Examples/hdro-0001/>` |
+---------------+----------------------------------------------------------------+

.. _hdro-0001-overview:

Overview
-------
--------
This example uses a NHERI wave-flume digital twin, the ``OSU LWF``, to simulate a scaled structure during wave loading in ``HydroUQ``. Two-way coupled OpenFOAM-OpenSees is configured to simulate the scenario.

You will define a Waterborne Event (**EVT**) to determine the engineering demand parameters (**EDP**) on a specified structure, i.e. **EVT** --> **EDP**, with the following steps:
Expand All @@ -22,8 +25,11 @@ You will define a Waterborne Event (**EVT**) to determine the engineering demand
#. Finally, recieve engineering demand parameters (**EDP**) of the structural response. Though beyond this example, you can use these EDPs to perform a fragility analysis of the structure.


Data
----
.. _hdro-0001-setup:

Set-Up
------

The dataset in this example originates from experimental tests conducted in the Hinsdale Wave Research Laboratory's Large Wave Flume at Oregon State University (``OSU LWF``), Corvallis, in 2020. Refer to Lewis 2023 [Lewis2023]_ and Bonus 2023 [Bonus2023]_ for details.

.. _figCoupled:
Expand All @@ -36,23 +42,23 @@ The dataset in this example originates from experimental tests conducted in the
Coupled Digital Twin Illustration

Model
-----
^^^^^

This model is characterized by the parameters:

* Youngs modulus :math:`E_0`for elastic behavior

* Initial yield stress and strain hardening ratio :math:`(f_y, b)` for plastic behavior
* Structural weight, :math:`w`, in kN as a random variable with a mean of 100 kN and a standard deviation of 10 kN.


Files required
--------------
^^^^^^^^^^^^^^



.. warning::
**Do NOT** place the files in your ``root``, ``downloads``, or ``desktop`` folder. The running application will copy every unrelated file in the directories and subdirectories multiple times.

UQ workflow
-----------
^^^^^^^^^^^

The inputs needed to run this example can be loaded into the HydroUQ user interface by selecting the ``Coupled Digital Twin`` example from the ``Examples`` menu at the top of the application.

Expand All @@ -71,14 +77,14 @@ The inputs can also be set up manually through the following steps:

#. Next in the **FEM** panel , select **OpenSees** and populate the **Input Script** field by choosing the path to the model file.

.. .. _figHBMFEM:
.. _figHBMFEM:

.. .. figure:: figures/FEM.png
.. :align: center
.. :figclass: align-center
.. :width: 600
.. figure:: figures/FEM.png
:align: center
:figclass: align-center
:width: 600

.. Inputs in the FEM panel
Inputs in the FEM panel

#. Select the **RV** tab from the input panel. This panel should be pre-populated with the names of the variables that were defined in the model scripts. If not, press the **Add** button to create a new field to define the input random variable. Enter the same variable name, as required in the model script. For this example, choose the Normal probability distribution for all the random variables and enter the parameter values for each distribution as shown in the figures below:

Expand Down Expand Up @@ -175,6 +181,12 @@ In addition to the results displayed in the **RES** panel in ``HydroUQ``, JSON f
.. warning::
The ``tmp.SimCenter`` directory is cleared every time the ``RUN`` button is clicked in ``HydroUQ``. So, if you want to restart the analysis using one of the sampling results files outlined above, make sure to copy the results file to a location outside the ``tmp.SimCenter`` directory at the end of the analysis.


.. _hdro-0001-references:

References
----------

.. [Lewis2023]
Lewis, N. (2023). Development of An Open-Source Methodology for Simulation of Civil Engineering Structures Subject to Multi-Hazards. *PhD thesis*, University of Washington, Seattle, WA. ISBN: 979-8-381408-69-0.
Expand Down
Binary file added Examples/hdro-0001/figures/FEM.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6c45418

Please sign in to comment.