Quantcast
Channel: Tecplot Website
Viewing all 281 articles
Browse latest View live

Modeling 3D Geothermal System

$
0
0

I’m Melinda Horne, a master’s student in the Hydrology program in the Earth and Environmental Sciences department of New Mexico Institute of Mining and Technology. My research involves analyzing a geothermal reservoir in south-central New Mexico.

The system was modeled in Fortran by Dr. Mark Person, who is my advisor. It is a two-dimensional model capable of simulating groundwater, heat and solute transport, as well as tectonic evolution and petroleum generation. With no surface expression, it is a blind geothermal reservoir, however there is one geothermal well with temperatures of 99 C at 371 m depth and a total dissolved solid of 1900 mg/L.

This geothermal reservoir is unique because it displays hotter temperatures at shallower depths – called a temperature inversion. Another unique feature is that it is located at the nexus of three hydrologic drainage divides and a buried geologic uplift. We believe that it is a steady-state system with a complex three-dimensional flow.

3D Model Domain

Figure 1. Model domain with geologic unit assignments. Purple is a hot aquifer and blue is a cool aquifer. The light blue line offsetting the units is the fault that is the geothermal fluid conduit.

Best Fit Heat Transport Model

Figure 2. Best-fit heat transport run with uncoupled temperature effects on density. This is after 10,000 years of flow. Input temperature is 120 C and flux is 200 m/yr. The cooler aquifer has a temperature of 30 C and 0.01 m/year flux.

Determining Temperature and Flow Rate

Our first challenge was to determine the flow rate and temperature of the geothermal reservoir and regional flow system. To do this, we used Tecplot 360 to display the 2D model with temperature, heat and solute concentration contours. Then we extracted a temperature-depth profile from the model output at the location of the geothermal well to match the well’s temperature-depth data (see Figure 3).

Best-fit coupled & uncoupled simulations

Figure 3: Compares data (green) to best-fit coupled (red) and uncoupled (purple) simulations. This
demonstrates that coupled and uncoupled simulations have different best-fit results that most likely
result from increased mixing from the effects of coupled temperature and density effects.

 

Determining Salinity

The second challenge was to image the geothermal upflow zone and determine the salinity and lateral extent of the system. We extracted salinity in Tecplot 360 and then post processed in R to convert from model salinity to formation resistivity. The 2D formation resistivity plots were used to compare to the formation resistivity data we collected with surface electrical surveys (transient electromagnetics). The collected data, which are also 2D plots, were interpolated and contoured in Tecplot 360.

Salinity Contours

Figure 4. Salinity contours across the model domain. The fault base has a salinity of 3,000 mg/L and the initial condition of the model has a salinity of 1,000 mg/L.

Archie's Law resisitivity

Figure 5. Archie’s Law resistivity across the model domain. This is obtained from extracting the salinity, post processing in R, and then uploading the subsequent Archie resistivity to Tecplot 360 to display.

Why I Use Tecplot 360

I have been using Tecplot 360 on and off for about two years, and there are many features that I find useful. These were especially helpful for my research:

  • Extracting Data – Without the ability to extract a precise line, I would not be able to match the geothermal temperature-depth profile.
  • Customizing contour ranges and colors – very helpful for communicating my work!
  • Reading in data – including whole-mesh datasets.
  • Exporting the model – using the write data feature, post processing it, and then reading the data back into Tecplot 360 to display it.

Tecplot 360 is extremely easy and intuitive to use and has been an irreplaceable tool for my master’s research.

Try Tecplot 360 for Free

The post Modeling 3D Geothermal System appeared first on Tecplot.


Visualizing Ocean Models

$
0
0

Description

Evaluate coastal and ocean model results quickly and interactively with Tecplot 360 using FVCOM results.

After a brief overview of Tecplot 360, this one-hour Webinar will cover:
– Loading and viewing FVCOM data in Tecplot 360
– Using cmocean colormaps
– Importing a georeferenced image and Shapefiles
– Viewing slices and iso-surfaces
– Calculating velocity magnitude
– Computing a vertical transect and a time average
– Exporting final plots and movies

The post Visualizing Ocean Models appeared first on Tecplot.

PyTecplot Quick Start

$
0
0

Description

This PyTecplot Quick Start video will get you up and running with Tecplot 360’s Python API in 30 minutes or less. We will use the case of the Onera M6 Wing and export images of slices at multiple locations. This simple case is used for illustration, but we will also discuss more complicated scenarios.

The Webinar will cover: PyTecplot Requirements, Installation, Recording and Playback, Modifying Recorded Python scripts, Connected vs. Batch Mode, Best Practices and the GitHub Repository.

If you are not a Tecplot 360 customer with current TecPLUS maintenance, you can download a free trial of Tecplot 360 to use during the Webinar at https://www.tecplot.com/360free.

The post PyTecplot Quick Start appeared first on Tecplot.

From Zero to Hero: Tecplot 360 Basics

$
0
0

Description

Get started with Tecplot 360 while learning best practices for plotting and analyzing your data. This 30-minute Webinar will walk you through everything from loading your data to exporting images and animations.

The agenda includes (but won’t be limited to!):

  • Loading your data
  • Exploring your data
  • Working with zones, variables, slices, iso-surfaces, streamtraces
  • Calculating new variables
  • Extracting data over time
  • Line plotting and frame linking
  • Exporting images and animations

The post From Zero to Hero: Tecplot 360 Basics appeared first on Tecplot.

Tecplot Add-in for Excel

$
0
0

Tecplot Add-in for Excel

This tutorial is for using the Tecplot add-in for Excel. It is available for Windows and found in the \util folder of your Tecplot 360 installation.

To enable the add-in for Excel, run the file RunTecplot5.xla, and instruct Excel to enable macros. The tool will then be found under the add-ins tab of Excel.

This add-in will load cells from left to right and top to bottom, so make the selection of cells that you wish to load into Tecplot 360, start in the upper left and move to the lower right.

This first example is in table format with multiple dependent variables in one zone.

Once the cells have been selected, click Send to Tecplot. This add-in will then create a new ASCII file from the cell data that is then loaded into Tecplot 360. We can toggle on mappings for the other variables in the Mapping Style dialog to compare our data.

In another example in table format, we can load in multiple zones, where the breaks between cells indicate the separation between the zones. The Tecplot add-in for Excel also supports loading and cell data in carpet format. This will load in a 2D dataset from the cells and assign variables X, Y, and V.

This concludes the tutorial for the Tecplot add-in for Excel. Thank you for watching.

The post Tecplot Add-in for Excel appeared first on Tecplot.

Multiple Domains, Multiple Scales, One Visualization Tool

$
0
0

Case study contributed by Michael Callaghan, PhD, P.Eng – Senior Applications Engineer, Aquanty

Aquanty is a leading-edge water resources science and technology firm specializing in predictive analytics, simulation and forecasting, research services, and IoT. Aquanty’s solutions and services are deployed globally across a broad range of industrial sectors including; agriculture, oil and gas, mining, watershed management, contaminant remediation, and nuclear storage and disposal. Aquanty’s flagship platform, HydroGeoSphere, is a class leader in fully integrated three-dimensional surface/subsurface modeling.
 

What Is an Integrated Surface-Subsurface Hydrologic Cycle Model?

Hydrological Cycle.

Figure 1. Hydrological Cycle.

HGS SimulationHydroGeoSphere (HGS) is a three-dimensional control-volume finite element simulator which is designed to simulate the entire terrestrial portion of the hydrologic cycle. It uses a globally-implicit approach to simultaneously solve the 2D diffusive-wave equation and the 3D form of Richards’ equation.

The basis for HGS’ integrated computation is multiple 1D, 2D, 3D ‘domains’ that interact with each other, including:

  • a 2D overland flow domain,
  • a 3D subsurface flow domain that can include separate discrete fractures and dual permeability domains,
  • as well as 1D surface flow channels,
  • 1D subsurface tile drains,
  • and 1D water wells.

Data intensive model output for the hydrologic cycle benefits from the flexibility of Tecplot 360 for visualization, which often requires plotting of multiple domains simultaneously and in 3D.

“We chose Tecplot 360 because of the quality of the plots. We need to present our results to clients, and for that plot quality there is no substitute to Tecplot 360.”

– Michael Callaghan, PhD, P.Eng, Senior Applications Engineer, Aquanty

Visualization of Surface Water – Groundwater Interaction

Simulating groundwater-surface water interaction in complex topography such as hummocky terrain has traditionally been viewed as a significant challenge to the hydrologic modelling community, for example so-called fill and spill behavior.

However, with HGS, the complex processes by which water movement is influenced by the combination of surface topography and highly variable subsurface hydrostratigraphy or preferential flow pathways can be readily reproduced.

In the example shown in Figure 2, precipitation is falling on an upland area which then initiates overland flow, filling, and spilling of surface depressions. The Tecplot 360 animation illustrates depression-focused groundwater recharge occurring beneath the depressions, with both a perched water table and a fractured aquitard influencing sub-surface water movement. 


