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.

How to use previous solution calculate some value and update for each time step?

Please login with a confirmed email address before reporting spam

Hi, I've been tortured by this problem for a long time. Hope there's someone can help me. I'm doing a time dependent heat transfer problem, I need to store value h and Z that I calculated at each time step. I define h with Global ODEs and DAEs, h is calculated using h and Z (from last time step), and integral of heat flux, Z is calculated using both h from this time step and h from last time step. So I think I can define h2=function of (h1,Z1), Z2=function of(h2,h1).

My problem is how I can do (h1=h2) and (Z1=Z2) at the end of each time step and then use the new h1 and Z1 to calculate h2 and Z2 for next time step.

I've seen this, https://www.comsol.com/blogs/using-the-previous-solution-operator-in-transient-modeling/ but I still couldn't find a way for my own problem, if I use Domain ODEs and DAEs to set h1=h2 after h2 is calculated, there will be an error.

Any help or comments are appreciated. Thanks.

Jing



0 Replies Last Post 7 gen 2019, 17:01 GMT-5
COMSOL Moderator

Hello Jing Yuan

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

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.