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.

How to define a variable which is different at the start time t=0 ?

Please login with a confirmed email address before reporting spam

In a time dependend model, I want to define a variable which is
T(t=0)=293
and
T(t>0)=294

What syntax is used to define a variable like this depending on time?

3 Replies Last Post 06.06.2014, 09:49 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 06.06.2014, 05:34 GMT-4
Hi,


May be something like this...

293*(t<=0.0001)+294*(t>0.0001)


Suresh
Hi, May be something like this... 293*(t0.0001) Suresh

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 06.06.2014, 09:36 GMT-4
t=0 is an infinitely short moment, so you might just as well make it 294 starting from t=0. I think you have to use 293 in the (solution for the) initial values.
t=0 is an infinitely short moment, so you might just as well make it 294 starting from t=0. I think you have to use 293 in the (solution for the) initial values.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 06.06.2014, 09:49 GMT-4
This is true according to common sense. But in the numerical model it's different.

I define a homogenous initial temperature for a domain. When I choose a different boundary temperature, then this changes the COMSOL model initial temperatur field even at the time t=0. I.e. it overwrites my initial values.. Even at the time t=0 the average temperature in the domain is biased towards the boundary temperature. Depending on the number of cells it can easily become significant.

The situation I want wo simulate is, that I have homogenous temperature in the beginning and at one moment the environmental temperature changes.

But meanwhile I got the way to solve this:
I can choose the function "step" in the "Global definitions". Then I can apply this function in the "Variables" to a varible name defining the boundary temperature.
This is true according to common sense. But in the numerical model it's different. I define a homogenous initial temperature for a domain. When I choose a different boundary temperature, then this changes the COMSOL model initial temperatur field even at the time t=0. I.e. it overwrites my initial values.. Even at the time t=0 the average temperature in the domain is biased towards the boundary temperature. Depending on the number of cells it can easily become significant. The situation I want wo simulate is, that I have homogenous temperature in the beginning and at one moment the environmental temperature changes. But meanwhile I got the way to solve this: I can choose the function "step" in the "Global definitions". Then I can apply this function in the "Variables" to a varible name defining the boundary temperature.

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.