Lecture 01: Getting started

In this lecture, we will learn how to get started and work with the Designsafe interface.

About Designsafe

Designsafe-ci is a new cyberinfrastructure for the natural hazards community. Designsafe provides cloud-based tools that support support the analysis, visualization, and integration of diverse data types. They support an end-to-end research workflows, enhance, amplify, and link the capabilities of other NHERI components. The designsafe network is as shown below:

alternate text

Overview of the cyberinfrastructure Designsafe-ci

About OpenFOAM

OpenFOAM (Open Source Field Operation And Manipulation) is a free, open-source software that uses Finite Volume Method to numerically solve differential equations. It is often used for calculation of problems related to fluid mechanics. Today, it is not only used at universities but also widely in the industrial sector.

In a simplistic sense, it is a collection of C++ programs representing the solvers and the utilities used for data manipulation. Along with solvers and utilities, OpenFOAM also has pre-processing and post-processing capabilities that allow setting up of cases, boundary conditions and also visualize the results. The general structure of OpenFOAM is described in the figure below.

alternate text

Generic struction of OpenFOAM

There are four main steps involved while using a CFD software:

  • Pre-processing: This involves preparing the geometry and the computational model. As a part of this, CAD / BIM models are prepared followed by a clean-up process. The CAD / BIM models are prepared by designers to enable the digital-twinning process and includes all the details of the geometry. However, for the CFD simulations, we do not require all the details. For example, if we have a flow around a building, then the fluid will not interact with the objects inside the building and these can be stripped off. During the clean-up process, the CAD/BIM models are prepared for the necessary simulation. In other words, the wet-volume is extracted as a part of the clean-up process.

  • Meshing: Here, the geometry is discretized by dividing it into cells. This process of mesh generation and assignment of element types helps us to convert our differential equations (i.e. Navier-Stokes equation) into a matrix equation. In OpenFOAM, this is achieved by two tools, namely blockMesh and snappyHexMesh. We will discuss about these utilities in Lecture 04 and 05 of the beginner series.

  • Solving: Once the geometry has been discretized and problem has been defined (i.e. assignment of boundary conditions), the resulting matrix equations are now solved using linear and nonlinear matrix solvers like conjugate gradient etc. We will briefly mention the solvers in Lecture 02 but discuss more about these in the advanced series of this CFD Notebooks.

  • Post-processing: Once the simulation has completed running, it is necessary to visualize the results and the quantities of interest. In this regard, we will use Paraview as a post-processing tool.

In order to run the siimulations, OpenFOAM uses set of files (called as dictionaries). These dictionaries are arranged in three main folders. We will be discussing all about this in the Lecture 02 of the beginner series.

In this lecture, we will only on learning the process to submit an OpenFOAM job through our Jupyter notebook and opening the result files using Paraview. In the upcoming lectures, we will see various aspects of OpenFOAM and how to modify them.

Jupyter Notebooks

JupyterLab is a web-based interactive development environment for Jupyter notebooks, code, and data. JupyterLab is flexible: configure and arrange the user interface to support a wide range of workflows in data science, scientific computing, and machine learning. JupyterLab is extensible and modular: write plugins that add new components and integrate with existing ones. A Jupyter notebook is an interface that connects to the kernel. The kernel executes the code sent by the user and communicate back its results. This kernel is connected and remains active even if the web browser is closed. Once the notebook is opened again, the web application automatically re-connects to the kernel.

The Jupyter notebooks are made of cells of different types:

  • Markdown cells: These are cells used to write headings, descriptions and comments. These cells do not include python codes that need to be executed. Instead, here a Markdown language is used to define headings, lists, pure HTML and even equations using LaTeX.

  • Code cells: These are cells that include codes that need to be run. The method to execute these codes is by using Shift-Enter. This will execute the code on the kernel and show the output.

Common shortcuts

Some of the common shortcuts include:

  • Execute a run: Shift-Enter. Here the current cell is executed, show outputs (if any) and then moves to the next cell.

  • Execute (in place): Ctrl-Enter. Here, the current cell is executed, show outputs (if any) and continues to be in the same cell. Once the execution is complete, the entire block of code is selected and one can start typing over it to execute the next command. This is a terminal style execution.

  • Execute (and add new cell): Alt-Enter. Here, the current cell is executed, show outputs (if any) and creates a new cell below.

Computing allocations

Designsafe allocates 8000 service units (SU) for computing and 50GB of storage space. 8000 SU’s is crudely 8000 hours of cloud-computing time. To be more precise, 1 SU is equivalent to one hour of wall clock time on a single processor core of time used. The computing times are calculated for all computations run through the Workspace, through Jupyter notebooks or even direct CLI.

Additional allocations

An additional Allocation on DesignSafe is headed by a project PI, who can be

  • NSF Graduate Student Researcher Fellows

  • Research staff employed by federal agencies or non-NSF FFRDCs

  • State educational offices or organizations and local school districts, a teacher or educator at an accredited public or private K-12 school in the USA

  • Independent museums, observatories, libraries, research laboratories, professional societies and similar organizations in the United States that are directly associated with educational or research activities in the USA

  • U.S. commerial organizations, especially small businesses with strong capabilities in scientific or engineering research or education may apply for an allocation

One can request for additional computing allocations by raising a help ticket through the designsafe portal. Please include:

  • Information about the eligibility of the requestor

  • A description of the research to be performed

  • Sources of support

  • Justification for the number of SUs requested.