Guest User

Untitled

a guest
Mar 5th, 2019
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.54 KB | None | 0 0
  1. # Session file started: 2019/02/02 21:38:00
  2. # CFX-19.1
  3.  
  4. # To avoid unnecessary file pre-processing and modifications, include
  5. # COMMAND FILE at the top of your session file.
  6. # If it is not included, the file is assumed to be older and will be
  7. # modified for backward compatibility.
  8. COMMAND FILE:
  9. CFX Post Version = 19.1
  10. END
  11.  
  12. #### Load extra perl functions
  13. ! use strict;
  14. ! use warnings;
  15. ! use File::Copy;
  16. ! use List::Util;
  17.  
  18.  
  19. #### Manual inputs:
  20. #### Input the directory location, Name of CSV file to collect information,
  21. #### ANSYS CFX .res file batch name
  22. ! my $CFXdir='E:/Upstream Study/';
  23. ! my $CSVfilename='UpstreamMeshStudy4';
  24. ! my $CFDbatchName='MeshStudy4_Case_';
  25. !
  26. ! my $AxialOffset=2;
  27. ! my $InletAxial=13.75;
  28. !
  29. #### Predeclare Variables
  30. ! our @splitline ;
  31. ! my $NumCols ;
  32. ! my $CasesStart;
  33. ! my $CasesEnd;
  34. ! my $RadiusIndex;
  35. ! my $LengthIndex;
  36. ! my $ClearanceIndex;
  37. ! my $UpAxialIndex;
  38. ! my $UpRadialIndex;
  39. ! my $InletRadialIndex;
  40. ! my $InletLocIndex;
  41. ! my $SealLocIndex;
  42. ! my $RotorSpeedIndex;
  43. ! my $LeakageIndex;
  44. ! my @OutArray;
  45.  
  46. #### Navigate to working directory
  47. ! chdir($CFXdir);
  48.  
  49. #### Make backup of .csv file and label with date and time
  50. ! my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
  51. ! $year=$year-100;
  52. ! $mon=$mon+1;
  53. ! copy "$CFXdir$CSVfilename.csv", "$CFXdir$CSVfilename\_backup\_$mon-$mday-$year\_$hour\_$min.csv";
  54.  
  55. #### For each .res file that matches the CFDbatchName post process in CFX
  56. #### to get relevent output information and slot it into the column associated
  57. #### with the number in the .res file name in the relevent arrays
  58.  
  59. # Read .res file list in the directory
  60. ! our @ResultList = grep ( -f , <$CFDbatchName*.res> );
  61. ! @ResultList = grep ( !/_old/ , @ResultList );
  62. # Count matching .res files in the res file list
  63. ! my $NumRes = scalar(@ResultList);
  64.  
  65. #### Open the .csv output file and process relevent geometric and operating
  66. #### condition information
  67.  
  68. # Load the file
  69. ! open our $InHandle, '<', "$CSVfilename.csv" or die "Can't read old file: $!";
  70. ! open our $OutHandle, '>', "$CSVfilename-output.csv" or die "Can't write new file: $!";
  71.  
  72. # Read file line by line
  73. ! my $linenum=0;
  74. ! my $ReadDataAtLine=1000;
  75. ! while(my $line = <$InHandle>) {
  76. # Advance line number by one
  77. ! $linenum++;
  78. # Grab a line from the input file
  79. # Remove line return from the line that was grabbed
  80. ! chomp($line);
  81. # Split the line by commas
  82. ! @splitline = split(/\s*,\s*/,$line);
  83. # find how many elements are in the split line array
  84. ! $NumCols = scalar(@splitline);
  85.  
  86. #### Begin parsing each line for relevent information
  87. # First few lines contain meta information about which cases to process
  88. ! if ($splitline[0] eq 'Import Cases') {
  89. ! $CasesStart=$splitline[1];
  90. ! $CasesEnd=$splitline[2];
  91. ! }
  92. # Check first array term and parse values
  93. # Import the geometry information
  94. # Import Variable Names as array from file
  95. ! elsif ($splitline[0] eq 'Variable Name') {
  96. ! my $indicesFound=0;
  97. ! my @q = (1..scalar(@splitline));
  98. ! for(@q){
  99. ! if ((defined $ResultList[$_]) && $splitline[$_] eq 'Radius (R)'){
  100. ! $RadiusIndex=$_;
  101. ! }
  102. ! elsif ((defined $ResultList[$_]) && $splitline[$_] eq 'Length (L)'){
  103. ! $LengthIndex=$_;
  104. ! }
  105. ! elsif ((defined $ResultList[$_]) && $splitline[$_] eq 'Clearance (H)'){
  106. ! $ClearanceIndex=$_;
  107. ! }
  108. ! elsif ((defined $ResultList[$_]) && $splitline[$_] eq 'Cavity Axial Width (W)'){
  109. ! $UpAxialIndex=$_;
  110. ! }
  111. ! elsif ((defined $ResultList[$_]) && $splitline[$_] eq 'Cavity Radial Depth (D)'){
  112. ! $UpRadialIndex=$_;
  113. ! }
  114. ! elsif ((defined $ResultList[$_]) && $splitline[$_] eq 'Inlet Radial Depth (Dinlet)'){
  115. ! $InletRadialIndex=$_;
  116. ! }
  117. ! elsif ((defined $ResultList[$_]) && $splitline[$_] eq 'Inlet Location (di)'){
  118. ! $InletLocIndex=$_;
  119. ! }
  120. ! elsif ((defined $ResultList[$_]) && $splitline[$_] eq 'Seal Location (dS)'){
  121. ! $SealLocIndex=$_;
  122. ! }
  123. ! elsif ((defined $ResultList[$_]) && $splitline[$_] eq 'Rotor Speed (omega)'){
  124. ! $RotorSpeedIndex=$_;
  125. ! }
  126. ! elsif ((defined $ResultList[$_]) && $splitline[$_] eq 'Leakage [kg/s]'){
  127. ! $LeakageIndex=$_;
  128. ! }
  129. ! }
  130. ! }
  131. # Identify when to start reading numbers in
  132. ! elsif ($splitline[0] eq 'Case Number') {
  133. ! $ReadDataAtLine=$linenum;
  134. ! }
  135. # Read numbers in
  136. ! elsif ( ($linenum - $ReadDataAtLine >= $CasesStart) && (($linenum - $ReadDataAtLine <= $CasesEnd)) ) {
  137. ! my @DataArrayIn = @splitline;
  138. !
  139. ! my $SealRadius=$splitline[$RadiusIndex];
  140. ! my $SealLength=$splitline[$LengthIndex];
  141. ! my $Clearance=$splitline[$ClearanceIndex];
  142. ! my $UpAxial=$splitline[$UpAxialIndex];
  143. ! my $UpRadial=$splitline[$UpRadialIndex];
  144. ! my $InletRadial=$splitline[$InletRadialIndex];
  145. ! my $InletLoc=$splitline[$InletLocIndex];
  146. ! my $SealLoc=$splitline[$SealLocIndex];
  147. ! my $RotorSpeed=$splitline[$RotorSpeedIndex];
  148. !
  149. ! my $p1x = $AxialOffset-$UpAxial-$InletAxial; # Axial location of P1 in [mm]
  150. ! my $p1y = $SealRadius + 0.5*$Clearance + $UpRadial * ($InletLoc-$SealLoc); # Radial location of P1 in [mm]
  151. ! my $p2x = $AxialOffset-$UpAxial; # Axial location of P2 in [mm]
  152. ! my $p2y = $SealRadius + 0.5*$Clearance + $UpRadial * ($InletLoc-$SealLoc); # Radial location of P2 in [mm]
  153. ! my $p3x = -$AxialOffset; # Axial location of P3 in [mm]
  154. ! my $p3y = $SealRadius + 0.5*$Clearance; # Radial location of P3 in [mm]
  155. ! my $p4x = $AxialOffset; # Axial location of P4 in [mm]
  156. ! my $p4y = $SealRadius + 0.5*$Clearance; # Radial location of P4 in [mm]
  157. ! my $p5x = $SealLength-$AxialOffset; # Axial location of P5 in [mm]
  158. ! my $p5y = $SealRadius + 0.5*$Clearance; # Radial location of P5 in [mm]
  159. !
  160. ! my $CaseNum = $splitline[0];
  161. ! my $CFXfilename = "$CFDbatchName$CaseNum.res";
  162. ! my $StreamExportName = "$CFXdir$CFDbatchName$CaseNum-Streamlines.csv";
  163. !
  164. ! my $ResFound=0;
  165. ! my @a = (1..scalar(@ResultList));
  166. ! for(@a){
  167. ! if ((defined $ResultList[$_]) && $ResultList[$_] eq $CFXfilename){
  168. ! $ResFound=1;
  169. ! }
  170. ! }
  171. ! if ( $ResFound == 1 ) {
  172.  
  173. #### If the .res file exists in the directory then
  174. #### Start the CFX Post processing
  175. > load filename=$CFXfilename, force_reload=true
  176.  
  177. > update
  178.  
  179. # Initialize Turbomachinery Variables in CFX Post
  180. > update
  181.  
  182. VIEW:Turbo Initialisation View
  183. Object Visibility List = /WIREFRAME:Wireframe, /COMPHIGHLIGHT:Default Domain
  184. Is A Figure = false
  185. END
  186.  
  187. # Setting Single View: /VIEW:Turbo Initialisation View
  188. VIEWPORT MANAGER:
  189. Viewport Layout = No Split
  190. Maximized Viewport = -1
  191. END
  192. >setViewportView cmd=set, view=/VIEW:Turbo Initialisation View, viewport=1
  193.  
  194. VIEWPORT MANAGER:
  195. Synchronize Visibility = false
  196. END
  197.  
  198. > turbo init
  199. > turbo more_vars
  200. > update
  201.  
  202. # Create Plane on Inlet Upstream at Point 1
  203. PLANE:PlanePt1
  204. Apply Instancing Transform = On
  205. Apply Texture = Off
  206. Blend Texture = On
  207. Bound Radius = 0.5 [m]
  208. Colour = 0.75, 0.75, 0.75
  209. Colour Map = Default Colour Map
  210. Colour Mode = Constant
  211. Colour Scale = Linear
  212. Colour Variable = Pressure
  213. Colour Variable Boundary Values = Hybrid
  214. Culling Mode = No Culling
  215. Direction 1 Bound = 1.0 [m]
  216. Direction 1 Orientation = 0 [degree]
  217. Direction 1 Points = 10
  218. Direction 2 Bound = 1.0 [m]
  219. Direction 2 Points = 10
  220. Domain List = /DOMAIN GROUP:All Domains
  221. Draw Faces = On
  222. Draw Lines = Off
  223. Instancing Transform = /DEFAULT INSTANCE TRANSFORM:Default Transform
  224. Invert Plane Bound = Off
  225. Lighting = On
  226. Line Colour = 0, 0, 0
  227. Line Colour Mode = Default
  228. Line Width = 1
  229. Max = 0.0 [Pa]
  230. Min = 0.0 [Pa]
  231. Normal = 1 , 0 , 0
  232. Option = Point and Normal
  233. Plane Bound = None
  234. Plane Type = Slice
  235. Point = $p1x [mm], $p1y [mm], 0 [mm]
  236. Point 1 = 0 [m], 0 [m], 0 [m]
  237. Point 2 = 1 [m], 0 [m], 0 [m]
  238. Point 3 = 0 [m], 1 [m], 0 [m]
  239. Range = Global
  240. Render Edge Angle = 0 [degree]
  241. Specular Lighting = On
  242. Surface Drawing = Smooth Shading
  243. Texture Angle = 0
  244. Texture Direction = 0 , 1 , 0
  245. Texture File =
  246. Texture Material = Metal
  247. Texture Position = 0 , 0
  248. Texture Scale = 1
  249. Texture Type = Predefined
  250. Tile Texture = Off
  251. Transform Texture = Off
  252. Transparency = 0.0
  253. X = 0.0 [m]
  254. Y = 0.0 [m]
  255. Z = 0.0 [m]
  256. OBJECT VIEW TRANSFORM:
  257. Apply Reflection = Off
  258. Apply Rotation = Off
  259. Apply Scale = Off
  260. Apply Translation = Off
  261. Principal Axis = Z
  262. Reflection Plane Option = XY Plane
  263. Rotation Angle = 0.0 [degree]
  264. Rotation Axis From = 0 [m], 0 [m], 0 [m]
  265. Rotation Axis To = 0 [m], 0 [m], 0 [m]
  266. Rotation Axis Type = Principal Axis
  267. Scale Vector = 1 , 1 , 1
  268. Translation Vector = 0 [m], 0 [m], 0 [m]
  269. X = 0.0 [m]
  270. Y = 0.0 [m]
  271. Z = 0.0 [m]
  272. END
  273. END
  274.  
  275. # Create Plane on Inlet Upstream at Point 2
  276. PLANE:PlanePt2
  277. Apply Instancing Transform = On
  278. Apply Texture = Off
  279. Blend Texture = On
  280. Bound Radius = 0.5 [m]
  281. Colour = 0.75, 0.75, 0.75
  282. Colour Map = Default Colour Map
  283. Colour Mode = Constant
  284. Colour Scale = Linear
  285. Colour Variable = Pressure
  286. Colour Variable Boundary Values = Hybrid
  287. Culling Mode = No Culling
  288. Direction 1 Bound = 1.0 [m]
  289. Direction 1 Orientation = 0 [degree]
  290. Direction 1 Points = 10
  291. Direction 2 Bound = 1.0 [m]
  292. Direction 2 Points = 10
  293. Domain List = /DOMAIN GROUP:All Domains
  294. Draw Faces = On
  295. Draw Lines = Off
  296. Instancing Transform = /DEFAULT INSTANCE TRANSFORM:Default Transform
  297. Invert Plane Bound = Off
  298. Lighting = On
  299. Line Colour = 0, 0, 0
  300. Line Colour Mode = Default
  301. Line Width = 1
  302. Max = 0.0 [Pa]
  303. Min = 0.0 [Pa]
  304. Normal = 1 , 0 , 0
  305. Option = Point and Normal
  306. Plane Bound = None
  307. Plane Type = Slice
  308. Point = $p2x [mm], $p2y [mm], 0 [mm]
  309. Point 1 = 0 [m], 0 [m], 0 [m]
  310. Point 2 = 1 [m], 0 [m], 0 [m]
  311. Point 3 = 0 [m], 1 [m], 0 [m]
  312. Range = Global
  313. Render Edge Angle = 0 [degree]
  314. Specular Lighting = On
  315. Surface Drawing = Smooth Shading
  316. Texture Angle = 0
  317. Texture Direction = 0 , 1 , 0
  318. Texture File =
  319. Texture Material = Metal
  320. Texture Position = 0 , 0
  321. Texture Scale = 1
  322. Texture Type = Predefined
  323. Tile Texture = Off
  324. Transform Texture = Off
  325. Transparency = 0.0
  326. X = 0.0 [m]
  327. Y = 0.0 [m]
  328. Z = 0.0 [m]
  329. OBJECT VIEW TRANSFORM:
  330. Apply Reflection = Off
  331. Apply Rotation = Off
  332. Apply Scale = Off
  333. Apply Translation = Off
  334. Principal Axis = Z
  335. Reflection Plane Option = XY Plane
  336. Rotation Angle = 0.0 [degree]
  337. Rotation Axis From = 0 [m], 0 [m], 0 [m]
  338. Rotation Axis To = 0 [m], 0 [m], 0 [m]
  339. Rotation Axis Type = Principal Axis
  340. Scale Vector = 1 , 1 , 1
  341. Translation Vector = 0 [m], 0 [m], 0 [m]
  342. X = 0.0 [m]
  343. Y = 0.0 [m]
  344. Z = 0.0 [m]
  345. END
  346. END
  347.  
  348. POINT:PointLoc3
  349. Apply Instancing Transform = On
  350. Colour = 1, 1, 0
  351. Colour Map = Default Colour Map
  352. Colour Mode = Constant
  353. Colour Scale = Linear
  354. Colour Variable = Pressure
  355. Colour Variable Boundary Values = Hybrid
  356. Culling Mode = No Culling
  357. Domain List = /DOMAIN GROUP:All Domains
  358. Draw Faces = On
  359. Draw Lines = Off
  360. Instancing Transform = /DEFAULT INSTANCE TRANSFORM:Default Transform
  361. Lighting = On
  362. Line Width = 2
  363. Max = 0.0 [Pa]
  364. Min = 0.0 [Pa]
  365. Node Number = 1
  366. Option = XYZ
  367. Point = $p3x [mm], $p3y [mm], 0 [mm]
  368. Point Symbol = Crosshair
  369. Range = Global
  370. Specular Lighting = On
  371. Surface Drawing = Smooth Shading
  372. Symbol Size = 1.0
  373. Transparency = 0.0
  374. Variable = Pressure
  375. Variable Boundary Values = Hybrid
  376. OBJECT VIEW TRANSFORM:
  377. Apply Reflection = Off
  378. Apply Rotation = Off
  379. Apply Scale = Off
  380. Apply Translation = Off
  381. Principal Axis = Z
  382. Reflection Plane Option = XY Plane
  383. Rotation Angle = 0.0 [degree]
  384. Rotation Axis From = 0 [m], 0 [m], 0 [m]
  385. Rotation Axis To = 0 [m], 0 [m], 0 [m]
  386. Rotation Axis Type = Principal Axis
  387. Scale Vector = 1 , 1 , 1
  388. Translation Vector = 0 [m], 0 [m], 0 [m]
  389. X = 0.0 [m]
  390. Y = 0.0 [m]
  391. Z = 0.0 [m]
  392. END
  393. END
  394.  
  395. # Create Plane on Inlet Upstream at Point 4
  396. PLANE:PlanePt4
  397. Apply Instancing Transform = On
  398. Apply Texture = Off
  399. Blend Texture = On
  400. Bound Radius = 0.5 [m]
  401. Colour = 0.75, 0.75, 0.75
  402. Colour Map = Default Colour Map
  403. Colour Mode = Constant
  404. Colour Scale = Linear
  405. Colour Variable = Pressure
  406. Colour Variable Boundary Values = Hybrid
  407. Culling Mode = No Culling
  408. Direction 1 Bound = 1.0 [m]
  409. Direction 1 Orientation = 0 [degree]
  410. Direction 1 Points = 10
  411. Direction 2 Bound = 1.0 [m]
  412. Direction 2 Points = 10
  413. Domain List = /DOMAIN GROUP:All Domains
  414. Draw Faces = On
  415. Draw Lines = Off
  416. Instancing Transform = /DEFAULT INSTANCE TRANSFORM:Default Transform
  417. Invert Plane Bound = Off
  418. Lighting = On
  419. Line Colour = 0, 0, 0
  420. Line Colour Mode = Default
  421. Line Width = 1
  422. Max = 0.0 [Pa]
  423. Min = 0.0 [Pa]
  424. Normal = 1 , 0 , 0
  425. Option = Point and Normal
  426. Plane Bound = None
  427. Plane Type = Slice
  428. Point = $p4x [mm], $p4y [mm], 0 [mm]
  429. Point 1 = 0 [m], 0 [m], 0 [m]
  430. Point 2 = 1 [m], 0 [m], 0 [m]
  431. Point 3 = 0 [m], 1 [m], 0 [m]
  432. Range = Global
  433. Render Edge Angle = 0 [degree]
  434. Specular Lighting = On
  435. Surface Drawing = Smooth Shading
  436. Texture Angle = 0
  437. Texture Direction = 0 , 1 , 0
  438. Texture File =
  439. Texture Material = Metal
  440. Texture Position = 0 , 0
  441. Texture Scale = 1
  442. Texture Type = Predefined
  443. Tile Texture = Off
  444. Transform Texture = Off
  445. Transparency = 0.0
  446. X = 0.0 [m]
  447. Y = 0.0 [m]
  448. Z = 0.0 [m]
  449. OBJECT VIEW TRANSFORM:
  450. Apply Reflection = Off
  451. Apply Rotation = Off
  452. Apply Scale = Off
  453. Apply Translation = Off
  454. Principal Axis = Z
  455. Reflection Plane Option = XY Plane
  456. Rotation Angle = 0.0 [degree]
  457. Rotation Axis From = 0 [m], 0 [m], 0 [m]
  458. Rotation Axis To = 0 [m], 0 [m], 0 [m]
  459. Rotation Axis Type = Principal Axis
  460. Scale Vector = 1 , 1 , 1
  461. Translation Vector = 0 [m], 0 [m], 0 [m]
  462. X = 0.0 [m]
  463. Y = 0.0 [m]
  464. Z = 0.0 [m]
  465. END
  466. END
  467.  
  468. # Create Plane on Inlet Upstream at Point 5
  469. PLANE:PlanePt5
  470. Apply Instancing Transform = On
  471. Apply Texture = Off
  472. Blend Texture = On
  473. Bound Radius = 0.5 [m]
  474. Colour = 0.75, 0.75, 0.75
  475. Colour Map = Default Colour Map
  476. Colour Mode = Constant
  477. Colour Scale = Linear
  478. Colour Variable = Pressure
  479. Colour Variable Boundary Values = Hybrid
  480. Culling Mode = No Culling
  481. Direction 1 Bound = 1.0 [m]
  482. Direction 1 Orientation = 0 [degree]
  483. Direction 1 Points = 10
  484. Direction 2 Bound = 1.0 [m]
  485. Direction 2 Points = 10
  486. Domain List = /DOMAIN GROUP:All Domains
  487. Draw Faces = On
  488. Draw Lines = Off
  489. Instancing Transform = /DEFAULT INSTANCE TRANSFORM:Default Transform
  490. Invert Plane Bound = Off
  491. Lighting = On
  492. Line Colour = 0, 0, 0
  493. Line Colour Mode = Default
  494. Line Width = 1
  495. Max = 0.0 [Pa]
  496. Min = 0.0 [Pa]
  497. Normal = 1 , 0 , 0
  498. Option = Point and Normal
  499. Plane Bound = None
  500. Plane Type = Slice
  501. Point = $p5x [mm], $p5y [mm], 0 [mm]
  502. Point 1 = 0 [m], 0 [m], 0 [m]
  503. Point 2 = 1 [m], 0 [m], 0 [m]
  504. Point 3 = 0 [m], 1 [m], 0 [m]
  505. Range = Global
  506. Render Edge Angle = 0 [degree]
  507. Specular Lighting = On
  508. Surface Drawing = Smooth Shading
  509. Texture Angle = 0
  510. Texture Direction = 0 , 1 , 0
  511. Texture File =
  512. Texture Material = Metal
  513. Texture Position = 0 , 0
  514. Texture Scale = 1
  515. Texture Type = Predefined
  516. Tile Texture = Off
  517. Transform Texture = Off
  518. Transparency = 0.0
  519. X = 0.0 [m]
  520. Y = 0.0 [m]
  521. Z = 0.0 [m]
  522. OBJECT VIEW TRANSFORM:
  523. Apply Reflection = Off
  524. Apply Rotation = Off
  525. Apply Scale = Off
  526. Apply Translation = Off
  527. Principal Axis = Z
  528. Reflection Plane Option = XY Plane
  529. Rotation Angle = 0.0 [degree]
  530. Rotation Axis From = 0 [m], 0 [m], 0 [m]
  531. Rotation Axis To = 0 [m], 0 [m], 0 [m]
  532. Rotation Axis Type = Principal Axis
  533. Scale Vector = 1 , 1 , 1
  534. Translation Vector = 0 [m], 0 [m], 0 [m]
  535. X = 0.0 [m]
  536. Y = 0.0 [m]
  537. Z = 0.0 [m]
  538. END
  539. END
  540.  
  541. > update
  542.  
  543. # Create Library expressions in CFX POST
  544.  
  545. LIBRARY:
  546. CEL:
  547. EXPRESSIONS:
  548. TotalLeakage = 360 * massFlow()@Outlet * 1 [s/kg]
  549. RotorTorque = 360 * torque_x()@Rotor * 1 [N^-1 m^-1]
  550. MinRotorYplus = minVal(Yplus)@Rotor
  551. MaxRotorYplus = maxVal(Yplus)@Rotor
  552. AvgRotorYplus = ave(Yplus)@Rotor
  553. MinStatorYplus = minVal(Yplus)@Stator
  554. MaxStatorYplus = maxVal(Yplus)@Stator
  555. AvgStatorYplus = ave(Yplus)@Stator
  556. EmaxResid = maxVal(E Diss K.Residual)@Default Domain
  557. KmaxResid = maxVal(K TurbKE.Residual)@Default Domain
  558. PmaxResid = maxVal(P Mass.Residual)@Default Domain
  559. UmaxResid = maxVal(U Mom.Residual)@Default Domain
  560. VmaxResid = maxVal(V Mom.Residual)@Default Domain
  561. WmaxResid = maxVal(W Mom.Residual)@Default Domain
  562. EavgResid = ave(E Diss K.Residual)@Default Domain
  563. KavgResid = ave(K TurbKE.Residual)@Default Domain
  564. PavgResid = ave(P Mass.Residual)@Default Domain
  565. UavgResid = ave(U Mom.Residual)@Default Domain
  566. VavgResid = ave(V Mom.Residual)@Default Domain
  567. WavgResid = ave(W Mom.Residual)@Default Domain
  568. p1Vax = areaAve_x(Velocity Axial)@PlanePt1 * 1 [s/m]
  569. p1Vrad = areaAve_x(Velocity Radial)@PlanePt1 * 1 [s/m]
  570. p1Vcirc = areaAve_x(Velocity in Stn Frame Circumferential)@PlanePt1 * 1 [s/m]
  571. p1Press = areaAve_x(Pressure)@PlanePt1 * 1 [Pa^-1]
  572. p2Vax = areaAve_x(Velocity Axial)@PlanePt2 * 1 [s/m]
  573. p2Vrad = areaAve_x(Velocity Radial)@PlanePt2 * 1 [s/m]
  574. p2Vcirc = areaAve_x(Velocity in Stn Frame Circumferential)@PlanePt2 * 1 [s/m]
  575. p2Press = areaAve_x(Pressure)@PlanePt1 * 1 [Pa^-1]
  576. p3Vax = probe(Velocity Axial)@PointLoc3 * 1 [s/m]
  577. p3Vrad = probe(Velocity Radial)@PointLoc3 * 1 [s/m]
  578. p3Vcirc = probe(Velocity in Stn Frame Circumferential)@PointLoc3 * 1 [s/m]
  579. p3Press = probe(Pressure)@PointLoc3 * 1 [Pa^-1]
  580. p4Vax = areaAve_x(Velocity Axial)@PlanePt4 * 1 [s/m]
  581. p4Vrad = areaAve_x(Velocity Radial)@PlanePt4 * 1 [s/m]
  582. p4Vcirc = areaAve_x(Velocity in Stn Frame Circumferential)@PlanePt4 * 1 [s/m]
  583. p4Press = areaAve_x(Pressure)@PlanePt1 * 1 [Pa^-1]
  584. p5Vax = areaAve_x(Velocity Axial)@PlanePt5 * 1 [s/m]
  585. p5Vrad = areaAve_x(Velocity Radial)@PlanePt5 * 1 [s/m]
  586. p5Vcirc = areaAve_x(Velocity in Stn Frame Circumferential)@PlanePt5 * 1 [s/m]
  587. p5Press = areaAve_x(Pressure)@PlanePt1 * 1 [Pa^-1]
  588. END
  589. END
  590. END
  591. > update
  592.  
  593. ! @MaxResids=(getExprString(EmaxResid),getExprString(KmaxResid)
  594. ! ,getExprString(PmaxResid),getExprString(UmaxResid)
  595. ! ,getExprString(VmaxResid),getExprString(WmaxResid));
  596. ! for( @MaxResids ) {
  597. ! $MaxRes = $_ if !$MaxRes || $_ > $MaxRes;
  598. ! }
  599. ! @AveResids=(getExprString(EavgResid),getExprString(KavgResid)
  600. ! ,getExprString(PavgResid),getExprString(UavgResid)
  601. ! ,getExprString(VavgResid),getExprString(WavgResid));
  602. ! for( @AveResids ) {
  603. ! $AveRes = $_ if !$AveRes || $_ > $AveRes;
  604. ! }
  605. !
  606. ! @OutArray = ( getExprString(TotalLeakage),getExprString(RotorTorque),
  607. ! getExprString(MinRotorYplus),getExprString(MaxRotorYplus),
  608. ! getExprString(AvgRotorYplus),getExprString(MinStatorYplus),
  609. ! getExprString(MaxStatorYplus),getExprString(AvgStatorYplus),
  610. ! getExprString(p4Vcirc)/($RotorSpeed/60*2*3.14159*$SealRadius/1000),
  611. ! $MaxRes,$AveRes,getExprString(p1Vax),
  612. ! getExprString(p1Vrad),getExprString(p1Vcirc),
  613. ! getExprString(p1Press),getExprString(p2Vax),
  614. ! getExprString(p2Vrad),getExprString(p2Vcirc),
  615. ! getExprString(p2Press),getExprString(p3Vax),
  616. ! getExprString(p3Vrad),getExprString(p3Vcirc),
  617. ! getExprString(p3Press),getExprString(p4Vax),
  618. ! getExprString(p4Vrad),getExprString(p4Vcirc),
  619. ! getExprString(p4Press),getExprString(p5Vax),
  620. ! getExprString(p5Vrad),getExprString(p5Vcirc),
  621. ! getExprString(p5Press));
  622. !my $NumElOut=scalar(@OutArray);
  623. !splice @splitline, $LeakageIndex, $NumElOut, @OutArray;
  624.  
  625. STREAMLINE:TheStreamLines
  626. Absolute Tolerance = 0.0 [m]
  627. Apply Instancing Transform = On
  628. Colour = 0.75, 0.75, 0.75
  629. Colour Map = Default Colour Map
  630. Colour Mode = Use Plot Variable
  631. Colour Scale = Linear
  632. Colour Variable = Velocity
  633. Colour Variable Boundary Values = Conservative
  634. Cross Periodics = On
  635. Culling Mode = No Culling
  636. Domain List = /DOMAIN GROUP:All Domains
  637. Draw Faces = On
  638. Draw Lines = Off
  639. Draw Streams = On
  640. Draw Symbols = Off
  641. Grid Tolerance = 0.01
  642. Instancing Transform = /DEFAULT INSTANCE TRANSFORM:Default Transform
  643. Lighting = On
  644. Line Width = 1
  645. Location List = Domain Interface 1 Side 2
  646. Locator Sampling Method = Equally Spaced
  647. Max = 0.0 [m s^-1]
  648. Maximum Number of Items = 25
  649. Min = 0.0 [m s^-1]
  650. Number of Samples = 25
  651. Number of Sides = 8
  652. Range = Global
  653. Reduction Factor = 1.0
  654. Reduction or Max Number = Max Number
  655. Sample Spacing = 0.1
  656. Sampling Aspect Ratio = 1
  657. Sampling Grid Angle = 0 [degree]
  658. Seed Location List = Inlet
  659. Seed Point Type = Locations
  660. Simplify Geometry = Off
  661. Specular Lighting = On
  662. Stream Drawing Mode = Line
  663. Stream Initial Direction = 0 , 0 , 0
  664. Stream Size = 1.0
  665. Stream Symbol = Ball
  666. Streamline Direction = Forward
  667. Streamline Maximum Periods = 20
  668. Streamline Maximum Segments = 10000
  669. Streamline Maximum Time = 0.0 [s]
  670. Streamline Type = Surface Streamline
  671. Streamline Width = 2
  672. Surface Drawing = Smooth Shading
  673. Surface Streamline Direction = Forward and Backward
  674. Symbol Size = 1.0
  675. Symbol Start Time = 10.0 [s]
  676. Symbol Stop Time = -10.0 [s]
  677. Symbol Time Interval = 1.0 [s]
  678. Tolerance Mode = Grid Relative
  679. Transparency = 0.0
  680. Variable = Velocity
  681. Variable Boundary Values = Conservative
  682. OBJECT VIEW TRANSFORM:
  683. Apply Reflection = Off
  684. Apply Rotation = Off
  685. Apply Scale = Off
  686. Apply Translation = Off
  687. Principal Axis = Z
  688. Reflection Plane Option = XY Plane
  689. Rotation Angle = 0.0 [degree]
  690. Rotation Axis From = 0 [m], 0 [m], 0 [m]
  691. Rotation Axis To = 0 [m], 0 [m], 0 [m]
  692. Rotation Axis Type = Principal Axis
  693. Scale Vector = 1 , 1 , 1
  694. Translation Vector = 0 [m], 0 [m], 0 [m]
  695. X = 0.0 [m]
  696. Y = 0.0 [m]
  697. Z = 0.0 [m]
  698. END
  699. END
  700.  
  701. EXPORT:
  702. ANSYS Export Data = Element Heat Flux
  703. ANSYS File Format = ANSYS
  704. ANSYS Reference Temperature = 0.0 [K]
  705. ANSYS Specify Reference Temperature = Off
  706. ANSYS Supplemental HTC = 0.0 [W m^-2 K^-1]
  707. Additional Variable List =
  708. BC Profile Type = Inlet Velocity
  709. Export Connectivity = Off
  710. Export Coord Frame = Global
  711. Export File = $StreamExportName
  712. Export Geometry = On
  713. Export Location Aliases =
  714. Export Node Numbers = On
  715. Export Null Data = On
  716. Export Type = Generic
  717. Export Units System = Current
  718. Export Variable Type = Current
  719. External Export Data = None
  720. Include File Information = Off
  721. Include Header = On
  722. Location = Domain Interface 1 Side 2
  723. Location List = /STREAMLINE:TheStreamLines
  724. Null Token = null
  725. Overwrite = On
  726. Precision = 8
  727. Separator = ", "
  728. Spatial Variables = X,Y,Z
  729. Variable List = Axial Distance, Pressure, Radius, Rotation Velocity, \
  730. Rotation Velocity X, Rotation Velocity Y, Rotation Velocity Z, Streamline Number \
  731. on TheStreamLines, Time on TheStreamLines, Total Pressure in Rel Frame, Total Pressure \
  732. in Stn Frame, Velocity Axial, Velocity Circumferential, Velocity in Stn Frame \
  733. Circumferential, Velocity Radial, X, Y, Z
  734. Vector Brackets = ()
  735. Vector Display = Scalar
  736. END
  737. >export
  738.  
  739. > update
  740. > setcamera viewport=1, camera=+Z
  741.  
  742. >centerview 1
  743.  
  744. # Sending visibility action from ViewUtilities
  745. >show /STREAMLINE:TheStreamLines, view=/VIEW:Turbo Initialisation View
  746.  
  747. LEGEND:StreamLegend
  748. Colour = 0, 0, 0
  749. Font = Sans Serif
  750. Legend Aspect = 0.07
  751. Legend Format = %10.3e
  752. Legend Orientation = Vertical
  753. Legend Plot = /STREAMLINE:TheStreamLines
  754. Legend Position = 0.02 , 0.15
  755. Legend Size = 0.6
  756. Legend Ticks = 5
  757. Legend Title = Legend
  758. Legend Title Mode = Variable and Location
  759. Legend X Justification = Right
  760. Legend Y Justification = Top
  761. Show Legend Units = On
  762. Text Colour Mode = Default
  763. Text Height = 0.024
  764. Text Rotation = 0
  765. END
  766.  
  767. # Sending visibility action from ViewUtilities
  768. >show /LEGEND:Legend 1, view=/VIEW:Turbo Initialisation View
  769.  
  770. ! my $StreamPicFile = "$CFXdir$CFDbatchName$CaseNum\_Streamlines.png";
  771.  
  772. HARDCOPY:
  773. Antialiasing = On
  774. Hardcopy Filename = $StreamPicFile
  775. Hardcopy Format = png
  776. Hardcopy Tolerance = 0.0001
  777. Image Height = 600
  778. Image Scale = 100
  779. Image Width = 600
  780. JPEG Image Quality = 80
  781. Screen Capture = Off
  782. Use Screen Size = On
  783. White Background = Off
  784. END
  785. >print
  786.  
  787. CONTOUR:PressureContour
  788. Apply Instancing Transform = On
  789. Clip Contour = Off
  790. Colour Map = Default Colour Map
  791. Colour Scale = Linear
  792. Colour Variable = Pressure
  793. Colour Variable Boundary Values = Hybrid
  794. Constant Contour Colour = Off
  795. Contour Range = Local
  796. Culling Mode = No Culling
  797. Domain List = /DOMAIN GROUP:All Domains
  798. Draw Contours = On
  799. Font = Sans Serif
  800. Fringe Fill = On
  801. Instancing Transform = /DEFAULT INSTANCE TRANSFORM:Default Transform
  802. Lighting = On
  803. Line Colour = 0, 0, 0
  804. Line Colour Mode = Default
  805. Line Width = 1
  806. Location List = Domain Interface 1 Side 2
  807. Max = 0.0 [Pa]
  808. Min = 0.0 [Pa]
  809. Number of Contours = 11
  810. Show Numbers = Off
  811. Specular Lighting = On
  812. Surface Drawing = Smooth Shading
  813. Text Colour = 0, 0, 0
  814. Text Colour Mode = Default
  815. Text Height = 0.024
  816. Transparency = 0.0
  817. Use Face Values = Off
  818. Value List = 0 [Pa],1 [Pa]
  819. OBJECT VIEW TRANSFORM:
  820. Apply Reflection = Off
  821. Apply Rotation = Off
  822. Apply Scale = Off
  823. Apply Translation = Off
  824. Principal Axis = Z
  825. Reflection Plane Option = XY Plane
  826. Rotation Angle = 0.0 [degree]
  827. Rotation Axis From = 0 [m], 0 [m], 0 [m]
  828. Rotation Axis To = 0 [m], 0 [m], 0 [m]
  829. Rotation Axis Type = Principal Axis
  830. Scale Vector = 1 , 1 , 1
  831. Translation Vector = 0 [m], 0 [m], 0 [m]
  832. X = 0.0 [m]
  833. Y = 0.0 [m]
  834. Z = 0.0 [m]
  835. END
  836. END
  837.  
  838. # Sending visibility action from ViewUtilities
  839. >show /CONTOUR:PressureContour, view=/VIEW:Turbo Initialisation View
  840.  
  841. # Sending visibility action from ViewUtilities
  842. >hide /LEGEND:StreamLegend, view=/VIEW:Turbo Initialisation View
  843.  
  844. # Sending visibility action from ViewUtilities
  845. >hide /STREAMLINE:TheStreamLines, view=/VIEW:Turbo Initialisation View
  846.  
  847. LEGEND:Pressure Legend
  848. Colour = 0, 0, 0
  849. Font = Sans Serif
  850. Legend Aspect = 0.07
  851. Legend Format = %10.3e
  852. Legend Orientation = Vertical
  853. Legend Plot = /CONTOUR:PressureContour
  854. Legend Position = 0.02 , 0.15
  855. Legend Size = 0.6
  856. Legend Ticks = 5
  857. Legend Title = Legend
  858. Legend Title Mode = Variable and Location
  859. Legend X Justification = Right
  860. Legend Y Justification = Top
  861. Show Legend Units = On
  862. Text Colour Mode = Default
  863. Text Height = 0.024
  864. Text Rotation = 0
  865. END
  866.  
  867. # Sending visibility action from ViewUtilities
  868. >show /LEGEND:Pressure Legend, view=/VIEW:Turbo Initialisation View
  869.  
  870. ! my $PressPicName = "$CFXdir$CFDbatchName$CaseNum\Pressure.png";
  871.  
  872. HARDCOPY:
  873. Antialiasing = On
  874. Hardcopy Filename = $PressPicName
  875. Hardcopy Format = png
  876. Hardcopy Tolerance = 0.0001
  877. Image Height = 600
  878. Image Scale = 100
  879. Image Width = 600
  880. JPEG Image Quality = 80
  881. Screen Capture = Off
  882. Use Screen Size = On
  883. White Background = Off
  884. END
  885.  
  886. >print
  887.  
  888. >close
  889.  
  890. ! } #End if statement to check if file exists in directory
  891. !
  892. ! } #End if statement for reading input
  893. ! my $OutString = join(",", @splitline)."\n";
  894. ! print $OutHandle $OutString;
  895. !
  896. ! } # End while loop for line reading
  897.  
  898.  
  899.  
  900. ! close $InHandle;
  901.  
  902. ! close $OutHandle;
  903.  
  904. #### cfx5post -batch "E:\Upstream Study\UpstreamStudyResReader.cse"
Advertisement
Add Comment
Please, Sign In to add comment