Figure 2. Visualization of surface water-groundwater interaction.

Flood Inundation Visualization

HGS models may range across a number of scales from centimeters to meters to kilometers to 100’s of kilometers. Use of an unstructured finite element mesh makes this possible.

Tecplot 360’s inherent flexibility with unstructured grids makes it a very useful visualization tool across many scales of problems.

In this application, HydroGeoSphere is being used to recreate the Southern Alberta, Canada flooding that occurred in June 2013. The simulation results presented in Figure 3 depict a flood pulse derived from basin scale hydrologic simulations being routed across a local scale model of the City of Medicine Hat, Alberta, Canada. LiDAR-derived topography was used as input for this model, and results show excellent agreement between simulated and observed high water marks.


Figure 3. Flood inundation visualization.

The above visualization cases are made possible with Tecplot 360. HGS is highly integrated with Tecplot ecosystem using a powerful post-processing tool to directly produce results in Tecplot file formats. Tecplot 360 is an essential tool for everyday 2D data plotting, high quality 3D model visualization, results inspection and evaluation.

Learn more about Aquanty and HydroGeoSphere »

Try Tecplot 360 for Free

The post Multiple Domains, Multiple Scales, One Visualization Tool appeared first on Tecplot.

11 Questions About Tecplot 360 Basics

$
0
0

These questions were asked during the Webinar, From Zero to Hero: Tecplot 360 Basics. Tecplot 360 Product Manager, Scott Fowler, provides the answers below. Most of the answers show Webinar timestamps so that you can follow along in the Webinar. Learn more about Tecplot 360.


View full Webinar page

Tecplot 360 Basics Questions

1. How do you save all the steps to a macro?

The steps taken in the Webinar (timestamp 36:55) can be recorded to a macro file. Macros are the legacy scripting language of Tecplot 360, and the language on which many of our file formats are based.

  • You can customize the Tecplot 360 user interface using the quick macro panel.
  • You can customize defaults using what we call a configuration file, tecplot.cfg.
  • You can save your current work by saving to a layout file. If you have created new variables, you will also be asked to save the data file. The saved layout file is in this macro language.

Macro Video Tutorials

Tecplot 360 also has a Python API, called PyTecplot, which is available to customers on TecPLUS maintenance. Learn more about PyTecplot.

2. Why is the cylinder surface not showing velocity magnitude?

The cylinder in the Webinar example (timestamp 38:07) is a no-slip wall. Because it is a boundary condition, there are no velocities on the wall. If I want to see the velocities near the wall, I could change J planes to, for example, J=2.

3. Can we plot stagnation energy?

Yes. That is a variable that can be computed. From the main menu (Webinar timestamp 38:46), select Analyze>Calculate Variables and click Select…, then choose Stagnation Energy. See Section 21-3.2 Identifying State Variables in the Tecplot 360 User’s Manual.

4. How do I export a figure without a borderline?

You can hide the border by editing the active frame. To edit a frame (Webinar timestamp 36:55), right-click on the edge of your frame, then choose Edit Active Frame. Uncheck Show border.

Some graphics cards will have a little drop shadow on the right and bottom of plots. This is graphics card dependent. If you see a drop shadow after turning off borders, please see this article on how to correct it in the Tecplot Knowledge Base.

5. When I save a layout and move the layout to another folder, it won’t load.

When you use the menu command File>Save Layout As, there is a toggle (under the Save as type) that says Use relative paths (Webinar timestamp 36:55).

  • Checking the toggle saves the referenced data layout file as a relative path.
  • Unchecking the toggle saves the layout file as an absolute path. You should be able to load your data when it is saved as an absolute path.

You can also edit the layout file because they are saved as human readable macro files. (timestamp 39:50). I’ll quickly open a macro file and you can see what the Tecplot macro language looks like.

Here is the layout that I saved earlier. You can see that I have a command to point to linedata.plt. To move this file to a different folder, I need to change the file path to an absolute path. I can update the path in the macro file.

Relative paths are often used by people doing optimization studies when they have a folder hierarchy with, for example, Mach alpha sweep and data within each sub folder. Using a relative path, they can copy a single layout into each subfolder and load that data by relative path.

6. Can you repeat extracting the line plot?

Yes. Use Tools>Probe To Create Time Series Plot, then single click on the plot, and that will update the time series plot (Webinar timestamp 41:20). You can see that as I single click, the line plot updates through time.

For more on extracting, see the Tecplot 360 User’s Manual

7. Is it possible to export a cropped image?

Images cannot be cropped in the traditional sense. However, selecting File>Export from the main menu gives you some options (Webinar timestamp 41:53). You can export three different regions of your plot:

  • All frames – Exports all frames in your workspace.
  • Current frame – Exports only the current frame.
  • Work area – Exports entire “gray” region of your workspace.

To export only a portion of your image, you can do what we call a paper zoom. Zoom in on your plot by holding down the shift key, middle mouse button while moving the mouse up. A work area export will export the zoomed-in plot you see in the work area.

8. How can I get two plots in the same frame?

In XY line plots you can plot up to five X-axes and up to five Y-axes (Webinar timestamp 41:20).

In this case we’ll use multiple Y-axes. In the line plot, go into the Mapping Style dialog from the Plot sidebar, and you will see that there are multiple Y axes. For this example, select RHO and Velocity Magnitude to plot in the same frame, then press CNTL+F to fit the view. You can see that these have two very different scales. In the Mapping Style dialog, set RHO to Y2, and now row is on the Y2 axis.

This will give you two plots in the same frame. Select the adjuster toolAdjust tool to move the label.

9. Can I add LaTeX symbols to the legend?

You cannot use LaTeX symbols in a legend, but you can add LaTeX annotation to your plot and position it near the legend (Webinar timestamp 47:16). Here is how to do that:
  • Select the text tool text tool.
  • On your plot, click where you want to position the text, which brings up the Text Details dialog.
  • Press the LaTeX button (upper right side of Text Details dialog).
  • Add the LaTeX annotation, set the Size in points, and press Accept.
  • Click on the legend, which brings up the contour & Multi-Coloring Details dialog.
  • Toggle off Show header.
  • Click on the Legend Box… and click No Box.
  • Close the dialog.
  • Click on your LaTeX annotation and move it above the legend.

That will mimic adding LaTeX symbols to the legend.

Watch the Video on LaTeX Fonts

10. What is the Shade used for?

In 3D plots, zone effects (translucency and lighting) cause color variation (shading) throughout the zone(s). Shading can also help you discern the shape of the plot. To add shading to your plot, toggle-on Shade in the Plot sidebar. Use the Shade page of the Zone Style dialog to customize shading.

For information on translucency and lighting zone effects refer to Chapter 13, and for information on shade, refer to section 12-1 in the Tecplot 360 User’s Manual.

11. How do I perform a Fourier Transform?

In XY line plots, navigate to the Data>Fourier Transform… menu option. Follow along in this video for a demonstration: Loading Excel Data and FFT in Tecplot 360.
 

The post 11 Questions About Tecplot 360 Basics appeared first on Tecplot.

Webinar: Ask the Expert about Tecplot 360

$
0
0

Ask the Expert about Tecplot 360

In this Webinar, customers ask questions of Tecplot 360 Product Manager, Scott Fowler. Scott will help you develop your own internal expertise as he answers your questions interactively. You’ll learn new and improved techniques, current best practices and implementation considerations.

Topics include:

  • Streamlines and Streaklines
  • Macros, PyTecplot
  • MATLAB
  • Frames & Styles

Download the files used in the webinar containing the presentation, data files, macros and Pytecplot scripts.

Download the 17MB ZIP file

The post Webinar: Ask the Expert about Tecplot 360 appeared first on Tecplot.


Tecplot Macro Tutorials

$
0
0

This blog on Tecplot Macro Tutorials was written from a webinar entitled Ask the Expert About Tecplot 360 hosted by Scott Fowler, Tecplot 360 Product Manager. We received numerous questions about Tecplot macros and this blog pulls our macro resources together in one place.

What is a Tecplot macro? A Tecplot macro is a set of instructions, called macro commands, that perform actions in Tecplot 360. Macro commands can be used to accomplish virtually any task that can be done via the Tecplot 360 interface, offering an easy way to automate Tecplot 360 processes.

We recommend that you download the macros, datasets and layout files used in the descriptions below. If you do not already have Tecplot 360 running, you can download a Free Trial.

Macro, Data and Layout Files (17MB ZIP)


Using a Macro to Produce Transient Plots

This macro reads and edits different time steps and produces transient plots. This macro first finds out how many time steps are in your dataset, then it loops over those time steps. At each time step the current time step is set and an image is exported. That’s It!

