CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   plot bulk mean temperature in cfd-post (http://www.cfd-online.com/Forums/cfx/90778-plot-bulk-mean-temperature-cfd-post.html)

m.salemi July 20, 2011 10:03

plot bulk mean temperature in cfd-post
 
Hi
I want to calculate nusselt number for turbulent flow in a pipe with constant temperature in wall and i need to plot bulk mean temperature.
how can i plot the change of bulk mean temperture along lenght of tube in cfd-post???

ghorrocks July 20, 2011 19:35

The easiest way I can think of is to use a session file to generate lots of cross section planes and calculate the average temperature on each plane, then assemble the average temperatures into a graph or data file. I suspect this needs to be scripted.

m.salemi July 21, 2011 04:49

thanks a lot...
but how can i use this method???

ghorrocks July 21, 2011 07:56

Record a session file in CFD-Post and edit it. Do the CFD-Post tutorials on session files.

ghorrocks July 21, 2011 08:03

Record a session file in CFD-Post and edit it. Do the CFD-Post tutorials on session files.

AliTr July 21, 2011 20:21

1 Attachment(s)
#you can use below eample to create an array of planes in your preffered offsets
# you have to change the $PlotVariable and $CalcFunction according to your model, this example is made to calculate average velocity for a multiphase model
# this example shall be run on CFX-POST Command Editor


!CreateSectionPlanes();
! sub CreateSectionPlanes{
# Data
! $PlanePreName = "Plane YZ ";
! $PlotVariable = "Water.Superficial Velocity";
! $CalcFunction = "areaAve($PlotVariable)";

# Set the Min and Max plot variables for new planes
! $MinVal = 0;
! $MaxVal = 2.25;

# First plane coordinates
! $startX = -27;
! $startY = 0;
! $startZ = 13;

# new plane offsets
! $dX = 2;
! $dY = 0;
! $dZ = 0;

# Total num,ber of planes to be created
! $TotalPlanesNo = 14;

# Create a CSV file in C:\ to export the results
! open(SwRes,">C:/Results.csv") || die "Can't open file $!\n";
! print SwRes "Plane , X , Y , Z , ",$CalcFunction ,"\n";


! for ($j=0; $j<$TotalPlanesNo ;$j++) {

! $PlaneName = $PlanePreName . ($j+1);
! $NewX = $startX + $dX * $j;
! $NewY = $startY + $dY * $j;
! $NewZ = $startZ + $dZ * $j;
! $CalcString = $CalcFunction . "@" . $PlaneName;

PLANE: $PlaneName
Apply Instancing Transform = On
Apply Texture = Off
Blend Texture = On
Bound Radius = 0.5 [m]
Colour = 0.75, 0.75, 0.75
Colour Map = Default Colour Map
Colour Mode = Variable
Colour Scale = Linear
Colour Variable = $PlotVariable
Colour Variable Boundary Values = Hybrid
Culling Mode = No Culling
Direction 1 Bound = 1.0 [m]
Direction 1 Orientation = 0 [degree]
Direction 1 Points = 10
Direction 2 Bound = 1.0 [m]
Direction 2 Points = 10
Domain List = /DOMAIN GROUP:All Domains
Draw Faces = On
Draw Lines = Off
Instancing Transform = /DEFAULT INSTANCE TRANSFORM:Default Transform
Invert Plane Bound = Off
Lighting = Off
Line Colour = 0, 0, 0
Line Colour Mode = Default
Line Width = 1
Max = $MaxVal
Min = $MinVal
Normal = 1 , 0 , 0
Option = YZ Plane
Plane Bound = None
Plane Type = Slice
Point = 0 [m], 0 [m], 0 [m]
Point 1 = 0 [m], 0 [m], 0 [m]
Point 2 = 1 [m], 0 [m], 0 [m]
Point 3 = 0 [m], 1 [m], 0 [m]
Range = User Specified
Render Edge Angle = 0 [degree]
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
Transparency = 0.0
Visibility = On
X = $NewX
Y = $NewY
Z = $NewZ
OBJECT VIEW TRANSFORM:
Apply Reflection = Off
Apply Rotation = Off
Apply Scale = Off
Apply Translation = Off
Principal Axis = Z
Reflection Plane Option = XY Plane
Rotation Angle = 0.0 [degree]
Rotation Axis From = 0 [m], 0 [m], 0 [m]
Rotation Axis To = 0 [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

! $CalcVal = getExprVal($CalcString);
! print SwRes $PlaneName," , ",$NewX," , ",$NewY," , ",$NewZ," , ", $CalcVal,"\n";

! };

! close SwRes;
!};

m.salemi July 22, 2011 05:57

tahnks a lot AliTr but can you explain more about geometry of your problem for better understanding or give me a tutorial that explain the use of command editor???

AliTr July 23, 2011 02:28

check the CFX-POST help, it has all you need.

to use the code, you need to define the start coordinate in mentioned section (# First plane coordinates ) and also provide dx,dy,dz for new planes.

m.salemi July 23, 2011 04:36

thanks AliTr
i need to define new variable as "Temperature*Velocity" and use areaAve(Temperature*Velocity)@plane to determine bulk temperature but when i run this,have some error as "Temperature*Velocity does not exist"...
do you know reason of error?

AliTr July 24, 2011 04:31

you need to define a new variable in CFX-Post and use it instead of "Temperature*Velocity". PLEASE READ CFX help, these are basics. however below expression will create a new variable as "TmprVelocity"

LIBRARY:
CEL:
EXPRESSIONS:
TmprVel = Temperature * Velocity
END
END
END

USER SCALAR VARIABLE: TmprVelocity
Boundary Values = Conservative
Calculate Global Range = Off
Expression = TmprVel
Recipe = Expression
Variable to Copy = Pressure
Variable to Gradient = Pressure
END

m.salemi July 24, 2011 05:41

thanks a lot...


All times are GMT -4. The time now is 13:37.