Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
es-ice_tut.pdf
Скачиваний:
127
Добавлен:
18.03.2015
Размер:
10.04 Mб
Скачать

Chapter 9

POST-PROCESSING: GENERAL TECHNIQUES

 

Creating an Animation of Temperature Isosurfaces

 

 

Figure 9-9 Fuel distribution at 400 degrees CA

Figure 9-10 shows the fuel distribution following combustion at 725 degrees CA.

Figure 9-10 Fuel distribution at 725 degrees CA

Creating an Animation of Temperature Isosurfaces

This section provides an example of how a pro-STAR input file (isoTemp.inp)

Version 4.20

9-15

POST-PROCESSING: GENERAL TECHNIQUES

Chapter 9

Creating an Animation of Temperature Isosurfaces

 

 

 

can be used to create an animation of temperature isosurfaces throughout the simulation. Opening the input file with a text editor will display its contents as shown below. For clarity, the full command names are shown, although the usual four-letter abbreviations can be used instead.

Connect the events file and load the transient data

RESUME, , EVFILE, CONNECT TRLOAD, ,

Create a custom colour table for use with the colour scale

CLRTABLE, POST, 1, 1.0, 0.0, 0.0, 0.3 CLRTABLE, POST, 2, 1.0, 0.6, 0.0, 0.3 CLRTABLE, POST, 3, 1.0, 1.0, 0.0, 0.3

Specify a 20-colour scale with a user-defined value range of 2200 and 2600

CSCALE, 3, USER, 2200, 2600

Set up the display items

PLLOCALCOOR, OFF, ALL PLDISPLAY, OFF, ALL PLDISPLAY, ON, LOGO PLDISPLAY, ON, HEAD PLDISPLAY, ON, MINMAX PLDISPLAY, ON, SCALE, ,8

Select the Extended Graphics option and a 1024 x 768 resolution for the image

TERMINAL, , EXTENDED HRSDUMP, IMAGE, 1024, 768

Set up a variable, it, that will be incremented at each loop iteration and begin the loop definition

*SET, it, 1, 1 *DEFINE, NOEXECUTE

Store the next time step

STORE, NEXT

Set up a crank-angle display label in the lower-right corner of the screen

*GET, TIME, time

*SET, CRANK, 3600 * TIME * 6 + 320 TSCALE, 4, 15

PLLABEL, 1, FORMAT, , 4, 10, 0.5 CRANK

F6.1, ' degCA'

9-16

Version 4.20

Chapter 9

POST-PROCESSING: GENERAL TECHNIQUES

 

Creating an Animation of Temperature Isosurfaces

 

 

Remove all manifolds from the cell set and define the current cell type as no. 501

CSET, ALL

CSET, DELETE, TYPE, 121 CSET, DELETE, TYPE, 122 CTABLE, 501, FLUID CMODIFY, CSET

Collect cell type 501 into a set and merge vertices for a clear view of the results

CSET, NEWSET, TYPE, 501 VSET, NEWSET, CSET VMERGE, VSET

Plot cell-averaged temperature data

GETCELL, T, ABSOLUTE CAVERAGE, CSET

Plot an isosurface at 2600 K and create a pro-STAR “layer” (described in Chapter 4 of the STAR-CD Post-Processing User Guide)

POPTION, ISOSURFACE, 2600 CPLOT

LAYER, ISO1, STORE LAYER, ISO1, HIDE

Plot an isosurface at 2400 K and create another layer

POPTION, ISOSURFACE, 2400 CPLOT

LAYER, ISO2, STORE LAYER, ISO2, HIDE

Plot an isosurface at 2200 K and create a third layer

POPTION, ISOSURFACE, 2400 CPLOT

LAYER, ISO2, STORE LAYER, ISO2, HIDE

Show all layers

LAYER, ALL, SHOW

Display the geometry edges

PLMESH, OFF CPLOT

EDGE, ON

REPLOT

Version 4.20

9-17

POST-PROCESSING: GENERAL TECHNIQUES

Chapter 9

Creating an Animation of Temperature Isosurfaces

 

 

 

Create a counter for the file names

*SET, itn, 1000 + it *SCOPY, itn, sitn, i4

Redisplay the mesh front view using the bottom-left corner of the graphics window and save it to a .gif file

WINDOW, 0, 0, 5, 5 VIEW, 0, -1, 0 ANGLE, 0 DISTANCE, 100 CENTER, 0, 0, -20

*SSET, sname, image_1_{sitn} HRSDUMP, GIF, {sname}

Redisplay the mesh side view using the bottom-right corner of the graphics window and save it to a .gif file