export_over_time.mcr
$!EXTENDEDCOMMAND COMMANDPROCESSORID='extend time mcr' COMMAND='QUERY.NUMTIMESTEPS NUMTIMESTEPS' 
$!LOOP |NUMTIMESTEPS| 
    $!EXTENDEDCOMMAND COMMANDPROCESSORID='extend time mcr' COMMAND='SET.CURTIMESTEP |LOOP|' 
    $!EXPORTSETUP EXPORTFORMAT = PNG
    $!EXPORTSETUP EXPORTFNAME = "FILE_|LOOP|.png"
    $!EXPORT 
$!ENDLOOP

Extend Time Macro Addon

The Extend Time Macro add-on simplifies the macro interface by allowing you to use a simple loop to query the number of solution times in the dataset and advance the time step. This differs from the native Tecplot macro language as it does not require that you know the solution time of your data.

This add-on uses a different algorithm than Tecplot 360 EX for sorting the solution times. Because Tecplot 360 combines time steps that are sufficiently close together, the number of time steps reported by this add-on may differ from the number of time steps reported by Tecplot 360.

You can load this addon by adding the following line to your tecplot.add File. See chapters 31 – 3.5 and 31 – 1.2 in the Tecplot 360 User’s Manual.

$!LoadAddOn "tecutilscript_extendtime.mcr"


Converting Binary Files to ASCII

A question asked during the webinar was “How do I convert TEC files to binary?” The .tec file extension has been adopted by the greater Tecplot community. These files are usually ASCII, but in this case, the TEC file was a binary file. So, the question becomes “How do I convert from binary to ASCII?” Well, that’s easy!

Let’s backtrack for a moment and review the canonical Tecplot file extensions:

  • PLT (.plt) – Tecplot binary format.
  • DAT (.dat) – Tecplot ASCII format.
  • SZL (.szplt) – Tecplot Subzone Load-on-demand binary format. This format allows you to load large volume metric grids with very little RAM.

» Read the “Comparison of Tecplot Data File Formats” blog on Tecplot file types.

We don’t have a standalone utility to convert binary files to ASCII, but you can do it using the macro binary_to_ascii.mcr (also included in the ZIP file mentioned above). In the macro, you simply use the ReadDataSet command and then a WriteDataSet command.

binary_to_ascii.mcr
#!MC 1410
$!ReadDataSet  '"VortexShedding.plt" '
  ReadDataOption = New
  ResetStyle = No
  VarLoadMode = ByName
  AssignStrandIDs = Yes
$!WriteDataSet  "VortexShedding.dat"
  IncludeText = No
  IncludeGeom = No
  IncludeCustomLabels = No
  IncludeDataShareLinkage = Yes
  Binary = No
  UsePointFormat = No
  Precision = 9
  TecplotVersionToWrite = TecplotCurrent

 
From the command line you would call tec360.exe and pass this macro. Note that the file names in the macro need to be hard coded.

>tec360 -b -p binary_to_ascii.mcr

Here a plug for the power of Python!
Using PyTecplot to convert files, in this case binary to ASCII, is so much simpler as you can see in these few lines of code. This Python script (binary_to_ascii.py)is in the ZIP file mentioned above.

import tecplot as tp
tp.data.load_tecplot(‘mybinaryfile.plt’)​
tp.data.save_tecplot_ascii(‘myasciifile.dat’)​

Converting ASCII Files to Binary

Another user wanted to convert ASCII files to binary.

You can use a utility called Preplot. Preplot is included with Tecplot 360 and it’s located in the bin directory in the Tecplot 360 installation. You just pass it an ASCII file (.dat) and tell it the output file name. Preplot will do the conversion for you.

> preplot myasciifile.dat mybinaryfile.plt

» Watch the video tutorial, Preplot and SZL Convert Tools.
» Read the Tecplot 360 User’s Manual.
» Reference the Data Format Guide.

A note about ASCII data, whenever Tecplot 360 loads an ASCII file we actually convert it to binary as it’s being loaded. Because of this, it is in your best interest, if you need to load that file over and over, to do the conversion only once. You will save yourself a lot of time!


Placing Streamlines and Streaklines Using Macros

During the webinar, one user was trying to create an arc of streamlines (which we call streamtraces in Tecplot 360). This is not possible using the onscreen “Rake” tool! The Rake tool only places straight lines of streamlines.

If you want to define an arc of streamlines, the best way to do it would be with PyTecplot (but that will be the topic of a future blog). I explain here how to do it with a Tecplot macro.

Here is the Tecplot macro for placing the streamtrace object associated with the frame. In the code below, I’m adding a streamtrace, defining it as a volume line, setting the direction to “both” (default is forward), and placing it at X= 0.5, Y=0.5, Z=0.5. You can create an arc by having multiple of these add commands at different locations.

$!STREAMTRACE ADD ​
  NUMPTS = 1 ​
  STREAMTYPE = VolumeLine​
  STREAMDIRECTION = Both​
  STARTPOS { X = 0.5 Y = 0.5 Z = 0.5 }​


Loading a Saved Frame Style Without the Position

How do I share data across frames without having to reload the data? In this example, I want to tile frames and then save the style from the upper left plot and load it into the lower right frame. You can do this, but not directly in the Tecplot 360 user interface. We will use a macro to do this (It can also be done with PyTecplot).

Copy Frame Style Steps

  1. First, create a new frame (click the Frame icon New Frame and draw a new frame). Then change the plot type to 2D Cartesian. (Now I could easily click on the upper left frame and save the frame style (Frame>Save Frame Style). Then, I could click in the new frame and load the frame style, but that will also copy the frame size and position which will overlay the original position. I want to retain the position. So, I don’t want to do it this way.)
  2. Drag and drop the copy_frame_style.mcr macro (from the ZIP file above) onto the Tecplot 360 user interface. Two new entries will appear in the Quick Macro Panel: “Copy frame Style” and “Paste frame Style.” Be sure the stylesheet directory in the macro is valid (C:\TEMP\temp_style.sty”).
  3. Click on the frame you want to copy, click the Quick Macro “Copy frame Style” and click Play (or simply double-click on the macro name).
  4. Select the new frame and double click on the “Paste frame Style” macro.
  5. Voila! You now have a new frame with the same style. This is one of the macros I use most often.

Copy Frame Style Video Tutorial


Watch MP4 Video

The magic is in the macro’s last command “INCLUDEFRAMESIZEANDPOSITION=NO,” which loads the frame style but ignores the position.


Making Macros Persistent in Tecplot 360

If you want these macro functions always available, you can put them in the tecplot.mcr file (located in Tecplot 360 installation directory).

If you are sharing the Tecplot 360 installation, for example in a Linux environment, you can put the “.tecplot.mcr” file in your Linux home directory so as not to impact other users on your network.

More information can be found in the Tecplot 360 User’s Manual (search for “tecplot.mcr”).

The post Tecplot Macro Tutorials appeared first on Tecplot.

Visualization of Higher Order Elements

$
0
0

Part 1: A Higher-Order Element Primer

This blog was written by Dr. Scott Imlay, Chief Technical Officer, Tecplot, Inc.

“DON’T PANIC!” Douglas Adams, Hitchhikers Guide to the Galaxy

In the next few blogs I’ll discuss our recent research on the visualization of results from higher-order element computational fluid dynamics (HOE CFD). If you are not one of the practitioners of this specialized form of CFD you may be asking “what?” If so, it’s OK, please just heed the advice of Douglas Adams and “DON’T PANIC!”

Partial Differential Equations

First, a quick primer on partial differential equations. Again, “DON’T PANIC!”

The behavior of a fluid flow is described by a set of partial differential equations which relate how the local state of the flow (density, momentum, energy; or alternatively pressure, temperature, velocity) changes over time and space. The simplest of these equations is the conservation of mass (continuity) equation

differential-equation

where ρ and u are the density and velocity of the fluid at a point in space and time (x and t). This equation is the mathematical version of the statement “mass cannot be created or destroyed”, or “if more mass flows into a region than flows out, the density must increase over time.”

If you’re not familiar with symbols in this equation, DON’T PANIC!

The symbol represents a partial derivative and density over time is the rate at which the density, ρ, is changing in time. Likewise, momentum increase with distance is the rate at which momentum (density times velocity) increases with increasing spatial dimension x. Another way to think of the partial derivative is as the slope of the curve:

partial-differential-is-slope-of-curve

Figure 1. ∂ρu/∂x is the rate at which momentum (density times velocity) increases with increasing spatial dimension x, which is the slope of the curve.

In the above chart the red line is the variation of ρu with x and the slope (change in ρu over change in x) of the tangent green line is momentum increase with distance at the point of tangency.

Approximating the Derivative

Of course, we don’t generally know a functional form for ρu in terms of x, so we need to approximate the derivative. This is where the order of accuracy comes into play. In solving these partial differential equations we use a grid, with Δx being the grid spacings between grid points. If our approximation to the derivative, call it derivative, has an error term proportional to Δxn we call it an n-th order accurate scheme. For example, a second order scheme would approximate the derivative with an error proportional to Δx2

second-order-scheme

