Category Archives: Molecular Workbench

Complete undo/redo support in Energy2D

In Version 2.3 of Energy2D, I have added full support of undo/redo for most actions. With this feature, you can undo all the way back to your starting point and redo all the way forward to your latest state. This is not only a must-have feature for a design tool with a reasonable degree of complexity, but also a simple -- yet powerful -- mechanism for reliably collecting very fine-grained data for understanding how a user interacts with the software.

Why are we interested in collecting these action data?

From the perspective of software engineering, these action data provide first-hand information for quality assurance (QA). QA engineers can analyze these data to measure the usability of the software, to identify behavior patterns of users, and to track results from version to version to gauge if an adjustment has led to better user experience.

From the perspective of education and training, these action data encode users' cognitive processes. Any interaction with the software, especially with a piece of highly visual and responsive software like Energy2D, is automatically a process of cognition. A fundamental thesis in learning science is to understand how we can design interactive materials that maximize learning for all students. These precious fine-grained action data may hold an important key to that understanding.

This idea of using the stack of actions stored in the undo manager of a piece of software to record and replay the entire process of interaction is a unique feature that has been implemented in our Energy2D and Energy3D software and proven a non-obtrusive, high-fidelity, and low-bandwidth technique for data collection.

Energy2D video tutorials in English and Spanish

Many users asked if there is any good tutorial of Energy2D. I apologize for the lack of a User Manual and other tutorial materials (I am just too busy to set aside time for writing up some good documentations).


So Carmen Trudell, an architect who currently teaches at the School of Architecture of the University of Virginia, decided to make a video tutorial of Energy2D for her students. It turned out to be an excellent overview of what the software is capable of doing in terms of illustrating some basic concepts related to heat transfer in architectural engineering. She also kindly granted permission for us to publish her video on Energy2D's website so that other users can benefit from her work.

If you happen to come from the Spanish-speaking part of the world, there is also a Spanish video tutorial made by Gabriel Concha based on an earlier version of Energy2D.

Comparing two smartphone-based infrared cameras

Figure 1
With the releases of two competitively priced IR cameras for smartphones, the year 2014 has become a milestone for IR imaging. Early in 2014, FLIR unveiled the $349 FLIR ONE, the first IR camera that can be attached to an iPhone. Months later, a startup company Seek Thermal released a $199 IR camera that has an even higher resolution and is attachable to most smartphones. In addition, another company Therm-App released an Android mobile thermal camera that specializes in long-range night vision and high-resolution thermography, priced at $1,600. The race is on... Into 2015, FLIR announced a new version of FLIR ONE that supports both Android and iOS and will probably be even more aggressively priced.

Figure 2
All these game changers can take impressive IR images just like taking conventional photos and record IR videos just like recording conventional videos, and then share them online through an app. The companies also provide a software developers kit (SDK) for a third party to create apps linked to their cameras. Excited by these new developments, researchers at several Swedish universities and I have embarked an international collaboration towards the vision that IR cameras will one day become as necessary as microscopes in science labs.

Figure3
To test these new IR cameras, I did an easy-to-do experiment (Figure 1) that shows a paradoxical warming effect on a piece of paper placed on top of a cup of (slightly cooler than) room-temperature water. This seemingly simple experiment actually leads to very deep science at the molecular level, as blogged before.

I took images using FLIR ONE (Figure 2) and SEEK (Figure 3), respectively. These images are shown to the right for comparison. As you can see, both cameras are sensitive enough to capture the small temperature rise caused by water absorption and condensation underside the paper.

The FLIR ONE has a nice feature that contextualizes the false-color IR image by overlaying it on top of the edges (where brightness changes sharply) of the true-color image taken at the same time by the conventional camera of the smartphone. With this feature, you can see the sharp edges of the paper in Figure 2.

Energy2D recommended in computational fluid dynamics textbook

Computational fluid dynamics (CFD) is an important research method that uses numerical algorithms to solve and analyze problems that involve fluid flows. Computers are used to perform the calculations required to simulate the interaction of liquids and gases with surfaces defined by boundary conditions. Today, almost every branch of engineering rely on CFD simulations for conceptual design and product design.

A recent textbook "Computational Fluid Dynamics, Second Edition: A Practical Approach" by Profs. Jiyuan Tu, Guan Heng Yeoh, and Chaoqun Liu has recommended Energy2D as "Shareware CFD" for beginners. Here is a quote from their excellent book:
"Nevertheless, first-time CFD users may wish to search the Internet to gain immediate access to an interactive CFD code. (Users may be required to register in order to freely access the interactive CFD code.) The website is http://energy.concord.org/energy2d/index.html provides simple CFD flow problems for first time users to solve and allows colorful graphic representation of the computed results."

Happy New Year from Energy2D

In the year 2014, Energy2Dhas incorporated a radiation simulation engine and a particle simulation engine, expanding its modeling capacity and making it a truly multiphysics simulation package. To celebrate the New Year, I made some simulations that demonstrate these multiphysics features using objects shaped after the numbers of 2015.

