CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > CFX

ANSYS CFX POST write an output file with perl

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 17, 2013, 09:35
Default ANSYS CFX POST write an output file with perl
  #1
say
New Member
 
say
Join Date: Sep 2009
Posts: 7
Rep Power: 7
say is on a distinguished road
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

say is offline   Reply With Quote

Old   July 17, 2013, 16:40
Default
  #2
Senior Member
 
Join Date: Dec 2009
Posts: 129
Rep Power: 10
mjgraf is on a distinguished road
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
mjgraf is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is swap4foam ?? AB08 OpenFOAM 27 July 1, 2013 09:17
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57
mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 12 December 12, 2011 05:16
mesh file for flow over a circular cylinder Ardalan Main CFD Forum 6 April 17, 2010 23:40
Compiling gmshFoam with OpenFOAM-1.5 BlGene Open Source Meshers: Gmsh, Netgen, CGNS, ... 10 August 6, 2009 04:26


All times are GMT -4. The time now is 21:39.