where the … represents terms containing higher exponents of ∆x like Δx3, Δx4, and so on. As the grid spacing Δx gets smaller the error terms with exponents higher than second order will vanish more quickly than the leading Δx2 term, so the approximation is called second order accurate. The majority of CFD codes are second-order accurate.

Higher-order Schemes

Higher-order schemes have a leading error of greater than second order. For example, a third-order scheme will have a leading error term of Δx3. As the order of the scheme gets higher, the approximation error drops more rapidly as the grid spacing Δx gets smaller. A higher-order scheme gives a more accurate solution than a second-order scheme with a given grid spacing. Alternatively, you can say that the grid spacing doesn’t need to be as small to get a desired level of accuracy. It is the ability to use a coarser grid to get the same level of accuracy that makes the higher-order schemes attractive.

truncation error in higher-order element scheme

Figure 2. It is the ability to use a coarser grid to get the same level of accuracy that makes the higher-order element schemes attractive.

Finite-element Methods

For finite-element methods, the variation of the solution over the element is generally approximated as a polynomial with unknown coefficients. For example, in two-dimensions, the element shape may be triangular with a linear variation of solution over the triangle. The goal of the finite-element method, therefore, is to solve for coefficients of the polynomials for all elements in such a way to give the best approximation to the solution of the partial-differential equations.

Enough about the method, let’s focus on the finite-elements themselves!

Why Use Higher-order Elements?

The degree of the polynomial determines the order of accuracy of the scheme (at least the spatial derivatives). For example, linear elements are second order accurate, quadratic elements are third-order accurate, and cubic elements are fourth-order accurate. In general, if p is the degree of the polynomial approximation then p+1 is the order of accuracy.

Why use higher-order elements? In short, for a large class of problems, HOEs achieve a desired level of accuracy with less computation expense. The following chart (Figure 3) from the AIAA Higher-Order Workshop shows how this is true. The horizontal axis of this chart is “work units” (how much computational resources the code uses) and the vertical axis is the solution accuracy (not order-of-accuracy, but how close the solution is to the correct solution). As you can see, the “_P3_” results for each of the codes tend to perform better than the “_P1_” or “_P2_” results. Here “P3” indicates a cubic polynomial which would yield a fourth-order accurate scheme. Note that in the chart below, down is more accurate.

higher-order elements solution accuracy

Figure 3. Higher-order elements achieve a desired level of accuracy with less computation expense. This chart, from the AIAA Higher-Order workshop, shows how this is true. The horizontal axis of this chart is “work units” (how much computational resources the code uses) and the vertical axis is the solution accuracy (not order-of-accuracy, but how close the solution is to the correct solution). Down is more accurate.

solution accuracy legend for higher-order elements

Legend for Figure 3.

Unsteady Flows

Unsteady flows with propagating vortices are the class of flows that benefit the most from higher-order methods. This is the type of flow you often get with large-eddy simulations, which are becoming more popular as computers get more powerful. For this reason, the usage of higher-order methods will likely increase in the future. Visual Analysis codes like Tecplot 360 need to be ready.

In the next blog I’ll discuss the challenge of visualizing higher-order finite-element solutions.

Subscribe to Tecplot 360

Get notified when the next blog is posted!

Subscribe to Tecplot 360

The post Visualization of Higher Order Elements appeared first on Tecplot.

How to Extract Data from a Surface, through Time

$
0
0

Upcoming Webinar:

Comparing Simulation
and Measured Data
Through Extractions

Thursday, March 26, 2020
10:00 – 11:00 AM PDT

Register Now

Extracting data from a surface, through time, using PyTecplot

In this example we want to extract Pressure values through time from the wall of a simulation at specific XYZ locations. After the extractions, we want to plot the results with Time on the X-Axis and Pressure on the Y-Axis for each XYZ location.

To do this we must use the PyTecplot function tecplot.data.probe_on_surface(). Another probe function, tecplot.data.probe_at_position(), is available but is likely to fail since it expects data to exist at the exact XYZ location (rather than near the location). Since a surface is infinitely thin it’s unlikely that the supplied XYZ location will be exactly on the surface, so we use the tecplot.data.probe_on_surface() function to find the surface value closest to the XYZ location.

Download the Data, layout and Scripting Files

Download the ZIP file

Extract Data Instructions:

wing inside boundary

Figure 1. View of the wing inside the boundary

  1. Load data.szplt and switch to the 3D Cartesian plot type.
  2. Activate the ‘wall’ zone in the Zone Style dialog.
  3. Turn on the Contour zone layer and change the contouring variable to Pressure.
  4. Fit the data (Ctrl+F) and rotate the view as seen in Figure 1.
  5. Allow Python connections via Scripting>PyTecplot Connections…
  6. From a command prompt, ‘cd’ to the directory that contains ‘probe_on_surface_through_time.py’ and run the script using the command:
    > python –O probe_on_surface_through_time.py
  7. The script extracts data from the XYZ locations specified in XYZ.txt and will create one zone for each XYZ location. These zones represent the Pressure values on the wall at each of those locations.
  8. To plot the new data, create a new frame and switch to XY Line plot type. Create line mappings using the Create Mappings dialog (see Figure 2 below).
  9. To show to timing marker in the XY plot, run the show_markergridline.mcr macro.
  10. In the 3D plot, activate the three new zones and use the Scatter plot layer to display the XYZ locations in the 3D plot.
  11. The final result is shown in Figure 4.
Create mappings dialog

Figure 2. Create Mappings dialog

Pressure over time

Figure 3. Pressure over time at each of the three XYZ locations on the wall


Final Result

This Tecpot image shows the line data and the XYZ locations in context of the 3D plot.

Extract Surface through Time

Figure 4. Final result showing the line data and the XYZ locations in context of the 3D plot

Also see the related Tecplot 360 Video Tutorial, External Flow – Comparing a CFD Simulation with Experimental Data.

The post How to Extract Data from a Surface, through Time appeared first on Tecplot.

ATS, Tecplot Distributor in Brazil, Specializes in High-End CFD Solutions

$
0
0

In a new series, we’re excited to showcase Tecplot’s excellent distribution network, starting with ATS, our distributor in Brazil. While North American and European sales and support are covered directly by Tecplot, we’re thrilled that users in most other parts of the world can receive great instruction and service from an expert in their own time zone and language. ATS certainly fits this description.

Reliable and Robust Solutions for Mechanical and Thermo-fluid Dynamic Systems

We asked ATS to describe who they are and what they do.

ATS is an engineering services and software distribution company based in Sao Paulo, Brazil, with an engineering office in Miami, FL. We specialize in high-end numerical computational solutions. And we work with clients in the aeronautical, space, defense, oil & gas, mining and heavy industries. Our approach is aligning traditional engineering methods with advanced computational techniques to provide reliable and robust solutions for mechanical and thermo-fluid dynamic systems.

In the aerospace industry we work on conceptual projects and studies, product development phases (JDP, PDR, CDR), experimental test planning, execution and analysis, and certification projects, all the way from creation to modification and upgrading of existing equipment. We are 100% composed of engineers with real industry experience on aerodynamics and combustion, structural analysis, systems engineering, thermal and chemical processes, CFD and FEA simulations, optimization algorithms and several other types of studies and analysis. In order to execute our projects, we must rely on fast, robust and accurate software for numerical simulation. Our expertise has allowed us to become distributors of some of the best software on the market:

Tecplot 360 has been one of our greatest tools for development and analysis.

The wide range of visualization tools available on Tecplot 360 allows a deep understanding of the phenomenon being analyzed, providing essential information for engineering studies and decision making.

Case Study: Landing Envelope of a Helicopter on a Brazilian Navy Corvette

We asked ATS for an example of how they put their expertise in CFD and their knowledge of how to get the best out of Tecplot to the test.

One of the cases we’ve worked recently was the definition of the landing envelope of a helicopter on a Brazilian Navy Corvette. As many of us know, a helicopter has its own landing envelope dictated by the manufacturer, defining the limits of wind direction and speed during a landing maneuver on the ground. When landing on a ship under rough wind and sea conditions, the picture is a little different.

The huge corvette structure is disturbing the air flow on the landing deck in such a way that the wind conditions on the helicopter during the landing maneuver is not the same as it would be on a ground landing.

Each helicopter has its own ground landing envelope, and each ship affects the flow in a unique way, forcing the definition of a specific ship landing envelope for each combination of helicopter and ship. This ship landing envelope definition is usually done with several wind tunnel experiments and actual flight tests, which are expensive, time consuming and dangerous for the test pilot and the ship crew.

ATS was hired by the Brazilian Navy to provide a better solution for the problem, and we proposed a numerical approach with computational fluid dynamics. We validated our CFD simulations with available experimental data, using Tecplot 360 as the main post-processing tool for the analysis.

We were able to analyze the flow around the Corvette and the landing deck on several wind and sea conditions using these Tecplot 360 tools:

  • Discrete vector plotting
  • Volume and surface slicing and extraction
  • Excel data loading
  • XY line plotting
