Jump to content
Mr. Tobias Kriesel

Connection with cfast

Recommended Posts

Hi there,
 
I am trying to connect framework to a program called cfast:
 
 
In the documentation you can find a description for running cfast from a command prompt (page: 23):
 
 
I tried to call cfast in the computation mode as described in the tutorial 04_external_software with several files as input files (like standard.in) and to set the ouput to "result values". If I do the run command, there is always an error as shown below (taken from console):
 
*** INFO computation : running external process [C:/Program Files (x86)/CFAST6/CFAST.exe in design baseline]
*** INFO FGenIntReader : Could not open file

 

If I use the console there are different results:
 
I with

 

C:\Program Files (x86)\CFAST6>cfast C:\Users\Tobias\directorywherethefilesare
\standard.in

 

 
or:
 
II with

 

C:\Program Files (x86)\CFAST6>cfast C:\Users\Tobias\directorywherethefilesare
\standard

 

 
The input file including all parameters is the standard.in – whereas in the documentation it says that you should call it without extension:
 
copy&paste from the pdf from above:

[drive1:\][folder1\]cfast [drive2:\][folder2\]project 
The project name will have extensions appended as needed (see below). For example, to run a test 
case when the cfast executable is located in c:\nist\cfast6 and the input data file is located in c:\data, 
the following command could be used: 
c:\nist\cfast6\cfast c:\data\testfire0 <<< note there is no extension. 
If the command is entered as \bin\cfast \bin\data\testfire0.in, then CFAST will try to open 
testfire0.in.in 

 

 

 
My guess is, that framework makes the call of cfast with the extension of the input file and that is why I get the error message. Do you agree with this, or is there anything else wrong?
 
If my idea is worth of a try, which of the following ways would you recommend to try?
 
I Make a script like script.bat that would remove the extension in a call of cfast.
 
II Use the Arguments in the Execution Settings of computation (I dont know what arguments are possible).
 
Or do you recommend another way?
 
Thanks a lot in advance for your efforts,
 
kind regards
 
Tobias Kriesel
 

Share this post


Link to post
Share on other sites

Hi Tobias,

 

From your post it is not really clear whether cfast really runs or not. For instance, it might be possible that cfast runs, but CAESES/FFW is not able to read in the result file for some reasons (what kind of result file do you expect from cfast?). Is it possible to share a light-weight version of your fbdc-file so that we can have a look at your setup?

 

I guess you do not need the computation arguments if you have a batch script that does the right call, such as

C:\Program Files (x86)\CFAST6>cfast C:\Users\Tobias\directorywherethefilesare\standard

Cheers

Joerg

Share this post


Link to post
Share on other sites

Hi Daehwan, hi Joerg,

 

as from now everything works! Thank you!

 

@Joerg: Yesterday every program worked for its own, cfast in console/gui and framework, but not together.

 

@Daehwan: Nice tutorial. The only trouble I had was at page 7, ( set configuration for the batch file) with fstring and fdouble in path of in file and path of cfast. But now it works.

 

I am sorry, I got no material for optimization today. I didnt wanted to start to build compartments until the software would run satisfactory. Maybe in a few weeks. There are some other things to do before.

 

Thanks and have a nice day,

Tobias

Share this post


Link to post
Share on other sites

Good to hear that.

 

Actually all what I did with CFAST was to read the page 23 and select out the input and output files of CFAST the BLACK BOX for me.

 

In other words, I have no idea what CFAST does and I just acknowleged it is related with Fire and Smoke. 

 

When you have an optimization model please don't forget telling us.

 

 

Tschao -

Daehwan

 

P.S. Im welchen Studiengang bist du ?

Share this post


Link to post
Share on other sites

Hi Daehwan,

 

