Jump to content

Recommended Posts

I have coupled Friendship to STAR-CCM+ running batch jobs on a Torque cluster system. The optimization is generating designs that are evaluated in STAR-CCM+

 

I would like to couple Red Cedar Heeds to Friendship for Heeds to control the generation of designs and evaluation of sensitivity of the design variables, hence choosing the most sensitive ones.

 

How do I couple the interface of Friendship to be controlled by HEEDS. Are designs then generated and evaluated individually or based on a limited number of previous designs?

Can you help me with that?

Is it at all possible with my present student license?

Share this post


Link to post
Share on other sites

Hi Henrik,

 

Actually, CAESES does not include an interface that allows to "remote control" it. Also, I do not really have any previous experience with Heeds. However, there are ways to achieve what you want, but they are not really straight forward.

 

I think the best option is to use fsc-scripts along with the "waitAndExecScript(FString filename, FInteger timeout)" command. This (undocumented) command waits until the given filename exists and the content of the file ends with the line "//DONE". As soon as that is the case, the file is executed as an fsc-script. The second parameter tells CAESES how long it should wait for the file in seconds before giving up (a value of -1 means forever).

 

With this in mind, you could maybe write a bash script or little program in your favorite programming language that writes an fsc-script based on the output of Heeds (or maybe Heeds can do it itself? As I said, I do not have experience with it.) After that the process could be as follows (rough outline, to give you an idea):

  • Start CAESES from within Heeds with an initial fsc script which would look like this: 
    openProject("path/to/your/project")
    
    // here you could set the initial values of your design variables, e.g. myDeva.setValue(0.1)
    
    // create a new design
    design(NULL,NULL)
    
    // trigger StarCCM+
    starComputation.run()
    
    // tell CAESES to wait for a script file to appear in the results directory
    waitAndExecScript(getResultsDir() + "/continue.fsc")
    
  • Now Heeds would have to analyze the StarCCM+ output and create the new values for the design variables (those of interest). Then the next script should be generated in the same directory as the StarCCM+ result files. This could look like this: 

    // go back to the baseline
    baseline.edit()
    
    // create next design
    design(NULL, NULL)
    
    // set the designvars you want here (based on Heeds)
    myDeva1.setValue(...)
    myDeva2.setValue(...)
    // ....
    
    starComputation.run()
    
    // now wait for the next script
    waitAndExecScript(getResultsDir() + "/continue.fsc")
    
    // trigger the previous waiting to end
    //DONE
    
  • Once the "DesignEngine" is done, the new script would just need include the "//DONE" line at the end (maybe change back into the baseline, too)

As I said, this is the rough outline of the process, I have in mind. You will need to fill in the details since I do not know Heeds.

 

I hope this helps and gives you an idea, how you can do the coupling.

 

Best regards,

Arne

Share this post


Link to post
Share on other sites

Oh, I forgot to mention: In case you want to trigger multiple StarCCM+ runs within your scripts, this would be possible, too. Let's say you want to trigger N runs with N sets of Variable values, you would need to repeat this section N times:

// all designs should be created from the baseline, so your tree doesn't get too deep
baseline.edit()

design(NULL, NULL)

// set variables here myDeva.setValue(...)

starComputation.run()

However, in that case you would need to manually change into every design that was created after your "DesignEngine" run has finished, in order to get CAESES to read the Star-CCM+ results for post-processing. This could be automated, too, with an fsc script, but not in a way that will work the same every time:

When creating your designs (design(NULL, NULL)), you can also provide a design name, e.g.:

design design1(NULL, NULL)

In your generated scripts, the number should be increased for every design, in order to create unique names. Then you need to keep track of how many designs you created. Then the final script would look something like this:

design1.edit()
design2.edit()
design3.edit()

// ...

designN.edit()

saveProject()
//DONE

Note that I added the "saveProject()", just to be sure  ;)

 

I said that this would not work the same every time, because CAESES may alter the names of the designs, if an object with the same name already exists in the project. So you can only be sure that the designs will have the names you chose, when you ensure beforehand that no objects with the same name exist. This means running this "DesignEngine" multiple times within the same project which is saved in between, the second run will not update the correct designs at the end. So each "DesignEngine" run needs to start from a "clean" version of the project.

 

Best regards,

Arne

Share this post


Link to post
Share on other sites

Hi Henrik,

 

Please check this post for more information and a generalized method to couple CAESES to any kind of external optimization software.

 

Cheers

Joerg

 

PS: Just to give you an idea ... with CAESES 4.0 that is coming up these days, there will be more functionality to receive information about the sensitivities of design variables. See the attachment for a quick preview ... ;-)

post-8-0-53182100-1436252911_thumb.png

Share this post


Link to post
Share on other sites

Thanks Arne and Jörg,

 

I can see there is a bit more work in this than expected. So this will vary the design variables on the go depending on the feedback?

When is version 4.0 out?

 

Kind regards, Henrik

Share this post


Link to post
Share on other sites

Hi Henrik,

 

Currently, we are expecting 4.0 within the next days... there is still heavy testing going on right now... we'll see...

 

Yes, you will be able to run sensitivities studies in order to find out which variables are most important to your task. This will be readily available in the pro edition of CAESES.

Share this post


Link to post
Share on other sites

Hey Henrik,

 

If you want to investigate design variable influences (sensitivities) take a look at this post and

you can create a pdf report with 2dDiagrams which is also a good resource to find out

the most important design variables.

 

The diagram report can be created from the designResultTable.

Simply click on the pdf button on the top of that window.

 

Cheers,

 

Karsten

Share this post


Link to post
Share on other sites

Dear Arne, Jörg and Karsten,

 

Do you think I would be able to gain license for version 4.0. I am working on a thesis project with deadline the 2nd of August, so maybe I could try some of your new optimization algorithms. Is there reverse compatibility to version 3.1?

 

Kind regards, Henrk

Share this post


Link to post
Share on other sites

... Beta testers right now. We'll take care of it and come back to you soon...

 

Joerg

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...