WINDOW, 5, 0, 10, 5 VIEW, 1, 0, 0 ANGLE, 0

DISTANCE, 100 CENTER, 20, 20, -20

*SSET, sname, image_2_{sitn} HRSDUMP, GIF, {sname}

Redisplay an isometric view of the mesh using the top-right corner of the graphics window and save it to a .gif file

WINDOW, 5, 5, 10, 10 VIEW, 1, 1, -1 ANGLE, 0

DISTANCE, 115 CENTER, -5, 10, -25

*SSET, sname, image_3_{sitn} HRSDUMP, GIF, {sname}

Redisplay the mesh top view using the top-left corner of the graphics window and save it to a .gif file

WINDOW, 0, 5, 5, 10 VIEW, 0, 0, 1 ANGLE, -90 DISTANCE, 100.0 CENTER, 0, 20, -20

*SSET, sname, image_4_{sitn} HRSDUMP, GIF, {sname}

End the loop definition and then execute the loop for all time steps

*END

*LOOP, 0, 152

9-18

Version 4.20

Chapter 9

POST-PROCESSING: GENERAL TECHNIQUES

 

Creating an Animation of Temperature Isosurfaces

 

 

 

Note that useful information on creating post-processing input files can be found in

 

the STAR-CD documentation set, volumes “pro-STAR Commands” and

 

“Post-Processing User Guide”.

 

Input files can be used by running pro-STAR in batch mode to generate images

 

and animations without opening the GUI. This facility produces consistent output

 

from several different models and simplifies the comparison of results.

 

Off-screen rendering with pro-STAR is not currently supported for Windows.

 

This means that the ability to use pro-STAR in batch mode to generate images and

 

animations is not available in the Windows environment. However, you can still use

 

the input file described above within the pro-STAR GUI by entering the following

 

command:

 

IFILE, isoTemp.inp

 

Note that when using an input file in the pro-STAR GUI, you need to add a c after

 

the TRLOAD, , and VMERGE, VSET commands, as the software will prompt you

 

to continue. This addition is not required when pro-STAR is running in batch mode

 

as the software does not prompt for input.

 

The following is an example of a Linux batch that creates an animation of

 

temperature distribution. The script employs third-party software (Gifsicle) to

 

create animations using several .gif files.

 

• Define a variable NUMB equal to 153 for use later in the script

 

NUMB=`ls image_1_1*.gif | wc -l`

 

• Run pro-STAR in batch mode, with input redirection to disable prompts, and

 

load the star.mdl model file

 

$STARDIR/bin/prostar gl -b << EOF

 

star

 

y

 

y

 

• Read the input file and execute its commands

 

IFILE, isoTemp.inp

 

• Quit pro-STAR without saving and complete the input redirection

 

QUIT, NOSAVE

 

EOF

 

• Convert the white background in each image to a transparent background.

 

Then, stack the four views on top of each other to combine them into a single

 

frame

 

sum=`expr 1000 + ${NUMB}`

 

for (( i=1001; $i <= ${sum}; i++ ))

 

do

 

convert image_2_${i}.gif -transparent \#ffffff

Version 4.20

9-19

POST-PROCESSING: GENERAL TECHNIQUES

Chapter 9

Creating an Animation of Temperature Isosurfaces

 

 

 

image_2_${i}t.gif

convert image_3_${i}.gif -transparent \#ffffff image_3_${i}t.gif

convert image_4_${i}.gif -transparent \#ffffff image_4_${i}t.gif

done

for (( i=1001; $i <= ${sum}; i++ )) do

composite -compose atop image_2_${i}t.gif image_1_${i}.gif comp1_${i}.gif

composite -compose atop image_3_${i}t.gif comp1_${i}.gif comp2_${i}.gif

composite -compose atop image_4_${i}t.gif comp2_${i}.gif final_${i}.gif

done

Remove unnecessary files rm comp*.gif *t.gif

Create an animation file called tempIso.gif using WhirlGif gifsicle -d 10 -l -o tempIso.gif final*.gif

Figure 9-11 shows the intake valve fully open at 470 degrees CA.

Figure 9-11 Intake valve at 470 degrees CA

9-20

Version 4.20

Chapter 9

POST-PROCESSING: GENERAL TECHNIQUES

 

Creating an Animation of Temperature Isosurfaces

 

 

 

Figure 9-12 shows the combustion phase and corresponding temperature

 

isosurfaces at 730 degrees CA.

Figure 9-12 Isosurfaces at 730 degrees CA.

Version 4.20

9-21

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]