CLICK IMAGES TO SEE LARGER VIEW [See image gallery at www.tecplot.com]
CFD Analysis Team

Meet the ATS Team. We are 100% composed of engineers with real industry experience. Contact us for high-end numerical computational solutions.

The results were delivered and widely approved by the customer, leading to academical papers submission, new project requests and deeper partnership between ATS and the Brazilian Military Forces.

Contact ATS

As you can see, ATS is highly qualified to represent Tecplot in Brazil. If ATS can assist you with Tecplot sales or support, or CFD consulting services. Please contact ATS directly.

ATS Aerothermal Solutions
Tel: +55 (11) 4119-5549
Fax: +55 (11) 3854-4224
Email: tecplot@ats4i.com.br
Web: www.ats4i.com.br

The post ATS, Tecplot Distributor in Brazil, Specializes in High-End CFD Solutions appeared first on Tecplot.

Compare CFD vs Measured Data through Extractions

$
0
0

Today I will show you how to get more out of your simulation data by using data extractions. Many of you know Tecplot 360 can show you your simulated data in vibrant 3D views. But we also know that many engineers make decisions by looking at single values or line plots. And that is where data extractions come in.

I am Scott Fowler, the product manager of Tecplot 360. I have been with Tecplot since 1999. One of my favorite things about this job is being able to interact with such an intelligent people like yourselves. Thank you for making my job so interesting!

Four Methods for Extracting Line Data in Tecplot 360

Video Timestamp – 0:02:06
Extractions help analyze CFD vs Measured Data
I am going to show you four techniques for extracting line data. You can use the first three techniques directly through the Tecplot 360 user interface. The fourth uses a new function in PyTecplot, our Tecplot 360 Python API (application programming interface).

  1. Extract from Polyline
  2. Extract precise line
  3. Extract a slice from a slice
  4. Probe on Surface – PyTecplot only

Demo, Data and Scripts

Video Timestamp – 0:03:45

The data, layout and scripts used in this demonstration are available for download. I am using the ONERA M6 Wing data simulated using SU2. In Figure 1, the spheres you see represent the locations of the measured data on the wing. The experimental data has been normalized and is also in the examples folder.

Download the Data, Script, and Layout Files

Method 1: Extracting from Polyline

Video Timestamp – 0:05:04

First, I will look at a way of extracting data using “Extract from Polyline.” This is a helpful tool for getting a quick and dirty view of what is happening on the surface. I am going to turn off the scatter layer, so we see just the wing.

  1. Select the Polyline tool and click two points along the leading edge of the wing. Now I have clicked once, clicked twice, and now it is just kind of hanging here. Right-click to finish drawing the Polyline.
  2. Select the Polyline by clicking on it, right-click on the line select Extract points which brings up the Extract Data Points dialog. This dialog gives me the choice of how many points along the line to extract. I can extract an even distribution of points along the line. The default is 200 spaced evenly along that line. (Or I can extract the points that define the geometry. I defined the Polyline by only two points, one at the start and one at the end, so I don’t want this option). I want data in the middle, evenly spaced, so I am going to select regular points along that geometry.
  3. Click Extract and the extraction is now complete. Open the Data>Data Set Information dialog. You can see that I have a zone called Extracted Points with 200, and it has all of the variable values associated with it.
  4. Plot these results using the Create New Frame tool . Click and drag to create a new frame.
  5. Change the Plot type to XY line. The new frame will inherit the data that was in the original frame. For the X-Axis, select y. For Y-Axis, select Pressure_Coefficient. For Zone, select the Extracted Points.

This is an easy way to get a quick line-plot view of your data using the Extract from Polyline tool.

Just a couple of notes about the Extract from Polyline tool. You can do arbitrary Polylines. Or click a number of points and extract a Polyline from these points. You may want to do this if you are in geoscience and you want to extract points on the surface of the ocean, or up an inlet or river. A tool like this is useful to follow the path of that river. And if you have transient data, when you have the Polyline selected, you can go to data, and extract the geometry over time.

One warning about Extracting from Polyline. Orientation of my data matters. I will turn off the mesh so you will see only the Polyline. If I rotate my plot, I am going to get a different set of points. Tecplot 360 extracts these points by shooting a ray from your eye through the screen, through the monitor, through that point, and then hitting the surface. Now I am going to get a point right on this line, but if I rotate my plot slightly, I am going to get a line in a very different location. This is important to know when you are writing scripts. If you are running Tecplot 360 in batch mode, you need to make sure that you do not change the orientation of your plot; that it stays the same relative to your Polyline.

Method 2: Extracting a Precise Line

Video Timestamp – 0:09:00

To specify an exact XYZ starting location and ending location, use the Extract a Precise Line (Data>Extract Precise Line). This tool is ideal for extracting data from a volume because we are specifying exact XYZ locations. Extracting from a surface like this, has similar issues to extracting the Polyline geometry in that it is dependent on the orientation the plot.

To look at a line that goes from the leading edge to the trailing edge, use the probe tool .

Click on the leading edge. Then copy and paste the XYZ values from the probe sidebar (hit CTRL+C, CTRL+V). Probe again at the trailing edge and then copy the XYZ values.

This time we will specify 100 points evenly distributed along the line. And we will go ahead and hit extract. Turn on the mesh. You see that I now have the line from our previous extraction and the line from this new extraction. If I rotate the plot you can see that of course an airfoil has shape to it. The line that I am extracting goes through the middle of the airfoil. In this view, if I hit extract, I am going to again shoot a ray from my eye through the screen and hit the surface that is along that line, which will hit the inside of my wing. If I extract again, you see that the line is inside my wing, and then as we rotate out, you can see that it is all the way back here.

In Summary, use the Extract Precise Line for extracting specific locations. But when extracting from a surface, remember that this method uses the same technique of shooting a ray from your eye through the screen to that location. Extract Precise Line is dependent on the orientation of your plot.

However, if you are extracting from the volume, the XYZ locations are within the volume, and your extractions will not be dependent on orientation.

Method 3: Extracting a Slice from a Slice

Video Timestamp – 0:12:13

Why would you want to extract a slice from a slice? I will start with the original plot and first turn on my slice layer and then turn off scatter.

Now I have a slice going through my volume domain near the surface of the wing. At the boundary layer my cells are very, very small. When I have an irregular distribution of points like this, the Extract Precise Line technique works okay but may not capture the information I am looking for. It spreads out too far in the region where my cells are small, and then over specifies in the area where my cells are large. We can approximate that by using the geometry tool (Create polylines geometry) and extracting points.

Now extract points, 200 points along the line, and we will turn on scatter again. When I zoom in, you can see that while I have 200 points evenly distributed along the line, the resolution between those points is not fine enough near the boundary. And it becomes too fine as my cells get larger. Extracting a precise line over-specifies the number of points that I want to extract.

A better way is to extract a slice from another slice. This will get the exact grid intersections. I will start over and do that (Delete the zone I just extracted, do a CTRL+F to fit the plot, and turn off scatter).

  • Right-click on the slice, select Extract, and then click Extract in the Extract Slice dialog to extract the slice. Now you see that we have some stitching here because I have a slice that is being drawn at the same time that I have a zone. These are coincident. So, when we send all these commands to OpenGL, these cells are exactly in the same spot. So OpenGL just picks one or the other. To remedy this, change slice group 1 to an X-plane.
  • I want to extract from a surface of the other slice. Now I have a line. You can see that this slice is also passing through the wing. But I don’t want it to pass through the wing, I want it to pass through the slice that we extracted. In the Zone Style dialog, turn off the wing. When I zoom in, you can see that the line is going right through all of cells.
  • Extract this slice. And then turn on the scatter layer and turn off the slice. We can see that this extracted line now has points at each one of the grid intersections. This will capture the information in the boundary layer with the cell density that you have.

Extracting a slice from a slice is a good technique for capturing grid density and avoiding over specifying.

Method 4: Extracting Using Probe On Surface

Video Timestamp – 0:16:12

Now I will show you how to use PyTecplot, the Tecplot 360 Python API to do these extractions. I want to extract the pressure coefficient information from my simulated data at each one of the measured locations. The spheres you see on the wing are measured data points.

Let’s zoom in and look at the leading edge. To change the center of rotation right to where my mouse is, I hit “o” on the keyboard. And then CTRL+right-click allows me to rotate. You can see as I zoom in, that the measured data is not exactly on the surface. If I were to probe at this XYZ position, and get information from the surface, it’s not going to be accurate because it’s not on the surface.

What is the solution? Our solution is to use the Python function called Probe On Surface. Probe On Surface takes an XYZ location and finds the nearest surface location independent of the view. It will use the normals of the surface data to try to find that nearest location.

Tecplot 360 Python API, PyTecplot

Video Timestamp – 0:17:39

PyTecplot is a Python API available to use with Tecplot 360 (with a maintenance agreement). More information, such as documentation and installation instructions on PyPi.org are available on our PyTecplot page.

