Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Store a subset of a time-dependent solution

Please login with a confirmed email address before reporting spam

I am solving a time-dependent model over a time interval of 0 to 2 seconds, and only want to retain the second half of the solution, as the first half is not used in post-processing. It is a large 3D FSI model, and I can save 1-2 GB of space if I can do this. Is there a way to tell the solver that I only want to store results for a particular range of time values, e.g. t >= 1? This could also apply to parametric studies.

If not, is there a way to copy a subset of a solution dataset into another dataset, and delete the original? That would require manual interaction, but would suit my needs.

--
Steven Conrad, MD PhD
LSU Health

6 Replies Last Post 10 lug 2017, 15:33 GMT-4
Josh Thomas Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 5 lug 2017, 09:53 GMT-4
Updated: 7 years ago 5 lug 2017, 10:04 GMT-4
Steve-

One solution would be to divide your problem into two time-dependent steps in separate studies:

1) Study 1 - Step 1 - Solve for 0 to 1 sec
2) Study 2 - Step 1 - Solve for 1 to 2 sec (using solution from Study 1 as "Initial values of variables solved for")

Compute both studies in series.

Then, you are free to clear the solutions from Study 1 while retaining results in Study 2 for post-processing.

You may also consider reducing the number of Times requested for ranges you will not be post-processing -- this is another simple way of reducing file sizes. For example, use this as the Times request:

0 range(1,0.1,2)

This will only store the solution for 0 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 and 2 sec.

With this method, accuracy will not be affected unless you are relying on Strict or Intermediate time stepping to govern the error. By default, the absolute and relative tolerances will force the solver to solve at finer time steps -- even though you are not storing the solution at these increments.

--
Best regards,
Josh Thomas
AltaSim Technologies
Steve- One solution would be to divide your problem into two time-dependent steps in separate studies: 1) Study 1 - Step 1 - Solve for 0 to 1 sec 2) Study 2 - Step 1 - Solve for 1 to 2 sec (using solution from Study 1 as "Initial values of variables solved for") Compute both studies in series. Then, you are free to clear the solutions from Study 1 while retaining results in Study 2 for post-processing. You may also consider reducing the number of Times requested for ranges you will not be post-processing -- this is another simple way of reducing file sizes. For example, use this as the Times request: 0 range(1,0.1,2) This will only store the solution for 0 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 and 2 sec. With this method, accuracy will not be affected unless you are relying on Strict or Intermediate time stepping to govern the error. By default, the absolute and relative tolerances will force the solver to solve at finer time steps -- even though you are not storing the solution at these increments. -- Best regards, Josh Thomas AltaSim Technologies

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 7 lug 2017, 22:31 GMT-4
Updated: 7 years ago 7 lug 2017, 22:35 GMT-4
Thanks, Josh

I first implemented it as two studies, but these results are used to compute flows for a subsequent mass transport step, which was also two studies. Four studies seemed a bit unwieldy and a lot of interaction, hence the question. It is a large 3D FSI problem that takes about 20 hours to solve. By using a single study, I can solve with two steps (flow and mass transport) in the single study with no interaction. I apologize for not describing the full project, but I was aiming for simplicity.

I also thought about your approach of limiting the time studies in the first half, but I need a full set of results from all of the flow steps in order to properly calculate the mass transport. I also looked at solving flow and mass transport simultaneously which would let me use the approach of reducing the time steps, but this greatly extended the solution time.

For ease of interaction I'll probably just keep the single step and live with a large dataset. I did reduce my storage requirements some by only storing those field variables i really needed to post-process. This reduced storage requirements by 30%.

Thanks for your time!

--
Steven Conrad, MD PhD
LSU Health
Thanks, Josh I first implemented it as two studies, but these results are used to compute flows for a subsequent mass transport step, which was also two studies. Four studies seemed a bit unwieldy and a lot of interaction, hence the question. It is a large 3D FSI problem that takes about 20 hours to solve. By using a single study, I can solve with two steps (flow and mass transport) in the single study with no interaction. I apologize for not describing the full project, but I was aiming for simplicity. I also thought about your approach of limiting the time studies in the first half, but I need a full set of results from all of the flow steps in order to properly calculate the mass transport. I also looked at solving flow and mass transport simultaneously which would let me use the approach of reducing the time steps, but this greatly extended the solution time. For ease of interaction I'll probably just keep the single step and live with a large dataset. I did reduce my storage requirements some by only storing those field variables i really needed to post-process. This reduced storage requirements by 30%. Thanks for your time! -- Steven Conrad, MD PhD LSU Health

