CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   polyline (https://www.cfd-online.com/Forums/cfx/21864-polyline.html)

ag November 24, 2005 09:06

polyline
 
I was trying to generate polylines using the following .cse session file. I am using this on CFX to simulate flow through a T piece pipe. At every cross-section i am taking 15 points to get the velocities.

The program runs fine for the negative x axis value but doesnt produce any results in the positive x axis. Results are good in the y aix also.

The orientation is like a inverted T along positive X and Y axes with one half of the T in the -ve xaxis.

# A CFX-Post session file for output of Values along Polylines defined by a file #

################################################## ############################# # # Creating a Polyline # ################################################## #############################

! sub PLineOut { ! ($XStart, $YStart, $ZStart, $XEnd, $YEnd, $ZEnd, $NrPts, $VarString, $OutFileName) = @_;

! $DeltaX = ($XEnd - $XStart)/$NrPts; ! $DeltaY = ($YEnd - $YStart)/$NrPts; ! $DeltaZ = ($ZEnd - $ZStart)/$NrPts;

! open(LPOINTSFH,">LinePts.txt"); ! for($Pcnt=0; $Pcnt<=$NrPts; $Pcnt++){ ! $XAct = $XStart + $DeltaX * $Pcnt; ! $YAct = $YStart + $DeltaY * $Pcnt; ! $ZAct = $ZStart + $DeltaZ * $Pcnt; ! print LPOINTSFH "$XAct $YAct $ZAct\n"; ! } ! close(LPOINTSFH);

POLYLINE:PolyPoints Apply Instancing Transform = On Boundary List = Default Colour = 1, 1, 1 Colour Mode = Constant Colour Variable = Pressure Domain List = All Domains Input File = LinePts.txt Instancing Transform = Default Transform Line Width = 1 Location = IsoCylinder Max = 0 [kg m^-1 s^-2] Min = 0 [kg m^-1 s^-2] Option = From File Range = Global Visibility = On END

> forceupdate PolyPoints

EXPORT: Include Header = On Null Token = <null> Precision = 8 Separator = " " Vector Brackets = () Vector Display = Components Export File = $OutFileName Location List = PolyPoints Overwrite = On Variable List = $VarString END
:export

! return 0; ! }

# ####program inputs #

! $NrOfPoints = 15; ! $Diameter = 0.03; ! $SF = 0.99;

! @XList = (-10.5, -1.5, -1, -0.75, -0.5, -0.25, 0, 0.5, 1.5, 2.5, 4.5);

! @YList = (1, 1.1, 1.25, 1.5, 2.1, 2.5, 3, 3.5,6);

! $R2 = $Diameter * $SF * 0.5;

! foreach $XC(@XList){ ! $FName = "out_" . $XC . ".dat"; ! $XDim = $XC * $Diameter; ! PLineOut($XDim, 0.0, 0, $XDim, $Diameter, 0, $NrOfPoints, "Y, Velo\ city u, Velocity v", $FName); ! }

! foreach $YC(@YList){ ! $FName = "out_b_" . $YC . ".dat"; ! $YDim = $YC * $Diameter; ! PLineOut(-$R2, $YDim, 0, $R2, $YDim, 0, $NrOfPoints, "X, Velo\ city u, Velocity v", $FName); ! }


All times are GMT -4. The time now is 12:16.