Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

stop condition

Please login with a confirmed email address before reporting spam

I'm using time dependent solver, and i want to stop it when the temperature reachs the value 300K...
How can i do it? any suggestion?
Maybe i have to create a expresion like max(T)?

Thanks

11 Replies Last Post Oct 15, 2013, 6:13 p.m. EDT
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 15, 2011, 4:19 p.m. EDT
Hi

if I remember right in v3.5a you need to use matlab to get a max(T(x,y,z)) over a (sub-)Domain.
And there is a "stop conditions field" somewhere in the solver sub-tabs

--
Good luck
Ivar
Hi if I remember right in v3.5a you need to use matlab to get a max(T(x,y,z)) over a (sub-)Domain. And there is a "stop conditions field" somewhere in the solver sub-tabs -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 16, 2011, 11:47 a.m. EDT
I'll try it. Thanks Ivar
I'll try it. Thanks Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 27, 2011, 11:18 a.m. EDT
Hi Ivar,

I'm trying to implement a Stop condition on a time-dependent simulation. From what I've read, Comsol stops if the expression introduced goes negative, so here's the deal; I have a global variable gap which I defined as height + mod1.v . I simply introduced gap at the expression box, but I get the following error:
Expression could not be evaluated

I tried also with mod1.v alone and I get the same result. However if I put the time variable t it simulates. Any ideas?

Thanks in advance.

I'm in 4.0a by the way.
Hi Ivar, I'm trying to implement a Stop condition on a time-dependent simulation. From what I've read, Comsol stops if the expression introduced goes negative, so here's the deal; I have a global variable gap which I defined as height + mod1.v . I simply introduced gap at the expression box, but I get the following error: Expression could not be evaluated I tried also with mod1.v alone and I get the same result. However if I put the time variable t it simulates. Any ideas? Thanks in advance. I'm in 4.0a by the way.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 28, 2011, 10:03 a.m. EDT
Hi!

Attached an example of time-dependent simulation with stop condition.
Movement will stop, if max. stress in the plate is bigger than stress_max.
Stop condition is in Study 1 -> Solver Configurations -> Solver 1 -> Time-Dependent Solver 1 -> Stop Condition 1.
You can include it with right-click...
It is for solid in V4.1.

Ralf
Hi! Attached an example of time-dependent simulation with stop condition. Movement will stop, if max. stress in the plate is bigger than stress_max. Stop condition is in Study 1 -> Solver Configurations -> Solver 1 -> Time-Dependent Solver 1 -> Stop Condition 1. You can include it with right-click... It is for solid in V4.1. Ralf


Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 29, 2011, 2:37 a.m. EDT
Hi

Shouldn't one use rather a boolean expression than a "real number" with a <= or >= or >, > ?

--
Good luck
Ivar
Hi Shouldn't one use rather a boolean expression than a "real number" with a = or >, > ? -- Good luck Ivar

Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 29, 2011, 3:38 a.m. EDT
Hi,

The example above is correct and shows how to form a scalar expression that COMSOL evaluates as a stop condition. The time stepping stops when the expression becomes negative (that is, when the maximum effective stress becomes greater than the stress level defined by the parameter stress_max).

The problem with using mod1.v is that it is a field quantity (the Y-component of the displacement) and not a scalar. In the example model above, an expression like 3e-4-mod1.maxop1(mod1.v) works and stops the time stepping when the maximum y-direction displacement exceeds 3e-4.

Best regards,
Magnus Ringh, COMSOL
Hi, The example above is correct and shows how to form a scalar expression that COMSOL evaluates as a stop condition. The time stepping stops when the expression becomes negative (that is, when the maximum effective stress becomes greater than the stress level defined by the parameter stress_max). The problem with using mod1.v is that it is a field quantity (the Y-component of the displacement) and not a scalar. In the example model above, an expression like 3e-4-mod1.maxop1(mod1.v) works and stops the time stepping when the maximum y-direction displacement exceeds 3e-4. Best regards, Magnus Ringh, COMSOL

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 29, 2011, 3:27 p.m. EDT
Hi

Thanks for the precision Magnus, indeed, I did not, read fully trough the help section, only halfway ;)

--
Good luck
Ivar
Hi Thanks for the precision Magnus, indeed, I did not, read fully trough the help section, only halfway ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 30, 2011, 12:43 p.m. EDT
Hi Magnus,

Thank you very much for your response. I realized later that the expressions for stop condition cannot contain variables which depend on spacial directions. However, I had aborted that approach and used a conditional expression on a boundary condition. But now, I'm gonna try the maxop and see what happens, still, there's a little doubt about that; How does comsol understand the maxop1, as the first maximum which exceeds the condition, or does it compare with the global maximum of the expression?

Thanks in advance.
Hi Magnus, Thank you very much for your response. I realized later that the expressions for stop condition cannot contain variables which depend on spacial directions. However, I had aborted that approach and used a conditional expression on a boundary condition. But now, I'm gonna try the maxop and see what happens, still, there's a little doubt about that; How does comsol understand the maxop1, as the first maximum which exceeds the condition, or does it compare with the global maximum of the expression? Thanks in advance.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 30, 2011, 3:14 p.m. EDT
Hi

maxop1 is an operatzor to get the maximum value out from a domain or a boundary or ... (see the maxop1 definition in the definition node, so its the max over the implicit or explicit variables used for the expression, seen over the selected entity(ies), no ?

By the way maxop is v4 (dosent exist in 3.5, there one needed to go via Matlab)

--
Good luck
Ivar
Hi maxop1 is an operatzor to get the maximum value out from a domain or a boundary or ... (see the maxop1 definition in the definition node, so its the max over the implicit or explicit variables used for the expression, seen over the selected entity(ies), no ? By the way maxop is v4 (dosent exist in 3.5, there one needed to go via Matlab) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 28, 2011, 9:38 a.m. EDT
Thanks for good example
Thanks for good example

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 15, 2013, 6:13 p.m. EDT
Hello Ivan,
I am attempting to create a stop condition very similar to what was accomplished here except for the variables I would like the stop condition follow. In my model I am looking to stop the solver when a steady state temperature is reached. This is defined as less than a 1degC increase in temperature over an hour. The expression would be something along the lines of: maxT(t) - maxT(t-3600) > 1. My question is what the correct expression would be in order to grab the temperature at the previous hour. Thank you for your time.
Best,
Matt
Hello Ivan, I am attempting to create a stop condition very similar to what was accomplished here except for the variables I would like the stop condition follow. In my model I am looking to stop the solver when a steady state temperature is reached. This is defined as less than a 1degC increase in temperature over an hour. The expression would be something along the lines of: maxT(t) - maxT(t-3600) > 1. My question is what the correct expression would be in order to grab the temperature at the previous hour. Thank you for your time. Best, Matt

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.