CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Running Solver in Batch (https://www.cfd-online.com/Forums/cfx/24392-running-solver-batch.html)

Nick August 10, 2007 12:45

Running Solver in Batch
 
I've been looking through the help files, but it doesn't seem to be very clear on this (Or at least I'm not seeing it). I want to know if its possible to have the solver automatically execute a series of runs, using the previous run as the initial values file.

For example, say I have three definition files, a.def, b.def and c.def

Is there a way to set up the solver to run a.def, then upon completion, run b.def with a.res as the initial values. Then, similarly with c.def using b.res as the initial values.

Robin August 10, 2007 14:36

Re: Running Solver in Batch
 
Hi Nick,


There are a couple ways to approach this. If a, b and c are parametric variations of the same setup, you can often set the parameters up to be driven by DesignXplorer within ANSYS Workbench. Driving Parameters may come from CAD (native CAD parameters are accessible if you have the appropriate ANSYS CAD interface), or from CEL expressions in Pre (which can subsequently be used in boundary conditions, source terms, etc.). DX also requires output parameters, which would come from expressions in Post that evaluate to a single value. I won't go into further details here on how to set it up; instructions are avaialbe in the documentation.

If the variations in a, b, and c are not parametric or at least are not available paramters (such as mesh density), then you need to write a script or batch file that does the job. What follows is an example of a simple batch file could be created which explicitely uses the expected results file name. If you want to get fancy, there are options to have cfx5solve.exe return the name of the RES and incorporate the output into a script.

----batch file-----
cfx5solve -def a.def
cfx5solve -def b.def -ini a_001.res -interp-iv
cfx5solve -def c.def -ini b_001.res -interp-iv
...

Regards,
Robin

Nick August 10, 2007 14:42

Re: Running Solver in Batch
 
Thanks a lot Robin, I'll look into the DX later on, but for now the batch file works great!


All times are GMT -4. The time now is 10:06.