Products

Simulation Templates, your magic typewriter for CFD Automation

By Annabella Grozescu

I don’t know anyone who doesn’t enjoy a good story, but have you ever tried writing one yourself? Lately, a lot of us spent time watching movies, reading books, or playing video games. Personally, I can recognize different writing styles, different categories of stories and can tell you what I like and don’t like. But writing a story myself?

Woman trying to write

That’s not an easy feat, only a chosen few have the magical ability to do so. It is not enough for the storyteller to have an idea and the desire to write. When they put their ideas on paper, they face a lot of challenges. They must follow several rules about how to construct the story, the characters, the relationships… We thank them for their effort if all is done well as we can just enjoy these stories without thinking about the struggles behind the scenes. Of course, the reward for the storyteller is knowing that we are enjoying their creations. And if they are really good, the recognition they get.

Simulation story: the engineer’s journey

The more I think about it, the more I realize that we, as engineers, are in a similar situation as storytellers. We have problems to solve. We face struggles in solving these problems and we must follow a lot of rules (for example maths, physics, chemistry). In the end, if we are successful, our (rather huge) audience can benefit from our work as we build almost everything in the world.

Automation – the way of telling a consistent simulation story

As simulation engineers, one way we can make sure our simulation is telling a consistent story is through automation. By writing up a script (pun not intended) on what our engineering tool is supposed to do, we are transferring the status of our protagonist (the product) from one state to another/hopefully better one while gaining detailed insights into its performance.

Scripts – the hard way of telling a simulation story

But here comes the issue with authorship again! Looking back at the first “engineering story” I tried to write up through simulation automation, I don’t think I can fit my journey into one single plotline. I was trying to update the Java macros created by someone else. 16 000 lines of code, it was like being in someone else’s brain! And to make things worse, this person left the company and couldn’t hold my hand whilst I was navigating his brain. All I had as a guide were a few comments in the Java macros.

Coding headache

After 2 weeks of failing to understand those 16 000 lines, I decided this was mission impossible. At this point, I had two choices:

  • write it all from scratch (have you ever been sat in front of a blank sheet of paper?)
  • or try something new, something that back in the day was still at an early stage: simulation templates.

Embedded automation – a magic tool to build smart simulation workflows

When using Simcenter STAR-CCM+, simulation templates are like a new way of telling simulation stories by transforming expert CFD engineers into efficient storytellers. And here is the good news – unlike in the regular Hollywood business – Simcenter STAR-CCM+ provides the ultimate typewriter: embedded automation.

Simulation templates – an easier way to automated workflows

With this magic tool, the struggles of conventional storytelling (that let engineers get lost in endless Linux scripts and Java spaghetti Western code), we have tools such as filters, dynamic queries, tags, simulation operations, and more to help lessen and overcome our challenges in creating these stories.

All are embedded into one single, intelligent, simulation environment. In Simcenter STAR-CCM+ version 2022.1, that will be released at the end of February, we will add another one: the simulation template file.

I can already hear you say:

Hoooold on a second! We could already create simulation templates, where’s the news?

Bear with me and we’ll get there very soon.

Sheldon mind-reading
Source: memegenerator.net

Why automate workflows with simulation templates?

Before the introduction of embedded automation and simulation templates, CFD experts had to create Java macros to automate workflows, which means they also had to know how to code in Java.

Don’t get me wrong!

Java macros are great as they allow us to do everything we need, and they are not going anywhere, but now we have an easier way to automate and leverage automated workflows. This also means that a lot more engineers can become storytellers that create automated workflows for others to easily use. It sometimes reminds me a bit of the block-chart-based programming environment that LEGO provides for their toy robots, which allow kids to program great things without knowing anything about C++.

EV3 program for pneumatic actuators
Programming of LEGO Mindstorms – automation for everyone, source: https://softroboticstoolkit.com/soft-robotics-kids/fabrication/sample-program

Automation dominates almost every aspect of our life, so much that we don’t even notice it anymore. Therefore, I am not going to tell you why you should automate your workflows. Instead, I am going to tell you why the CFD engineers I talked to choose to automate their workflows with simulation templates.

Ensure robust and reproducible workflows

The simulation template creators, our storytellers, want to deploy automated workflows to ensure robust and reproducible workflows while mitigating error-prone and difficult to maintain coding.

On that note, I was amazed to discover that all the stories ever told are based on only 7 plotlines. Only seven plotlines! Can you believe it?!?! There is no doubt in my mind that James Bond, Jaws, and Star Wars are different stories, but they all follow the same basic plotline.

Some story science goes even further, saying there are only three types of story and –despite a bunch of genres – the vast majority of our human stories all follow one single structure. (Like the universal simulation template)

Establish immediate productivity

But writing a story with a magical typewriter aside, there is a second, very important aspect to simulation automation through templates: What’s the purpose of a good story without… right… an audience?

Cheering audience
Simulation Templates have the power to create excitement for a large user base (audience) of engineers, without the necessity to look behind the curtain

It is about the engineers making use of these intelligent simulation templates to explore the different scenarios, the ones who can enjoy using the templates and provide the end results. They are the big audience! They are the ones with new insights, the ones the author empowered to grow. Without a writer’s blockage, without the struggles of having to craft a storyboard themselves.

The users of these intelligent simulations can become productive immediately as they are provided streamlined workflows with a set of clear instructions. With consistent workflows, those consumers can have greater trust in the results as all simulations are following the same setup process. This approach ensures that everybody is consistently using the best practices provided by the experts and eliminates the human error that can occur during setup. No more bad stories out there! And over time, the audience can also choose to learn more about the simulation setup and even become authors themselves.

OK, OK! So, what’s the news in Simcenter STAR-CCM+ 2022.1?

Simulation templates: live in Simcenter STAR-CCM+ 2022.1

We are formalizing the concept of simulation templates by introducing a new file type, the ‘.simt’ file. At the same time, we added a layer of protection, so that neither authors nor users overwrite the simulation template by mistake. It is now possible to create a new simulation from an existing template and also to ‘Save to Template’.

Simulation Templates in action. With Simcenter STAR-CCM+ 2022.1, you will be able to store those template files

Coming back to my 16 000 lines of code, you guessed it right, I went with simulation templates. Just the thought of those Java macros coming back to me for updates daunted me. I am not so much into tragedies and horror stories!

Have you had a similar story? What was your plotline?

Review us on G2
Review us on TrustRadius
This article first appeared on the Siemens Digital Industries Software blog at https://blogs.sw.siemens.com/simcenter/simulation-templates-your-magic-typewriter-for-cfd-automation/