Josh Thomas Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 10 lug 2017, 09:20 GMT-4
Updated: 7 years ago 10 lug 2017, 09:22 GMT-4
Steve-

Glad to hear you have found an acceptable solution -- albeit maybe not an ideal one.

A side issue perhaps but...

In terms of running multiple studies automatically, have you seen the Study Reference feature? For example, if you have two studies in a model you would like to run sequentially -- you can add a third study and then add two "Study Reference" nodes that reference Study 1 and Study 2 in sequence. Then, when you click "Compute" on Study 3 it will execute Study 1 and Study 2 in sequence automatically with no additional user interaction required. (See attached image).

This technique may re-open the door for the double-study option being useful for you.

--
Best regards,
Josh Thomas
AltaSim Technologies
Steve- Glad to hear you have found an acceptable solution -- albeit maybe not an ideal one. A side issue perhaps but... In terms of running multiple studies automatically, have you seen the Study Reference feature? For example, if you have two studies in a model you would like to run sequentially -- you can add a third study and then add two "Study Reference" nodes that reference Study 1 and Study 2 in sequence. Then, when you click "Compute" on Study 3 it will execute Study 1 and Study 2 in sequence automatically with no additional user interaction required. (See attached image). This technique may re-open the door for the double-study option being useful for you. -- Best regards, Josh Thomas AltaSim Technologies


Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 10 lug 2017, 09:49 GMT-4
Updated: 7 years ago 10 lug 2017, 09:49 GMT-4
Hi,

Note that for many models you can reduce the file size significantly by a couple of changes in the Time-Dependent Solver node:

In the Output section, you can clear 'Store reaction forces' and 'Store time derivatives' (assuming that you do not need these results). Not storing the time derivatives will often reduce the file size by 40 to 60%.

Regards,
Henrik
Hi, Note that for many models you can reduce the file size significantly by a couple of changes in the Time-Dependent Solver node: In the Output section, you can clear 'Store reaction forces' and 'Store time derivatives' (assuming that you do not need these results). Not storing the time derivatives will often reduce the file size by 40 to 60%. Regards, Henrik

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 10 lug 2017, 14:54 GMT-4
Thanks, Josh, I had just come across the Study Reference feature. I've been using COMSOL since FEMLAB 2.3, but I overlooked this addition when it was introduced, or perhaps I saw it and didn't know how I might use it. I've added a 5th study to calculate a parabolic flow profile over a non-planar boundary for one of my boundary conditions.

Thanks, Henrik, I don't need the reaction forces or derivatives stored, so that would be a good complementary way to reduce storage further. I wasn't aware of this option.

I'll be presenting this work at COMSOL Boston (if my abstract gets accepted), so thanks again for the help.

--
Steven Conrad, MD PhD
LSU Health
Thanks, Josh, I had just come across the Study Reference feature. I've been using COMSOL since FEMLAB 2.3, but I overlooked this addition when it was introduced, or perhaps I saw it and didn't know how I might use it. I've added a 5th study to calculate a parabolic flow profile over a non-planar boundary for one of my boundary conditions. Thanks, Henrik, I don't need the reaction forces or derivatives stored, so that would be a good complementary way to reduce storage further. I wasn't aware of this option. I'll be presenting this work at COMSOL Boston (if my abstract gets accepted), so thanks again for the help. -- Steven Conrad, MD PhD LSU Health

Josh Thomas Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 10 lug 2017, 15:33 GMT-4
Good luck! See you in Boston!

--
Best regards,
Josh Thomas
AltaSim Technologies
Good luck! See you in Boston! -- Best regards, Josh Thomas AltaSim Technologies

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.