PyTecplot runs in two modes:

  1. Connected-mode drives a live-running Tecplot 360 instance
  2. Batch mode is helpful if you have many files you want to process on a cluster. You will need enough licenses to run multiple instances simultaneously. But this powerful tool gives you access to the raw data.

Python is a separate installation. Please read the installation instructions. If you have Python 2.7, 3.4 or 3.5 and newer you can use PyTecplot. The command is “PIP install PyTecplot” on most machines.

First, I will reset the plot with CTRL+F and turn off the mesh.

Probe On Surface Demo

Video Timestamp – 0:19:30

I am going to run a script that I have already written, and then I will show you how it works. 

  1. To allow a Python script to drive a Tecplot 360 instance, we need to connect PyTecplot. Select Scripting>PyTecplot connections and make sure the Accept connections box is checked. We use sockets to communicate in between Python and Tecplot 360. In this demo, we are communicating with sockets over port 7600.
  2. Second, bring up a command prompt, and run the script, ProbeOnSurface.py.
  3. This script will find the XYZ locations for each of the zones that defines the points. At each location, it will call the Python script probe_on_surface and then construct a new zone within Tecplot 360.
  4. To confirm this, open the Data>Data Set Information dialog. You can see that we have the probed values.
  5. Open the Zone Style dialog and turn these zones on.
  6. Change the scatters symbols to cubes and change the size to 1.5%.

Now you can see the measured values are close to the spheres. Zooming in again, we see that the cube is actually on the surface, whereas the measured location is slightly off the surface. But using the normal of the cell to identify the closest location to the sphere is as close as we can get. Zoom back out using CTRL+F.

Analyzing the Probe On Surface Data

Video Timestamp – 0:21:30

Now we want to analyze this data. Let’s look at the data in a line plot.

  1. Create a new frame.
  2. Set the Plot to XY Line. The new plot inherits the data from the original plot.
  3. In the Create Mappings dialog, set X-Axis versus Y-Axis for all linear zones. And we want to look at X vs Pressure_Coefficient.
  4. Open Plot>Axis and reverse the Y-axis for the proper orientation of the Cp plot.
  5. Now let’s focus on one of the sections. Open the Mapping Style dialog and select only Map Number 4 and 11 (Sections 4 – .8),  and check Show Selections Only.
  6. Then fit the plot with CTRL+F.
  7. Add the line legend with Plot>Line Legend and click the Show Line Legend checkbox. Check the Symbols checkbox.

Now I have a quantitative view of the data. You can see the area where there is a large variance between the simulated data (probed line) and the measured data.

Analyzing the Variance Between Probed and Measured Data

Video Timestamp – 0:22:41

How do I find the variance on the model? Let’s bring our 3D view to the front and then do a calculation to highlight where the variance is.

  • In the Zone Style dialog, let’s again just focus on 0.8 and show selected only, and turn our wing back on.
  • Select Data>Alter>Specify Equations
  • You can see my seeded equation {cp_diff} = V12[6] – V12. This will compute a new variable called cp_diff. This will be the difference in pressure coefficient between the 12th variable in my dataset. V12 is shorthand for the Pressure_Coefficient. Make sure that you select zone #13 in the zone list because we want this equation to apply only to that zone.
  • Press Compute to calculate the difference in coefficient of pressure between these two zones.
  • Color the cubes by that difference in pressure coefficient. Open the Contour dialog and set up another contour group for cp_diff. Set the levels from -0.1 to 0.1 with 11 levels. This will put zero right at the center.
  • Select a different color map. I will choose this orange and purple.
  • Open the Zone Style dialog, right-click and select contour group 2. Now you can easily see where we have a difference between our measured data and our simulated data.

The scatter symbols are sized by a percentage of the frame. In Tecplot 360, you can zoom in on the frame itself. You can see I am bringing the whole frame closer to me. To do this, I am holding down the shift key and pressing and dragging the middle mouse button, that brings everything closer. Now I can get a quantitative understanding of the difference between the measure data and the simulated data.

The Python Script, Probe On Surface

Video Timestamp – 0:25:55

To fit all my frames back to my view, press CTRL+Shift+A, and to fit my wing, press CTRL+F.

Now, let’s look at my Python script, ProbeOnSurface.py. The script is available in the packaged download file.

  • Import a Python package called NumPy, which is a mathematical package. NumPy has functions for matrices, arrays, and other mathematics.
    import numpy as np
  • Import the Tecplot package and alias Tecplot to tp. Everytime you see tp, I am referencing Tecplot.
    import tecplot as tp
  • Connect the script to the live running version of Tecplot 360.
    tp.session.connect()
  • Suspend the user interface. Because I am connected to a live running instance of Tecplot 360, every function call will try to update Tecplot 360. In this situation, because I am doing introspection of the data and math, I don’t need to update the view until the end. Suspending the user interface will make the script run a little bit faster as well.
    tp.session.suspend():
  • Get the current frame.
    frame = tp.active.frame()
  • Get the dataset in that frame.
    dataset = frame.dataset
  • Get a list of zones that start with the word “Section.” This is my measured data. (My measured data all start with the word “Section.”)
    sections = dataset.zones(“Section*”)
  • Loop over all Section zones, which puts the XYZ locations associated with my measured data into an array.
    for zone in sections:
        print(“Extracting simulated results for: “, zone.name)
        points = [zone.values('x').as_numpy _array()
               ,zone.values('y').as_numpy _array()
               ,zone.values('z').as_numpy _array()]
        num_points = len(points[0])
  • Pass this data off to the Probe On Surface function. Limit the search to a single surface to make sure that Probe On Surface looks only for data on the wing surface.
    res = tp.data.query.probe_on_surface(points, zones=[dataset.zone("WingSurface")])
  • Through a little bit of NumPy magic, I can reshape the results, so they are passed back off the Tecplot to create new data.
    values = np.array(res.data).reshape((-1, num_points))
  • Add a new zone to the dataset with the probed results (called “Probed -“). Do this for each variable. And then for each of the variables in the dataset, I am putting the probe results into this resulting zone.
    probed_points = dataset.add_ordered_zone('Probed - ' + zone.name, num_points)
    for val, var in zip(values, dataset.variables()):
          values(var)[:] = val
  • End the script.
    print("Done")

If you are new to Python and PyTecplot, our PyTecplot Docs are a good resource, and if you have a Tecplot license with maintenance, contact our excellent Technical Support Team.

Download the Data, Script, and Layout Files

We will be posting the Q&A section of this Webinar in a separate blog.


Get the Newest Version of Tecplot 360

Request a Free Trial

Get Invited to Upcoming Webinars

Subscribe to Tecplot

 

The post Compare CFD vs Measured Data through Extractions appeared first on Tecplot.

Complex Nature of Higher-Order Finite-Element Data

$
0
0

Visualizing Higher-Order Finite-Element Data – Part 2: The Challenges

This blog was written by Dr. Scott Imlay, Chief Technical Officer, Tecplot, Inc.

“Run when you can, walk if you have to, crawl if you must; just never give up!”

-Dean Karnazes, Ultramarathon Man

I feel it is important to acknowledge our worldwide struggle with COVID-19. Like me, most of you have probably made significant changes to your lives to slow the spread of the disease. Some of you have been more directly affected; having yourself or loved ones fall ill. A few of you may have lost a loved one. I used variations of the Dean Karnazes quote above as a mantra to help keep me moving through the most difficult parts of IRONMAN triathlons. It also helped me through the darkest moments of my grief after my daughter passed away last year. If you are going thru a dark time, give it a try.

Run when you can, walk if you have to, crawl if you must, just never give up! Keep moving forward!

Visualization techniques for Higher-Order Finite-Element Solutions

Isosurface in a linear tetrahedra.

Figure 1. Isosurface in a linear tetrahedra.

In keeping with this theme, my colleagues and I at Tecplot are pushing ahead at full speed on new features and new releases, in spite of working from home. My current role is researching visualization techniques for higher-order finite-element solutions. My last blog Visualization of Higher-Order Elements was a primer on higher-order finite-element CFD methods – what they are, how they are used, and what they work best for. In this blog I will address the challenges visualizing the results of a high-order CFD solution.

The complexity of higher-order finite-element data complicates the visualization process. First, is the variability in defining the coefficients of the polynomial basis functions. For nodal techniques, the coefficients of the basis function are the values of the solution at the nodes. Sometimes a modal technique is used where the polynomial is less coupled to the nodal values. When developing visualization algorithms for the higher-order-element data we much decide which basis functions to use.

Frequently, the polynomial order used for the solution is higher than the polynomial order used to define the curved edges and surfaces of the grid. For example, the grid may use a linear or tri-linear polynomial (our normal elements) while the solution within the element may vary by a third-order polynomial. For curved edges and surfaces, a second- or third-order polynomial is often used even if higher-order polynomials (up to 10th order) are used for the solution.

Solution Complexities

