CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   CFX from Matlab Error (https://www.cfd-online.com/Forums/cfx/251395-cfx-matlab-error.html)

zese August 14, 2023 01:16

CFX from Matlab Error
 
Dear all,

I want to run cfx pre in matlab. so I wrote the following command in matlab:

system('C:"Program Files""ANSYS Inc"\v202\CFX\bin\cfx5pre.exe -line -def ./filename.def -batch filename.pre')

in which filename.pre is the session file.
but I receive the following error:
-- ERROR -- A simulation is already open! This must be closed before opening a new simulation.


ans =

0


Does anyone know how I can solve it? because I dont see any simulation running in my system

Gert-Jan August 14, 2023 03:28

Is there a lock file (.lck) present in your working folder?
This might prevent opening the definition file. Therefore delete it and see if it helps.

ghorrocks August 14, 2023 05:53

Also, check that your script (filename.pre) does not open a .cfx file and then open another one (or start a new one). I think that gives the error you describe. You have to close the first cfx file before you can open a new one.

Gert-Jan August 14, 2023 05:58

On top of that: I think you should read .cfx-files and write .def-files. Is that what you do?


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