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

how to make cfx automatically solve same model with different boundary conditions?

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

Like Tree6Likes
  • 1 Post By urosgrivc
  • 2 Post By ghorrocks
  • 2 Post By Gert-Jan
  • 1 Post By Gert-Jan

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 7, 2018, 05:18
Exclamation how to make cfx automatically solve same model with different boundary conditions?
  #1
New Member
 
gengchen
Join Date: May 2018
Posts: 14
Rep Power: 6
w784370882 is on a distinguished road
Hello, everyone. Here is the situation that I want to calculate the same model with outlet mass flow changing from 5kg/s to 15kg/s. I add 1kg/s every time so that is 10 results finally. I don't want to change the outlet boundary condition manually. Is there some way to realize it? I've already searched question on the internet but no detailed introduction was found. Thanks
w784370882 is offline   Reply With Quote

Old   November 7, 2018, 06:53
Default
  #2
Senior Member
 
urosgrivc
Join Date: Dec 2015
Location: Slovenija
Posts: 365
Rep Power: 9
urosgrivc is on a distinguished road
Use parameters:

if you set your outlet as an expression you are able to set it as a parameter and then you are able to set up 10 simulations from workbench and run them one after the other automaticaly, without even opening cfxpre in the proces.
just be sure to export all the needed data by that I mean output parameters (easily set in cfx post before you start your 10 simulations) that you observe and you need to be sure that the simulation is correctly solved before it goes to the next one.

this process has great capabilities like genetic optimisation, response surface, etc.

To make your outlet as an expression you can do this:
Make an expression named, let us say;
OutletMassFlow
you then set this expression as;
5 [kg s^-1]
this unit will be used when the expression is used in cfx
and rightclick on the expresion and select (use as a workbench input parameter)
This will make it visible as a parameter in the workbench automatically
Than in the settings for outlet you call in this expression OutletMassFlow instead of writing in fixed walue
w784370882 likes this.

Last edited by urosgrivc; November 9, 2018 at 09:54.
urosgrivc is offline   Reply With Quote

Old   November 7, 2018, 10:45
Default
  #3
Senior Member
 
Join Date: Jun 2009
Posts: 1,604
Rep Power: 29
Opaque will become famous soon enough
What version of ANSYS CFX are you using?

If you check version R19.2 or later for the "operating maps" feature. You can set a variable to be changed during the simulation. You will obtain as many results file as variations you included in the setup.

Say, you select mass flow from 1->5 kg/s in 10 increments. The software will start with 1 kg/s, once converged, it will start another simulation with 2 kg/s and so on until it finishes. In the future, we should be able to run the 10 simulations at the same time (assuming parallel licenses and resources available).

The ANSYS Solver Manager monitor all the simulations for you automatically and give you a status which simulation failed, converged, etc.
Opaque is offline   Reply With Quote

Old   November 7, 2018, 11:28
Default
  #4
New Member
 
gengchen
Join Date: May 2018
Posts: 14
Rep Power: 6
w784370882 is on a distinguished road
many thanks!!! I've tried this method just now and it's stilling running. Now I'm going back to sleep and check it out tomorrow morning. Wish you have a good day! ( ^_^ )
w784370882 is offline   Reply With Quote

Old   November 7, 2018, 18:41
Default
  #5
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,230
Rep Power: 135
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
An alternative approach is to generate a series of CCL files with the different flow rates defined and then run them in a batch file. This method allows you to do this sort of thing outside Workbench, if that is of interest.
alirezame and w784370882 like this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   November 7, 2018, 21:02
Default
  #6
Senior Member
 
Join Date: Jun 2009
Posts: 1,604
Rep Power: 29
Opaque will become famous soon enough
The operating maps functionality is a stand-alone feature independent of Workbench, not to be confused with design parameters.
Opaque is offline   Reply With Quote

Old   November 8, 2018, 02:13
Default
  #7
New Member
 