cfast is a easy to use 2 zone model fire simulation program. You just got 2 layers of gas, one cold and one hot (smoke). That allows fast calculations. If you need complexer simulations its better to use fds (https://code.google.com/p/fds-smv/).

 

For both programs there is a viewer called smokeview: One example of the result of cfast is here:

 

 

Schiffs- und Meerestechnik (mit Interesse an Brandschutz auf Schiffen;-).

 

Greets,

Tobias

Share this post


Link to post
Share on other sites

Hi,

 

since last time I did some research on theory of fires (and prevention) and didn't used the model anymore. Now I would like to get a little bit deeper in optimization. The connection works if I am just using the run button at the middle of the software connector. Its ok, for the standard file and for my new created project.

 

My new problem is: The optimization doesn't work. I set up a sobol algorithm with just 5 variants for test purposes. I tried it in my project and just as well in the file that was generated by Daehwan. 

 

From the console I got from both:

*** INFO FGenIntReader : Could not open file C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation//standard.status for reading [parsing process aborted]

If I have a look at this directory the result file isn't there. In the "original" directory it is available (projectdirectory/manual_results/baseline/computation) but in the new generated directories (01_Sobol/Sobol_01_des0000/computation) its missing. Its clear that I don't get a result from here, but I don't know why it isn't copied/build like all the other input files.

 

Something missing in the description of the problem?

 

greets,

Tobias

Share this post


Link to post
Share on other sites

Hi Tobias,

 

I can only look at Daehwan's project, but from what I see there the "standard.status" file should be a result from cfast, right? This error message comes when an expected result file from an external program cannot be found after the external program has finished.

 

Are all the other input files created in the 01_Sobol/Sobol_01_des0000/computation directory (bunsen.o, cfast.bat, standard.in, thermal.csv, Wood_Wall.o)? Is cfast triggered? If yes, does cfast report any errors (look into the stdouterroroutput.redirect file in the computation directory)?

 

Regards,

Arne

Share this post


Link to post
Share on other sites

Hi Arne,

 

thanks for your reply. Currently I am working with Daehwan's project so we got the same basis. The input files wont differ very much from each other. So if this works, my project will do the same. The standard.status is one of the files of the result. But all the other result files are missing too. All input files are in the mentioned folder.

 

I dont know if I can answer the last 2 questions right now, but here is the result of one stdouterroroutput.redirect file of one sobol directory (its everywhere the same content):

Moving C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation/input/bunsen.o to C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation//bunsen.o
Moving C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation/input/cfast.bat to C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation//cfast.bat
Moving C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation/input/standard.in to C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation//standard.in
Moving C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation/input/thermal.csv to C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation//thermal.csv
Moving C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation/input/Wood_Wall.o to C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation//Wood_Wall.o

[Captured output from application C:/Data/Cfast/cfast_master.bat]


C:\Users\Tobias\Desktop\cfastconnect\01_Sobol\Sobol_01_des0000\computation>cfast.bat

C:\Users\Tobias\Desktop\cfastconnect\01_Sobol\Sobol_01_des0000\computation>C:\Data\Cfast\CFAST C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation//standard 

greets,

Tobias

 

Share this post


Link to post
Share on other sites

Hi Tobias,

 

It seems like CAESES is actually doing exactly what it's supposed to do and the problem is on cfast's side.

 

Please try the following:

  • Start a Windows command prompt (cmd.exe)
  • Change to one of the Sobol directories (cd C:\Users\Tobias\Desktop\cfastconnect\01_Sobol\Sobol_01_des0000\computation)
  • Run the cfast.bat file (cfast.bat)

What's the result?

 

Greets,

Arne

Share this post


Link to post
Share on other sites

Hi Arne,

 

the result is, nothing happens beside the command is shown in the command window:

C:\Users\Tobias\Desktop\cfastconnect\01_Sobol\Sobol_01_des0000\computation>C:\Da
ta\Cfast\CFAST C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/co
mputation//standard

I also had a view on the task manager of windows. If I just use the run command at the software connector, a task named cfast appears and stays for about 2 seconds. If I am using the command line in the folder you told, nothing happens at the task manager. I understand that there should be no difference and I think there is probably a fault in my configuration, but I cannot find it right now.

 

greets,

Tobias

Share this post


Link to post
Share on other sites

Hi Tobias,

 

Well, to be honest it's not very nice of cfast not to print anything at all... Did you also try to enter the command line from the bat file directly in the console?

 

Please also try the following:

Instead of using the commandline from the bat file:

C:\Data\Cfast\CFAST C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation//standard

try

C:\Data\Cfast\CFAST /f C:/Users/Tobias/Desktop/cfastconnect/01_Sobol/Sobol_01_des0000/computation//standard

Also, edit the standard.in file and change the line

TIMES,1800,-120,0,10,30

to

TIMES,1800,120,0,10,30

According to their user guide (page 15) this should a) enable full output and b ) send the output to the console.

 

