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.

Minimum Value In a Transient Simulation

Matt Petroleum Engineering

Please login with a confirmed email address before reporting spam

Hi all,

Is there a way to keep track of the minimum value in a transient simulation and use this value during solving? For example, at the first time step, the minimum value should be u_min=u(t1) and the subsequent time step should be u_min = min(u(t1), u(t2)) and so on until the last time step of u_min = min(u(t1),..., u(t)). I have tried defining an ODE to calcualte the minimum and have had no luck. Any help would be appreciated!


2 Replies Last Post Jan 1, 2022, 4:23 p.m. EST
Matt Petroleum Engineering

Please login with a confirmed email address before reporting spam

Posted: 2 years ago Dec 31, 2021, 8:37 a.m. EST
Updated: 2 years ago Dec 31, 2021, 8:46 a.m. EST

** Update, the solution seems to be to define an ODE with the following weak form syntax:

where u is a variable from another PDE/physics interface, and umin is the dependent ODE variable. However, this method only works for Time Dependent solver where derivatives are continuous. This will not work for Time Discrete solver in which time derivatives are replaced by bdf() operator. I wonder if anyone has a solution for time discrete solver?

** Update, the solution seems to be to define an ODE with the following weak form syntax: \marthrm{0 = -d\left(umin,TIME\right)*test\left(umin\right) + \left(u\leq umin\right)*\left(d\left(u,TIME\right)\leq 0 \right)*d\left(u,TIME\right)*test\left(umin\right)} where u is a variable from another PDE/physics interface, and umin is the dependent ODE variable. However, this method only works for Time Dependent solver where derivatives are continuous. This will not work for Time Discrete solver in which time derivatives are replaced by bdf() operator. I wonder if anyone has a solution for time discrete solver?

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 2 years ago Jan 1, 2022, 4:23 p.m. EST

Hi Matt,

have a look into this blog contribution by Walter Frei: https://www.comsol.de/blogs/using-the-previous-solution-operator-in-transient-modeling/

I have used this method in many transient and parametric studies. I think it should work in time-discrete as well, but haven't tried that so far.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Hi Matt, have a look into this blog contribution by Walter Frei: https://www.comsol.de/blogs/using-the-previous-solution-operator-in-transient-modeling/ I have used this method in many transient and parametric studies. I think it should work in time-discrete as well, but haven't tried that so far. Cheers Edgar

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.