These simulations feature the fluid dynamics engine, the heat conduction engine, the thermal radiation engine, and the particle dynamics engine. If you are curious enough, you can click this link to run the simulations.


These shapes were drawn using Energy2D's polygon and ring tools, which allow users to create a wide variety of arbitrary 2D shapes. Many users probably do not know how versatile the polygon tool actually is (the original triangle icon on the tool bar probably misleads some to think it is only good for drawing triangles -- so I changed it to look like a cross-section of an I-beam). The polygon tool allows one to easily draw a polygon with maximally 256 control points for adjusting its shape later. One can draw an approximate shape and then drag these control points to get it to the exact shape. To modify a shape even further, one can also insert a control point by double-clicking on an existing point. A new point will be added to the adjacent position, which you can then drag around. To delete a control point, just hold down the SHIFT key while double-clicking on it. In addition, a polygon can be rotated, twisted, compressed, or elongated using the corresponding fields in its property window (there is currently no graphical user interface for doing those things, however).

As for the New Year's resolutions, in 2015, the ring shape will be enhanced into a new tool called the shape subtractor, which allows users to subtract a shape from another to make a hollow one.

On the numerical simulation side, we will continue to improve the accuracy of the existing simulation engines by adding an explicit solver as an option for users to overcome some of the problems related to the implicit solvers.

On the multiphysics modeling side, we will try to support multiple fluids, which seems simple at first glance but has turned out to be a very difficult mathematical problem. With the capacity of multiple fluids, we will also be able to add an electromagnetism solver in order to model effects such as electrorheological fluids (fluids whose viscosity changes with respect to an applied electric field).

We wish all Energy2D users a very successful new year!

European scientists use Energy2D to simulate submarine eruptions

The November issue of the Remote Sensing of Environment published a research article "Magma emission rates from shallow submarine eruptions using airborne thermal imaging" by a team of Spanish scientists in collaboration with Italian and American scientists. The researchers used airborne infrared cameras to monitor the 2011–2012 submarine volcanic eruption at El Hierro, Canary Islands and used our Energy2D software to calculate the heat flux distribution from the sea floor to the sea surface. The two figures in the blog post are from their paper.

According to their paper, "volcanoes are widely spread out over the seabed of our planet, being concentrated mainly along mid-ocean ridges. Due to the depths where this volcanic activity occurs, monitoring submarine volcanic eruptions is a very difficult task." The use of thermal imaging in this research, unfortunately, can only detect temperature distribution on the sea surface. Energy2D simulations turn out to be a complementary tool for understanding the vertical body flow.

Their research was supported by the European Union and assisted by the Spanish Air Force.

Although Energy2D started out as an educational program, we are very pleased to witness that its power has grown to the point that even scientists find it useful in conducting serious scientific research. We are totally thrilled by the publication of the first scientific paper that documents the validity of Energy2D as a research tool and appreciate the efforts of the European scientists in adopting this piece of software in their work.

Beautiful Chemistry


It is hard for students to associate chemistry with beauty. The image of chemistry in schools is mostly linked to something dangerous, dirty, or smelly. Yet Dr. Yan Liang, a collaborator and a materials scientist with a Ph.D. degree from the University of Minnesota, is launching a campaign to change that image. The result of his work is now online at beautifulchemistry.net.

To bring the beauty of chemistry to the general public, Dr. Liang uses 4K UltraHD cameras and special lenses to capture chemical reactions in astonishing detail and advanced computer graphics to render stunning images of molecular structures.

Using the beauty of science to interest students has rarely been taken seriously by educators. The federal government has invested billions of dollars in instructional materials development. But from a layman's point of view, it is hard to imagine how children can be engaged in science if they do not fall in love with it. Beautiful Chemistry represents an attempt that could inspire a whole new genre of high-quality educational materials based on breathtaking scientific visualizations. How about Beautiful Physics and Beautiful Biology?

Our work is well aligned with this vision. Our interactive, visual Energy2D simulations bring a beautiful world of heat and mass flow to students like never seen before; our Energy3D software creates splendid 3D scenes based on scientific calculations; and our infrared visualization of the real world has uncovered a beautiful hidden universe through an IR lens. These materials demonstrate computational and experimental ways to marry science and beauty and have resulted in great enticements in science classrooms.

BTW, Dr. Liang is the artist who designed the splash panes of Energy2D and Energy3D.

Simulating cool roofs with Energy3D

Fig. 1: Solar absorption of colors.
Cool roofs represent a simple solution that can save significant air-conditioning cost and help mitigate the urban heat island effect, especially in hot climates. Nobel Prize winner and former Secretary of Energy Steven Chu is a strong advocate of cool roofs. It was estimated that painting all the roofs and pavements around the world with reflective coatings would be "equivalent to getting 300 millions cars off the road!"

With Version 4.0 of Energy3D (BTW, this version supports 200+ worldwide locations -- with 150+ in the US), you can model cool roofs and evaluate how much energy you can save by switching from a dark-colored roof to a light-colored one. All you need to do is to set the colors of your roofs and other building blocks. Energy3D will automatically assign an albedo value to each building block according to the lightness of its color.

