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.

Two-Step Study Issue

Please login with a confirmed email address before reporting spam

Hi all, I'm having an issue implementing something interesting that I think COMSOL should be able to do.

I have a step which solves for the steady state temperature distribution in a 2D domain subjected to temperature boundary conditions. After the simulation executes, I evaluate the heat flux across one of the boundaries, which happens to be a non-constant distribution.

In a second step, I want to prescribe this heat flux distribution as a boundary condition at that same boundary, swap some of the other BCs, and solve for the new temperature distribution in the domain.

It's really easy to set up a two-step study and use the "Modify for Step" option to assign BCs that are only active in step 1 vs step 2. But the part I am struggling with is assigning this flux boundary condintion is a solution from the previous step. I have tried a few things, including making a second study instead of a second step, trying to reference the results using "sol1.ntflux," bringing in two instances of heat transfer physics, but nothing has worked.

Any tips? Thanks!


3 Replies Last Post 8 juin 2023, 13:05 UTC−4
Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 4 juin 2023, 19:11 UTC−4
Updated: 1 year ago 4 juin 2023, 19:14 UTC−4

I'm guessing that the "two instances of heat transfer physics" approach is your best bet, but the devil is in the details. As you seem to already know, you need to carefully set the active/inactive physics as the problem solving progresses from one stage to the next and you also need to ensure the values of certain computed variables get transferred to the next stage. Anyway, I encourage you to post your .mph file to the forum so that it can be reviewed by many others here, and so that the issue(s) in your particular model will be easier to identify.

-------------------
Scientific Applications & Research Associates (SARA) Inc.
www.comsol.com/partners-consultants/certified-consultants/sara
I'm guessing that the "two instances of heat transfer physics" approach is your best bet, but the devil is in the details. As you seem to already know, you need to carefully set the active/inactive physics as the problem solving progresses from one stage to the next and you also need to ensure the values of certain computed variables get transferred to the next stage. Anyway, I encourage you to post your .mph file to the forum so that it can be reviewed by many others here, and so that the issue(s) in your particular model will be easier to identify.

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 5 juin 2023, 04:07 UTC−4

Looks like it should be possible to use the withsol() operator to pick up the flux from the first study step.

-------------------
Henrik Sönnerlind
COMSOL
Looks like it should be possible to use the withsol() operator to pick up the flux from the first study step.

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 8 juin 2023, 13:05 UTC−4
Updated: 1 year ago 8 juin 2023, 13:05 UTC−4

Thank you both, this was exactly the pointer I needed. I found helpful examples in this article: https://www.comsol.com/support/learning-center/article/Examples-of-the-withsol-Operator-59801#:~:text=For%20example%3A,from%20the%20nearest%20stored%20timesteps..

Best,

Lawrence Smith

Thank you both, this was exactly the pointer I needed. I found helpful examples in this article: [https://www.comsol.com/support/learning-center/article/Examples-of-the-withsol-Operator-59801#:~:text=For%20example%3A,from%20the%20nearest%20stored%20timesteps.](http://). Best, Lawrence Smith

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.