Another complexity is that the solution is not always continuous. For example, the discontinuous Galerkin (DG) method has a discontinuity in the solution values between adjacent elements. Customers sometimes want to see the discontinuity in their visualization and sometimes they don’t. For example, the amount of discontinuity gives them information on the level of grid-convergence. Small jumps between elements mean they have a sufficiently dense grid while large jumps mean the grid is too coarse. On the other hand, when presenting the results to customers they would prefer not to see the discontinuities.

Nature of Isosurface – Linear versus Quadratic

But, probably the biggest complexity for higher-order-element visualization algorithms is the very nature of the data. Consider first the isosurface passing through a linear tetrahedral element. Because the solutions are linear, the isosurface within the element will be a planar triangle or quadrilateral (see Figure 1).

Visualizing Higher-Order Finite-Element Data

Figure 2. Isosurface in a quadratic tetrahedra.

In fact, the isosurface can be completely defined by its intersections with the edges of the tetrahedra. Since the solution varies linearly along the edges you can calculate these intersections very quickly. You can also quickly exclude edges based on the range of the nodal values at either end of the edge. If the isosurface value is greater than the maximum node value, or less than the minimum node value, no need to compute further. In this way, the vast majority of the edges can be excluded from further computation by a couple of simple floating-point compares. This, among other optimizations, make this simple technique very fast. The equivalent algorithms (marching cubes) for hexahedra is a little more complex, but the same sort of optimizations apply.

Isosurface in a quadratic Tetrahedra

No such simple isosurface algorithm exists for higher-order elements. The isosurface is not, in general, planar and it doesn’t even have to intersect the edges or surfaces of the element (see Figure 2). You can have isosurfaces that are entirely contained within an element like little islands. It demands a new and, most likely, more computationally expensive algorithm.

Other areas of visualization are also complicated by the use of higher-order elements. Surface shading, mesh plots, interpolations for streamtrace computation (and other things) all must be modified.

In my next blog, I will discuss the results of our research into higher-order finite-element isosurface algorithms.

Subscribe to Tecplot 360

Get notified when the next blog is posted!

Subscribe Now

The post Complex Nature of Higher-Order Finite-Element Data appeared first on Tecplot.

Creating Materials Legend Tecplot 360

$
0
0

Here’s a Tecplot Tip that requires a bit of Tecplot “Kung Fu” – but our customers love it!

Tecplot 360 is designed to read and display numeric data, but sometimes you may have categorical data that is best represented using names. We call this a Materials Legend. An example of this type of data is a groundwater simulation in which scalar values refer to materials such as rock, sand, and water. Another example is an internal combustion simulation where the particles have different states: Not in wall film, In wall film, rebounded, etc.

While categorical data is not the primary design target, Tecplot 360 can display this information in the Contour Legend using Custom Label Sets. Custom labels are text strings contained within a data file or text geometry file which define labels for your axes or contour table. You may select Custom Labels anywhere you can choose a number format. The result is the text strings in place of numbers. There is more information on Custom Labels in our documentation:

Creating Custom Label Sets

Our goal here is to create a legend which displays the names associated with the DP_film_flag variable values in a CONVERGE dataset (from Convergent Science). The CONVERGE documentation defines the values of DP_film_flag as shown in the table below.

Value Meaning
0 Not in wall film
1 In wall film
2 Rebounded
3 Splashed
4 Separated
5 Stripped
Custom Label Sets

Figure 1. Custom Label Sets

Custom Label Sets are a way of assigning strings to (1-based) positive integer values. A custom label set can be a simple one-line file containing the strings that you want to associate with the values. You can then load this data file with your simulation data.

The first string is associated with the value 1, the second string with the value 2, and so on. Since the DP_film_flag values start at zero, we have to create a 1-based copy of this variable, which I will demonstrate below. 

Part 1: Initial setup

  1. Load the files: tec000050.plt and customlabels.dat. Download the ZIP file below to find the files.
    Materials Legend Files
  2. Create a new variable called Film Flag which is a 1-based version of DP_film_flag. This new variable will be used to color the particles. 
    Specify Equations

    Figure 2. Specify Equations dialog

     

  3. Adjust the plot style to display the spray zone, colored by Film Flag and shaped as Octahedron (Octahedrons are faster to draw than Spheres and easier to see than Points. We’ll use the Sphere shape for the final output). Watch this 2-minute video tutorial on displaying spray particles.

In Figure 3, you can see distinct colors, but it’s difficult to know which particles are In wall film or Rebounded by looking at numbers. We want to see the names on the legend, instead of the numbers.

Adjusted Plot Style

Figure 3. Adjusted Plot Style: display the spray zone, colored by Film Flag and shaped as Octahedron.

Part 2: Adjusting the Contour Legend to create the Materials Legend

  1. Double-click on the contour legend and set the contour levels to integer values 0-6. The zero value ensures we have an extra color band at the bottom of the legend.  
    Contour Details dialog

    Figure 4. Contour Details dialog

     

  2. Display the string values on the legend: Select the Legend page and click on the Number Format… Now, In the Specify Number Format dialog choose Custom set 1, and change the Prefix and Suffix fields as shown below. Using the <sub> and </sub> notation is a trick to align the strings with the center of the color, rather than at the division of the color band. Make the font Bold to increase the size and weight of the font, because the subscript notation reduces it.
    Contour Details Legend

    Figure 5. Display string values on the legend in the Specify Number Format dialog.

     

  3. Now, Adjust the end points of the legend to white so they blend into the background. Start by unchecking Separate color bands.
  4. Next, open the Legend Box… and set Legend Type to Fill with Fill color set to White.
    Legend Box

    Figure 6. Legend Box Dialog

     

  5. To make the end-points of the legend white, use the Override band colors feature from the Bands page. Override the band spanning 0-1 and the band spanning 7-8. 
    Override Band Colors

    Figure 7. Override band colors option

     

  6. The contour legend should now appear as the adjusted Material Legend for the Film Flag.
    Film Flag

    Figure 8. Adjusted Film Flag Legend

     

  7. To further distinguish the colors of each material you have two options:
    • Use additional band overrides to define specific colors for each level.
    • Choose a different colormap (or create a custom colormap – see Materials_Legend.py in the supplied files). For this dataset, the Qualitative – Dark 2 colormap does a pretty good job of distinguishing between the different values.
    Contour Details-Qualitative Dark 2

    Figure 9. Qualitative Dark 2 colormap

 
And here is your final image.

Materials Legend

Figure 10. Final Image – Materials Legend for the Film Flag

 


See Related Videos »

The post Creating Materials Legend Tecplot 360 appeared first on Tecplot.


Getting Started Tecplot for Barracuda

$
0
0

The webinar is hosted by Scott Fowler, Tecplot 360 Product Manager, and Sam Clark, Barracuda Virtual Reactor Product Manager.

Description

You won’t find a tutorial here, but I will give you a tour of what Barracuda Virtual Reactor® users will see as they begin to use Tecplot for Barracuda to look at their simulation results. And for anyone who is not familiar with Barracuda from past experience, I’ll point out a few things that make Barracuda unique among CFD codes.

Barracuda Virtual Reactor® is the industry standard for CFD simulation of industrial fluidization systems, and it just got a whole lot more powerful thanks to a recent partnership with Tecplot, Inc. This Webinar will help you get started using Tecplot for Barracuda while learning best practices for plotting and analyzing Virtual Reactor™ data. 

Tecplot for Barracuda will greatly enhance the ease-of-use, flexibility, and operating system compatibility of Barracuda’s post-processing capabilities. The CPFD Software team is excited about Tecplot for Barracuda and we are confident that Barracuda users will find it to be a powerful tool for post-processing their simulation results.

Webinar Agenda

  • Tecplot and CPFD​
  • CPFD and Barracuda Virtual Reactor​
  • Fluidized Bed Example​
  • Where to learn more​

First I’ll give you a quick overview of the example problem we’re going to be using to do this demo today, this is a large industrial scale fluidized catalytic cracking regenerator and Barracuda is very strong in this area. It has become an industry standard for people who are doing simulations of FCC regenerators. This particular example is based on a case study that was presented at the 2016 AFPM annual meeting. There is a paper available if you want to dig in to more of the details of the case study itself and what the engineering conclusions were. That paper is available on the CPFD Software website.

Demonstration Outline

  • Launching Tecplot360 from the Barracuda GUI​
  • Viewing the Grid and Boundary Conditions
  • Exploring 3D simulation results​
  • Using multiple frames
  • Selecting spatial regions using blanking
  • Working with layouts and frame styles​
  • Comparing two simulations side-by-side​
  • Extracting data from 3D results
  • Plotting data from Barracuda’s text-based output files

The post Getting Started Tecplot for Barracuda appeared first on Tecplot.

Tecplot 360 Basics Training – Aerodynamics

$
0
0

Description

