CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Batch (https://www.cfd-online.com/Forums/cfx/25952-batch.html)

Kim Skatun June 16, 2008 06:53

Batch
 
Hi I have 10 different cad models where there is one parameter that is varied. I would like to mesh this cad file and then put on BC, where I want the BC to change 10 times for each meshfile,. Pressure at inlet to go from 0 to 10 bar. Then I want to solve it and read out the massflow at the outlet. This should be 100 runs and therefore I would like to do this in a batch job, how do I do that. Each file works fine now, so now I am trying to find out how that one geometry parameter effects the result.

Cheers Kim


Glenn Horrocks June 16, 2008 21:47

Re: Batch
 
hi,

Automating the pressure from 0-10 bar is easy, use CCL and a script (Linux) or batch (Windows) file to run the series of runs. Scripting the geometry changes is trickier but can be done. Whether it is quicker just to generate the geometry files yourself and run the batch file will depend on what you are trying to do.

Glenn Horrocks

Kim Skatun June 17, 2008 10:54

Re: Batch
 
Well easy and easy...

What I did was to make several ccl files, where I changed them manually, see comment in text. DOMAIN: Default Domain

Coord Frame = Coord 0

Domain Type = Fluid

Fluids List = Molasse

Location = B4

BOUNDARY: Inlet

Boundary Type = INLET

Location = F319.4

BOUNDARY CONDITIONS:

FLOW DIRECTION:

Option = Normal to Boundary Condition

END

FLOW REGIME:

Option = Subsonic

END

MASS AND MOMENTUM:

Option = Total Pressure

Relative Pressure = 5 [bar] <----- changing this value in each file.. 11 files 0 - 10 bar with 1 bar step.

END

END

END

I would also like to post process them somehow, below I made a small perl scrip that gets the value I am interested in, but how do I extend my code to take all the result files in a given directory and save the result in 11 different files?

This is the command I am currently sending to the solver: cfx5solve -def ..\molassenicer_mesh.def -ccl ..\DefFiles\0bar.ccl cfx5solve -def ..\molassenicer_mesh.def -ccl ..\DefFiles\1bar.ccl -initial 0bar_001.res cfx5solve -def ..\molassenicer_mesh.def -ccl ..\DefFiles\2bar.ccl -initial 1bar_001.res

the problem is that name of result file is incorrect, how can I force the result file to have a given name?

Cheers Kim


Mehul June 19, 2008 02:52

Re: Batch
 
As I understood from your message, You are looking for 10 different values of pressure BC on same surface and individual result file for them.

I think you should create 10 different .def files . Make Batch executables and simply run batch file from Batch command of CFX . It will generate individual res files.

Kim Skatun June 19, 2008 02:56

Re: Batch
 
I made some matlab script that modifies the ccl files and then I run it with the same def file. This works fine. But I would imagine that there should be an easier way than making regex for the ccl file to change the pressure at the BC.


Kim Skatun June 19, 2008 11:05

Re: Batch
 
How can I run my .pre files from the commando line? My script works nicely when I: file->new simulation Session->Play file Then I select the file...

Shouldn't this be the same as cfx5pre -batch file

But this always returns file handle -1 What does this mean?

Cheers Kim



All times are GMT -4. The time now is 19:39.