This Week in CFD

3D Scanning of Hangar Produces Aerospace Art

Boeing engineers using a handheld scanner have produced 3D scans of their factory in Everett, Washington with the goal of producing maps that robots might eventually use to efficiently locate automated machinery. As a side benefit, the Boeing Technical Fellow in charge of this work finds the images to be quite stunning on their own and akin to something you’d find hanging in a museum of modern art.

3D scan of Boeing’s factory in Everett, Washington. Image from Boeing.

News in Brief

  • McGill University professor Wagdi Habashi is to be awarded the National Order of Quebec for his work in CFD.
  • The abstract deadline for the International Society of Grid Generation 2012 conference has been extended to 15 June.
  • CFD Online has created new online forums dedicated to the CFD postprocessing software Avizo Wind, EnSight, FieldView, ParaView, and Tecplot.
  • CFD is included in the new technical handbook from Xylem Inc. titled Flygt Handbook of Sludge Pumping.
  • Zeus Numerics released CFDExpert-Lite, an affordable version of their CFDExpert product.
  • Kansas’ Baldwin High School won the Real World Design Challenge. Their winning entry for a light sport aircraft was analyzed using Mentor Graphics’ FloEFD.
  • CFD, Formula 1, and Marussia F1.
  • Renault used CFD for the aerodynamics of their Alpine A110-50 concept car which generates one-third of its down force from ground effect.
  • Of course, Sierra Nevada Corporation continues use of CFD on their Dream Chaser spacecraft, designed to transport astronauts to the ISS.
  • There’s an interesting blog post on whether or not CFD is an exact science.

More Droplet Photography

Dark Roasted Blend brings us this gallery of artful photographs of liquid droplets.

Dew-Soaked Dandelions by Sharon Johnstone. Image from Dark Roasted Blend.

Posted in Applications, News | Tagged , , , , , , , , , | Leave a comment

8 Questions with David Thompson

David Thompson is the associate director of the Mississippi State University (MSU) Center for Advanced Vehicular Systems, where he is CFD Group Lead. Since joining MSU in 1998, his research has focused on mesh generation and refinement techniques, including those that employ general polyhedral elements, vortex detection and visualization, aircraft icing, biomedical flows, and vortex-dominated flows.

What do you see as the biggest challenges facing CFD in the next three years?

DT: Dealing with massive amounts of data. With the maturation of massively parallel systems and fast processors (GPUs), we solve larger-scale problems or more problems. In either case, the main problem is not the obtaining the solution. It is data management during preprocessing and postprocessing.

JC: You mention GPUs specifically. We did a pilot project on them last year and found that the effort (to code, maintain, debug) wasn’t worth the performance improvement. Can you say more about your GPU experience?

DT: I don’t have any personal experience with GPUs, mainly because I haven’t had access to them. One of our research faculty members is collaborating on a project with Drexel University to perform turbulent flow simulations using GPUs. The project is still in the early stages so he doesn’t have any hard performance numbers yet. My primary reservations, from afar at least, are the ones you mentioned and the problem of legacy code. Of course, regardless of whether you go GPU or not, the problem of data management remains.

JC: Also, can you say something more precise about the size of some of the simulations you’re working on?

DT: The problems I have been working on have not been “large” spatially, with the largest being only about 20M – 50M elements. The size issue arose because they were unsteady simulations that required saving numerous time steps. Altogether, a set of these simulations is about 20GB or so. We are getting ready to perform some unsteady simulations that will require 100s of GB but not quite a TB.

What are you currently working on?

DT: I’m working in five main areas right now:

  1. Automated mesh generation for ice accretion in three dimensions (NASA)
  2. Vortex detection and visualization in large-scale CFD data sets (NSF)
  3. Simulating droplet impingement and solidification on ice resistant surfaces (EADS-IW)
  4. Simulating separated flow using hybrid RANS/LES model (NASA)
  5. Simulating airflow and particle deposition in the human lungs (NSF)

Here’s an example of a particularly memorable simulation. The objective was to redesign a droplet delivery device for small-scale, refrigerated wind tunnel (Figure 1) that minimizes droplet deposition in the device and droplet scatter in test section. Figure 2 shows droplets and the delivery device with transparent surfaces. Finally, Figure 3 shows the reduction in droplet dispersion of the redesigned device over the baseline. Hybrid RANS/LES was used to simulate unsteady turbulent flow.