Tecplot 360 Basics training with Account Manager Jared McGarry. Jared has plenty of tips, tricks, and best practices to show you how to analyze your data more effectively. This training uses the ONERA M6 Wing dataset, which you can find in your Tecplot 360 installation examples folder.

  • Touring the Tecplot 360 User Interface. ​
  • Loading your data. ​
  • Exploring your data – styling slices, iso-surface, and streamlines. ​
  • Calculating new quantities – using the equation editor and built-in functions. ​
  • Extracting data – for dimensionality reduction. ​
  • Line Plotting – engineering decisions are often made with simple line plots. ​
  • Exporting your results – exporting images, animations, and videos. ​

Try Tecplot 360 for free

The post Tecplot 360 Basics Training – Aerodynamics appeared first on Tecplot.

Tecplot 360 Basics Training – Q&A

$
0
0
You asked some great questions during the Tecplot 360 Basics Online Training session using the ONERA M6 Wing dataset. Over 150 scientists and engineers registered to learn how to increase their efficiency when visualizing and analyzing their CFD results.

We were not able to answer every question during the training, and this blog provides answers to all the questions. We thought you all might be interested in reading through them to find ones that will help you with your work.

You can watch this training session video, register for upcoming training sessions, and watch recorded sessions.

How can I make a graphic overlapping two pair of data with different delta X?

To overlay two datasets that have different X values, you have two options:

  1. Use Data>Alter>Specify Equations to normalize the X variable. You can then plot both datasets in the same frame.
  2. Use two different frames. Load each dataset into a separate frame and then overlay the frames. Use Frame>Edit Current Frame to make the frame background transparent.

How do I pull out a single variable from a pre-formatted Tecplot dataset and plot it as line vs time?

If I have understood the question correctly, after you load the data, you can use the Tools>Probe. This command creates a time-series function to plot the values at a specific point through time. You can also use the Analyze>Perform Integration tool to create a line plot of an integrated variable versus time.

Can I input exact geometries to extract? For example, can I define a rectangle by coordinates and then extract geometry over time?

Yes, you can do this using our scripting layer. See the macro command, $!ExtractFromPolyline, in the Tecplot Scripting Guide.

If you prefer Python, use the script, tecplot.data.extract.extract_line(), in the PyTecplot Reference Manual.

Could you do a seminar on PyTecplot?

We have many tutorials and webinars on PyTecplot. Here is a list of the resources available on our website. And we will most likely do a future online training on PyTecplot!

Which export format do you recommend?

Tecplot binary files (.plt or .szplt) are recommended for importing and exporting Tecplot 360 data. See our blog on Comparison of Data File Formats.

If you are asking about image and animation export formats, here is our advice. The vector image formats EPS and PostScript will give you the clearest high-resolution images for printing and publications. If you are sharing your images online, JPEG, PNG are best because they will be easier to render and the files sizes will be smaller. Here is a short blog on Exporting Image File Formats.

For movies, we find that MP4 works well for us. The format you choose will certainly depend on where you will be using the video.

Can Tecplot 360 import CFD++ data directly?

CFD++ exports directly to Tecplot binary format (.plt), and we recommend that. Tecplot 360 is compatible with many other file formats. Here is a short video tutorial on Loading Your Data. And here is a link to all Tecplot 360 compatible file formats.

Can Tecplot 360 read Autodesk CFD files?

Tecplot 360 does not have a direct loader for Autodesk CFD files. We can read STL files, so if you’re bringing in a geometry, we can read the STL format. If you are having trouble loading your data, please contact our support staff (support@tecplot.com), and we’ll see if we help you.

If I switch to a predefined view in 3D (let’s say an XY view), can I control the direction of the view?

I believe you are referring to the Snap to orientation view in the plot sidebar. Yes, once you snap to an orientation view, you can manipulate the plot as usual. The Snap to orientation views are quick shortcuts to get to a certain view.

Can you integrate the pressure along the wing surface to get the net force?

Yes. You do that with the Analyze>Perform Integration menu, which opens the Integrate dialog. Then you can do integrations, and calculate forces and moments. Here are a couple of links that can walk you through calculating forces:

In a map view of a terrain where Z changes with X and Y, can Tecplot 360 show an X, Y view of only the top most layer nodes? Sometimes it shows contours underlying the layers.

This is an interesting question. In coastal and ocean modeling, for example, if you load FVCOM data, which have X, Y and Z dimensions, and show a 2D plot, Tecplot 360 has no awareness of depth in that 2D view. The Z axis must be assigned to tell Tecplot 360 whether to show the top nodes or the bottom nodes. If you want to see a top down view, change to a 3D plot and assign the Z axis for a top down view.

Can I do a derivation of the variables in the equation editor?

Yes, go to Data>Alter>Specify Equations to open the Specify Equations dialog. Click on the Help menu, which opens the equations page in the Tecplot 360 User’s Manual. This Help page has links to the equation syntax. There you will see a list of the different expressions and operators you can use. The page also tells you how to do different derivative and differencing functions, if you want a derivative of an existing variable.

Export image and video formats seem to lose some quality compared to what I see in the Tecplot GUI. Can you give me some suggestions?

The first thing to try is to check the anti-aliasing box and set it to three (3). Antialiasing will smooth out the lines and the text. However, there will still be some differences in the onscreen vs. the exported images. Tecplot 360 uses one branch of code for onscreen rendering, and a different branch when exporting. I recommend exporting larger images with anti-aliasing.

Is there a way to find the location of the maximum or minimum value of a variable?

This capability is not built into the Tecplot 360 GUI (graphical user interface), but can be done with our Python API, PyTecplot. A script to highlight the maximum point is available on our GitHub page. More information can be found in our user manuals, installation, getting started, scripting and quick reference guides in our Tecplot Product Documentation.

The post Tecplot 360 Basics Training – Q&A appeared first on Tecplot.

Getting Started Tecplot 360 – FVCOM Dataset

$
0
0

Getting Started with Tecplot is easy with this online training session. Learn the basic capabilities of visualizing your results with Tecplot 360 in this 45-minute training session. The demonstration uses an FVCOM dataset (in netCDF format), however, the training is applicable for other datasets, whether you are working with steady or unsteady results.

You can follow along by downloading the dataset from our Getting Started Bundle. Timestamps have been added for each section to get you to answers faster! See all Training Videos.

Getting Started with Tecplot 360 – Training Agenda

  • Introducing Tecplot, Inc. [timestamp 00:30]
  • Touring the Graphical User Interface (GUI) [timestamp 04:00]
  • Loading FVCOM Data in netCDF format [timestamp 06:44]
  • Manipulating the Plot View [timestamp 08:00]
  • Viewing the Dataset Information [09:45]
  • Adding a Georeferenced Image [timestamp 11:22]
  • Adjustment of 3D Plot Axis [timestamp 11:50]
  • Blanking Values [timestamp 13:56]
  • Walking through the Plot Sidebar [timestamp 14:39]
    (Mesh, Contour, Shade, Vector, Edge, Scatter)
  • Viewing Slices, Isosurfaces, Streamtraces [timestamp 25:13]
  • Frames, Frame Style Files, and Frame Linking  [timestamp 29:55]
  • Data Extraction and Polylines [timestamp 33:45]
  • Exporting Results with Images and Videos [timestamp 41:10]
  • Q&A [timestamp 45:05]

The post Getting Started Tecplot 360 – FVCOM Dataset appeared first on Tecplot.

Even Vector Spacing

$
0
0

Even Vector Spacing in Tecplot 360

This video will demonstrate how to use Even Vector Spacing in Tecplot 360.

  1. Update Your Software to Tecplot 360 2020 R1 or newer. Get a Free Trial or Update your Licensed Software.
  2. The layout and dataset can be found in the Getting Started Bundle for Tecplot 360.
  3. Open the Ocean3 layout file in the Ocean\finallayouts folder.

Notice that the vectors are too dense in the rivers and inlets. We can thin these out using Even Vector Spacing.

Open the Vector Details dialog. Toggle on Use even vector spacing and Tecplot 360 will attempt to pick good default values for the vector spacing. Clicking Reset Spacing will force this attempt at picking values, dependent on the current scale of the plot. For this plot we want to increase the distribution of the vectors, so we will set the spacing to 0.003, 0.003, 1.

If you’re unsure what values to enter in this dialog, try the Measure Distance tool under the Tools menu to determine a good distance between vectors.

Notice that the spacing has been reduced in the rivers and inlets and it’s now easier to see the direction and magnitude of the vectors.

We can use attributes such as Vector Head Style, Uniform vector length, and Vector Arrowhead settings to further refine the view of the plot.

You may notice that the vectors are still not perfectly evenly spaced. Toggle on the Mesh to shows this more clearly. This is because Tecplot 360 is using the actual grid for vector locations and selectively removing vectors where the grid is too dense to approximately enforce the display intervals specified in the spacing controls. The advantage is that Tecplot 360 does not perform any interpolation of the data to generate the vectors, improving performance and accuracy of results.

Learn more about Tecplot 360 and See What’s New.

The post Even Vector Spacing appeared first on Tecplot.

Viewing all 281 articles
Browse latest View live