Ever find yourself in a situation where you want to combine multiple datasets to create a single dataset for seamless animations and other post-processing operations?
In this month’s tips and tricks video, I share a scenario that allows you to combine two separate transient studies without having to use separate editing software for video preparation.
Click below to watch as I walk you through the process. To help you follow along, we have included the video transcription below.
There’s no reason to learn software programs through trial and error, so in addition to our tips and tricks, our upcoming training classes will support you, the COMSOL user, in utilizing best practices with many of the COMSOL modules. Please visit our training calendar and find the course that is best for you.
Combine Solutions for Seamless Animations Transcription
In this tips and tricks video, I’d like to show you how to combine solutions for seamless animations and other post-processing operations.
This tip is useful whenever you have multiple datasets that you’d like to join together to create a single dataset. One scenario where you might want to do this is when, let’s say you had two separate transient studies. Where one of those studies solves for a few variables in a certain time range, and then you want to make a change to the boundary conditions, maybe add a layer of material and a certain temperature as well. Then compute a second study that picks up where the first study left off, and continues to solve in time or a second-time range.
In that case, you would have two separate datasets to reference for post-processing and that’s not ideal. It’d be much more convenient, and it is much more convenient, if you can combine those into a single Dataset that spans the entire time range from day 0 to day 2. Rather than having two separate Datasets one that goes from day 0 to 1, and one that goes from 1 to 2. Much more seamless for creating animations that show time progressing for the entire duration, than just the two separate video files.
So I’d like to show you how to accomplish this.
So, what we have here is this scenario I just described, where heat transfer analysis simple 2D model that solves for the transient temperature distribution in the bottom layer of material here. Time starts at day 0 going up to day 1. We solve that Study and then we make some changes to the boundary conditions and materials. And then we solve a second Study that picks up where the first Study left off at day 1, solving in increments of every one hour up to day 2. And so in the end what you have are two Datasets. So, when it comes to post-processing it’s a little bit clunky, because you have to reference these two different Datasets if you want to look at times between 0 and 1 day – here’s a look at Study 1. If you want to look at times between 1 day and 2 days you have to look at Study 2. And if you wanted to create an animation with the entire time range you wouldn’t be able to do it. You would have to splice those together in a separate editing software for video preparation. But, what we can do instead is add a third study that combines the two solutions and I’ll show you how to do that.
If you right-click on the root node, we can select “Add Study” and we’ll add an “Empty Study” and then close that “Add Study” window. And then I’ll right-click on Study 3 and select “Combine Solutions,”. This will add a Combine Solutions feature and then I can combine whatever solutions I want either through a Concatenation Summation or some other options here. Concatenation is what we want where it’s going to take the first block of time and just butt it up against the second block of time. We’ll need to set the First solution to the Study 1 and then the Second solution to Study 2. And, simply Compute Study 3 and this doesn’t solve for any field variables, it just takes the two datasets and concatenates them. You can see it only took one second to build that new Dataset and now we have Study 3, which is here. And, now for all of our post-processing we can switch the Dataset to Study 3. And now you’ll see I can pick any time between 0 and 2 days and uh, most helpfully perhaps, you can now animate this and solve for the heating of the first layer all the way through to the adding of the second layer. And we can create this animation that uh, does the whole time range rather than having to splice those together.
So, I hope you found this tip helpful. Bye now.