Engineering Design and Analysis with Innovation

Close Icon
   
Contact Info     +44 141 582 1416

Pump Cavitation Analysis in ANSYS CFX (Part IV)

 

 

This blog is the continuation of the series of blogs on the pump cavitation analysis in ANSYS CFX and to automate this process by using CEL (CFX Expression Language) and Perl script. The previous blogs can be found under the following links;

Pump Cavitation Analysis in ANSYS CFX (Part I)
Pump Cavitation Analysis in ANSYS CFX (Part II)
Pump Cavitation Analysis in ANSYS CFX (Part III)

 

In this blog we are introducing to the automation of the pump cavitation analysis in ANSYS CFX by using CEL (CFX Expression Language) and Perl script.

 

4.1 Inserting new CEL (CFX Expression Language) Expression:

Go to: Insert > Expressions, Functions and Variables > Expression or click on Expression icon Expression

Inserting CEL Expression

Or right click on Expressions in Outline tree and go to Expressions > Insert >  Expression

New Expression

This will then open a new dialogue box; select the name of the Expression as “InletPressure” and click OK.

Inlet Pressure Expression

 

Choose the appropriate inlet pressure in the definition tab of the details of the expression and click Apply. Choose the appropriate units for inlet pressure and remember use the square brackets “[ ]”.

Expression Details

 

4.2 Exporting CCL (CFX Command Language) File:

Go to: File > CCL > Export or click on Export CCL icon CCL Export icon

CCL Export

Or right click on Expressions in Outline tree and go to Expressions > Export CCL

CCL Export

This will then open a new dialogue box; choose the location of the directory, file name and also choose SIMULATION > EXPRESSIONS AND FUNCTIONS > EXPRESSION and click Save.

CCL Export

 

4.3 Editing CCL file:

Open the “150kPa.ccl” file in text editor and replace 150 [kPa] by 125 [kPa] in the InletPressure expression definition, and save the file as “125kPa.ccl”. Repeat this process for 100 [kPa], 75 [kPa], 65 [kPa] and 60 [kPa].

CCL File edit

 

4.4 Creating Perl Script File:

The next task is to crete a Perl Script file (for more information on Perl please visit http://www.perl.org/docs.html and http://www.perl.org/books/beginning-perl).

Open a blank Notepad or any other text editor file and type in the following text:

use strict;

system “cfx5solve -def CFX_CAV_On.def -ccl 150kPa.ccl -ini CFX_CAV_Off_001.res -name CFX_CAV_On_150kPa”;

system “cfx5solve -def CFX_CAV_On.def -ccl 125kPa.ccl -ini CFX_CAV_On_150kPa_001.res -name CFX_CAV_On_125kPa”;

system “cfx5solve -def CFX_CAV_On.def -ccl 100kPa.ccl -ini CFX_CAV_On_125kPa_001.res -name CFX_CAV_On_100kPa”;

system “cfx5solve -def CFX_CAV_On.def -ccl 75kPa.ccl -ini CFX_CAV_On_100kPa_001.res -name CFX_CAV_On_75kPa”;

system “cfx5solve -def CFX_CAV_On.def -ccl 65kPa.ccl -ini CFX_CAV_On_75kPa_001.res -name CFX_CAV_On_65kPa”;

system “cfx5solve -def CFX_CAV_On.def -ccl 60kPa.ccl -ini CFX_CAV_On_65kPa_001.res -name CFX_CAV_On_60kPa”;

 

Save this file as “runsolver.pl” in the directory where you would like to run the analysis. This directory should also contain the following files;

  1. CFX_CAV_On.def (The definition file created with cavitation model turned on as explained in the tutorial “Pump Cavitation Analysis in ANSYS CFX (Part II)”.
  2. .ccl files as explained in the section 4.3
  3. CFX_CAV_Off_001.res (The results file created with cavitation model turned ff as explained in the tutorial “Pump Cavitation Analysis in ANSYS CFX (Part I)”.

Please note that we have used “Perl Syntax” and “CFX command line syntax” to write the code above. For further details on CFX command line syntax please refer to ANSYS CFX Solver Manager User’s Guide and search for “Command-Line Options and Keywords for cfx5solve”.

 

4.5 Running Perl Script:

Open CFX launcher from the Start menu of your computer and select the working directory where you have saved the Perl script and other files as explained in section 4.4.

Go to: Tools > Command Line

Command Line Launcher

Write the following command and press Enter.

perl runsolver.pl

Command Line

This will start CFX solver in the batch mode, starting CFX_CAV_On.def with the CCL file overriding the CFX_CAV_On.def file and initialising from the CFX_CAV_Off_001.res file.

 

4.5 Viewing the Solver Progress:

Go to: CFX > CFX Solver Manager or press Ctrl+S or click on CFX Solver Manager icon  CFX Solver Manager icon

Launch CFX Solver Manager

Go to: File > Monitor run in Progress or press Ctrl+M or click on Open a CFX Solver run in progress for monitor icon  In Progress Run icon

In Progress Run

 

 

3 Responses so far.

  1. [...] Pump Cavitation Analysis in ANSYS CFX (Part IV) http://www.techcae.com/blog/?p=316 __________________ techCAE (Engineering Design and Analysis with Innovation) http://www.techcae.com [...]

  2. [...] part 4 of how to perform pump cavitation analysis in CFX, this time focusing on automation [...]

  3. [...] published Part 4 of their series on pump cavitation using CFX. (Here are links to Part 1, Part 2, and Part [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>