Figure 1: Overall view of refrigerated wind tunnel including droplet device (left) and test section (right).

Figure 2: Droplet delivery device with transparent surfaces to show droplets.

Figure 3: The droplet dispersion in a plane perpendicular to the test section flow was reduced by the redesigned device (right) relative to the baseline (left).

How did you get to be where you are today?

DT: I got my B.S. in aerospace engineering from MSU in 1979. I worked for Joe Thompson as an undergraduate researcher and then continued working with Joe to get my M.S. in aerospace engineering in 1980. I moved to Iowa State University to work on my Ph.D. with Dale Anderson and completed that degree in 1987. I always knew that I wanted to be in aerospace engineering. Of course, I had no idea what CFD was in 1978. That was when Les Hester, who taught a few undergraduate courses at MSU, introduced me to Joe Thompson.  I started working for Joe and one thing led to another. Dale Anderson, who was my Ph.D. advisor, was also a great mentor, but it was really Mr. Hester and Joe who got me into CFD.

I worked at General Dynamics/Fort Worth Division (1980-83) in the Aeroanalysis Group. I was on the faculty at UT Arlington (1987-94). I also took a brief detour into K12 as the director of the academic program at a state-supported residential high school for gifted and talented 11th and 12th grade students (1994-98). While the job was extremely stressful, I learned a lot; however, I decided I wanted to get back into CFD, which led me back to MSU where I joined the research faculty (1998) and moved into a tenure-track position in 2003.

JC: It’s fair to say that anyone doing CFD mesh generation in the 1980s was influenced by Joe Thompson, either personally or through his work. Wouldn’t you agree?

DT: Definitely. Between the short courses and the book Numerical Grid Generation, published in 1985, Joe directly impacted many practitioners of mesh generation during this period. In fact, in 1992 he received the AIAA Aerodynamics Award for “meritorious achievement in the field of applied aerodynamics recognizing notable contributions in numerical grid generation which have revolutionized computational aerodynamics for realistic configurations and complex flows.”

JC: And Dale Anderson was my M.S. adviser and John Steinbrenner’s Ph.D. adviser. There’s a lot of common influence there.

Who or what inspired you to get started in your career?

DT: I had the good fortune to grow up in the 1960s. In fact, I like to think that I lived “The Wonder Years” (late ‘80s early ‘90s TV reference). While there was a lot of turmoil, there were two specific events in 1968-69 that had a profound impact upon me: 1) on Christmas Eve 1968, I heard the Genesis story read from a spacecraft orbiting the Moon (Apollo 8) and 2) in July 1969, I watched grainy images on a black-and-white TV of a man actually walking on the Moon (Apollo 11). It would be three, except that on Apollo 12 the color camera was destroyed when it was accidentally pointed at the sun. To this day, I seem to have a grudge against Alan Bean. Apparently, I think it was his fault.

JC: We recently watched Space X’s Dragon capsule dock with the International Space Station. I don’t think anyone would argue that it was as momentous as the lunar landing, but do you think it will have the same impact on young people today?

DT: I would say both no and yes. No because I don’t know how many young people were actually paying attention. Everybody knew about the Apollo missions. Yes, because this is a necessary step toward the commercialization of space, which may affect their everyday lives more directly.

What advice do you have for young people entering the field today?

DT: This is what I tell my Intro to CFD class:

  • Don’t trust anything you get from a CFD code. There is a reason we do mesh refinement studies.
  • Any monkey can run a code. Your value-added as an engineer is through the interpretation of the results.

JC: That may some of the best advice for CFDers that I’ve ever heard.

How do you know Pointwise?

DT: I knew John Steinbrenner from Iowa State and Rick Matus from UT Arlington.  I was familiar with the mesh generation work that had been done in the CFD Group at General Dynamics in the mid-1980s. I also know Carolyn Dear from her days at MSU.

JC: Let’s not forget about the AIAA Meshing, Visualization, and Computational Environments technical committee, for which you and I have served as chair.

Can you share with us your favorite tools and resources that help you get your job done?

  • Mesh generation: I use our in-house mesh generation system SolidMesh/AFLR almost exclusively.
  • Flow solvers: I use our in-house flow solver Loci/CHEM, that was developed with funding from NSF and NASA, for problems for which density-based simulations are appropriate. I have been experimenting with OpenFOAM® for some incompressible simulations. Occasionally, I use ANSYS Fluent®.
  • Vis tools: I use EnSight® because I like the interface and toolset.

