|
[Sponsors] |
ANSYS CFX POST write an output file with perl |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 17, 2013, 10:35 |
ANSYS CFX POST write an output file with perl
|
#1 |
New Member
say
Join Date: Sep 2009
Posts: 7
Rep Power: 17 |
Hi
I'm trying to write a session in POST. The Script should average over some Contour Levels some values and then it should write the values into a file, called "file.txt". I've already written some lines but it doesn't work. can anybody help me please. ! open (RB, '>>D:\TXT\RB_data.txt'); !for ($i=1 ; $i<=$x; $i++) { USER SURFACE:USRadius Apply Instancing Transform = On Apply Rotation = On Apply Scale = On Apply Texture = Off Apply Translation = Off Associated Boundary = Out Hub Associated Boundary Specified = On Blend Texture = On Colour = 0, 0.8, 0 Colour Map = Default Colour Map Colour Mode = Constant Colour Scale = Linear Colour Variable = Pressure Colour Variable Boundary Values = Hybrid Contour Level = $i Contour Name = /CONTOUR:CONRadius Culling Mode = No Culling Domain List = /DOMAIN GROUP:All Domains Draw Faces = On Draw Lines = Off File Units = m Input File = Instancing Transform = /DEFAULT INSTANCE TRANSFORMefault Transform Lighting = On Line Colour = 0, 0, 0 Line Colour Mode = Default Line Width = 1 Maintain Conservative Values = Off Max = 0.0 [Pa] Min = 0.0 [Pa] Offset Direction = 1 , 0 , 0 Offset Distance = 0.0 [m] Offset Mode = Uniform Offset Type = Normal Option = From Contour Principal Axis = Z Range = Global Render Edge Angle = 0 [degree] Rotation Angle = 0 [degree] Rotation Axis From = 0 [m], 0 [m], 0 [m] Rotation Axis To = 1 [m], 0 [m], 0 [m] Rotation Axis Type = Principal Axis Scale Factor = 1.0 Specular Lighting = On Surface Drawing = Smooth Shading Texture Angle = 0 Texture Direction = 0 , 1 , 0 Texture File = Texture Material = Metal Texture Position = 0 , 0 Texture Scale = 1 Texture Type = Predefined Tile Texture = Off Transform Texture = Off Translation Vector = 0 [m], 0 [m], 0 [m] Transparency = 0.0 Use Mid Side Nodes = On OBJECT VIEW TRANSFORM: Apply Reflection = Off Apply Rotation = On Apply Scale = On Apply Translation = Off Principal Axis = Z Reflection Plane Option = XY Plane Rotation Angle = 0 [degree] Rotation Axis From = 0 [m], 0 [m], 0 [m] Rotation Axis To = 1 [m], 0 [m], 0 [m] Rotation Axis Type = Principal Axis Scale Vector = 1 , 1 , 1 Translation Vector = 0 [m], 0 [m], 0 [m] X = 0.0 [m] Y = 0.0 [m] Z = 0.0 [m] END END #--------------------------------------- #Expressions #--------------------------------------- LIBRARY: CEL: EXPRESSIONS: AveTotPres = massFlowAve(Total Pressure)/@USRadius END END END ! print RB "$AveTotPres" "\n ; !} ! close (RB); What's wrong there? thanks |
|
July 17, 2013, 17:40 |
|
#2 |
Senior Member
Join Date: Dec 2009
Posts: 131
Rep Power: 20 |
you wrapped your AveTotPres in the expression tags. This created the expression in CFX and can not be called using perl variable syntax.
You either have to create the power syntax for the expression or use the getExprVal() function to set a perl variable to the expression value. where is $x defined? I do my variable to file differently but yours is fine. open file if () { user surface ! $AveTotPres = massFlowAve("Total Pressure","USRadius"); ! print RB "$AveTotPres\n"; } close file |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 18:22 |
mesh file for flow over a circular cylinder | Ardalan | Main CFD Forum | 7 | December 15, 2020 14:06 |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 02:22 |
friction forces icoFoam | ofslcm | OpenFOAM | 3 | April 7, 2012 11:57 |
[Gmsh] Compiling gmshFoam with OpenFOAM-1.5 | BlGene | OpenFOAM Meshing & Mesh Conversion | 10 | August 6, 2009 05:26 |