Figure 1 shows five rectangles in different gray colors (upper) and their thermal view (lower). In this thermal view, blue represents low energy absorption, red represents high energy absorption, and the colors in-between represents the energy absorption at the level in-between.

Now let's compare the thermal views of a black roof and a white roof of a cape code house, as shown in Figure 2. To produce Figure 2, the date was set to July 1st, the hottest time of the year in northern hemisphere, and the location was set to Boston.

Fig. 2: Compare dark and white roofs.
How much energy can we save if we switch from a perfectly black roof (100% absorption) to a perfectly white roof (0% absorption)? We can run the Annual Energy Analysis Tool of Energy3D to figure this out in a matter of seconds. The results are shown in Figure 3. Overall, the total yearly energy cost is cut from 6876 kWh to 6217 kWh for this small cape code house, about 10% of saving.

Figure 3 shows that the majority of savings comes from the reduction of AC cost. The reason that the color has no effect on heating in the winter is because the passive solar heat gains through the windows in this well-insulated house is enough to keep it warm during the sunshine hours. So the additional heat absorbed by the black roof in the same period doesn't offset the heating cost (it took me quite a while to figure out that this was not a bug in our code but actually the case in the simulation).

Fig. 3: Compare heating and AC costs (blue is white roof).
Of course, this result depends on other factors such as the U-value and thermal mass of the roof. In general, the better the roof is insulated, the less its color impacts the energy cost. With Energy3D, students can easily explore these design variables.

This new feature, along with others such as the heat flux visualization that we have introduced earlier, represents the increased capacity of Energy3D for performing function design using scientific simulations.

Here is a video that shows the heating effect on roofs of different colors.

Visualization of heat flux in Energy3D using vector fields

Fig. 1: Winter in Boston
One of the strengths of our Energy3D CAD software is its 3D visualizations of energy transfer. These visualizations not only allow students to see science concepts in action in engineering design, but also provide informative feedback for students to make their design choices based on scientific analyses of their design artifacts.

Fig. 2: Summer in Boston
A new feature has been added to Energy3D to visualize heat transfer across the building envelope using arrays of arrows. Each arrow represents the heat flux at a point on the surface of the building envelope. Its direction represents the direction of the heat flux and its length represents the magnitude of the heat flux, calculated by using Fourier's Law of Heat Conduction. Quantitatively, the length is proportional to the difference between the temperatures inside and outside the building, as well as the U-value of the material.

Fig. 3: Winter in Miami
The figures in this post show the heat flux visualizations of the same house in the winter and summer in Boston and Miami, respectively. Like the solar radiation heat map shown in the figures, the heat flux is the daily average. The U-value of the windows is greater than those of the walls and roof. Hence, you can see that the heat flux vectors in the winter sticking out of the windows are much longer than those sticking out of the walls or roof. In the summer, the heat flux vectors point into the house but they are much shorter, agreeing with the fact that Boston's summer is not very hot.

Fig. 4: Summer in Miami
Now move the same house to Miami. You can see that even in the winter, the daily average heat flux points inside the house, agreeing with the fact that Miami doesn't really have a winter. In the summer, however, the heat flux into the house becomes significantly large.

These visualizations give students clear ideas about where a house loses or gains energy the most. They can then adjust the insulation values of those weak points and run simulations to check if they have been fixed or not. Compared with just giving students some formulas or numbers to figure out what they actually mean to science and engineering practices, experiential learning like this should help students develop a true understanding of thermal conduction and insulation in the context of building science and technology.

Here is a YouTube video of the heat flux view.

Accurate prediction of solar radiation using Energy3D: Part II

About a week ago, I reported our progress in modeling worldwide solar radiation with our Energy3D software. While our calculated insolation data for a horizontal surface agreed quite well with the data provided by the National Solar Radiation Data Base, those for a south-facing vertical surface did not work out as well. I suspected that the discrepancy was partly caused by missing the reflection of short-wave radiation: not all sunlight is absorbed by the Earth. A certain portion is reflected. The ability of a material to reflect sunlight is known as albedo. For example, fresh snow can reflect up to 90% of solar energy. People who live in the northern part of the country often experience strong reflection from snow or ice in the winter.

Figure 1. Calculated and measured insolation on a south-facing surface.
In the summer, the Sun is high in the sky. A south-facing plate doesn't get as much energy as in other seasons, especially near the Equator where the Sun is just above your head (such as Honolulu as included in the figures above). However, the ambient reflection can be significant. After incorporating this component into our equations following the convention in the ASHRAE solar radiation model, the agreement between the calculated and measured results significantly improves -- you can see this big improvement by comparing Figure 1 (new algorithm) with Figure 2 (old algorithm).

Figure 2. Results without considering reflected short-wave radiation.
This degree of accuracy is critically important to supporting meaningful engineering design projects on renewable energy sources that might be conducted by students across the country. We are working to refine our computational algorithms further based on 50 years' research on solar science. This work will lend Energy3D the scientific integrity needed for rational design, be it about sustainable architecture, urban planning, or solar parks.

Go to Part I and Part III.