If we were to come visit you, where’s a good place to go out for dinner?

DT: It depends on whether you want the “Southern Experience” or not. The Little Dooey is a barbecue place that the people at EPSN love. Of course, like most places, the best barbecue is served in dives. For all you Texans – get pork. Don’t get beef.  Get pork. Trust me.

JC: When in Rome, or in this case Starkville…

Posted in People & Places | Tagged , , , , | 3 Comments

This Week in CFD

CFD Contributes to Head and Neck Cancer Treatment

Human vasculature targeted by intra-arterial injection.

A team led by Dr. Manosh Paul at the University of Glasgow used CFD to analyze a new intra-arterial method for injecting cancer medications. The intra-arterial method offers the benefits of targeting the medication on the cancerous regions rather than having it spread throughout the entire body thereby increasing efficacy and decreasing side effects.

The CFD process begins with a CT scan of the patient to reveal the geometry of the arteries, bones, and tumor. The CFD simulation itself then takes into account the injection site, injection pressure, and pulse to simulate the eventual concentration of the medication around the tumor. This approach therefore can customize the delivery per patient.

Event Updates

DEM Solutions Introduces Coupler for Fluid-Particle Simulations

Coupled fluid-particle simulation of a fluidized bed. Image from DEM Solutions.

DEM Solutions announced the release of the EDEM CFD Coupling Interface that lets any CFD solver be coupled with DEM’s EDEM solver for discrete element modeling. The bi-directional interface lets any CFD solver – in-house, commercial, or open source – perform a fully coupled fluid-particle simulation.

This interface has been used since 2006 exclusively with the Fluent CFD solver and is now extended to any CFD solver. The interface’s API allows for interactions of mass, momentum and heat.