Other than that, it's starting to look like a case for the cfast support since the even running it from the commandline with no CAESES involved fails.

 

Best regards,

Arne

Share this post


Link to post
Share on other sites

Hi again,

 

I think I got a little bit closer to the heart of the problem. As far as I can see its a slash/\backslash problem. Until yesterday evening I didn't paid much attention to /\ but its worth.

 

This works (manually) in the new created sobol directory and gives the output of the processing steps to the console (without using /f).

C:\Data\test\cfast C:\Data\test\cfast_t1\09_Sobol\Sobol_09_des0000\Runner\\standard 

This does nothing:

C:\Data\test\cfast C:/Users/Tobias/Desktop/cfastconnect/09_Sobol/Sobol_09_des0000/computation//standard 

And this gives back: 107 (I cannot really find the meaning of this error message):

C:\Data\Cfast\CFAST /f C:/Users/Tobias/Desktop/cfastconnect/09_Sobol/Sobol_09_des0000/computation//standard 

That is why I tried to find all / and replace them with \. If I do so in the cfast.bat and execute it, all result files in the sobol directory are created. But I get a problem to implement it in framework. My cfast.bat looks like that If it is shown at: "show preview of input files":

C:\Data	est\cfast C:/Data/test/cfast_t1/manual_results/baseline/standard

Is there a possibility for a "small" workaround?

 

greets,

Tobias

Share this post


Link to post
Share on other sites

Hi,

 

There's an easy workaround:

  • Select the cfast.bat entry in the SoftwareConnector
  • Set the value of "Path_Of_CFAST" to 
    "C:\Data\\test\cfast"
    

    (Note the double backslash in front of test! It is necessary because "\t" has a special meaning, it's the tab-character. The resulting value will have only one backslash).

  • Set the value of "Path_Of_INfile" to 

    getWindowsResultsDir() + "\standard"
    

    this will give you the results directory with backslashes instead of slashes

Good luck!

 

Arne

Share this post


Link to post
Share on other sites

Hi,

 

I got my next question: There are several other result files that are interesting. In my case, I had a look at a file called vorsimulation_zone.csv. This one is created successfully in my result directory(s). There are columns with the results of every single computation. In the next step I created a script in fortran that created a executable after compiling giving me min/max/mean of the columns of my interest in a out.dat file. In another softwareconnector I did the single steps, described in this threat. My present problem is like the one before a path problem. I cant take the result files of software connector 1 as an input file for software connector 2 (fortranskript). The results of the second one (out.dat) are always the same, because they are from the original directory.

 

I also had a look into this threat (similar problem for me):

http://www.friendship-systems.com/forum/index.php?/topic/56-how-to-connect-two-external-softwares-to-caeses/  

 

I tried to set up the path of the input file like Joerg described to:

fortranskript.getResults().getResultsFileName("vorsimulation_zone.csv")

 

, but this isn't working for me. The console tells:

 

*** INFO Expression not assigned : Infinite recursion detected [fortranskript.getResults().getResultFileName("vorsimulation_zone.csv")] 

The Problem report is clear, but I got no idea how to fix it. 

 Any recommendations?

 

greets,

Tobias

 

 

 

Share this post


Link to post
Share on other sites

Hi Tobias,

 

Actually, there is an easier way to set up a process chain since version 3.1. See the attached PDF for a quick walkthrough (sorry for the brevity and formatting of the document, I just compiled it really quickly).

 

Regarding the recursion: I am not 100% sure, but you said "fortranskript" is the second computation in the chain, right? The path of the input file for that one should be "firstComputation.getResults().getResultsFileName("vorsimulation_zone.csv")". What you are trying to do seems to me like you are trying to make an object depending on itself. Anyways, try the method described in the PDF, maybe this already solves that problem as well.

 

Regards,

Arne

Setting up a process chain.pdf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...