gengchen
Join Date: May 2018
Posts: 14
Rep Power: 6
w784370882 is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
An alternative approach is to generate a series of CCL files with the different flow rates defined and then run them in a batch file. This method allows you to do this sort of thing outside Workbench, if that is of interest.
ghorrocks, thank u very much! I used to write .bat file for fluent calculating. Now I learned how to write it in CFX format, it's also useful in situations when calculation needs lots of operation points.
w784370882 is offline   Reply With Quote

Old   November 8, 2018, 02:15
Default
  #8
New Member
 
gengchen
Join Date: May 2018
Posts: 14
Rep Power: 6
w784370882 is on a distinguished road
Quote:
Originally Posted by Opaque View Post
The operating maps functionality is a stand-alone feature independent of Workbench, not to be confused with design parameters.
My ansys version is 19.1 so I will check this method after I install a new version. Thank you for your advice!
w784370882 is offline   Reply With Quote

Old   November 8, 2018, 07:11
Default
  #9
Senior Member
 
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,632
Rep Power: 25
Gert-Jan will become famous soon enough
If you have a def file called case.def, you can simply create a batch file containing commands like:

cfx5solve -def case.def -ccl 1kgs.ccl -name 1kgs
cfx5solve -def case.def -ccl 2kgs.ccl -name 2kgs

This will give you result files:

1kgs_001.res
2kgs_001.res

where your ccl-file 1kgs.ccl only contains:

FLOW: Flow Analysis 1
DOMAIN: domain1
BOUNDARY: inlet
BOUNDARY CONDITIONS:
MASS AND MOMENTUM:
Mass Flow Rate = 1 [kg s^-1]
END
END
END
END
END

So you only need a small part of the ccl-tree.
alirezame and w784370882 like this.
Gert-Jan is offline   Reply With Quote

Old   November 8, 2018, 07:17
Default
  #10
Senior Member
 
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,632
Rep Power: 25
Gert-Jan will become famous soon enough
When starting a case in the solver manager, you can also add these commands in the Solver-tab/Solver Arguments.

So, if you run case.def and add arguments "-ccl 1kgs.ccl -name 1kgs" then the result will be the same. But only 1 file at a time, manually.,,,,,
w784370882 likes this.
Gert-Jan is offline   Reply With Quote

Old   November 9, 2018, 01:17
Default
  #11
New Member
 
gengchen
Join Date: May 2018
Posts: 14
Rep Power: 6
w784370882 is on a distinguished road
Quote:
Originally Posted by Gert-Jan View Post
If you have a def file called case.def, you can simply create a batch file containing commands like:

cfx5solve -def case.def -ccl 1kgs.ccl -name 1kgs
cfx5solve -def case.def -ccl 2kgs.ccl -name 2kgs

This will give you result files:

1kgs_001.res
2kgs_001.res

where your ccl-file 1kgs.ccl only contains:

FLOW: Flow Analysis 1
DOMAIN: domain1
BOUNDARY: inlet
BOUNDARY CONDITIONS:
MASS AND MOMENTUM:
Mass Flow Rate = 1 [kg s^-1]
END
END
END
END
END

So you only need a small part of the ccl-tree.
It's a good idea! Now I start to get the hand of these situations. Thanks!
w784370882 is offline   Reply With Quote

Old   November 9, 2018, 09:21
Default
  #12
Senior Member
 
Join Date: Jun 2009
Posts: 1,604
Rep Power: 29
Opaque will become famous soon enough
If this is a one-time effort, it does not matter much which approach you take.

However, if you expect to repeat this approach multiple times you are better off learning a feature which takes care of the nuisances of simulation management, file management, monitoring multiple runs, post-processing, etc.

In either case, you are at the start of the learning curve.

My 2 cents.
Opaque is offline   Reply With Quote

Reply

Tags
batch runs, ccl

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 06:15
Problem in setting Boundary Condition Madhatter92 CFX 12 January 12, 2016 05:39
convergenceof natural convection prob. in cfx cpkewat CFX 15 January 31, 2014 07:29
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05
CFX doesn't continue calculation... mactech001 CFX 6 November 15, 2009 22:25


All times are GMT -4. The time now is 23:30.