News in Brief

  • Canyon’s new time trial bike, the Speedmax CF Evo, features fork, seat, and down tubes with non-NACA cross sections because CFD indicated a lack of good aero performance below 70 km/hr.
  • Stanford University provides these animations of turbulent flows. [For some reason the video is titled Modeling the Complexities of Hypersonic Flight but I think that's a misnomer.]
  • Tecplot was named a finalist for Red Herring’s Top 100 America’s award. The award identifies the most promising private technology companies.
  • The results of Intelligent Light‘s research into modeling helicopter rotor and wake interactions was featured in NCSA’s Access magazine.
  • Data collected from the flight and crash of DARPA’s hypersonic HTV-2 will aid the development of thermal modeling technology. [This article is full of typos and since I myself recently published something with a glaring typo (and probably will again) I don't feel bad about pointing this out.]
  • NASA announced the recipients of 2012 Space Technology Research Fellowship grants.
  • Airbus Bremen is looking to hire a CFD Meshing Workstream Leader.

CEI Announced the Retirement of EnSight CFD

CEI announced the discontinuation of their EnSight CFD Free and EnSight CFD Paid products and their replacement with EnSight Free and EnSight Desktop. The new products offer more capability, a smoother upgrade path, and the same pricing as the products they replace.

Is This Really the Most Mesmerizing Fluid Dynamics Video You’ll Ever See?

Gizmodo calls this video collection of various fluid phenomena the most mesmerizing that you’ll ever see. To me it looks like the backdrop from a Pink Floyd concert from 1967. What does it look like to you?

Posted in Applications, News | Tagged , , , , , , , | Leave a comment

Creating a CAE Plugin – Understanding the Pointwise Grid Model API (Part 1)

The main purpose of a CAE plugin is to export a grid model. To do this, the plugin must convert the grid data as represented by Pointwise into a format supported by the solver the plugin is targeting. To do this conversion properly, you must have a thorough understanding of the Pointwise grid model (PWGM).

For this post, I will focus on the unstructured PWGM. The structured PWGM will be covered in a future post. While there is much in common between the structured and unstructured PWGM, there are fundamental differences that make them better covered in two articles rather than one.

Grid Handles

Through out this post, I will be referring to Handles. Handles are a compact way to uniquely identify any PWGM entity or element without using pointers. For those of you familiar with C/C++, a Handle can be considered the SDK’s equivalent of a C++ this pointer. The unstructured PWGM supports five Handle types:

  • PWGM_HGRIDMODEL
  • PWGM_HBLOCK
  • PWGM_HDOMAIN
  • PWGM_HVERTEX
  • PWGM_HELEMENT

Each Handle type has one or more SDK functions that is used to query the entity that the Handle represents. The SDK uses a function naming scheme in which the name’s prefix reflects the entity Handle being queried. For example, all functions beginning with PwDom take a PWGM_HDOMAIN as their first parameter (the domain’s this pointer).

Using Handles also reduces the number of arguments needed by SDK functions. Their use also permits simpler function calls in your plugin code. For example, without Handles, a block element function would need three parameters to uniquely identify a given PWGM block element:

elementFunction(model, blkIndex, elementIndex, otherArgsHere);

However, using Handles, the function call becomes:

elementFunction(hElement, otherArgsHere);

You can also extract information from a Handle using various SDK macros. See the Modules/PWGM-API Opaque Data Handle Types section of the CAE Plugin SDK documentation for the details.

Grid Hierarchy

The unstructured PWGM is arranged in a hierarchy. The root of this hierarchy is the grid model itself. At export, the grid model’s Handle is passed to the plugin’s runtimeWrite() function using the PWGM_HGRIDMODEL model parameter. The unstructured PWGM is divided into two distinct, yet related, views. The first view provides cell centric access to the grid model. The second view provides face centric access to the grid model.

The face centric view API is not available in the current 1.0 R3 version of the Plugin SDK. However, the coding is finished and is being tested. I hope to have it released in the next few weeks.

In the cell centric view, the grid model consists of

  • One array of Blocks, each with an array of cell Elements and a single Condition.
  • One array of Domains, each with an array of face Elements and a single Condition.
  • One array of Vertices.

In the face centric view, the grid model consists of

  • One array of all Block cell Elements.
  • One array of all cell face Elements, including the faces that lie on the grid’s boundary and the faces that are internal to the grid.
  • One array of Vertices.

It is important to note that the same array of Vertices is used by both the cell centric and face centric views. As hinted to above, the vertices are the common relation that ties the two views together. The complete grid model hierarchy is represented in the figure below.

The grid model hierarchy

The grid model hierarchy

Grid Dimensionality

A gold star for anyone who noticed that the discussion above did not mention 2D grids versus 3D grids. That is because the PWGM makes accessing the grid data (mostly) independent of the grid’s dimensionality.

As in Pointwise itself, the PWGM supports both 2D and 3D meshes. However, there is one key difference. The PWGM provides the same interface to the mesh data independently of its 2D or 3D dimensionality. The uniformity of the PWGM is accomplished using five generic entities; Blocks, Domains, Elements, Vertices and Conditions. Specifically, from the PWGM’s point of view:

  • A Block is collection of block Elements, all of which are assigned a common volume Condition. Each block is identified by a unique, integer index. The indices range from 0 to the number of blocks in the model (Nb) minus 1 (0 … Nb-1).
  • A Domain is a collection of domain Elements, all of which are assigned a common boundary Condition. Each domain is identified by a unique, integer index. The indices range from 0 to the number of domains in the model (Nd) minus 1 (0 … Nd-1).
  • A Vertex is a single XYZ coordinate identified by a unique, integer index. The indices range from 0 to the number of vertices in the model (Nv) minus 1 (0 … Nv-1).
  • An Element is an ordered collection of Vertex indices. The index order defines the Element’s connectivity (see Module/Cell Connectivity).
  • A Condition is a set of two user defined and two solver defined attributes.

A plugin accesses this entity hierarchy using the same function calls. The distinction between 2D and 3D only comes into play in the Elements. For example, the Elements of 3D blocks are hexes, prisms, pyramids, and tets. The Elements of 3D boundary domains are tris and quads. Similarly, the Elements of 2D blocks are tris and quads. The Elements of 2D boundary domains are bars (lines). The tables below summarize the relationship between PWGM grid entities, their Elements and the corresponding Pointwise grid entities.

Elements and Entities

Grid Model element types and Pointwise entity types by dimensionality

Before the grid you created in Pointwise is passed to the plugin, Pointwise boundary entities (domains in 3D or connectors in 2D) sharing the same boundary condition are merged into a single PWGM Domain. As a result, the number of PWGM Domains may not be the same as the number of Pointwise boundary entities, depending on how Pointwise boundary conditions are applied to a grid.

Conversely, Pointwise volumes (blocks in 3D or domains in 2D) sharing a common volume condition are not merged. This means that the number of PWGM Blocks always will be equal to the number of Pointwise volume entities. The figure below illustrates how a 2D Pointwise grid appears to a plugin for cell centric views.

Boundary Entity Merge (cell centric view)

How boundary merging changes a Pointwise grid before it is passed to a plugin (cell centric view).

In the face centric view, the merging of boundary and volume conditions is not meaningful because Blocks and Domains only are accessed as cell and face Elements. The figure below illustrates how the same 2D Pointwise grid appears to a plugin for face centric views.

Face Centric View

How a Pointwise grid appears to a plugin in the face centric view.

Enumerating Entities

The PWGM provides enumerated, random access to all grid entities and their corresponding Elements, except for faces in the face centric view. Using this scheme, an SDK function is provided for each entity or entity Element to ascertain the number of items that exist in the grid model. The count then is used with other related enumeration SDK functions to step through the item hierarchy one by one. For example, the number of grid model blocks is determined using the PwModBlockCount() function. With this count you then enumerate the blocks using the PwModEnumBlocks() function. The PWGM enum functions return a Handle to the requested item. The top, model level function names begin with the PwMod prefix. These function all take a grid model Handle as their input and return either a count or a Handle to an enumerated grid model entity. The top, model level functions currently supported by the unstructured PWGM are

PWP_UINT32   PwModBlockCount   (PWGM_HGRIDMODEL model);
PWGM_HBLOCK  PwModEnumBlocks   (PWGM_HGRIDMODEL model, PWP_UINT32 ndx);
PWP_UINT32   PwModDomainCount  (PWGM_HGRIDMODEL model);
PWGM_HDOMAIN PwModEnumDomains  (PWGM_HGRIDMODEL model, PWP_UINT32 ndx);
PWP_UINT32   PwModVertexCount  (PWGM_HGRIDMODEL model);
PWGM_HVERTEX PwModEnumVertices (PWGM_HGRIDMODEL model, PWP_UINT32 ndx);

Enumerating the Elements of a Block or Domain is done in a similar manner. First, you get the entity’s Element count using the appropriate Block or Domain Handle (obtained using the functions above). Then, using the count, you enumerate the Elements one by one obtaining each Element’s Handle. The Element’s Handle is used to obtain the Element’s data. The Block and Domain Element functions currently supported by the PWGM are

PWP_UINT32    PwBlkElementCount (PWGM_HBLOCK block, PWGM_ELEMCOUNTS *pCounts);
PWGM_HELEMENT PwBlkEnumElements (PWGM_HBLOCK block, PWP_UINT32 ndx);
PWP_UINT32    PwDomElementCount (PWGM_HDOMAIN domain, PWGM_ELEMCOUNTS *pCounts);
PWGM_HELEMENT PwDomEnumElements (PWGM_HDOMAIN domain, PWP_UINT32 ndx);

An Element’s data is obtained using two functions:

PWP_BOOL PwElemDataMod     (PWGM_HELEMENT element, PWGM_ELEMDATA *pData);
PWP_BOOL PwEnumElemDataMod (PWGM_HELEMENT element, PWGM_ENUMELEMDATA *pData);

In addition to the Elements, each Block and Domain has an associated Condition. A Condition represents a Block’s Volume Condition or a Domain’s Boundary Condition. The Condition data is obtained using the functions listed below:

PWP_BOOL PwBlkCondition (PWGM_HBLOCK block, PWGM_CONDDATA *pCondData);
PWP_BOOL PwDomCondition (PWGM_HDOMAIN domain, PWGM_CONDDATA *pCondData);

The grid model’s XYZ vertex data is obtained using the functions listed below. The specifics of a particular export format will determine which of these functions to use. See the plugin documentation for details.

PWP_BOOL PwVertDataMod  (PWGM_HVERTEX vertex, PWGM_VERTDATA *pVertData);
PWP_BOOL PwVertIndexMod (PWGM_HVERTEX vertex, PWP_UINT32 *pIndex);
PWP_BOOL PwVertXyzVal   (PWGM_HVERTEX vertex, PWGM_ENUM_XYZ which, PWGM_XYZVAL *pVal);

Streaming Entities

The PWGM provides “streamed” access to the faces of the face centric view. They are streamed in the sense that the faces are made available to the plugin one at a time. Once the plugin has finished with a face Element, it cannot access the face Element again without restarting the stream from the beginning (unless you make local copies of the face data in the plugin).

We decided to use face streaming in the PWGM to minimize the amount of additional memory consumed during export. Pointwise does not explicitly store grid face information. As a result, to provide the face centric view, the PWGM needs to process the cell centric data and convert it to a face centric representation. Storing the full, face centric view for enumerated, random access can more than double the amount of RAM already required by the cell centric view. And, as many of our customers already know, large grid models can strain the RAM limits of many modern computers. The addition of non-streamed face Element data may exceed a computers available RAM and prevent some large grids from being exported at all!

A plugin initiates a face streaming session with a call to the PwModStreamFaces() SDK function. This function accepts a PWGM_ENUM_FACEORDER value, three callback functions, and a user-data pointer.

PWP_BOOL PwModStreamFaces(PWGM_HGRIDMODEL model, PWGM_ENUM_FACEORDER order,
                          PWGM_BEGINSTREAMCB beginCB, PWGM_FACESTREAMCB faceCB,
                          PWGM_ENDSTREAMCB endCB, void *userData);

The optional user-data pointer can be set to null or it can be used to pass plugin specific runtime information to all phases of the streaming session. The user-data pointer is passed to each of the three callbacks.

The face order value controls how the faces are grouped during streaming. The supported orders are listed below.

typedef enum PWGM_ENUM_FACEORDER_e {
    PWGM_FACEORDER_DONTCARE,      // all cell faces in any order
    PWGM_FACEORDER_BOUNDARYFIRST, // all cell faces in boundary, interior order
    PWGM_FACEORDER_INTERIORFIRST, // all cell faces in interior, boundary order
    PWGM_FACEORDER_BOUNDARYONLY,  // only boundary cell faces
    PWGM_FACEORDER_INTERIORONLY,  // only interior cell faces
    PWGM_FACEORDER_BCGROUPSFIRST, // BoundaryFirst grouped by BCs
    PWGM_FACEORDER_BCGROUPSLAST,  // InteriorFirst grouped by BCs
    PWGM_FACEORDER_BCGROUPSONLY,  // BoundaryOnly grouped by BCs
}
PWGM_ENUM_FACEORDER;

The faces are streamed to a plugin using the three callback functions. The beginCB() callback is invoked by the PWGM once at the beginning of the streaming session. This callback receives the number of the boundary, internal and total faces that will be streamed.

PWP_BOOL beginCB(PWGM_BEGINSTREAM_DATA *data);

typedef struct PWGM_BEGINSTREAM_DATA_t {
    PWGM_ENUM_FACEORDER order;   // requested cell face stream sequence order.
    PWP_UINT32 totalNumFaces;    // total # of faces in model (= #Boundary + #Interior).
    PWP_UINT32 numBoundaryFaces; // # faces in totalNumFaces lie on the model's boundary.
    PWP_UINT32 numInteriorFaces; // # faces in totalNumFaces that are interior to the model.
    PWGM_ELEMCOUNTS counts;      // model's total element counts.
    PWGM_HGRIDMODEL model;       // grid model handle
    void *userData;              // pointer passed to PwModStreamFaces(..., void *userData)
}
PWGM_BEGINSTREAM_DATA;

When the plugin returns from beginCB(), the PWGM begins processing the cell centric data. As faces are completed, they are passed to the faceCB() callback. The information passed to this callback includes the face type (internal or boundary), the face vertices, and the block cell Elements on either side of the face.

PWP_BOOL faceCB(PWGM_FACESTREAM_DATA *data);

typedef struct PWGM_FACESTREAM_DATA_t {
    PWGM_HGRIDMODEL model;      // grid model handle
    PWP_UINT32 face;            // face's index in the model's index space
    PWGM_ELEMDATA elemData;     // The face's element data.
    PWGM_ENUM_FACETYPE type;    // One of the PWGM_FACETYPE_XXX types.
    PWGM_FACEREF_DATA owner;    // The block element that owns face.
    PWGM_FACEREF_DATA neighbor; // The block element on the other side of the face. This value
                                // is undefined if type is PWGM_FACETYPE_BOUNDARY.
    void *userData;             // pointer passed to PwModStreamFaces(..., void *userData)
}
PWGM_FACESTREAM_DATA;

After the last face is passed to faceCB(), the PWGM makes one final call to the endCB() callback.

PWP_BOOL endCB(PWGM_ENDSTREAM_DATA *data);

typedef struct PWGM_ENDSTREAM_DATA_t {
    PWGM_HGRIDMODEL model; // grid model handle
    PWP_BOOL ok;           // PWP_TRUE if streaming completed successfully
    void *userData;        // pointer passed to PwModStreamFaces(..., void *userData)
}
PWGM_ENDSTREAM_DATA;

The following example C++ code shows the streaming API in use.

/**************************************/
PWP_UINT32
beginCB(PWGM_BEGINSTREAM_DATA *data)
{
    // Cast user data pointer to a CAEP_RTITEM*
    CAEP_RTITEM *pRti = (CAEP_RTITEM*)data->userData;

    // perform initialization here

    // Set starting progress step count
    return caeuProgressBeginStep(pRti, data->totalNumFaces);
}

/**************************************/
PWP_UINT32
faceCB(PWGM_FACESTREAM_DATA *data)
{
    // Cast user data pointer to a CAEP_RTITEM*
    CAEP_RTITEM *pRti = (CAEP_RTITEM*)data->userData;

    // process this face
    if (PWGM_FACETYPE_INTERIOR == data->type) {
        // do something
    }
    else if (PWGM_FACETYPE_BOUNDARY == data->type) {
       // do something else
    }

    // Increment progress
    return caeuProgressIncr(pRti);
}

/**************************************/
PWP_UINT32
endCB(PWGM_ENDSTREAM_DATA *data)
{
    // Cast user data pointer to a CAEP_RTITEM*
    CAEP_RTITEM *pRti = (CAEP_RTITEM*)data->userData;

    // perform final cleanup here

    // End progress step
    return caeuProgressEndStep(pRti);
}

/**************************************/
PWP_BOOL
runtimeWrite(CAEP_RTITEM *pRti, PWGM_HGRIDMODEL model,
             const CAEP_WRITEINFO * /*pWriteInfo*/)
{
    PWP_BOOL ret = PWP_FALSE;
    if (caeuProgressInit(pRti, 2) && writePointsFile(*pRti)) {
        // In this example, passing pRti as the PwModStreamFaces(..., void *userData) parameter.
        // However, any implementation specific value can be used.
        ret = PwModStreamFaces(model, PWGM_FACEORDER_BCGROUPSLAST, beginCB, faceCB, endCB, pRti);
    }
    caeuProgressEnd(pRti, ret);
    return ret;
}

That’s All Folks

That's all folks

Armed with an understanding of the unstructured grid model available within the Pointwise CAE plugin SDK, you should be able to create a plugin that adds your solver of choice to Pointwise. As always, if you have any further questions feel free to contact Pointwise support. We are here to help!

I will be covering the structured grid model in my next post. In the meantime, you can learn more about the PWGM by clicking on the button below.

Learn more about the Pointwise CAE Plugin SDK

Posted in Applications, Software | Tagged , , , , , , , , | Leave a comment

This Week in CFD

Overset Grid Symposium in Dayton this October

The 11th Overset Composite Grids and Solution Technology Symposium will be held 15-18 October 2012 in Dayton, Ohio. Abstracts for both presentations and student posters are now being accepted with a deadline of 29 June. Topics being sought are unsteady and moving body problems, emerging hybrid strategies, works in progress as well as those recently completed.

The Symposium consists of three days of technical presentations preceded by one day of tutorials and workshops.

Exa Released PowerFLOW 4.4

Particles colored by velocity and sized by age. Simulation by PowerFLOW, postprocessed in PowerVIZ. Image from Exa.

Exa Corp. released PowerFLOW 4.4, the newest version of their Lattice Boltzmann CFD software suite. New features in this release are focused on user productivity and are said to include:

  • Grid generation updates that are up to 80% faster
  • Performance improvements of up to 15% on large clusters
  • Templates for thermal and wind noise simulations

For more details:

Khamsin v0.7 Released for CFD in SketchUp

Hibou Scientific Software released Khamsin v0.7, their CFD software for the building industry that’s a plugin for SketchUp (formerly Google SketchUp). This latest version includes enhancements for how Khamsin works with OpenFOAM and Dolfyn. (Khamsin acts as an environment that interfaces with OpenFOAM, OpenFVM, Dolfyn, and EnSight CFD for the analysis.)

[I wonder whether Khamsin has been affected at all by Google's recent sale of SketchUp to Trimble Navigation?]

Briefs

  • Altair Hyperworks is now available for Mac OS X.
  • NAFEMS’ The CAE Guy will be hosting a webinar pitting CFD experts vs. designers.
  • The University of Pittsburgh’s Swanson School of Engineering has been awarded a $1.3M grant from the U.S. Dept. of Energy which will go, in part, to CFD simulations of high temperature gas reactors.
  • Experimental and CFD Studies of Gas-Liquid Flow in Bends
  • WindSim version 5.1 was released for CFD simulation of wind turbines.
  • CFD modeling of heat sinks

Mesh Software Unlike Any I’ve Seen Before

Modeling knitted garments with Stitch Meshes

When I found another article with “mesh” and “software” in its title the result turned out to be completely unexpected. Stitch Meshes is software for simulating knitted garments. The software starts with a simple faceted model of the garment onto which one generates a mesh. Each cell of the mesh is assigned a particular type of stitch and a pattern tool is available for creating arrays of common stitch patterns. A relaxation technique is then applied to achieve a realistic model of the garment. Be sure to watch the video.

This article hits a little close to home because Pointwise shares a building with a retail yarn shop. Who knew we had so much in common?

Posted in Applications, Events, News, Software | Tagged , , , , , , | Leave a comment

This Week in CFD

Intelligent Light Seeks Partners for Unsteady Turbulence Visualization

Volume rendering of a temporal mixing layer. Image copyright Intelligent Light (c) 2012.

Intelligent Light is seeking partners with whom to collaborate on recently completed research into visualizing unsteady turbulent flows. Through a Phase II STTR from AFOSR, researchers at IL developed a technique whereby the system can be trained to find features like turbulent vortices and then track those feature statistically over time.

Those interested in collaborating on this research should contact IL by emailing research@ilight.com.

Applications

CFD simulation of Blue Origin’s biconic capsule design with a split flap deployed. Image from Blue Origin via Wired.

  • Blue Origin and Sierra Nevada have been using CFD and wind tunnel testing to study the aero performance of their commercial space vehicles as part of NASA’s Commercial Crew Development program.
  • Here’s a similar article about Blue Origin.
  • CFD assisted performance evaluation of the TwincerTM disposable high-dose dry powder inhaler (registration required)
  • Validation of a CFD model from a roadside long term tracer study
  • CFD studies show that split winglets with scimitars reduce winglet drag by 2.5%. Confidence in the simulation is high because previous studies were within 0.1% of flight test results.
  • Here’s an unrelated article about winglets on Boeing’s 737 MAX.
  • Smoke hazard assessment using CFD modelling
  • CFD helps design fans that keep oil and gas drilling systems cool.
  • CFD in Food Processing (book)
  • CFD can be used to model bus fires.

CFD solution of flow through a cooling fan. Solution from FloEFD. Image from Desktop Engineering.

Jobs

New Releases

  • TYCHO v0.92 has been released. TYCHO is a freely available compressible hydrodynamics code written in C and parallelized with OpenMP.
  • Rocket Propulsion Analysis v.2.0 is now available.
Posted in News, Software | Tagged , , | Leave a comment

This Week in CFD

CEI’s EnSight to be Bundled with KARALIT CFD

KARALIT announced that they would begin bundling CEI’s EnSight postprocessing software with their CFD solver technology. KARALIT CFD is an immersed boundary method that promises to relieve the burden of preprocessing.  The addition of EnSight to their portfolio is said to bring “world-class visualization” to KARALIT’s customers.

LearnCAx Offers Online CFD Instruction

Mesh methodologies for CFD. Image from LearnCAx.

The new LearnCAx blog offers online instruction in computer aided technologies and their first posts constitute the beginnings of an introduction to CFD.  The four articles posted so far cover What is CFD?, Preprocessing – Selecting the Domain, Preprocessing – Grid Generation, and Preprocessing – Boundary Tagging. More posts are promised on solver and postprocessing technologies.

Events

Apps & Other

CFD results for a light sport aircraft from Stallion.

  • For those of you who write code for a living, you might be interested in Light Table, a new IDE concept.
  • Hanley Innovations has blogged about how to setup CFD for a complete aircraft in about a minute using their Stallion 3D software.
  • Optimizing data centers for energy efficiency using CFD and other tools may or may not be worth the effort.
Posted in Applications, Events, News | Tagged , , , , | 1 Comment