**** Entered By: akpaul @ 03/29/2005 01:48 PM ****
Q. I want to define 100 or more nozzles at specific X,Y,Z locations. The X,Y,Z data is in a text/data file - how can I do this in a efficient way without having to define each nozzle manaully in CFX-PRE

A. An efficient way of doing this is by using perl scripted CCL (CFX Command Language). The following example is based on Lagragian multiphase models, since it is easier to implement. You should be able to follow the same method for an Eulerian approach using point sources. The example requires a CFX Multiphase license. But users should be able to follow the same approach for any similar application. Required files are attached.

Example :

Specifying point 'Particle Injection Regions' (Nozzles) by reading in the X,Y,Z location of each point from a data file.

Instructions:

1) Create a new simulation in CFX-PRE. Setup domains, boundary conditions and properties as required. In this case include a 'Particle' phase.
2)On the domains form, create one 'Particle Injection Region'. This is a dummy definition, so we can get the required CCL for modification later.
3)Set appropriate solver controls and initial guess
4)Write out a solver 'definition' file - in this case NozzleTest.def.
5) From the CFX-5 Launcher (make sure the working directory is set correctly), go to Tools>Command Line.
6) At the DOS prompt, enter the following command:

cfx5cmds -read -def NozzleTest.def -text NozzleTest.ccl

This will extract a text file 'NozzleTest.ccl' in your working folder.

7) Open the text file in Wordpad and look for the following section:

PARTICLE INJECTION REGION: Particle Injection Regions 1
FLUID: Water at 25 C
INJECTION CONDITIONS:
INJECTION METHOD:
Cone Angle = 25.0 [deg]
Injection Centre = 0.6 [m], 0.5 [m], 0.25 [m]
Injection Velocity Magnitude = 300 [m s^-1]
Number of Positions = 50
Option = Cone
INJECTIO


**** Entered By: akpaul @ 03/29/2005 01:48 PM ****
Q. I want to define 100 or more nozzles at specific X,Y,Z locations. The X,Y,Z data is in a text/data file - how can I do this in a efficient way without having to define each nozzle manaully in CFX-PRE

A. An efficient way of doing this is by using perl scripted CCL (CFX Command Language). The following example is based on Lagragian multiphase models, since it is easier to implement. You should be able to follow the same method for an Eulerian approach using point sources. The example requires a CFX Multiphase license. But users should be able to follow the same approach for any similar application. Required files are attached.

Example :

Specifying point 'Particle Injection Regions' (Nozzles) by reading in the X,Y,Z location of each point from a data file.

Instructions:

1) Create a new simulation in CFX-PRE. Setup domains, boundary conditions and properties as required. In this case include a 'Particle' phase.
2)On the domains form, create one 'Particle Injection Region'. This is a dummy definition, so we can get the required CCL for modification later.
3)Set appropriate solver controls and initial guess
4)Write out a solver 'definition' file - in this case NozzleTest.def.
5) From the CFX-5 Launcher (make sure the working directory is set correctly), go to Tools>Command Line.
6) At the DOS prompt, enter the following command:

cfx5cmds -read -def NozzleTest.def -text NozzleTest.ccl

This will extract a text file 'NozzleTest.ccl' in your working folder.

7) Open the text file in Wordpad and look for the following section:

PARTICLE INJECTION REGION: Particle Injection Regions 1
FLUID: Water at 25 C
INJECTION CONDITIONS:
INJECTION METHOD:
Cone Angle = 25.0 [deg]
Injection Centre = 0.6 [m], 0.5 [m], 0.25 [m]
Injection Velocity Magnitude = 300 [m s^-1]
Number of Positions = 50
Option = Cone
INJECTION DIRECTION:
Injection Direction X Component = -1
Injection Direction Y Component = 0
Injection Direction Z Component = 0
Option = Cartesian Components
END
END
PARTICLE MASS FLOW RATE:
Mass Flow Rate = 1e-4 [kg s^-1]
END
END
END
END

This is the definition of the Particle Injection Region. (Look for 'Point Sources' if using the Eulerian approach)
We will put a loop around this section so it defines four Nozzles.

8) Create a data file with the X,Y,Z location (in meters) of each nozzle. In this example the file (NozzleLoc.dat) has the following data:

0.6,0.5,0.25
0.6,1.0,0.25
0.6,1.5,0.25
0.6,2.0,0.25

9) Modify the above section as follows and save it as NozzleTestModified.ccl

########## Modify CCL to include multiple injection regions ####################
! $nnozzle = 4;
#! @yloc = (0.5, 1.0, 1.5, 2.0);
! open INPUT, "< NozzleLoc.dat";
! $i = 1;
! while ($i < $nnozzle+1) {
! $/ = ",";
! $X = <INPUT>;
! chomp $X;
! $Y = <INPUT>;
! chomp $Y;
! $/ = "n";
! $Z = <INPUT>;
! chomp $Z;
PARTICLE INJECTION REGION: Nozzle$i
FLUID: Water at 25 C
INJECTION CONDITIONS:
INJECTION METHOD:
Cone Angle = 25.0 [deg]
# Injection Centre = 0.6 [m], $yloc[$i-1] [m], 0.25 [m]
Injection Centre = $X [m], $Y [m], $Z [m]
Injection Velocity Magnitude = 300 [m s^-1]
Number of Positions = 50
Option = Cone
INJECTION DIRECTION:
Injection Direction X Component = -1
Injection Direction Y Component = 0
Injection Direction Z Component = 0
Option = Cartesian Components
END
END
PARTICLE MASS FLOW RATE:
Mass Flow Rate = 1e-4 [kg s^-1]
END
END
END
END
!$i++;
!}
! close(INPUT);
##########ENDModification###########################

This will create Nozzle1,Nozzle2,Nozzle3 and Nozzle4 during the start of the run, with appropriate X,Y,Z values. Make sure the loop ends after the correct 'END' CCL statement.'#' is a comment in CCL. Note that I have also shown how to define an array with the Yloc of nozzles and how to use it, as an alternative.

10) Save the NozzleTestModified.ccl file. From command line execute the following command from the command line:

cfx5cmds -write -def NozzleTest.def -text NozzleTestModified.ccl

This will input the new CCL to the solver definition file.

11) Start the run in the Solver manager. The new nozzles will be created at the start of run.

12) Alternatively you can open the modified def file in PRE to check if everything worked. BUT DO THIS ONLY IF YOU HAVE A SMALL NUMBER OF NOZZLES. Since CFX-PRE will execute the perl statements when opening the def file, it will create all the new nozzles. If you have 100 or more , it will make PRE slow. To open a Def file in PRE go to File>Open and change the filter to 'def files' and select the def file. You use this method as a debugging tool, by defining a small number of nozzles to see if the perl statements are working as you intended it to.





Show Form
No comments yet. Be the first to add a comment!